/* Minimal custom styles to complement Bootstrap 5 */
/* Theme variables */
:root {
  /* Haunt on High palette */
  --haunt-bg: #0b0b0b;
  --haunt-text: #f5f5f5;
  --haunt-muted: #b8b8b8;
  --haunt-border: #333333;
  --haunt-orange: #ff7518;
  --haunt-purple: #9c4dcc;
  --haunt-mint: #8ef5c0;

  /* Map to Bootstrap variables */
  --bs-body-bg: var(--haunt-bg);
  --bs-body-color: var(--haunt-text);
  --bs-warning: var(--haunt-orange);
  --bs-purple: var(--haunt-purple);
  /* Helpful extras for consistency */
  --bs-secondary-color: var(--haunt-muted);
  --bs-border-color: var(--haunt-border);
}

/* Global background and typography */
html { background-color: var(--haunt-bg); scrollbar-gutter: stable; }
body {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  line-height: 1.6;
}

/* Headings typography */
h1, h2, h3,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: 'Creepster', cursive;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--haunt-orange);
}

h4, h5, h6 { font-family: 'Nunito', sans-serif; font-weight: 600; letter-spacing: 0.2px; }
.btn, .navbar .nav-link, label { font-family: 'Nunito', sans-serif; }
strong { color: var(--haunt-orange); }
em { color: var(--bs-purple); }
p, li { line-height: 1.6; }

/* Ensure Bootstrap dark surfaces match theme */
.bg-dark { background-color: var(--haunt-bg) !important; }
.text-muted { color: var(--haunt-muted) !important; }
.border-secondary { border-color: var(--haunt-border) !important; }
.navbar { border-color: var(--haunt-border) !important; }
.navbar-dark .navbar-nav .nav-link,
.navbar-dark .nav-link { color: rgba(245,245,245,0.75); }
/* Orange glow on hover/focus, consistent with footer (also for xs "Visitors' Wall" link) */
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus,
.navbar-dark .navbar-nav .nav-link:focus-visible,
.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus,
.navbar-dark .nav-link:focus-visible { color: var(--haunt-orange) !important; text-shadow: 0 0 6px rgba(255,117,24,0.5); }
.navbar-dark .navbar-nav .nav-link.active { color: var(--haunt-text); }

/* Utilities: accents and effects */
.text-orange { color: var(--haunt-orange) !important; text-shadow: 0 0 6px rgba(255,117,24,0.5); }
.bg-orange { background-color: var(--haunt-orange) !important; }
.btn-orange {
  --bs-btn-color: #1a0f05;
  --bs-btn-bg: var(--haunt-orange);
  --bs-btn-border-color: var(--haunt-orange);
  --bs-btn-hover-bg: #ff9a3c;
  --bs-btn-hover-border-color: #ff9a3c;
  --bs-btn-active-bg: #ff9a3c;
  --bs-btn-active-border-color: #ff9a3c;
  --bs-btn-disabled-bg: var(--haunt-orange);
  --bs-btn-disabled-border-color: var(--haunt-orange);
}

.text-purple { color: var(--haunt-purple) !important; text-shadow: 0 0 6px rgba(156,77,204,0.5); }
.bg-purple { background-color: var(--haunt-purple) !important; }
.border-purple { border-color: var(--haunt-purple) !important; }

.text-ghost { color: var(--haunt-mint) !important; }
.bg-night-gradient { background: radial-gradient(circle at top, #1a1a1a 0%, #0b0b0b 60%, #0b0b0b 100%); }

/* Hero section with background image */
.hero {
  position: relative;
  min-height: 58vh;
  /* Fallback hero background; JS swaps day/night dynamically */
  background: url('../images/hero/hero-night.jpg') center/cover no-repeat;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.75));
}
.hero .hero-content { position: relative; z-index: 1; padding-top: 3rem; padding-bottom: 3rem; }

/* Homepage refinements: keep shared hero and page typography unchanged. */
.home-hero .hero-tagline {
  color: var(--haunt-muted);
  font-weight: 400;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}
.home-hero::after {
  background:
    linear-gradient(to bottom, rgba(11,11,11,0), var(--haunt-bg)) bottom / 100% 4rem no-repeat,
    linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.75));
  pointer-events: none;
}
.home-intro { max-width: 68ch; margin-inline: auto; }
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
  .home-hero.has-parallax { overflow: hidden; }
  .home-hero.has-parallax::before {
    content: '';
    position: absolute;
    /* Cover 70px of downward travel, with a 2px safety margin at each end. */
    inset: -72px 0 -2px;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    transform: translate3d(0, var(--hero-parallax-y, 0px), 0);
    pointer-events: none;
  }
}
@media (max-width: 359.98px) {
  .home-hero .hero-actions { flex-direction: column; align-items: center; }
  .home-hero .hero-actions .btn { width: 13rem; max-width: 100%; min-height: 44px; }
}
.photo-removal-notice { color: #969696; }
.photo-removal-notice a { color: #d0d0d0; text-decoration: none; }
.photo-removal-notice a svg { width: 1em; height: 1em; margin-left: 0.2em; vertical-align: -0.15em; }
.photo-removal-notice a:hover,
.photo-removal-notice a:focus-visible { color: var(--haunt-text); text-decoration: underline; text-underline-offset: 0.2em; }
.photo-removal-notice a:focus-visible { outline: 2px solid var(--haunt-orange); outline-offset: 3px; }

/* Static porch-light pools beneath the noninteractive homepage previews. */
.home-photo-preview > .col {
  --porch-light: 85, 190, 105;
  position: relative;
  isolation: isolate;
}
.home-photo-preview > .col:nth-child(2) { --porch-light: 156, 77, 204; }
.home-photo-preview > .col:nth-child(3) { --porch-light: 255, 151, 55; }
.home-photo-preview > .col::before {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: auto 8px -18px;
  height: 44px;
  background: radial-gradient(ellipse at center, rgba(var(--porch-light), 0.16), rgba(var(--porch-light), 0) 72%);
}
@media (max-width: 575.98px) {
  .home-photo-preview > .col::before { bottom: -12px; height: 32px; opacity: 0.65; }
}

/* Image hover for galleries */
.img-zoom { transition: transform 180ms ease, filter 180ms ease; filter: saturate(0.97) contrast(1.02); }
.img-zoom:hover { transform: scale(1.03); filter: saturate(1) contrast(1.06); }

/* Small helper */
.note { color: var(--bs-secondary-color); }

/* Buttons: faint glow on hover/focus */
.btn { transition: box-shadow 200ms ease, transform 200ms ease; }
.btn:hover, .btn:focus-visible { box-shadow: 0 0 8px rgba(255,117,24,0.5); }

/* Footer readability and separation */
footer.bg-dark { color: #d0d0d0; box-shadow: 0 -1px 0 var(--haunt-border) inset; }
footer.bg-dark a, footer.bg-dark .nav-link, footer.bg-dark .text-muted { color: #d0d0d0 !important; }
footer.bg-dark a:hover, footer.bg-dark .nav-link:hover { color: var(--haunt-orange) !important; }
footer .footer-facebook { position: relative; min-width: 44px; text-align: center; }
footer .footer-facebook::after { content: ''; position: absolute; inset: -2px 0; }
footer .footer-facebook svg { width: 20px; height: 20px; vertical-align: -3px; }
footer.bg-dark .footer-facebook:hover,
footer.bg-dark .footer-facebook:focus-visible { color: #fff !important; }
footer .footer-facebook:focus-visible { outline: 2px solid var(--haunt-orange); outline-offset: 2px; border-radius: 3px; }

/* Footer ghost separator icon */
.sep-ghost { width: 1.2em; height: 1.2em; vertical-align: -0.2em; filter: drop-shadow(0 0 4px rgba(255,117,24,0.45)); }
.sep-ghost path { fill: var(--haunt-text) !important; }
/* Make eyes and smile slightly bigger without scaling the whole icon */
.sep-ghost circle { transform-box: fill-box; transform-origin: center; transform: translateY(-1.5px) scale(1.25); }
.sep-ghost path[stroke] { stroke-width: 2; }

/* Aspect-ratio helpers to reduce CLS */
.ar-4x3 { aspect-ratio: 4 / 3; }
.object-cover { object-fit: cover; }

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after { 
    animation: none !important; 
    transition: none !important; 
    scroll-behavior: auto !important;
  }
  .flicker, .hover-zoom, .fade-loop, .glow-pulse, .img-zoom {
    animation: none !important;
    transition: none !important;
  }
}

/* Countdown styles */
.countdown-wrap { max-width: 960px; margin-inline: auto; text-align: center; position: relative; isolation: isolate; }
.countdown-heading {
  font-family: 'Creepster', cursive;
  font-weight: 700;
  color: var(--haunt-orange);
  text-shadow: 0 0 12px rgba(255,117,24,0.55);
  margin-top: 1.25rem; margin-bottom: 1rem;
  line-height: 1.1;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
}
.countdown { 
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; 
  gap: 0.5rem 2.25rem; margin-bottom: 0.5rem;
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
}
.countdown-group { display: inline-flex; align-items: baseline; }
.countdown-number {
  font-family: 'Nunito', sans-serif; font-weight: 700;
  color: #ffffff; letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255,117,24,0.35);
  transition: filter 180ms ease;
  font-feature-settings: 'tnum' 1;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  line-height: 1;
}
.countdown #countdown-compact .colon {}
#countdown-compact .colon {
  font-family: 'Nunito', monospace;
  display: inline-block;
  width: 0.6ch;
  text-align: center;
  opacity: 0.9;
  color: var(--haunt-orange);
  text-shadow: 0 0 6px rgba(255,117,24,0.3);
  vertical-align: middle;
  line-height: 1;
  position: relative;
  top: 0.02em;
  /* ensure no tabular numeric features get inherited */
  font-variant-numeric: normal;
  font-feature-settings: normal;
}
/* Lock digit and colon scaling together to avoid fractional rounding drift */
.countdown-number, .colon { font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem); }
.countdown-number:hover { filter: brightness(1.1); }
.countdown-label {
  font-family: 'Nunito', sans-serif; font-weight: 400; 
  color: var(--haunt-muted); margin-left: 0.25rem;
}
/* Sizing across breakpoints: numbers always below heading size */
.countdown-number { font-size: 2rem; }
.countdown-label { font-size: 1rem; }
@media (min-width: 768px) { .countdown-number { font-size: 2.25rem; } .countdown-label { font-size: 1.1rem; } }
@media (min-width: 992px) { .countdown-number { font-size: 2.5rem; } .countdown-label { font-size: 1.2rem; } }
@media (min-width: 1200px) { .countdown-number { font-size: 3rem; } .countdown-label { font-size: 1.3rem; } }

/* Soft pulsing glow behind numbers (reduced-motion safe) */
@keyframes glowPulse { 0% { text-shadow: 0 0 6px rgba(255,117,24,0.25);} 50% { text-shadow: 0 0 14px rgba(255,117,24,0.55);} 100% { text-shadow: 0 0 6px rgba(255,117,24,0.25);} }
.glow-pulse { animation: glowPulse 2.4s ease-in-out infinite; }

.countdown-divider { border: none; border-top: 1px solid rgba(255,117,24,0.5); width: 160px; margin: 1rem auto 0; }

.countdown-message { font-family: 'Creepster', cursive; color: var(--haunt-orange); text-shadow: 0 0 12px rgba(255,117,24,0.6); font-size: clamp(2.25rem, 6vw, 3.25rem); margin-top: 0.5rem; }
.countdown-message.interlude { font-family: 'Nunito', sans-serif; font-weight: 600; letter-spacing: 0.2px; }
.fade-soft { opacity: 0; transition: opacity 750ms ease; }
.fade-soft.show { opacity: 1; }

/* Lantern glow background (lg and up only) */
@keyframes glow-fade { 0% { opacity: .35; } 50% { opacity: .9; } 100% { opacity: .35; } }
@media (min-width: 992px) {
  .countdown-wrap::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(circle at center, rgba(255,140,0,0.1), transparent 70%);
    opacity: 0.6;
    animation: glow-fade 9s ease-in-out infinite;
  }
}

/* Keep the desktop layout; stack each number over its label on smaller screens. */
#countdown-full { display: inline-flex !important; }
@media (max-width: 1199.98px) {
  #countdown-full {
    display: inline-grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%; max-width: 40rem;
    gap: 0.5rem 1.25rem;
  }
  #countdown-full .countdown-group { flex-direction: column; align-items: center; gap: 0.125rem; }
  #countdown-full .countdown-label { margin-left: 0; white-space: nowrap; }
}
@media (max-width: 479.98px) {
  #countdown-full { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 20rem; }
}

/* JS suppression class to hide all countdowns during CELEBRATE/INTERLUDE */
#countdown-compact.countdown-suppressed,
#countdown-abbrev.countdown-suppressed,
#countdown-full.countdown-suppressed { display: none !important; }

/* Navbar brand: Haunt on HIGH styling */
.haunt-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  position: relative;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}
.haunt-brand .haunt-on {
  font-family: 'Caveat Brush', cursive;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  letter-spacing: 0.07em;
  color: #f7f7f7;
  transform: rotate(-7deg) translateX(-0.4em) translateY(0.2em);
  transform-origin: bottom center;
  text-shadow: 0 0 6px rgba(255,255,255,0.35);
  white-space: nowrap;
  margin-bottom: 0.45em;
}
.haunt-brand .haunt-word { display: inline-block; transform-origin: center bottom; }
.haunt-brand .haunt-on .char { display: inline-block; transform-origin: center bottom; line-height: 1; }
.haunt-brand .haunt-on .char.space { width: 0.33em; }
/* Gentle upward arc across characters (8 chars for "Haunt on") */
.haunt-brand .haunt-word .char:nth-child(1) { transform: translateY(0.25em) rotate(-3deg); }
.haunt-brand .haunt-word .char:nth-child(2) { transform: translateY(0.18em) rotate(-2deg); }
.haunt-brand .haunt-word .char:nth-child(3) { transform: translateY(0.12em) rotate(-1deg); }
.haunt-brand .haunt-word .char:nth-child(4) { transform: translateY(0.06em) rotate(0deg); }
.haunt-brand .haunt-word .char:nth-child(5) { transform: translateY(0.06em) rotate(0deg); }
.haunt-brand .haunt-on > .char.space { transform: translateY(0.12em) rotate(1deg); }
.haunt-brand .haunt-on > .char:nth-last-child(2) { transform: translateY(0.18em) rotate(2deg); }
.haunt-brand .haunt-on > .char:last-child { transform: translateY(0.25em) rotate(3deg); }
.haunt-brand .high {
  font-family: 'Creepster', cursive;
  font-size: clamp(1.6rem, 2.8vw, 2rem);
  color: #f7f7f7;
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px rgba(255,255,255,0.35);
}
.haunt-brand::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 130%;
  height: 0.2rem;
  left: -15%;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.1), transparent 70%);
  transform: rotate(-2deg);
  pointer-events: none;
}
/* A single tilt for mouse users; touch and reduced-motion keep the static logo. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .haunt-brand .haunt-word { transition: transform 200ms ease-out; }
  .haunt-brand:hover .haunt-word { transform: rotate(-3deg); }
}

/* (Removed haunted house icon rules) */

/* Navbar brand skeleton mascot (to the right of text) */
/* (Mascot removed) */
