/* AI Engineering Digest — ASTGL editorial */
:root {
  --deep-blue: #1E3A5F;
  --teal: #2A9D8F;
  --orange: #E9724C;
  --charcoal: #1F2937;
  --warm-white: #F9FAFB;
  --muted: #64748b;
  --faint: #94a3b8;
  --rule: #e5e7eb;
  --card: #ffffff;
  --read: 40rem;
  --hub: 60rem;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--warm-white);
  color: var(--charcoal);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.65;
}

a { color: var(--teal); text-underline-offset: 0.15em; }
a:hover { color: var(--deep-blue); }
a:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

.wrap {
  max-width: var(--read);
  margin: 0 auto;
  padding: 0 1.35rem 5.5rem;
}

.wrap.wide { max-width: var(--hub); }

.masthead {
  padding: 1.1rem 0 0.95rem;
  border-bottom: 1px solid var(--rule);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--deep-blue);
}

.brand img {
  height: 36px;
  width: 68px;
  object-fit: cover;
  object-position: left center;
  display: block;
}

.brand-name {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-name small {
  display: block;
  font-weight: 500;
  font-size: 0.62rem;
  color: var(--teal);
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.nav a { color: var(--deep-blue); text-decoration: none; }
.nav a:hover,
.nav a[aria-current="page"] { color: var(--teal); }

.nav a.rss {
  color: var(--teal);
  font-weight: 500;
  text-decoration: none;
}

.nav a.rss:hover { color: var(--deep-blue); }

.issue-head { padding: 2.15rem 0 0; }

.date-line {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.75rem, 4.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--deep-blue);
}

.wrap.wide .issue-head h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.05rem);
  max-width: 44rem;
}

.lede {
  margin: 1.1rem 0 0;
  font-size: 1.08rem;
  max-width: 42rem;
}

.window {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Breaking AI News */
.breaking {
  margin: 1.6rem 0 0;
  padding: 1.05rem 1.15rem 1.2rem;
  background: var(--deep-blue);
  color: #fff;
  border-radius: 8px;
}

.breaking-kicker {
  margin: 0 0 0.8rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
}

.breaking-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem 1.5rem;
}

.breaking article h3 {
  margin: 0 0 0.35rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.breaking article h3 a {
  color: #fff;
  text-decoration: none;
}

.breaking article h3 a:hover { color: #b8ebe4; }

.breaking article p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.84);
}

.breaking .sources { margin-top: 0.55rem; }
.breaking .sources a { color: #9ee0d6; }

/* Homepage section modules — one structure, two layouts */
.hub-grid {
  display: flex;
  flex-direction: column;
  margin: 1.35rem 0 0;
}

.mod {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0 1.25rem;
  border-top: 1px solid var(--rule);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0 0 0.7rem;
}

.section-head h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--deep-blue);
  letter-spacing: -0.02em;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.12);
  color: var(--deep-blue);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.mod-stories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.35rem;
}

.story h3 {
  margin: 0 0 0.3rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--deep-blue);
}

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

.story h3 a:hover { color: var(--teal); }

.story p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--charcoal);
}

.story.also {
  padding-top: 0.15rem;
}

.mod-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.section-head .badge { display: none; }
.mod-foot .badge { display: inline-block; }

.open {
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--teal);
}

.open:hover { color: var(--orange); }

/* Phone / narrow: Mockup B rows — two stories side-by-side when they fit */
@media (min-width: 560px) and (max-width: 799.98px) {
  .mod-stories { grid-template-columns: 1fr 1fr; }
  .story.also {
    padding-left: 1.1rem;
    border-left: 2px solid var(--teal);
  }
}

/* Desktop: Mockup A tiles */
@media (min-width: 800px) {
  .breaking-grid { grid-template-columns: 1fr 1fr; }

  .hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.6rem;
  }

  .mod {
    padding: 1rem 1.05rem 1.05rem;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 8px;
  }

  .mod-stories { grid-template-columns: 1fr; }

  .story.also {
    margin-top: 0.15rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--rule);
  }

  .story.also h3 {
    font-size: 0.88rem;
    font-weight: 600;
  }

  .story.also h3::before {
    content: "Also: ";
    font-weight: 500;
    color: var(--muted);
  }

  .story.also p { display: none; }

  .section-head .badge { display: inline-block; }

  .mod-foot {
    margin-top: auto;
    padding-top: 0.85rem;
    justify-content: flex-start;
  }

  .mod-foot .badge { display: none; }
}

/* Section pages */
.back {
  display: inline-block;
  margin: 1.25rem 0 0;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.section { margin: 2.6rem 0 0; }

.section h2 {
  margin: 0 0 1rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--deep-blue);
  letter-spacing: -0.025em;
}

.count-note {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

h1 .count-note {
  display: block;
  margin: 0.45rem 0 0;
  font-family: Inter, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
}

article.item {
  margin: 0 0 1.15rem;
  padding: 0.15rem 0 1.15rem 1.15rem;
  border-left: 3px solid var(--teal);
  background: none;
  box-shadow: none;
}

article.item h3 {
  margin: 0.2rem 0 0.45rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--deep-blue);
}

article.item h3 a { color: inherit; text-decoration: none; }
article.item h3 a:hover { color: var(--teal); }

article.item p { margin: 0 0 0.5rem; font-size: 0.95rem; }
article.item p:last-of-type { margin-bottom: 0; }

article.item > time,
.item-date {
  display: block;
  margin: 0 0 0.15rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  margin-top: 0.65rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.sources { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; }
.sources a { color: var(--teal); font-weight: 500; }

.aside { margin: 0.85rem 0 0; font-size: 0.88rem; color: var(--muted); }

.vendor {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.68em;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
}

code {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82em;
  color: var(--deep-blue);
  background: #eef2f6;
  padding: 0.08em 0.32em;
}

footer.site-foot {
  margin-top: 2.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
}

.foot-links {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.foot-links a { color: var(--teal); text-decoration: none; font-weight: 500; }
.foot-links a:hover { color: var(--deep-blue); }

.foot-links button {
  font: inherit;
  color: var(--teal);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-weight: 500;
}

.foot-links button:hover { color: var(--deep-blue); }

.tagline {
  margin: 0;
  font-style: italic;
  color: var(--teal);
  font-size: 0.95rem;
}

.credit { margin: 0.45rem 0 0; font-size: 0.75rem; color: var(--muted); }
.credit a { color: var(--deep-blue); text-decoration: none; font-weight: 600; }
.credit a:hover { color: var(--teal); }

.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-list li { border-bottom: 1px solid var(--rule); }
.issue-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--deep-blue);
  text-decoration: none;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 600;
}
.issue-list a:hover { color: var(--teal); }
.issue-list .when {
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-weight: 400;
  font-size: 0.82rem;
  flex: none;
}

.prose p { color: var(--charcoal); }
.prose h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  color: var(--deep-blue);
  font-size: 1.15rem;
  margin: 1.6rem 0 0.5rem;
}
.prose ul { padding-left: 1.15rem; }
.prose li { margin: 0.4rem 0; }
.secondary { margin-top: 1.4rem; font-style: italic; color: var(--teal); }

@media (max-width: 640px) {
  .wrap { padding: 0 1rem 3.5rem; }
  .brand img { height: 30px; width: 56px; }
  .issue-list a { flex-direction: column; gap: 0.2rem; }
  article.item { padding-left: 0.9rem; }
}

/* Subscribe splash + footer capture */
.aed-footer-sub {
  margin: 0 0 1.4rem;
  padding: 1.1rem 1.15rem 1.2rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.aed-footer-sub h2 {
  margin: 0 0 0.35rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--deep-blue);
}

.aed-footer-sub .aed-blurb {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.aed-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.55rem;
  align-items: flex-end;
}

.aed-field {
  flex: 1 1 14rem;
  margin: 0;
}

.aed-field span {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.aed-field input[type="email"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--warm-white);
  color: var(--charcoal);
  font: inherit;
  font-size: 0.95rem;
}

.aed-field input[type="email"]:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}

.aed-form button[type="submit"] {
  flex: 0 0 auto;
  padding: 0.62rem 1.05rem;
  border: 0;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.aed-form button[type="submit"]:hover { filter: brightness(1.05); }
.aed-form button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: default;
}

.aed-status {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--muted);
}

.aed-status.is-ok { color: var(--teal); }
.aed-status.is-err { color: var(--orange); }

.aed-splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.aed-splash[hidden] { display: none !important; }

.aed-splash-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 58, 95, 0.45);
}

.aed-splash-dialog {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  padding: 1.4rem 1.35rem 1.25rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.22);
}

.aed-splash-dialog img {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 0 0.85rem;
}

.aed-splash-dialog h2 {
  margin: 0 0 0.4rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--deep-blue);
}

.aed-splash-dialog .aed-blurb {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.aed-note {
  margin: 0 0 0.95rem;
  font-size: 0.9rem;
  color: var(--charcoal);
}

.aed-dismiss {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.35rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
}

.aed-dismiss:hover { color: var(--deep-blue); }

body.aed-splash-open { overflow: hidden; }
