/* ===========================================================
   Advent Giving Calendar — 2025 Launch Build
   -----------------------------------------------------------
   Created by Jeff & Pilar Prus — CMF International
   Hosted via Cloudflare Pages + GitHub
   Campaign Year: 2025
   -----------------------------------------------------------
   This stylesheet is part of the Advent Giving Calendar project.
   All rights reserved.
   =========================================================== */

:root {
  --frost-bg: #f4f7fb;
  --frost-card: #ffffff;
  --frost-edge: #e6eef7;
  --frost-blue: #a5c8e1;
  --frost-blue-deep: #75aacc;
  --soft-gold: #e8dcca;
  --ink: #1c1c1c;
  --muted: #5a6a7a;
}

body {
  background: var(--frost-bg);
  color: var(--ink);
  font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
}

/* Header */
.header {
  background: linear-gradient(180deg, #eaf2fb 0%, #dfeaf6 100%);
  color: var(--ink);
  border-bottom: 1px solid var(--frost-edge);
}
.header .subtitle { color: var(--muted); }

/* Controls */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}
.controls {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin: 0.75rem 0 0.25rem;
}
.btn {
  appearance: none;
  border: 1px solid var(--frost-blue);
  background: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(117,170,204,0.25);
}
.btn.primary { background: var(--frost-blue); color: #fff; }
.btn.ghost { background: transparent; color: var(--frost-blue-deep); }

/* Flip animation */
.flip-mode .day {
  perspective: 900px;
}
.card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms cubic-bezier(.2,.65,.27,1);
  border-radius: 10px;
}
.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.front {
  background: linear-gradient(180deg, #ffffff, #f6fbff);
}
.back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #ffffff, #f1f8ff);
}
/*.flip-mode .day[data-status="pending"] .card,
.flip-mode .day[data-status="reserved"] .card {
  transform: rotateY(180deg);
} */

/* Text scaling on back face */
.back .back-inner {
  font-size: clamp(0.65rem, 1.6vw, 0.9rem);
  line-height: 1.3;
  padding: 0.3rem;
}
.back h3 {
  font-size: clamp(0.8rem, 2vw, 1rem);
  margin: 0.2em 0;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(18, 33, 48, 0.28);
  backdrop-filter: blur(2px);
  z-index: 10;
}
.modal.show { display: grid; }
.modal-dialog {
  background: #fff;
  width: min(620px, 92vw);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
}
.selection-list {
  max-height: 40vh;
  overflow: auto;
  border: 1px solid rgba(123, 31, 36, 0.25); /* faint maroon at 25% opacity */
  border-radius: 10px;
  padding: 0.5rem;
  background: #fbfdff;
}
.total-row {
  display: flex;
  justify-content: space-between;
  /* border-top: 2px solid var(--frost-edge); border removed - now handled by HTML */
  margin: 0.8rem 0 0.6rem;
  padding-top: 0.6rem;
}

/* === v1.2 visual clarity hotfix === */

/* Remove rounding so seams stay tight */
.card, .face {
  border-radius: 0 !important;
}

/* Add visible dividers between tiles */
.calendar-grid {
  border-collapse: collapse; /* (technically a no-op for grid, but fine to keep) */
}

/* Light borders for available + pending tiles */
.day[data-status="available"],
.day[data-status="pending"] {
  border: 1px solid rgba(200,200,200,0.5);
}

/* No border once reserved, so the background image shows cleanly */
.day[data-status="reserved"] {
  border: none;
}


/* Ensure fronts have readable contrast */
.face.front {
  background: #2d7a2d; /* classic green */
  color: #fff;
}
.day-number {
  display: block;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.day-amount {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  color: #fff;
  opacity: 0.95;
}

/* Back faces — lighter green paper effect */
.face.back {
  background: #f8fff8;
  color: #333;
  border: 1px solid rgba(0,0,0,0.1);
}
.back .back-inner {
  font-size: 0.9rem;
  color: #333;
}
.back h3 {
  font-weight: 600;
  margin-top: 0;
  color: #2d7a2d;
}


/* Snowflakes */
body.winter-on #snowHost {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.snowflake {
  position: absolute;
  top: -2%;
  opacity: 0.9;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.8));
}
@keyframes fall {
  to {
    transform: translateY(105vh) translateX(var(--drift, 0px)) rotate(360deg);
  }
}

/* Other animations … */

/* Snow animation overlay */
.snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Subtle shimmer overlay */
.shimmer-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6; /* slightly above snow layer */
}


/* --- Snow button feedback styles --- */
#snowBtn {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.5s ease;
}

/* when snow is active */
#snowBtn.snow-active {
  color: #fff;
  background-color: #0077b6;        /* icy blue */
  box-shadow: 0 0 15px rgba(0, 183, 255, 0.7);
}

/* optional hover tweak */
#snowBtn.snow-active:hover {
  box-shadow: 0 0 20px rgba(0, 200, 255, 0.9);
}

/* ===========================================================
   Frosted Hero Header — v1.9.0
   Elegant Advent intro with message
   =========================================================== */
.frosted-hero {
  position: relative;
  background: linear-gradient(180deg, #eaf2fb 0%, #dfeaf6 100%);
  color: var(--ink);
  text-align: center;
  padding: 2.5rem 1rem 2.75rem;
  border-bottom: 1px solid var(--frost-edge);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  background-image: url('../images/frosted-header-bg.jpg'); /* optional */
  background-size: cover;
  background-position: center;
  background-blend-mode: lighten;
}

.frosted-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Make header container an anchor for absolute positioning */
.frosted-hero {
  position: relative;
}

/* Keep text centered */
.hero-inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  z-index: 2;
}

/* Centered page title + subtitle above hero */
.hero-title-block {
  text-align: center;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 3;
}

.hero-title-block h1 {
  font-family: 'Merriweather', serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0;
  color: var(--frost-blue-deep);
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 600;      /* was 400 */
  color: #496c92;        /* frost blue deep tone */
}

/* ===========================================================
   Two-column hero layout
   =========================================================== */
.two-col-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  text-align: left;
  max-width: 1000px;
  margin: 0 auto;
}

/* Left-side circular photo */
.hero-photo-wrap {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

.hero-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  background-color: #fff;
}

/* Right-side text column */
.hero-text {
  max-width: 650px;
}

/* Mobile: stack photo above text */
@media (max-width: 700px) {
  .two-col-hero {
    flex-direction: column;
    text-align: center;
  }
}

.hero-message {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.6;
  color: var(--muted);
  margin: 0 auto;
  max-width: 680px;
}

.hero-message strong {
  color: var(--frost-blue-deep);
  font-weight: 600;
}

/* Optional subtle fade animation */
.frosted-hero {
  animation: heroFadeIn 1s ease-in-out;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Brief instructional line above the calendar */
.calendar-intro {
  font-size: 1rem;
  color: var(--muted);
  margin: 0.25rem auto 0.5rem;
  text-align: center;
  font-weight: 500;
  animation: heroFadeIn 1s ease-in-out; /* optional subtle fade to match header */
}

/* Highlighted action phrase inside the instructions */
.calendar-intro .action-highlight {
  color: var(--frost-blue-deep);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.25s ease;
}

/* Optional hover tint (subtle visual cue) */
.calendar-intro .action-highlight:hover {
  color: var(--frost-blue);
}

/* ===========================================================
   Advent Giving Calendar — Confirmed Tile Fade Reveal
   -----------------------------------------------------------
   Smooth fade for overlay and card removal
   =========================================================== */

.day[data-status="reserved"] .pending-overlay,
.day[data-status="reserved"] .card {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-in-out;
}

.day[data-status="reserved"] {
  transition: filter 0.6s ease-in-out, background-color 0.6s ease-in-out;
  filter: brightness(1);
}

/* ===========================================================
   Mobile Frost Overlay — improves readability on small screens
   =========================================================== */
@media (max-width: 600px) {
  .frosted-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.10); /* subtle 10% white frost */
    pointer-events: none;
    z-index: 1; /* sits above background image but below text */
  }

  .hero-inner,
  .hero-title-block {
    position: relative;
    z-index: 2; /* ensures text stays above the overlay */
  }
}

