@import url("global.css"); /* Use global styles */

/* ============ Base / Resets for this page ============ */
:root {
  --radius: 12px;
  --shadow-sm: 0 4px 10px rgba(0,0,0,.12);
  --shadow-md: 0 10px 24px rgba(0,0,0,.16);
  --shadow-lg: 0 18px 40px rgba(0,0,0,.18);
  --gap: 1.25rem;

  /* Estimated fixed header height; tweak if your header differs */
  --header-h: 72px;
}

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

html, body { height: 100%; }
body {
  background: var(--secondary); /* fallback under the canvas */
  color: var(--secondary);
  margin: 0;
}
img { max-width: 100%; height: auto; display: block; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== Full-page animated background canvas ===== */
#bg-net {
  position: fixed;
  inset: 0;
  z-index: 0;             /* behind all content */
  pointer-events: none;   /* never block clicks */
}

/* Wrap page content above the background */
.page-content {
  position: relative;
  z-index: 1;
}

/* ============ Shared wrappers / headings ============ */
.blog-container,
.post-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--section-padding);
}

h1, h2, h3 { color: var(--dark); line-height: 1.25; margin: 0 0 .5rem; }

/* Section subtitles (used under hero) */
.section-subtitle {
  color: var(--dark);
  font-size: clamp(1.3rem, 1rem + 1.2vw, 1.8rem);
  margin-top: 1.25rem;
}

/* =====================================================
   HERO FULL-BLEED + STICKY TITLE
   ===================================================== */

/* Full-bleed wrapper pushes content edge-to-edge */
.hero-bleed {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw); /* full-width within centered layout */
  margin-right: calc(50% - 50vw);
  padding-top: calc(var(--header-h) + 10px); /* ensure below header */
  margin-bottom: 1.25rem;
}

/* Sticky title centered over the hero */
.hero-title {
  position: absolute;
  top: calc(var(--header-h) + 8px); /* stays under header on scroll */
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
  margin: 0 auto 10px;
  padding: 0;
  background: transparent;
  width: min(1200px, 92vw);
  color: #fff;
  font-size: clamp(1.8rem, 1.1rem + 2vw, 2.4rem);
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
  pointer-events: none;
}

/* Optional subtle underline for hero title */
.hero-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 8px auto 0;
  background: var(--accent);
  border-radius: 2px;
}

/* Actual slider spans full width */
.hero-slider {
  width: 100vw;
  aspect-ratio: 16 / 7;               /* cinematic ratio */
  position: relative;
  border-radius: 0;                    /* edge-to-edge look */
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #101010;
}

/* Each slide is an <a> */
.slide {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
  z-index: 1;
}
.slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

/* dark gradient on slide */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.45) 60%, rgba(0,0,0,0.65) 100%);
  z-index: 2;
}

/* glass card with only title */
.glass {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  color: #fff;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
  z-index: 3;
  max-width: min(960px, 92vw);
}
.glass h3 {
  margin: 0;
  font-size: clamp(1.1rem, 1rem + 1.1vw, 1.8rem);
  line-height: 1.25;
  color: #fff;
  text-align: center;
}

/* Dots (no arrows) */
.slider-dots {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 4;
}
.slider-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: rgba(255,255,255,.55);
  transition: transform .2s ease, background .2s ease;
}
.slider-dot.active {
  background: #fff;
  transform: scale(1.15);
}

/* ============ Blog Listing ============ */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: calc(var(--gap) + .25rem);
  padding: .5rem 0 1.25rem;
}

.blog-item {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
}

.blog-item .thumb {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.blog-item h2 {
  font-size: 1.25rem;
  margin: .85rem 1rem 0;
  line-height: 1.35;
}
.blog-item h2 a {
  text-decoration: none;
  color: var(--dark);
}
.blog-item h2 a:hover,
.blog-item h2 a:focus-visible {
  color: var(--accent);
}

.blog-item p {
  font-size: .95rem;
  color: var(--text);
  margin: .5rem 1rem 1rem;
}

.blog-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ============ Single Post Page ============ */
.post-container {
  display: grid;
  gap: 1.25rem;
  scroll-margin-top: calc(var(--header-h) + 12px); /* if navigated via hash */
  padding-top: calc(var(--section-padding) + 8px);
}

/* Make post H1 clearly visible and not hidden under header */
.post-title-safe {
  font-size: clamp(1.9rem, 1.1rem + 2.2vw, 2.6rem);
  color: #fff;
  margin-top: calc(var(--header-h) + 8px);
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.post-meta {
  color: var(--text);
  font-size: .95rem;
  margin-top: -.25rem;
  margin-bottom: .5rem;
}

/* Hero image */
.post-hero {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.post-hero img {
  width: 100%;
  height: clamp(220px, 40vw, 420px);
  object-fit: cover;
}

/* “Prose” styling */
.post-content {
  color: var(--dark);
  font-size: 1.05rem;
  line-height: 1.75;
  text-wrap: pretty;
}
.post-content p { margin: 0 0 1rem; color: var(--text); }
.post-content h2 { font-size: 1.4rem; margin: 1.25rem 0 .5rem; }
.post-content h3 { font-size: 1.2rem; margin: 1rem 0 .4rem; }
.post-content img {
  margin: 1rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.post-content a { color: var(--accent); text-decoration: underline; }
.post-content ul, .post-content ol { padding-left: 1.25rem; margin: .75rem 0 1rem; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .blog-list { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 768px) {
  .hero-slider { aspect-ratio: 16 / 9; }
  .hero-title { top: calc(var(--header-h) + 6px); }
}
@media (max-width: 480px) {
  .hero-slider { aspect-ratio: 16 / 10; }
}
