/* Custom styles for the Touche theme integration */

/* The fixed navbar is 72px high, so a scrolled-to element must stop below it. */
html {
  scroll-padding-top: 4.5rem;
}

/* On phones the month name takes its own row above the links. */
.calendar-nav h2 {
  width: 100%;
}

@media (min-width: 768px) {
  .calendar-nav h2 {
    width: auto;
  }
}

.calendar-month {
  table-layout: fixed;
}

.calendar-month td {
  height: 7rem;
  vertical-align: top;
}

/* A Mist border on an unchecked box is about 1.2:1 on Paper; Slate meets the 3:1 floor for controls. */
.form-check-input {
  border-color: #6c757d;
}

/*
 * Touche removes the focus ring, so keyboard users cannot see where they are.
 * Amber alone is about 2:1 on Paper, so an Ink ring sits inside it: one of the two meets 3:1 on any background.
 */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input[type="submit"]:focus-visible,
[role="button"]:focus-visible,
.form-check-input:focus-visible {
  outline: 2px solid #f5a637;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #000;
}

/* Amenities page: the photos are the content, so they get the full column width. */
.amenity-photo {
  aspect-ratio: 3 / 2;
  display: block;
  object-fit: cover;
  width: 100%;
}

@media (min-width: 768px) {
  .amenity-wide .amenity-photo {
    aspect-ratio: 21 / 9;
  }
}

/* Many residents are older; the default badge text is about 12px. */
.amenity .badge {
  font-size: 0.875rem;
  padding: 0.4em 0.75em;
}

.amenity-reason {
  max-width: 65ch;
}

/*
 * News and events: each day shows its date once. A full Mist rule separates days;
 * a shorter rule, in the text column only, separates the items of one day.
 */
.agenda-day {
  border-top: 1px solid #e9ecef;
  padding-block: 3rem;
}

.agenda-day:last-child {
  border-bottom: 1px solid #e9ecef;
}

/* The heading wraps the date, so it keeps the date's own type. */
.agenda-date {
  font: inherit;
}

.agenda-weekday,
.agenda-time {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.agenda-time {
  color: #000;
}

.agenda-event + .agenda-event {
  border-top: 1px solid #e9ecef;
  margin-top: 2rem;
  padding-top: 2rem;
}

.agenda-text {
  max-width: 65ch;
}

/* On a long day the date stays in view below the fixed navbar. */
@media (min-width: 768px) {
  .agenda-date {
    position: sticky;
    top: 6rem;
  }
}

/* Contact sits after the right link group with a thin amber border, so the groups keep 2 links each. */
@media (min-width: 992px) {
  .navbar .navbar-nav .navbar-end-link {
    border: 1px solid #f5a637;
  }
}

/* Contact page: the resident chooses who gets the message from three labelled choices. */
.message-recipients {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .message-recipients {
    grid-template-columns: repeat(3, 1fr);
  }
}

.message-recipient {
  /* The cards stretch to the same height; the text stays under the name. */
  align-content: start;
  border: 1px solid #e9ecef;
  cursor: pointer;
  display: grid;
  gap: 0.5rem 0.75rem;
  grid-template-columns: auto 1fr;
  padding: 1.5rem;
  transition: border-color 0.1s;
}

.message-recipient:hover {
  border-color: #6c757d;
}

.message-recipient:has(:checked) {
  border-color: #f5a637;
  outline: 1px solid #f5a637;
}

.message-recipient.is-invalid {
  border-color: #dc3545;
}

.message-recipient .form-check-input {
  margin-top: 0.35em;
}

.message-recipient-name {
  color: #000;
  font-family: "Playfair Display", serif;
  font-size: 1.25rem;
}

.message-recipient-text {
  color: #6c757d;
  grid-column: 2;
}

/* The editor toolbar sits on the editor's top border, like a part of the field. */
.message-toolbar-buttons {
  border: 1px solid #e9ecef;
  border-bottom: 0;
  display: flex;
  margin-top: 0.5rem;
}

.message-toolbar-buttons button {
  background: none;
  border: 0;
  border-right: 1px solid #e9ecef;
  color: #343a40;
  height: 3rem;
  transition: color 0.1s;
  width: 3rem;
}

.message-toolbar-buttons button:hover {
  color: #f5a637;
}

.message-toolbar-buttons button.trix-active {
  background-color: #e9ecef;
  color: #000;
}

.message-toolbar .message-link-dialog[data-trix-active] {
  align-items: center;
  border: 1px solid #e9ecef;
  border-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem;
}

.message-link-dialog .form-control {
  flex: 1 1 16rem;
}

.message-body {
  min-height: 14rem;
}

.message-body ul,
.message-body ol {
  margin-bottom: 0;
  padding-left: 1.5rem;
}
