/* ============================================================
   Data Center Digest — screen.css
   ============================================================ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #111111;
  --muted:      #6b7280;
  --light:      #9ca3af;
  --rule:       #e5e7eb;
  --accent:     #0f4c81;
  --accent-dk:  #0d3f6e;
  --bg:         #ffffff;
  --bg-subtle:  #f9fafb;
  --max:        760px;
  --wide:       1140px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }


/* ============================================================
   SITE HEADER
   ============================================================ */

.site-header {
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(6px);
  z-index: 100;
}

.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav .nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.main-nav .nav li a,
.main-nav > a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.main-nav .nav li a:hover,
.main-nav > a:hover { color: var(--ink); background: var(--bg-subtle); }

.btn-subscribe {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 7px 16px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  margin-left: 6px;
}

.btn-subscribe:hover { background: var(--accent-dk) !important; color: #fff !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--ink);
  padding: 4px;
}


/* ============================================================
   HOMEPAGE — HERO
   ============================================================ */

.hero { border-bottom: 1px solid var(--rule); }

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 48px 56px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.eyebrow-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-bottom: 16px;
}

.hero-title a { color: inherit; }
.hero-title a:hover { color: var(--accent); }

.hero-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-meta::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 180px;
}

.hero-excerpt p {
  font-size: 17px;
  line-height: 1.7;
  color: #374151;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.15s;
}

.read-more::after { content: '→'; }
.read-more:hover { gap: 10px; }


/* ── Tag/category pill (used on homepage cards and post header) ── */
.tag,
.cat-badge-ghost {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: #eff6ff;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}


/* ============================================================
   HOMEPAGE — STORY LIST
   ============================================================ */

.stories-section { background: var(--bg); }

.stories-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 48px 64px;
}

.stories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 0 14px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0;
}

.stories-header h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.stories-header a {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}

.stories-header a:hover { color: var(--ink); }

.story-item {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 24px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}

.story-item:last-of-type { border-bottom: none; }

.story-content h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.2px;
  color: var(--ink);
  margin-bottom: 8px;
  transition: color 0.15s;
}

.story-content h3 a { color: inherit; }
.story-content h3 a:hover { color: var(--accent); }

.story-content p {
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

.story-date {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  padding-top: 4px;
  line-height: 1.6;
  flex-shrink: 0;
}


/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 0;
  border-top: 1px solid var(--rule);
}

.pagination-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  transition: background 0.15s;
}

.pagination-btn:hover { background: var(--bg-subtle); }
.pagination-info { font-size: 13px; color: var(--muted); }


/* ============================================================
   SUBSCRIBE BAND
   ============================================================ */

.subscribe-band {
  background: var(--bg-subtle);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.subscribe-band-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 44px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.subscribe-band-text h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 26px;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 6px;
}

.subscribe-band-text p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.btn-subscribe-large {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 11px 26px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-subscribe-large:hover { background: var(--accent-dk); color: #fff; }


/* ============================================================
   TAG PAGE
   ============================================================ */

.tag-header { border-bottom: 1px solid var(--rule); }

.tag-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 48px;
}

.tag-header-inner h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 40px;
  letter-spacing: -0.5px;
  margin-top: 12px;
}

.tag-description {
  font-size: 15px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
}


/* ============================================================
   POST PAGE — BASE
   ============================================================ */

.post-main { padding-bottom: 80px; }

/* Default post article (page.hbs uses this too) */
.post-article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 48px;
}

/* Wide variant — used by post.hbs for digest editions */
.post-article--wide {
  max-width: var(--wide);
}

.post-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}

/* In the wide post layout the header needs its own centering */
.post-article--wide .post-header {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.post-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-top: 10px;
  margin-bottom: 14px;
}

.post-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-meta::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 140px;
}


/* ── Post content (non-digest prose) ── */
.gh-content {
  font-size: 18px;
  line-height: 1.8;
  color: #1f2937;
}

.gh-content > p { margin-bottom: 1.4em; }

.gh-content > p:first-child {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  margin-bottom: 2em;
  line-height: 1.5;
}

.gh-content h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  color: var(--ink);
  margin: 2em 0 0.6em;
  letter-spacing: -0.2px;
}

.gh-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5em 0;
}

.gh-content ul {
  margin: 0 0 1.4em 1.4em;
  padding: 0;
}

.gh-content ul li {
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 0.5em;
  padding-left: 4px;
}

.gh-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.gh-content a:hover { color: var(--accent-dk); }
.gh-content strong { font-weight: 600; }
.gh-content em { color: var(--muted); font-style: normal; font-size: 0.95em; }
.gh-content code {
  font-family: monospace;
  font-size: 0.85em;
  background: var(--bg-subtle);
  padding: 2px 5px;
  border-radius: 3px;
}


/* ── Post footer ── */
.post-footer {
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.post-tag-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.15s;
}

.post-tag-link:hover { background: #dbeafe; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.post-nav-link:hover { border-color: var(--accent); background: #eff6ff; }
.post-nav-next { text-align: right; }

.post-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-nav-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.3;
}


/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
  padding: 20px 48px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}


/* ============================================================
   DIGEST LAYOUT — CATEGORY BADGES
   ============================================================ */

.cat-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  white-space: nowrap;
}

.cat-power        { background: #fff7ed; color: #c2410c; }
.cat-ai           { background: #eff6ff; color: #1d4ed8; }
.cat-cooling      { background: #f0fdfa; color: #0f766e; }
.cat-policy       { background: #f0fdf4; color: #15803d; }
.cat-construction { background: #faf5ff; color: #7e22ce; }
.cat-market       { background: #f8fafc; color: #475569; }
.cat-opposition   { background: #fef2f2; color: #b91c1c; }


/* ============================================================
   DIGEST LAYOUT — STRUCTURE
   ============================================================ */

/* Reset gh-content base styles inside the digest layout */
.digest-layout p {
  font-size: unset;
  line-height: unset;
  margin-bottom: 0;
  color: inherit;
}

/* Status bar */
.digest-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #15803d;
  margin-bottom: 28px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

/* Two-column grid */
.digest-body {
  display: grid;
  grid-template-columns: 1fr 308px;
  gap: 36px;
  align-items: start;
}

/* ── Main column ── */
.digest-main { min-width: 0; }

/* Lead story */
.lead-story {
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 28px;
}

.lead-story-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.lead-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead-headline {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 14px;
}

.lead-body {
  font-size: 15px !important;
  line-height: 1.7 !important;
  color: #374151 !important;
  margin-bottom: 16px !important;
}

/* Story source line (used in lead and cards) */
.story-source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.story-source a {
  font-weight: 600;
  color: #374151;
  text-decoration: none;
}

.story-source a:hover { color: var(--accent); }

.source-sep { color: var(--rule); }

.source-time { color: var(--light); }

/* More stories section */
.more-stories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 14px;
  border-bottom: 2px solid var(--ink);
}

.more-stories-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.more-stories-count {
  font-size: 11px;
  color: var(--light);
}

/* Story cards */
.story-card {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.story-card:last-child { border-bottom: none; }

.story-card-num {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 26px;
  color: #e5e7eb;
  line-height: 1;
  min-width: 30px;
  padding-top: 2px;
  flex-shrink: 0;
}

.story-card-content { flex: 1; min-width: 0; }

.story-card-content .cat-badge { margin-bottom: 8px; display: block; width: fit-content; }

.story-card-headline {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 6px;
}

.story-card-headline a {
  color: inherit;
  text-decoration: none;
}

.story-card-headline a:hover { color: var(--accent); }

.story-card-excerpt {
  font-size: 13px !important;
  line-height: 1.6 !important;
  color: #6b7280 !important;
  margin-bottom: 10px !important;
}


/* ── Sidebar ── */
.digest-sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-widget {
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 20px;
}

.sidebar-widget-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

/* Quick hits */
.quick-hits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-hits-list li {
  font-size: 12px;
  line-height: 1.5;
  color: #374151;
  padding-left: 14px;
  position: relative;
}

.quick-hits-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--light);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

.quick-hits-list a {
  color: inherit;
  text-decoration: none;
}

.quick-hits-list a:hover { color: var(--accent); }

/* Subscribe widget */
.sidebar-subscribe {
  background: var(--accent);
  border-color: var(--accent);
  text-align: center;
}

.sidebar-subscribe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #93c5fd;
  margin: 0 auto 12px;
}

.sidebar-subscribe h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 17px;
  color: #ffffff;
  margin-bottom: 6px;
}

.sidebar-subscribe p {
  font-size: 12px !important;
  color: #bfdbfe !important;
  line-height: 1.5 !important;
  margin-bottom: 14px !important;
}

.btn-sidebar-subscribe {
  display: block;
  background: #ffffff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 6px;
  text-align: center;
  transition: background 0.15s;
}

.btn-sidebar-subscribe:hover { background: #eff6ff; color: var(--accent); }

/* Edition breakdown */
.edition-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breakdown-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}


/* ============================================================
   GHOST KOENIG EDITOR — required image width classes
   ============================================================ */

.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: auto calc(50% - 50vw);
  transform: translateX(calc(50vw - 50%));
}

.kg-width-full {
  position: relative;
  width: 100vw;
  margin: auto calc(50% - 50vw);
  transform: translateX(calc(50vw - 50%));
}

.kg-image { max-width: 100%; }

.kg-card figcaption {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .digest-body {
    grid-template-columns: 1fr;
  }

  .digest-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 20px; }

  .main-nav .nav { display: none; }
  .main-nav .btn-subscribe { display: none; }

  .main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--rule);
    padding: 14px 20px;
    gap: 4px;
    z-index: 99;
  }

  .main-nav.is-open .nav {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .main-nav.is-open .btn-subscribe { display: block; width: 100%; text-align: center; }
  .nav-toggle { display: block; }

  .hero-inner,
  .stories-inner,
  .subscribe-band-inner,
  .tag-header-inner { padding-left: 20px; padding-right: 20px; }

  .post-article { padding-left: 20px; padding-right: 20px; }
  .post-article--wide { padding-left: 20px; padding-right: 20px; }

  .hero-title { font-size: 32px; }
  .hero-excerpt p { font-size: 15px; }
  .hero-inner { padding-top: 44px; padding-bottom: 44px; }

  .story-item { grid-template-columns: 1fr; gap: 6px; }
  .story-date { text-align: left; }

  .subscribe-band-inner {
    flex-direction: column;
    text-align: center;
    padding: 32px 20px;
  }

  .post-title { font-size: 28px; }
  .gh-content { font-size: 16px; }
  .post-nav { grid-template-columns: 1fr; }

  .lead-headline { font-size: 22px; }

  .site-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 26px; }
  .post-title { font-size: 24px; }
  .lead-headline { font-size: 20px; }
}
