/* ============================================================================
   base.css - the look that every page shares (split out of layout.css, 2026-10-15)
   Variables, reset, body, shared content wrapper, top navigation, buttons,
   images, page headings, form fields, the gift-certificate banner and the
   footer. Phone rules for these pieces live in this file too.
   Load order on every page:  base.css, then site.css and/or merch.css.
   If Merch ever moves to its own domain, copy base.css along with merch.css.
   ============================================================================ */

/* ============================ Base Layout ============================ */
:root {
  --container-width: 1000px;
  --accent: #628141;
  --accent-hover: #7a9a5a;
  --bg: #fdf6f0;
  --card-shadow: 0 4px 12px rgba(0,0,0,0.1);
  --elevated-shadow: 0 4px 12px rgba(0,0,0,0.2);
  --nav-font-size: 16px;
  --nav-line-height: 1.2;
  --nav-gap: 20px;
  --nav-horizontal-padding: 20px;
  /* Single source of truth for header height (keeps mobile and desktop identical) */
  --nav-height: 48px;
}

html {
  font-size: 16px;
  scrollbar-gutter: stable;
  text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Standard "sr-only" utility - keeps an element in the accessibility
   tree (screen readers, page-outline/SEO tools) while removing it from
   visual layout entirely. Used where a real semantic element (e.g. an
   <h1>) is still wanted for structure, but showing it on screen would
   visually repeat something already conveyed another way (e.g. text
   baked into a banner graphic). */
.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;
}

body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.4;
  background-color: var(--bg);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  /* Optional: enable to reserve scrollbar space on all pages */
  /* overflow-y: scroll; */
}

/* Shared content wrapper */
.content-wrapper {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 20px;
}

/* ============================ Top navigation ============================ */
header {
  width: 100%;
  background: var(--bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Use locked height so mobile and desktop navs match */
.nav-wrapper {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--nav-horizontal-padding);
  display: flex;
  align-items: center;
  position: relative;
  height: var(--nav-height);
  min-height: var(--nav-height);
}

/* Order ensures nav links left, list button (merch.php only - see
   .list-bar below) next, hamburger rightmost */
.main-nav {
  order: 1;
  flex-grow: 1;
  flex-shrink: 0;
  flex-basis: auto;
  font-size: var(--nav-font-size);
  line-height: var(--nav-line-height);
}

.main-nav .nav-links {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--nav-gap);
  margin: 0;
  padding: 0;
  align-items: center; /* vertically center links inside locked height */
}

.main-nav .nav-links a {
  font-size: var(--nav-font-size);
  line-height: var(--nav-line-height);
  text-decoration: none;
  font-weight: bold;
  color: var(--accent);
  transition: color 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0;
  padding: 0 4px; /* small horizontal hit area without increasing header height */
}

/* Underline current page link (supports aria-current or .active) */
.main-nav .nav-links a[aria-current="page"],
.main-nav .nav-links a.active {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  color: var(--accent);
}

/* Focus style for keyboard users */
.main-nav .nav-links a:focus {
  outline: 2px solid rgba(98,129,65,0.18);
  outline-offset: 3px;
}

.menu-toggle {
  order: 3;
  margin-left: 12px;
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  height: var(--nav-height);
  line-height: var(--nav-height);
  padding: 0 8px; /* comfortable hit area without growing header */
}

/* Mobile nav dropdown */
@media (max-width: 768px) {
  .main-nav .nav-links {
    display: none;
    flex-direction: column;
    background: var(--bg);
    position: absolute;
    /* dropdown sits just below the locked header */
    top: calc(var(--nav-height) + 8px);
    right: var(--nav-horizontal-padding);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideDown 0.25s ease forwards;
    gap: 12px;
  }

  .main-nav .nav-links.show {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================ Flyer & images ============================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: var(--elevated-shadow);
}

.flyer {
  width: 80%;
  max-width: 600px;
}

@media (max-width: 768px) {
  .flyer {
    width: 95%;
    max-width: none;
  }
}

/* ============================ Buttons ============================ */
.btn {
  display: inline-block;
  margin: 8px 0;
  padding: 10px;
  background-color: var(--accent);
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1.2;
  font-size: 16px;
  text-align: center;
}

.btn:hover {
  background-color: var(--accent-hover);
}

.btn.full-width {
  width: 100%;
  display: block;
  margin: 8px 0;
  padding: 10px;
}

/* ============================ Page headings ============================ */
.page-container h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.8rem;
  color: var(--accent);
}

.page-container h2 {
  margin-top: 30px;
  font-size: 1.3rem;
  color: var(--accent);
}

/* ============================ Cancellation & About pages ============================ */
.page-container {
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  color: #333;
}

/* ============================ Register page ============================ */
.form-container {
  background-color: #fff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  max-width: 420px;
  margin: 40px auto;
}

.form-container h2 {
  text-align: center;
  margin: 0 0 18px;
  font-size: 1.6rem;
  color: var(--accent);
}

.form-container input,
.form-container textarea,
.form-container select {
  display: block;
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  /* 2026-08-29 (Finding 19, a11y/UX): was 15px, same iOS Safari
     auto-zoom issue fixed on .merch-modal-content's inputs below - this
     is the registration form and the admin login form, both of which
     share this same class. */
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}

.four-day-label {
  display: block;
  margin: 10px 0 2px;
  font-size: 14px;
  color: #444;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  width: auto;
  height: auto;
  max-width: min(92vw, 1200px);
  max-height: 84vh;
  margin: 0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

/* Prev/next arrows + counter for photo-viewer-modal's gallery mode.
   Hidden by default (via the [hidden] attribute set in the HTML) -
   only shown when a card image opens as a multi-photo gallery. */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 8px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-nav-prev {
  left: 14px;
}

.lightbox-nav-next {
  right: 14px;
}

.photo-viewer-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.photo-viewer-counter[hidden] {
  display: none;
}

body.lightbox-open {
  overflow: hidden;
}

.btn-secondary {
  background-color: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background-color: #f3f0e8;
  color: var(--accent);
}

.merch-price-note {
  font-weight: normal;
  font-size: 0.85rem;
  color: #777;
}

/* ============================ Responsive tweaks ============================ */
@media (max-height: 600px) {
  .form-container {
    margin-top: 24px;
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .form-container {
    width: 95%;
    max-width: 360px;
    padding: 20px;
  }

  .lightbox {
    padding: 16px;
  }

  .lightbox-image {
    max-width: 94vw;
    max-height: 80vh;
  }
}

@media (max-width: 480px) {
  .form-container {
    width: 98%;
    max-width: none;
    padding: 16px;
  }

  .form-container h2 {
    font-size: 1.4rem;
  }

  /* 2026-10-15: no font-size here any more. This rule used to set the
     fields back to 14px on phones, which undid the 16px that stops iPhone
     Safari from zooming in when a field is tapped (iOS zooms any field
     under 16px). The base .form-container rule keeps them at 16px. */
  .form-container input,
  .form-container textarea,
  .form-container select {
    padding: 10px;
  }

  .btn.full-width {
    font-size: 14px;
    padding: 10px;
  }

  .lightbox-close {
    top: 8px;
    right: 12px;
    font-size: 2rem;
  }

  .lightbox-nav {
    font-size: 1.3rem;
    padding: 8px 12px;
  }

  .lightbox-nav-prev {
    left: 6px;
  }

  .lightbox-nav-next {
    right: 6px;
  }
}

/* ======================= Gift certificate banner ======================= */
/* Small promotional callout announcing gift certificates (2026-09-16,
   holiday season) - same markup/string reused as-is on index.php,
   merch.php, and retreat-register.php, each inside its own
   .content-wrapper for the usual max-width/centering/gutter. Modeled on
   .demand-banner's contained-card shape just above, but in the site's
   green accent rather than .demand-banner's tan so it reads as a
   distinct "here's something new" callout instead of another
   informational notice, and it carries its own button rather than just
   text. */
.giftcert-banner {
  background-color: #eaf0e1;
  border: 1px solid rgba(98, 129, 65, 0.35);
  border-radius: 10px;
  padding: 12px 20px;
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 20px;
}

.giftcert-banner p {
  margin: 0;
  text-align: center;
  color: #3f5029;
  font-size: 1.1rem;
  line-height: 1.5;
}

.giftcert-banner .btn {
  flex-shrink: 0;
  margin: 4px 0;
}

@media (max-width: 600px) {
  .giftcert-banner {
    padding: 12px 16px;
    flex-direction: column;
  }
  .giftcert-banner p {
    font-size: 1rem;
  }
}

/* ============================ Footer ============================ */
/* Shared copyright notice - see footer.php. Deliberately understated
   (small, muted text) since it's a legal formality, not a page element
   anyone needs to notice. */
.site-footer {
  max-width: var(--container-width);
  margin: 40px auto 0;
  padding: 16px 20px 24px;
  text-align: center;
  border-top: 1px solid rgba(98, 129, 65, 0.2);
}

.site-footer p {
  margin: 0;
  color: #666;
  font-size: 13px;
}
