/* Shared interface patterns: lists, footer, inbox, videos, and feedback. */
/* Ordered lists (events, routes): single vertical column */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.list li {
  padding: 0.75rem 0;
  border-radius: 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--divider);
  position: relative;
}

.list li:first-child { border-top: 0; }

.list a {
  font-weight: 600;
}

/* One paper surface holds a whole collection; entries inside use rules rather than
   competing mini-cards. This is the same hierarchy as Events and Inbox. */
.collection-surface {
  position: relative;
  padding: 1rem;
  border: 2px solid var(--text);
  background: var(--panel);
  margin-bottom: 1.25rem;
}

/* A shallow evergreen cap carries the landing hero's calm, directional color into
   collections without turning every page into a dark panel. */
.collection-surface::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.4rem;
  background: var(--panel-2);
}

/* Page-heading metadata belongs in the heading line rather than creating a second,
   floating row that pushes the collection away from its title. */
.page-heading {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.page-heading h1 { margin: 0; }
.page-heading .muted { margin: 0; }

.inbox-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.inbox-heading-actions form { margin: 0; }
.inbox-heading-actions .btn { margin: 0; min-height: 2.25rem; }

/* Brings the footer into the same card/stamp language as the rest of the site instead of
   a bare row of links -- a small stamped wordmark straddling the top border, same idiom
   as a card's h2 (see components.css), scaled down and kept out of the way. */
.site-footer {
  position: relative;
  display: flex;
  justify-content: center;
  /* The wordmark is 0.75rem and the links are 0.85rem; the flex default (stretch) put
     both boxes at the row's full height and left their text sitting on two different
     baselines. */
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 1.25rem 1rem 2.5rem;
  border-top: 2px solid var(--text);
  background: var(--panel);
  /* Same box as .nav (chrome.css): the header is a centred panel with a 2px border, so
     a full-viewport-width footer left the two rules bounding the page at different
     lengths on anything wider than a phone. Width and side padding match it exactly, so
     the top and bottom rules end on the same vertical lines as each other and as the
     cards between them. */
  max-width: calc(40rem - 2.2rem);
  margin: 2rem auto 0;
}

.site-footer-stamp {
  position: static;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: 'Rajdhani', 'Work Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: none;
}

.site-footer-links {
  display: flex;
  justify-content: center;
  /* Contact is a <details>, so it grows downward when opened -- baseline keeps the
     closed summary on the same line as its neighbours either way. */
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-footer a {
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a:hover, .site-footer a:focus-visible {
  color: var(--text);
}

/* Not a mailto: link -- clicking mailto with no mail client configured (the common case
   on a phone/desktop that isn't set up for it) launched an OS chooser or a broken blank
   client instead of doing anything useful. Collapsed <details> instead of always-visible
   text so the address isn't printed as plain scrapable text on every page load; still
   copyable once opened. */
.footer-contact {
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-contact summary:hover, .footer-contact summary:focus-visible { color: var(--text); }
.footer-contact[open] summary { margin-bottom: 0.2rem; }

/* Inbox: Messages (person-to-person) vs Notifications (system-generated) are two
   different mental models -- talking to someone vs. being told something happened --
   so they're split into tabs. Same checkbox/radio-toggle trick as .cancel-confirm-*,
   no JS needed. */
.inbox-tab-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.inbox-tab-label {
  padding: 0.5rem 1rem;
  border-radius: 0;
  border: 1px solid var(--accent-dim);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.inbox-tab-panel {
  display: none;
}

#inbox-tab-messages:checked ~ .inbox-tab-panel-messages,
#inbox-tab-notifications:checked ~ .inbox-tab-panel-notifications,
#inbox-tab-sent:checked ~ .inbox-tab-panel-sent {
  display: block;
}

#inbox-tab-messages:checked ~ .inbox-tab-bar label[for="inbox-tab-messages"],
#inbox-tab-notifications:checked ~ .inbox-tab-bar label[for="inbox-tab-notifications"],
#inbox-tab-sent:checked ~ .inbox-tab-bar label[for="inbox-tab-sent"] {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-contrast);
}

.notif-item.notif-new {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.notif-item.notif-read {
  opacity: 0.65;
}

.notif-from {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.notif-meta {
  margin-top: 0.3rem;
  font-size: 0.8rem;
}

/* Generic two-step "Are you sure?" confirm, same mechanism as .cancel-confirm-* --
   a hidden checkbox swaps the toggle label for a red submit button, no JS needed. */
.confirm-submit {
  display: none;
}

.confirm-input:checked ~ .confirm-toggle {
  display: none;
}

.confirm-input:checked ~ .confirm-submit {
  display: inline-block;
}

/* An extra acknowledgement that appears alongside the confirm step, for an action that
   should take more than one tap -- see removing a fellow admin on the roster. */
.confirm-extra {
  display: none;
}

.confirm-input:checked ~ .confirm-extra {
  display: block;
  margin: 0.5rem 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* One shared editorial rhythm everywhere a video is listed: title, generous thumbnail,
   then quiet metadata -- see main/_video_list.html's video_list macro. */
.video-link {
  display: block;
}

.video-title,
.video-meta {
  display: block;
}

.video-thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0.35rem 0 0.55rem;
  border-radius: 0.3rem;
  overflow: hidden;
  background: #000;
}

.video-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  padding-left: 0.15rem;
}

.video-title {
  font-weight: 600;
  line-height: 1.35;
}

.video-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Floating feedback widget -- same checkbox-toggle trick as .nav-toggle above, no JS needed. */
.feedback-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 400;
  width: 3rem;
  height: 3rem;
  border-radius: 0.15rem;
  background: var(--action);
  color: var(--action-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--text) 28%, transparent);
  transition: bottom 0.15s ease;
}

/* Clear the fixed save-bar rather than sit underneath it. */
body:has(.save-bar:not([hidden])) .feedback-fab {
  bottom: 4.5rem;
}

body:has(.save-bar:not([hidden])) .feedback-panel {
  bottom: 8rem;
}

.feedback-panel {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 400;
  width: min(20rem, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 0;
  background: var(--panel);
  border: 2px solid var(--accent-dim);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--text) 28%, transparent);
}

.feedback-toggle-input:checked ~ .feedback-panel {
  display: block;
}

.feedback-panel label {
  margin-top: 0;
}

.feedback-panel textarea {
  min-height: 5rem;
  resize: vertical;
}

.feedback-panel-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.feedback-panel-actions button,
.feedback-panel-actions label.btn {
  margin: 0;
}

/* Was `:invalid:not(:placeholder-shown)` -- meant "invalid AND the user has typed
   something", but :placeholder-shown only ever matches a field that HAS a placeholder
   attribute. Login/signup's required fields don't have one, so :not(:placeholder-shown)
   was true immediately (nothing to "not show"), and :invalid is already true for any
   empty required field before the user touches it -- this fired the red/orange border on
   page load, not after a bad entry. :user-invalid only matches once the user has actually
   interacted with the field, which is what this was meant to do. */
input:user-invalid {
  border-color: var(--error);
}
