/* ==========================================================================
   John B. Garrett Lodge #711 — glassmorphism theme
   All theming lives here; Bootstrap only provides grid/navbar/utilities.
   ========================================================================== */

:root {
  --navy-900: #0a121e;   /* deepest background stop */
  --navy-700: #132337;   /* rgb(19,35,55) */
  --navy-500: #264759;   /* rgb(38,71,89) */
  --gold:       #c9a227; /* primary accent */
  --gold-light: #edda9b; /* rgb(237,218,155) — headings */
  --ink:        #e8e6df; /* near-white body text */
  --ink-dim:    rgba(232,230,223,0.72);
  --nav-height: 72px;
  /* background overlay stops + vignette strength (time-of-day themes override) */
  --bg0: rgba(19,35,55,0.88);
  --bg1: rgba(38,71,89,0.82);
  --bg2: rgba(10,18,30,0.94);
  --vignette-alpha: 0.42;
}

/* ---------- Time-of-day themes (JS sets <html data-theme="...">) ---------- */
/* night is the design baseline = :root values above */
html[data-theme="morning"] {
  --bg0: rgba(41,58,84,0.84);
  --bg1: rgba(74,92,115,0.78);
  --bg2: rgba(24,31,45,0.92);
  --vignette-alpha: 0.34;
}
html[data-theme="afternoon"] {
  --bg0: rgba(36,68,92,0.84);
  --bg1: rgba(48,94,110,0.78);
  --bg2: rgba(14,28,42,0.92);
  --vignette-alpha: 0.38;
}

/* ---------- Fonts (locally hosted, woff2) ---------- */
@font-face {
  font-family: 'Cinzel';
  src: url('../assets/fonts/cinzel-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--navy-900);
  background-image:
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 40%, var(--bg2) 100%),
    url('../assets/img/lodge-room-hero.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* iOS / touch fallback: fixed attachment is unreliable there */
@media (max-width: 768px) {
  body { background-attachment: scroll; }
}
@supports (-webkit-touch-callout: none) {
  body { background-attachment: scroll; }
}

/* subtle vignette above the fixed background, below content */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(4, 8, 14, var(--vignette-alpha)) 100%);
}

::selection {
  background: rgba(201, 162, 39, 0.35);
  color: #fff;
}

h1, h2, h3, .navbar-brand, .card-title-cinzel, blockquote {
  font-family: 'Cinzel', 'Times New Roman', serif;
  letter-spacing: 0.04em;
}

a { color: var(--gold-light); }
a:hover { color: var(--gold); }

.ink-dim { color: var(--ink-dim); }

/* visible gold focus outline (WCAG) */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 2000;
  padding: 0.6rem 1rem;
  background: var(--navy-900);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: 8px;
  transition: top 200ms ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Glass recipe (signature card) ---------- */
.glass {
  background: linear-gradient(160deg, rgba(148,191,206,0.08) 0%, rgba(75,123,187,0.08) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  box-shadow: 0 4px 26px rgba(0,0,0,0.26),
              inset 0 0 0 1px rgba(255,255,255,0.08),
              inset 0 1px 0 rgba(255,255,255,0.15);
}

.glass-muted {
  background: linear-gradient(160deg, rgba(148,191,206,0.045) 0%, rgba(75,123,187,0.045) 100%);
  color: var(--ink-dim);
}

.card-pad    { padding: clamp(1.75rem, 4vw, 3rem); }
.card-pad-sm { padding: 1.1rem 1.5rem; }

/* ---------- Gold hairline rules ---------- */
.gold-rule {
  height: 1px;
  border: 0;
  margin: 1.1rem auto 2rem;
  width: min(280px, 60%);
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.9;
}

/* ---------- Section titles ---------- */
.section { padding: clamp(4rem, 9vw, 6.5rem) 0; }

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.35rem;
  color: var(--gold-light);
  text-wrap: balance;
}
.section-title-left { text-align: left; margin-bottom: 1.25rem; }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .section-title {
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  padding: 0.55rem 0;
  transition: box-shadow 300ms ease, background 300ms ease;
}
.site-nav.scrolled {
  background: linear-gradient(160deg, rgba(19,35,55,0.72) 0%, rgba(10,18,30,0.78) 100%);
  box-shadow: 0 6px 30px rgba(0,0,0,0.45),
              inset 0 0 0 1px rgba(255,255,255,0.06);
}

.brand-lockup {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(201,162,39,0.25));
}

.site-nav .nav-link {
  color: var(--ink-dim);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.45rem 0.9rem;
  position: relative;
  transition: color 250ms ease;
}
.site-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 250ms ease;
}
.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible { color: var(--ink); }
.site-nav .nav-link.active { color: var(--gold-light); }
.site-nav .nav-link.active::after,
.site-nav .nav-link:hover::after { opacity: 1; }

/* custom hamburger */
.nav-toggler {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 40px;
  padding: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggler span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--gold-light);
  border-radius: 2px;
  transition: transform 300ms ease, opacity 300ms ease;
}
.nav-toggler[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggler[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggler[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* collapsed mobile menu panel */
@media (max-width: 991.98px) {
  .site-nav .navbar-collapse {
    margin-top: 0.65rem;
    padding: 0.6rem 0.4rem;
    background: linear-gradient(160deg, rgba(19,35,55,0.55) 0%, rgba(10,18,30,0.65) 100%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
  }
  .site-nav .nav-link { padding: 0.7rem 1.1rem; }
  .site-nav .nav-link::after { left: 1.1rem; right: auto; width: 40px; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 2rem) 0 4rem;
}
.hero .container { position: relative; }

.hero-lockup {
  width: min(640px, 88%);
  height: auto;
  filter: drop-shadow(0 0 22px rgba(201,162,39,0.45)) drop-shadow(0 4px 18px rgba(0,0,0,0.55));
}

.hero-subtitle {
  font-family: 'Cinzel', 'Times New Roman', serif;
  letter-spacing: 0.04em;
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  color: var(--gold-light);
  margin: 1.4rem 0 0;
}

.hero-rule { margin: 1.4rem auto 1.2rem; width: min(340px, 70%); }

.hero-stated {
  color: var(--ink-dim);
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-cue {
  display: inline-block;
  margin-top: 3rem;
  color: var(--gold);
  opacity: 0.85;
  animation: cue-bounce 2.4s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--gold-light); }
@keyframes cue-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

/* ---------- Glass buttons ---------- */
.btn-glass {
  background: linear-gradient(160deg, rgba(148,191,206,0.10) 0%, rgba(75,123,187,0.10) 100%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.75rem 1.6rem;
  transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease, color 250ms ease;
}
.btn-glass:hover,
.btn-glass:focus-visible {
  color: var(--gold-light);
  border-color: rgba(201,162,39,0.65);
  box-shadow: 0 6px 22px rgba(0,0,0,0.35), 0 0 18px rgba(201,162,39,0.18);
  transform: translateY(-2px);
}
.btn-glass-gold { color: var(--gold-light); border-color: rgba(201,162,39,0.45); }

.btn-gold-outline {
  background: rgba(201,162,39,0.06);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--gold);
  border-radius: 12px;
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.7rem 1.5rem;
  transition: background 250ms ease, transform 250ms ease, box-shadow 250ms ease;
}
.btn-gold-outline:hover,
.btn-gold-outline:focus-visible {
  background: rgba(201,162,39,0.16);
  color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0,0,0,0.35), 0 0 18px rgba(201,162,39,0.22);
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-portrait { text-align: center; }
@media (min-width: 992px) {
  .about-portrait { position: sticky; top: calc(var(--nav-height) + 1.5rem); }
}
.portrait-img {
  border-radius: 12px;
  border: 1px solid rgba(201,162,39,0.35);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.about-portrait figcaption {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
  line-height: 1.5;
}

.namesake-quote {
  margin: 2.2rem 0 0;
  padding: 1.8rem 1.5rem 1.4rem;
  position: relative;
  text-align: center;
}
.namesake-quote::before,
.namesake-quote::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.namesake-quote::before { top: 0; }
.namesake-quote::after { bottom: 0; }
.namesake-quote p {
  font-family: 'Cinzel', 'Times New Roman', serif;
  letter-spacing: 0.04em;
  font-size: clamp(1.12rem, 2.2vw, 1.5rem);
  line-height: 1.55;
  color: var(--gold-light);
  margin-bottom: 1rem;
}
.namesake-quote footer {
  font-family: 'Inter', system-ui, sans-serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-dim);
}

/* ==========================================================================
   FREEMASONRY
   ========================================================================== */
.watermark {
  position: absolute;
  top: 50%;
  right: -4%;
  transform: translateY(-50%);
  width: min(520px, 62vw);
  height: auto;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}
#freemasonry { position: relative; overflow: hidden; }
#freemasonry .container { z-index: 1; }

.card-title-cinzel {
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.9rem;
}

/* ==========================================================================
   CALENDAR
   ========================================================================== */
.calendar-card { max-width: 640px; }
.calendar-note { max-width: 640px; text-align: center; font-size: 0.95rem; }

.cinzel-gold-line {
  font-family: 'Cinzel', 'Times New Roman', serif;
  letter-spacing: 0.04em;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 600;
  color: var(--gold);
  margin: 0.4rem 0 1.6rem;
}

.schedule {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 6vw, 4rem);
  flex-wrap: wrap;
}
.schedule-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--gold-light);
}
.schedule-item svg { color: var(--gold); flex: none; }
.schedule-item span { font-size: 1.08rem; font-weight: 500; letter-spacing: 0.02em; }

.calendar-rule { margin: 1.8rem auto 1.3rem; }

.upcoming-label {
  color: var(--ink-dim);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.upcoming-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--ink);
  font-weight: 500;
}
.upcoming-list li { display: flex; align-items: center; }
.upcoming-list li:not(:last-child)::after {
  content: '·';
  color: var(--gold);
  margin: 0 0.75rem;
}

/* ==========================================================================
   GALLERY
   ========================================================================== */
.gallery-item {
  display: block;
  width: 100%;
  padding: 6px;
  background: linear-gradient(160deg, rgba(148,191,206,0.06) 0%, rgba(75,123,187,0.06) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  cursor: zoom-in;
  transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}
.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 25 / 16;
  object-fit: cover;
  border-radius: 7px;
}
.gallery-item:hover,
.gallery-item:focus-visible {
  transform: scale(1.03);
  border-color: rgba(201,162,39,0.7);
  box-shadow: 0 8px 26px rgba(0,0,0,0.4), 0 0 20px rgba(201,162,39,0.22);
}
button.gallery-item { font: inherit; color: inherit; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: min(1100px, 92vw);
  margin: 0;
  text-align: center;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(201,162,39,0.45);
  box-shadow: 0 18px 60px rgba(0,0,0,0.6);
}
.lightbox-stage figcaption {
  margin-top: 0.9rem;
  color: var(--ink-dim);
  font-size: 0.92rem;
}
.lb-btn {
  position: absolute;
  z-index: 2;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(148,191,206,0.10) 0%, rgba(75,123,187,0.10) 100%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: var(--gold-light);
  cursor: pointer;
  transition: border-color 250ms ease, background 250ms ease;
}
.lb-btn:hover { border-color: var(--gold); background: rgba(201,162,39,0.14); }
.lb-close { top: 1.2rem; right: 1.2rem; font-size: 1.7rem; line-height: 1; }
.lb-prev  { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1.2rem; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.lodge-name {
  font-family: 'Cinzel', 'Times New Roman', serif;
  letter-spacing: 0.04em;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.address-link {
  font-size: 1.05rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(201,162,39,0.45);
  transition: color 250ms ease, border-color 250ms ease;
}
.address-link:hover { border-bottom-color: var(--gold); }

.form-title {
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 1.1rem;
}

.form-label { color: var(--ink-dim); font-size: 0.92rem; margin-bottom: 0.35rem; }

.form-control {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  color: var(--ink);
  padding: 0.65rem 0.9rem;
  transition: border-color 250ms ease, box-shadow 250ms ease;
}
.form-control::placeholder { color: rgba(232,230,223,0.4); }
.form-control:focus {
  background: rgba(255,255,255,0.07);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.18);
  color: var(--ink);
}
/* honeypot: visually hidden, unreachable by keyboard (tabindex=-1) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-note { margin: 0.75rem 0 0; font-size: 0.82rem; color: var(--ink-dim); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer-rule { width: 100%; margin: 0 0 0; }
.checker-strip {
  height: 14px;
  background: repeating-conic-gradient(rgba(255,255,255,0.10) 0% 25%, rgba(0,0,0,0.10) 0% 50%);
  background-size: 14px 14px;
}
.footer-inner { padding: 1.2rem 0 1.6rem; }
.footer-bar {
  border-radius: 12px;
  padding: 0.9rem 1.4rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-dim);
}

/* ==========================================================================
   MOTION
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .scroll-cue { animation: none; }
}

/* ==========================================================================
   MOBILE / TABLET HARDENING
   ========================================================================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body { -webkit-tap-highlight-color: transparent; }

/* instant tap response (no 300ms delay) on interactive elements */
a, button, .btn, .nav-toggler, .gallery-item { touch-action: manipulation; }

/* ≥44px touch targets */
.nav-toggler { min-width: 44px; min-height: 44px; }
@media (max-width: 991.98px) {
  .site-nav .nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}

/* notched devices: keep navbar + footer out of the sensor area */
@supports (padding-top: env(safe-area-inset-top)) {
  .site-nav {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .footer-inner {
    padding-bottom: calc(1.6rem + env(safe-area-inset-bottom));
  }
}

/* iOS zooms inputs under 16px — pin control size */
.form-control, .form-select { font-size: 1rem; }

/* larger lightbox controls on touch devices */
@media (pointer: coarse) {
  .lb-btn { width: 54px; height: 54px; }
  .lb-close { font-size: 2rem; }
}

/* hover-only effects: don't let them stick on touch */
@media (hover: none) {
  .gallery-item:hover { transform: none; box-shadow: none; }
}

/* short landscape phones: don't trap the hero at full height */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: calc(var(--nav-height) + 1.5rem); padding-bottom: 3rem; }
  .scroll-cue { display: none; }
}

/* ==========================================================================
   SMALL-SCREEN POLISH
   ========================================================================== */
@media (max-width: 575.98px) {
  .schedule { flex-direction: column; align-items: center; gap: 0.9rem; }
  .hero-actions .btn { width: 100%; max-width: 320px; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
}
