/* =====================================================================
   AI Digest — chefmikeh-tools
   Design system adapted from BUS622: glassmorphism + navy/crimson/gold.
   ===================================================================== */

:root {
  --navy:         #1F3A52;
  --navy-dark:    #14283A;
  --navy-soft:    #2C4A66;
  --crimson:      #A63A3A;
  --crimson-soft: #C45A5A;
  --gold:         #D4AF37;
  --gold-soft:    #E6C76A;
  --text:         #1A1A1A;
  --text-muted:   #555555;
  --bg-base:      linear-gradient(135deg, #EEF2F8 0%, #F2F5FA 50%, #E8EEF6 100%);
  --glass-bg:     rgba(255, 255, 255, 0.78);
  --glass-border: rgba(31, 58, 82, 0.12);
  --shadow-sm:    0 4px 16px rgba(31, 58, 82, 0.08);
  --shadow-md:    0 8px 32px rgba(31, 58, 82, 0.10);
  --font-sans:    "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont,
                   "Helvetica Neue", Arial, sans-serif;
  --radius:       16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-base);
  background-attachment: fixed;
  min-height: 100vh;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--crimson); }

/* ----- Top stripe + sticky navy header ----- */
.top-stripe {
  position: sticky;
  top: 0;
  height: 4px;
  background: var(--crimson);
  z-index: 30;
}
.site-header {
  position: sticky;
  top: 4px;
  z-index: 25;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.wordmark-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--gold-soft);
  text-transform: uppercase;
  font-weight: 700;
}
.wordmark-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.header-titleblock {
  background: var(--navy-dark);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-titleblock-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px 22px;
}
.header-titleblock .page-title {
  margin: 4px 0 2px;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}
.header-titleblock .page-subtitle {
  margin: 0;
  color: #B6C2D2;
  font-size: 0.95rem;
}
.overline-gold {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
}
.header-titleblock .overline-gold { color: var(--gold-soft); }

.site-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 0 0 22px;
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  box-shadow: var(--shadow-sm);
}
.hero-card .hero-title {
  margin: 4px 0 8px;
  font-size: 1.6rem;
  color: var(--navy);
}
.hero-card p { margin: 0 0 8px; color: var(--text-muted); }

/* ----- Digest collapsibles ----- */
.digests-heading {
  margin: 32px 0 14px;
  font-size: 1.25rem;
  color: var(--navy);
  border-bottom: 2px solid var(--crimson);
  padding-bottom: 6px;
  width: max-content;
}
.empty-state {
  padding: 40px 26px;
  text-align: center;
  color: var(--text-muted);
}
.digest-block {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin: 0 0 16px;
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.digest-summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0));
}
.digest-summary::-webkit-details-marker { display: none; }
.digest-summary::before {
  content: "▸";
  color: var(--navy);
  font-size: 1rem;
  transition: transform 0.18s ease;
  display: inline-block;
}
details[open] > .digest-summary::before { transform: rotate(90deg); }
.digest-date {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.digest-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.digest-count {
  background: var(--navy);
  color: #fff;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  white-space: nowrap;
}
.digest-delete {
  background: transparent;
  border: 1px solid var(--crimson);
  color: var(--crimson);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.digest-delete:hover {
  background: var(--crimson);
  color: #fff;
}
.digest-body {
  padding: 4px 22px 22px;
}

/* ----- Category sections within a digest ----- */
.category {
  margin-top: 18px;
}
.category-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.category-icon { font-size: 1.1rem; }
.category-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.hairline {
  border: 0;
  border-top: 2px solid var(--crimson);
  margin: 6px 0 14px;
  width: 56px;
}

/* ----- Article cards ----- */
.article {
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.article-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 6px;
}
.article-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  flex: 1 1 auto;
}
.article-title a { color: var(--navy); text-decoration: none; }
.article-title a:hover { color: var(--crimson); text-decoration: underline; }
.article-source {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.article-published {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}
.article-field {
  margin: 10px 0 0;
}
.article-field-label {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
}
.article-field-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}
.article-keypoints {
  margin: 4px 0 0 20px;
  padding: 0;
  font-size: 0.93rem;
}
.article-keypoints li { margin-bottom: 3px; }
.skills-pill {
  display: inline-block;
  background: rgba(31,58,82,0.08);
  color: var(--navy);
  font-size: 0.75rem;
  padding: 2px 9px;
  border-radius: 999px;
  margin-right: 4px;
  margin-top: 2px;
  font-weight: 600;
}
.gap-pill {
  display: inline-block;
  background: rgba(166,58,58,0.1);
  color: var(--crimson);
  font-size: 0.75rem;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
}

/* ----- Editor's note (top of each digest) ----- */
.editors-note {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), rgba(255,255,255,0));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 20px 24px 18px;
  margin: 8px 0 28px;
}
.editors-note-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
}
.editors-note-body {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
}
.editors-note-body:last-child { margin-bottom: 0; }

/* ----- Narrative summary (multi-paragraph) ----- */
.article-narrative {
  margin: 0 0 10px;
  font-size: 0.97rem;
  line-height: 1.7;
}
.article-narrative:last-child { margin-bottom: 0; }

/* ----- Footer ----- */
.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 24px 0 8px;
}

/* ----- Mobile ----- */
@media (max-width: 600px) {
  .digest-summary {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .digest-summary::before { display: none; }
  .digest-meta { grid-column: 1 / -1; }
}
