/* style.css — Daily Insight */
:root {
  --bg: #0f1116;
  --panel: #161922;
  --text: #e8e9ee;
  --muted: #9aa0ad;
  --accent: #7c9cff;
  --border: #262b38;
  --radius: 10px;
  --max: 760px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15, 17, 22, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: 0.2px;
}

.brand-mark { color: var(--accent); margin-right: 6px; }

nav a {
  color: var(--muted);
  margin-left: 22px;
  font-size: 0.95rem;
}

nav a:hover { color: var(--text); }

.hero { padding: 48px 0 24px; }

.hero h1 {
  font-size: 2rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.hero p { color: var(--muted); margin: 0; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 24px 0 60px;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s ease;
}

.card:hover { border-color: #384056; }

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 6px;
  line-height: 1.4;
}

.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }

.card p { margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; }
.card p:last-child { margin-bottom: 0; }

.meta {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* longhands only — keep .container's horizontal 20px padding */
.article {
  padding-top: 40px;
  padding-bottom: 80px;
}

.article h1 {
  font-size: 2rem;
  margin: 8px 0 12px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article h2 {
  font-size: 1.25rem;
  margin: 32px 0 8px;
  letter-spacing: -0.01em;
}

.lede {
  font-size: 1.1rem;
  color: #c5c9d4;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  margin: 16px 0 24px;
}

.article p { margin: 0 0 16px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 24px 0 60px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: var(--muted);
  gap: 6px;
}

.contact-form input,
.contact-form textarea {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #0b0d13;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}

.contact-form button:hover { filter: brightness(1.08); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p { margin: 0; }

/* Small screens — keep header from overflowing */
@media (max-width: 560px) {
  .header-inner {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 0;
  }

  nav a {
    margin-left: 0;
    margin-right: 18px;
  }

  .hero { padding: 32px 0 16px; }

  .hero h1,
  .article h1 { font-size: 1.6rem; }
}

/* ===== JuicyAds display zones =====
   Desktops get an in-column stack: a 728x90 leaderboard + 908x258 billboard,
   plus the two 160x600 side rails (see below). On narrow viewports (<=620px)
   the wide desktop banners are swapped for native 300x100 mobile units
   instead of being zoomed down, so phones get a properly sized, readable
   creative. */
.juicy-ad-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  margin: 24px auto;
  padding: 12px;
  overflow: hidden;
  text-align: center;
}

.juicy-ad-wrap ins { display: block; margin: 0 auto; }

/* Mobile-only units: hidden everywhere by default (desktop view). */
.juicy-mobile-ins { display: none; }

.ad-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.6;
}

/* Tablet: gentle shrink of the 908px billboard only. */
@media (max-width: 960px) {
  .juicy-ad-wrap ins[data-width="908"] { zoom: 0.93; }
}

/* Phone / small tablet: hide fixed-size desktop creatives, show 300x100. */
@media (max-width: 620px) {
  .juicy-ad-wrap { margin: 18px auto; padding: 10px 8px; }
  .juicy-ad-wrap ins:not(.juicy-mobile-ins) { display: none; }
  .juicy-mobile-ins { display: block; }
}

/* ===== Two-column sidebars (160x600 skyscrapers) =====
   Desktop >= 1080px gets a left + right rail flanking the 760px column.
   Phones/tablets keep the single-column reading experience: the rails are
   removed from flow entirely (display:none) so nothing shifts or overflows.
   The rails stick to the viewport while the article scrolls past them. */
.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.juicy-ad-side { display: none; }

@media (min-width: 1080px) {
  .page-shell {
    max-width: 1120px;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 170px;
    column-gap: 20px;
    align-items: start;
  }

  /* The <main> keeps its own 760px cap; the free space becomes the rails.
     NOTE: assets/cine.css sets `body.cine .container{max-width:1180px}` which
     outranks a plain .page-shell > .container rule, so we match that
     specificity to stay ahead of it. */
  body.cine .page-shell > .container,
  body.cine .page-shell > main {
    max-width: var(--max);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* Article/legal pages opt into a narrower measure in cine.css (780px). */
  body.cine .page-shell > .container.article {
    max-width: 780px;
  }

  .juicy-ad-side {
    display: block;
    position: sticky;
    top: 84px;
    padding-top: 24px;
    text-align: center;
  }

  /* The rail stacks several creatives; keep them tight and never the mobile one. */
  .juicy-ad-side .juicy-ad-wrap {
    margin: 0 0 12px;
    padding: 6px;
    gap: 10px;
  }
  .juicy-ad-side .juicy-mobile-ins { display: none; }

  /* Native 300x300 units are wider than the rail column: scale them to fit
     instead of overflowing it. zoom keeps the ad script's own width/height
     maths intact, unlike transform:scale. */
  .juicy-ad-side .juicy-native-ins {
    zoom: 0.55;
    margin: 0 auto;
  }

  /* The 125x125 square is small enough to leave at native size; scaling it
     down would hurt click-through and look lost in the rail. */
  .juicy-ad-side ins[data-width="125"] { zoom: 1; }
}

/* Very wide screens: give the rails a little more breathing room. */
@media (min-width: 1500px) {
  .page-shell {
    max-width: 1260px;
    grid-template-columns: 200px minmax(0, 1fr) 200px;
  }
  .juicy-ad-side .juicy-native-ins { zoom: 0.65; }
}

