/* AV Rota - layout only. Every colour and font here is a var() reference
   into design-tokens.css (linked in index.php, live from the main site) --
   nothing in this file duplicates a token's actual value, since that's a
   real runtime dependency, not a copy. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

a {
  color: var(--pink-text);
}

.page-header {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

/* A real way back to the main site -- this subdomain otherwise has none.
   Same recipe as the main site's own nav wordmark (.nav__brand /
   .nav__brand em, src/components/Nav.css): Fraunces, and "Church"
   italicised pink -- smaller than the main nav's 1.1rem, since this sits
   above the page's own "AV Rota" heading rather than being the page's
   primary wordmark itself. */
.page-header__parent-link {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  margin: 0 0 0.75rem;
}

.page-header__parent-link:hover {
  text-decoration: underline;
}

.page-header__parent-link em {
  font-style: italic;
  color: var(--pink-text);
}

.page-header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.25rem;
}

/* Same burning bush mark, same sizing as the main site's own
   .nav__brand-icon (src/components/Nav.css) -- decorative, alt="",
   since the "AV Rota" text right beside it already says what it is. */
.page-header__brand-icon {
  height: 1.7rem;
  width: auto;
  flex-shrink: 0;
}

.page-header .subtitle {
  margin: 0;
  color: var(--ink-soft);
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

.empty {
  color: var(--ink-soft);
}

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.service-card {
  background: var(--paper-card);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  /* A defensive outline, not just a shadow -- keeps each card legible in
     prefers-contrast/forced-colors modes the same way the main site's own
     identity-panel frames need one. */
  border: 1px solid var(--paper-deep);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* A calm accent, not the pink reserved sitewide for the main app's
   primary CTA -- avrota has no CTA of its own to protect that meaning
   for, but keeping pink's role consistent across both tools avoids two
   different "what pink means" rules in the same shared token set. */
.service-card--special {
  border-left: 4px solid var(--sky-text);
}

.service-card__date {
  margin: 0;
  font-weight: 500;
}

.service-card__tag {
  margin: 0.15rem 0 0;
  color: var(--sky-text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.service-card__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0.35rem 0 1rem;
}

.service-card__roles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
}

.service-card__role dt {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.service-card__role dd {
  margin: 0.15rem 0 0;
  font-weight: 500;
}

/* Reset to look like the plain text it replaces -- app.js adds
   --interactive once it's actually wired up (see below), so a page with
   JavaScript unavailable just shows inert, plain-looking text here, never
   a button that looks tappable but silently does nothing. */
.service-card__role-value {
  display: inline;
  border: none;
  background: none;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
}

.service-card__role-value--interactive {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.service-card__role-value--interactive:hover {
  color: var(--pink-text);
}

.service-card__role-value--interactive:focus-visible {
  outline: 2px solid var(--sky-text);
  outline-offset: 2px;
}

.service-card__swap-select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-soft);
  border-radius: 0.375rem;
  padding: 0.15rem 0.4rem;
}

.service-card__swap-select:focus-visible {
  outline: 2px solid var(--sky-text);
  outline-offset: 2px;
}

/* Naming a gap outright rather than letting it blend in -- the same
   principle the weekly reminder email applies to this page too.
   warm-text, not pink -- pink's reserved meaning above. */
.service-card__gap {
  color: var(--warm-text);
  font-weight: 600;
}

/* Present for assistive tech, invisible on screen -- used both for the
   swap endpoint's honeypot field (paired there with aria-hidden +
   tabindex="-1" so it's also out of tab order and never announced) and
   for a tab panel's own <h2>, which a sighted user already has as the
   visible tab label. Off-screen rather than display:none (some bots
   skip that for the honeypot case) -- same clip-rect technique as the
   main site's own .visually-hidden utility (src/index.css). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Phase 4's unavailability section -- a plain section on the page
   background, same shape as the service cards above, not nested inside
   anything. */
.unavailability h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.unavailability__note {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.unavailability label {
  display: block;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.unavailability select,
.unavailability input[type="date"] {
  display: block;
  margin-top: 0.25rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-soft);
  border-radius: 0.375rem;
  padding: 0.35rem 0.5rem;
}

.unavailability__date-row {
  display: inline-block;
  margin-right: 0.75rem;
}

button#unavailability-add-date,
button#unavailability-submit {
  font: inherit;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--ink-soft);
  border-radius: 0.375rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  margin: 0.25rem 0.5rem 0.25rem 0;
}

button#unavailability-submit {
  color: #fff;
  background: var(--pink-button-bg, var(--pink-text));
  border-color: transparent;
}

#unavailability-existing {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: -0.25rem 0 1rem;
}

#unavailability-result {
  margin: 0.75rem 0 0;
  font-weight: 500;
  min-height: 1.2em;
}

.rotation-editor h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.rotation-editor h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}

.rotation-editor h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 1rem 0 0.5rem;
}

.rotation-editor label {
  display: block;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.rotation-editor select,
.rotation-editor input[type="text"] {
  display: block;
  margin-top: 0.25rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-soft);
  border-radius: 0.375rem;
  padding: 0.35rem 0.5rem;
  width: 100%;
  max-width: 24rem;
}

/* Add-a-new-person and edit-a-person sections -- plain subsections, not
   their own bordered cards, since they already sit inside the People
   panel's own bounds. */
.rotation-editor__add-person,
.rotation-editor__edit-person {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--paper-deep);
}

.rotation-editor__capabilities {
  border: 1px solid var(--ink-soft);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
}

.rotation-editor__capabilities legend {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0 0.25rem;
}

.rotation-editor__checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 1rem 0 0;
  font-size: 0.9rem;
}

.rotation-editor__checkbox-label input[type="checkbox"] {
  margin: 0;
}

button#add-operator-submit,
button#edit-operator-submit {
  font: inherit;
  color: #fff;
  background: var(--pink-button-bg, var(--pink-text));
  border: 1px solid transparent;
  border-radius: 0.375rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  margin: 0.25rem 0 0;
}

#add-operator-result,
#edit-operator-result {
  margin: 0.75rem 0 0;
  font-weight: 500;
  min-height: 1.2em;
}

.rotation-editor__add {
  font: inherit;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--ink-soft);
  border-radius: 0.375rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  margin: 0.25rem 0.5rem 0.25rem 0;
}

#rotation-editor-result {
  margin: 0.75rem 0 0;
  font-weight: 500;
  min-height: 1.2em;
}

.rotation-editor__list {
  list-style: decimal;
  margin: 0 0 0.75rem;
  padding-left: 1.5rem;
}

.rotation-editor__list li {
  margin-bottom: 0.4rem;
}

.rotation-editor__list button {
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--ink-soft);
  border-radius: 0.3rem;
  padding: 0.15rem 0.5rem;
  margin-left: 0.4rem;
  cursor: pointer;
}

.rotation-editor__list button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* The special-services form -- add a manually-tagged service (WeWorship,
   an evening on an existing Sunday, or a standalone date), any date,
   Sunday or not. Same field styling as the unavailability form above. */
.special-services h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.special-services__note {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.special-services label {
  display: block;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.special-services input[type="date"],
.special-services input[type="text"] {
  display: block;
  margin-top: 0.25rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-soft);
  border-radius: 0.375rem;
  padding: 0.35rem 0.5rem;
  width: 100%;
  max-width: 24rem;
}

.special-services__weworship {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.special-services__weworship input[type="checkbox"] {
  margin: 0;
}

button#special-service-submit {
  font: inherit;
  color: #fff;
  background: var(--pink-button-bg, var(--pink-text));
  border: 1px solid transparent;
  border-radius: 0.375rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  margin: 0.25rem 0 0;
}

#special-service-result {
  margin: 0.75rem 0 0;
  font-weight: 500;
  min-height: 1.2em;
}

/* Tabs -- not everyone needs to see every part every time. app.js hides
   every panel but the active one and toggles aria-selected; without it,
   every panel just stacks in document order (each already reads fine on
   its own, same as before tabs existed), and the tab buttons above them
   are simply inert. */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid var(--paper-deep);
}

.tabs__tab {
  font: inherit;
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.6rem 0.25rem;
  margin-bottom: -1px;
  cursor: pointer;
}

.tabs__tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--pink-text);
}

.tabs__tab:focus-visible {
  outline: 2px solid var(--sky-text);
  outline-offset: 2px;
}

.tabs__panel-hint {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 1rem 0 0;
}

/* Same shape as the main site's own Footer.css, minus the verse of the
   day (and the class names prefixed page-footer__ rather than footer__,
   since .page-footer here is a plain page footer, not a shared React
   component). */
.page-footer {
  margin-top: 2rem;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--paper-deep);
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.page-footer__seal {
  display: block;
  /* Same clamp as Footer.css's own .footer__seal -- the source image is
     identical (a copy of the same file), so the same sizing math holds. */
  width: min(clamp(240px, 30vw, 500px), 100%);
  height: auto;
  margin: 0 auto 1.5rem;
  border-radius: 0.75rem;
}

.page-footer__back {
  margin: 0 0 0.75rem;
}

.page-footer__back a {
  color: var(--ink-soft);
}

.page-footer__back a:hover {
  color: var(--pink-text);
}

.page-footer__charity {
  margin: 0;
}

@media (max-width: 30rem) {
  .service-card__roles {
    grid-template-columns: 1fr;
  }

  .tabs__list {
    gap: 0;
  }

  .tabs__tab {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.6rem 0.15rem;
  }
}
