/* Fluupo — soft blue, AdSense-friendly layout (no external deps) */

:root {
  --blue: #3c96d2;
  --blue-soft: #6aafde;
  --blue-pale: #e8f3fa;
  --blue-mist: #f3f8fc;
  --blue-deep: #2b7eb8;
  --ink: #1a2b36;
  --ink-soft: #5a6d7a;
  --paper: #ffffff;
  --paper-tint: #f7fafc;
  --line: #d7e4ee;
  --ad-bg: #f0f5f9;
  --ad-border: #c9d9e6;
  --max: 1140px;
  --content: 720px;
  --side: 300px;
  --font-display: Georgia, "Palatino Linotype", Palatino, serif;
  --font-body: Candara, "Segoe UI", "Trebuchet MS", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 4px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper-tint);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--blue);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.shell {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header — compact for ad visibility below */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.brand:hover {
  color: var(--blue-deep);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--blue);
}

/* Ad slots — labeled, sized, spaced (AdSense policy friendly) */
.ad-top {
  padding: 0.85rem 0 0;
}

.ad-slot {
  margin: 1rem 0;
  text-align: center;
}

.ad-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a9bab;
}

.ad-frame {
  margin: 0 auto;
  border-radius: var(--radius);
}

.ad-slot--placeholder .ad-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
}

.ad-placeholder-text {
  padding: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a9bab;
}

.ad-slot--live .ad-frame {
  background: transparent;
  border: none;
  overflow: hidden;
}

.ad-slot--leaderboard .ad-frame {
  width: min(100%, 728px);
  min-height: 90px;
}

.ad-slot--banner .ad-frame {
  width: min(100%, 100%);
  min-height: 100px;
}

.ad-slot--rectangle .ad-frame {
  width: min(100%, 300px);
  min-height: 250px;
}

.ad-slot--halfpage .ad-frame {
  width: min(100%, 300px);
  min-height: 600px;
}

.ad-slot--inarticle .ad-frame {
  width: min(100%, 336px);
  min-height: 280px;
}

.ad-inline {
  margin: 1.75rem 0;
  padding: 0.5rem 0;
  clear: both;
}

/* Home intro — brand first, compact (leaves room for ads) */
.home-intro {
  padding: 1.75rem 0 0.5rem;
}

.brand-mark {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1;
  color: var(--blue);
}

.home-intro h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 400;
  color: var(--ink-soft);
}

.home-intro .lede {
  margin: 0;
  max-width: 42ch;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* Content + sidebar (classic high-CTR blog) */
.layout-adsense {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  gap: 2rem;
  padding: 1.25rem 0 3rem;
  align-items: start;
}

.layout-main {
  min-width: 0;
}

.layout-side {
  min-width: 0;
}

.side-sticky {
  position: sticky;
  top: 0.75rem;
}

.side-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.side-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-list li {
  border-top: 1px solid var(--line);
}

.side-list li:first-child {
  border-top: none;
}

.side-list a {
  display: block;
  padding: 0.65rem 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
}

.side-list a:hover {
  color: var(--blue);
}

/* Featured story — large click target */
.featured {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.featured-link {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  text-decoration: none;
  color: inherit;
}

.featured-visual {
  background: var(--blue-pale);
  min-height: 220px;
}

.featured-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 220px;
  transition: transform 0.45s var(--ease);
}

.featured-link:hover .featured-visual img {
  transform: scale(1.03);
}

.featured-body {
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 0.55rem;
  padding: 0.2rem 0.5rem;
  background: var(--blue-pale);
  color: var(--blue-deep);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.featured-body h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.2;
  color: var(--ink);
}

.featured-link:hover h2 {
  color: var(--blue);
}

.featured-body p {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.cta-text {
  color: var(--blue);
  font-weight: 700;
  font-size: 0.92rem;
}

/* Post grid — clickable cards for CTR / pageviews */
.stories {
  margin-top: 1.25rem;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.post-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.post-grid--related {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.post-card:hover {
  border-color: var(--blue-soft);
  box-shadow: 0 6px 18px rgba(60, 150, 210, 0.12);
}

.post-card-visual {
  aspect-ratio: 16 / 10;
  background: var(--blue-pale);
  overflow: hidden;
}

.post-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.post-card:hover .post-card-visual img {
  transform: scale(1.04);
}

.post-card-body {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.post-card-body time {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.post-card-body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--ink);
}

.post-card:hover h3 {
  color: var(--blue);
}

.post-card-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-body .cta-text {
  margin-top: auto;
  padding-top: 0.4rem;
}

.empty {
  color: var(--ink-soft);
}

/* Single post */
.post-head {
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.post-head h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  line-height: 1.2;
  color: var(--ink);
}

.post-head .lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.post-cover {
  margin: 0 0 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--blue-pale);
}

.post-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* Compact header when video is the hero (above the fold) */
.post-head--compact {
  margin-bottom: 0.65rem;
}

.post-head--compact h1 {
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  margin-bottom: 0;
}

.post-video {
  margin: 0 0 1rem;
  padding: 0;
}

.post-video-caption {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.5;
}

/* Lightweight YouTube facade — no iframe until click */
.yt-lite {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1520;
  border-radius: var(--radius);
  overflow: hidden;
}

.yt-lite__button {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
}

.yt-lite__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yt-lite__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 48px;
  margin: -24px 0 0 -34px;
  border-radius: 14px;
  background: #f00;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}

.yt-lite__play::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 14px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #fff;
}

.yt-lite__button:hover .yt-lite__play,
.yt-lite__button:focus-visible .yt-lite__play {
  background: #c00;
  transform: scale(1.05);
}

.yt-lite__button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.yt-lite iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.prose {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}

.prose h2 {
  margin: 1.6rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--ink);
}

.prose ul {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
}

.prose li {
  margin: 0 0 0.4rem;
}

.prose p {
  margin: 0 0 1.1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  color: var(--ink);
}

.back-link {
  margin: 1.25rem 0 0;
}

.back-link a {
  text-decoration: none;
  font-weight: 700;
}

.related {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.related h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

/* Static pages */
.content-page .page-head {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  color: var(--ink);
}

/* Footer */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 1.75rem 0;
  color: var(--ink-soft);
}

.footer-inner {
  display: grid;
  gap: 1rem;
}

.footer-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--blue);
}

.footer-note,
.footer-copy {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.footer-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.footer-nav a:hover {
  color: var(--blue);
}

/* Responsive */
@media (max-width: 960px) {
  .layout-adsense {
    grid-template-columns: 1fr;
  }

  .side-sticky {
    position: static;
  }

  .ad-slot--halfpage {
    display: none;
  }

  .featured-link {
    grid-template-columns: 1fr;
  }

  .post-grid--related {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .ad-slot--leaderboard .ad-frame {
    min-height: 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .featured-visual img,
  .post-card-visual img {
    transition: none;
  }
}
