/* ==========================================================================
   The content pages in winter: about, contact, the blog and a blog post. Loaded by
   Views/Shared/_LayoutHome.cshtml when a page sets ViewData["WinterPage"], after landing-winter.css
   and landing-winter-night.css, which bring the landing page's glass header, footer, icy page
   background and the mountain, star and moon colours.

   Each page's hero swaps its photo for the landing hero's winter sky (Views/Shared/_WinterHero.cshtml):
   a clear blue sky with a low sun, Ararat on the horizon, snow falling and white text; it runs up
   behind the floating header like the landing hero. The closing bands of the blog take the same sky
   without the mountain; a blog post keeps its own picture, with snow falling over it. At night the
   sky turns to the landing's night with stars and the moon; the sections below take the night colours
   of css/winter-night.css and css/winter-night-pages.css.
   ========================================================================== */

/* ---------- The sky ---------- */
.tw-winter-hero {
  position: absolute;
  inset: 0;
  z-index: 2; /* over the band's photo and its white veil */
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(46% 70% at 88% 0%, rgba(255, 246, 204, 0.6) 0%, transparent 62%),
    linear-gradient(180deg, #1b5fa6 0%, #2b78c0 45%, #559fd9 78%, #bfe0f5 100%);
}

/* The falling snow alone, over the band's own picture */
.tw-winter-hero--snow {
  background: none;
}

.tw-winter-hero__sun {
  position: absolute;
  right: -8%;
  top: -30%;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: #fff3c4;
  opacity: 0.4;
  filter: blur(80px);
}

/* Ararat stands on the band's foot; its last dune is the white of the page below */
.tw-winter-hero .lp-ararat {
  height: 190px;
}

@media (min-width: 992px) {
  .tw-winter-hero .lp-ararat {
    height: 240px;
  }
}

/* ---------- The heroes: room for the mountains, run up behind the floating header ---------- */
.tw-winter-page .hero-section {
  margin-top: calc(-1 * var(--lp-header-h, 80px));
}

.tw-winter-page .hero-section .hero-content {
  padding-top: var(--lp-header-h, 80px);
  padding-bottom: 150px;
}

@media (min-width: 992px) {
  .tw-winter-page .hero-section .hero-content {
    padding-bottom: 190px;
  }
}

/* ---------- The band at the top of the plain pages (terms, privacy, AI assistants, not found) ----------
   The landing hero's sky with Ararat, as a band that runs up behind the floating header; the page's
   own content starts below it on the snow */
.tw-winter-band {
  position: relative;
  height: calc(var(--lp-header-h, 80px) + 200px);
  margin-top: calc(-1 * var(--lp-header-h, 80px));
  overflow: hidden;
}

.tw-winter-band .lp-ararat {
  height: 150px;
}

@media (min-width: 992px) {
  .tw-winter-band {
    height: calc(var(--lp-header-h, 80px) + 240px);
  }

  .tw-winter-band .lp-ararat {
    height: 190px;
  }
}

html[data-theme="dark"] .tw-winter-band .lp-moon {
  bottom: 120px;
}

/* White text on the sky (the pages write the text colour inline) */
.tw-winter-page .hero-section h1,
.tw-winter-page .hero-section h2,
.tw-winter-page .hero-section p,
.tw-winter-page .cta-section h2,
.tw-winter-page .cta-section .cta-inner > div > p {
  color: #ffffff !important;
  text-shadow: 0 2px 18px rgba(10, 48, 92, 0.35);
}

.tw-winter-page .hero-section p {
  opacity: 0.92 !important;
}

/* The badges: frosted glass with a lime dot, as on the landing hero */
.tw-winter-page .hero-section .badge-custom,
.tw-winter-page .hero-section .hero-badge {
  background: linear-gradient(100deg, rgba(214, 238, 248, 0.2), rgba(229, 238, 128, 0.12));
  box-shadow: inset 0 0 0 1px rgba(214, 238, 248, 0.35), 0 10px 30px -16px rgba(150, 215, 240, 0.7);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  color: #ffffff;
}

/* Contact's second button: a glass outline on the sky */
.tw-winter-page .hero-section .btn-hero-outline {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tw-winter-page .hero-section .btn-hero-outline:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* ---------- Night ---------- */
/* The pages draw their text and lines from design-system.css's variables */
html[data-theme="dark"] .tw-winter-page {
  --text-color: #e9f2f9;
  --border-color: rgba(160, 205, 235, 0.16);
}

/* ...but whatever sits on the brand lime keeps its dark ink */
html[data-theme="dark"] .tw-winter-page .badge-custom,
html[data-theme="dark"] .tw-winter-page .category-badge,
html[data-theme="dark"] .tw-winter-page .featured-category-badge,
html[data-theme="dark"] .tw-winter-page .blog-pagination a.active,
html[data-theme="dark"] .tw-winter-page .btn-hero-primary,
html[data-theme="dark"] .tw-winter-page .btn-submit,
html[data-theme="dark"] .tw-winter-page .btn-faq,
html[data-theme="dark"] .tw-winter-page .why-icon,
html[data-theme="dark"] .tw-winter-page .feature-icon,
html[data-theme="dark"] .tw-winter-page .icon-container,
html[data-theme="dark"] .tw-winter-page .icon-large,
html[data-theme="dark"] .tw-winter-page .bullet-dot {
  color: #0d1b2a;
}

/* Icons inside lime tiles and buttons set their own colour from --text-color; dark ink for them too */
html[data-theme="dark"] .tw-winter-page .feature-icon *,
html[data-theme="dark"] .tw-winter-page .icon-container *,
html[data-theme="dark"] .tw-winter-page .icon-large *,
html[data-theme="dark"] .tw-winter-page .why-icon *,
html[data-theme="dark"] .tw-winter-page .bullet-dot *,
html[data-theme="dark"] .tw-winter-page .cta-button *,
html[data-theme="dark"] .tw-winter-page .cta-btn *,
html[data-theme="dark"] .tw-winter-page .btn-hero-primary *,
html[data-theme="dark"] .tw-winter-page .btn-submit *,
html[data-theme="dark"] .tw-winter-page .btn-faq * {
  color: #0d1b2a !important;
}

/* Pictures at night: the photos behind About's sections and over a blog post's title show through a
   lighter night veil, and the bright photos on the cards are dimmed a little so they do not glare */
html[data-theme="dark"] .tw-winter-page .article-header .hero-overlay {
  background: linear-gradient(180deg, rgba(11, 26, 42, 0.5) 0%, rgba(11, 26, 42, 0.78) 100%) !important;
}

html[data-theme="dark"] .tw-winter-page .featured-card img,
html[data-theme="dark"] .tw-winter-page .blog-card img,
html[data-theme="dark"] .tw-winter-page .article-card img,
html[data-theme="dark"] .tw-winter-page .blog-card-img img,
html[data-theme="dark"] .tw-winter-page .prose img,
html[data-theme="dark"] .tw-winter-page .related-img img,
html[data-theme="dark"] .tw-winter-page .info-image img {
  filter: brightness(0.88) contrast(1.05);
}

/* The badges on the night sky stay glass with white text, and the pale lime ones (badge-alt) are a
   faint glow, so their text stays light */
html[data-theme="dark"] .tw-winter-page .hero-section .badge-custom {
  color: #ffffff;
}

html[data-theme="dark"] .tw-winter-page .badge-custom.badge-alt,
html[data-theme="dark"] .tw-winter-page .badge-custom.badge-featured {
  color: #e5ee80;
}

/* Dark buttons by day (they take the text colour as their background): the brand lime at night,
   so they stay buttons instead of turning white */
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .cta-btn,
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .cta-button {
  background: #e5ee80;
  color: #0d1b2a !important; /* a blog post writes its white with !important */
}

html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .cta-btn:hover,
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .cta-button:hover {
  background: #dae46c;
  color: #0d1b2a !important;
}

/* The blog's pager: the current page keeps the lime */
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .blog-pagination a.active {
  background: #e5ee80;
  color: #0d1b2a;
}

/* The featured post: a night card with a hint of lime in the corner, as by day */
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .featured-card {
  background: linear-gradient(to bottom right, #11253b, #13283a 60%, rgba(229, 238, 128, 0.08));
  border-color: rgba(160, 205, 235, 0.16);
  box-shadow: 0 28px 56px -30px rgba(0, 6, 14, 0.9);
}

html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .featured-card:hover {
  border-color: #e5ee80;
}

/* A blog post's share buttons */
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .share-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Contact's form: fields of faint white with an ice-blue line, so they read on the night card */
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-input,
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-textarea,
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-select {
  border-color: rgba(160, 205, 235, 0.26);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(160, 205, 235, 0.24); /* Contact's fields have no border */
  color: #e9f2f9;
}

html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-input:focus,
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-textarea:focus,
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-select:focus {
  border-color: #9fd4ef;
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 0.25rem rgba(159, 212, 239, 0.14);
}

html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-input::placeholder,
html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-textarea::placeholder {
  color: rgba(222, 235, 245, 0.45);
}

html[data-theme="dark"][data-tw-bs-dark] .tw-winter-page .form-select option {
  background-color: #11253b;
  color: #e9f2f9;
}

/* About's light-grey band, painted in its style attribute */
html[data-theme="dark"] .tw-winter-page section[style*="#f9fafb"] {
  background-color: rgba(255, 255, 255, 0.03) !important;
}
html[data-theme="dark"] .tw-winter-hero {
  background:
    radial-gradient(60% 70% at 88% 4%, rgba(229, 238, 128, 0.12) 0%, transparent 60%),
    radial-gradient(70% 46% at 50% 100%, rgba(110, 190, 225, 0.3) 0%, transparent 70%),
    linear-gradient(180deg, #030a14 0%, #06142a 32%, #0b2440 62%, #153d5b 86%, #1f526f 100%);
}

html[data-theme="dark"] .tw-winter-hero--snow {
  background: none;
}

html[data-theme="dark"] .tw-winter-hero__sun {
  background: #e5ee80;
  opacity: 0.12;
}

/* The moon over the hills, inside the band rather than the landing hero's taller sky */
html[data-theme="dark"] .tw-winter-hero .lp-moon {
  bottom: 150px;
}

@media (min-width: 992px) {
  html[data-theme="dark"] .tw-winter-hero .lp-moon {
    bottom: 200px;
  }
}

html[data-theme="dark"] .tw-winter-page .article-header h1,
html[data-theme="dark"] .tw-winter-page .article-header .article-meta {
  color: var(--n-text);
}

/* Sections that paint themselves white by day become the night card colour; the generated rules in
   winter-night-pages.css cover the page stylesheets, these the landing's see-through sections */
html[data-theme="dark"] .tw-winter-page .section-with-bg .section-overlay {
  background: rgba(11, 26, 42, 0.72) !important; /* the photo shows through, the text stays readable */
}

@media (prefers-reduced-motion: reduce) {
  .tw-winter-hero__sun {
    animation: none;
  }
}
