/* Home greeting link. The selector is scoped to the existing Today header. */
#root .home-screen .welcome-row .agl-alpha-gal-guide-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin-top: .8rem;
  padding: .5rem .8rem;
  border: 1px solid #cae1cd;
  border-radius: 11px;
  background: #e9f4e9;
  color: #143e2e;
  text-decoration: none;
  font: 700 .875rem/1.2 system-ui, sans-serif;
}

#root .home-screen .welcome-row .agl-alpha-gal-guide-link:hover {
  background: #fff;
  text-decoration: underline;
  text-underline-offset: .15em;
}

#root .home-screen .welcome-row .agl-alpha-gal-guide-link:focus-visible {
  outline: 3px solid #f6cf85;
  outline-offset: 3px;
}

#root .home-screen .welcome-row .agl-alpha-gal-guide-link span {
  flex-shrink: 0;
}

/* Standalone article. */
.alpha-gal-guide {
  --paper: #faf9f3;
  --ink: #172d24;
  --muted: #4d6257;
  --green: #215d45;
  --line: #cddbd0;
  --hero: #e9f0e5;
  --emergency: #fcf0e5;
  --emergency-ink: #522e20;
  --emergency-edge: #a85f40;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

.alpha-gal-guide *,
.alpha-gal-guide *::before,
.alpha-gal-guide *::after {
  box-sizing: border-box;
}

.alpha-gal-guide a {
  color: var(--green);
  text-decoration-thickness: .08em;
  text-underline-offset: .17em;
}

.alpha-gal-guide a:focus-visible,
.alpha-gal-guide summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  border-radius: 3px;
}

.alpha-gal-guide :target {
  scroll-margin-block-start: 1.25rem;
}

.guide-wrap {
  width: min(calc(100% - 48px), 73rem);
  margin-inline: auto;
}

.guide-skip {
  position: absolute;
  z-index: 10;
  top: .75rem;
  left: .75rem;
  padding: .7rem 1rem;
  background: var(--paper);
  transform: translateY(-200%);
}

.guide-skip:focus {
  transform: none;
}

.guide-site-header {
  border-bottom: 1px solid var(--line);
}

.guide-header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.guide-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -.025em;
}

.guide-brand img {
  width: 60px;
  height: 58px;
  object-fit: contain;
}

.guide-home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem 0;
  font-size: .875rem;
  font-weight: 650;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  min-height: 25rem;
  margin-block: 2rem 3rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--hero);
}

.guide-hero-copy {
  align-self: center;
  padding: clamp(1.6rem, 4.5vw, 3.65rem);
}

.guide-hero h1 {
  max-width: 12ch;
  margin: 0;
  font: 700 clamp(2.5rem, 5.3vw, 4.7rem)/1 Georgia, serif;
  letter-spacing: -.048em;
  text-wrap: balance;
}

.guide-deck {
  max-width: 36ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.2rem);
  line-height: 1.55;
}

.guide-byline {
  margin: 1.35rem 0 0;
  color: var(--green);
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.55;
}

.guide-byline span {
  padding-inline: .2em;
}

.guide-cover {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: 48% center;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 45rem);
  align-items: start;
  justify-content: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.guide-toc {
  position: sticky;
  top: 1.25rem;
  padding: .15rem 1rem .2rem;
  border-left: 1px solid var(--line);
}

.guide-toc summary {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 750;
  cursor: pointer;
}

.guide-toc ul {
  display: grid;
  gap: .45rem;
  margin: .65rem 0 0;
  padding: 0;
  list-style: none;
}

.guide-toc a {
  display: inline-block;
  padding-block: .16rem;
  font-size: .875rem;
  line-height: 1.45;
}

.guide-prose {
  min-width: 0;
  font: 400 clamp(1.125rem, 1.7vw, 1.25rem)/1.72 Georgia, serif;
}

.guide-prose p {
  margin: 0 0 1.05em;
}

.guide-prose .guide-intro {
  font-size: 1.15em;
  line-height: 1.6;
}

.guide-prose h2 {
  margin: 0 0 .55em;
  font: 700 clamp(1.85rem, 3.65vw, 2.7rem)/1.13 Georgia, serif;
  letter-spacing: -.035em;
  text-wrap: pretty;
}

.guide-prose section {
  margin-block: 2.6rem;
}

.guide-prose sup {
  position: relative;
  top: -.35em;
  font: 600 .7rem/0 system-ui, sans-serif;
  vertical-align: baseline;
  white-space: nowrap;
}

.guide-emergency {
  margin: 1.75rem 0 2.5rem;
  padding: 1.2rem clamp(1rem, 3vw, 1.6rem);
  border-left: 4px solid var(--emergency-edge);
  border-radius: 0 14px 14px 0;
  background: var(--emergency);
  color: var(--emergency-ink);
}

.guide-emergency h2 {
  margin: 0 0 .4rem;
  font: 750 1.125rem/1.35 system-ui, sans-serif;
  letter-spacing: 0;
}

.guide-emergency p {
  margin: 0;
  font: 450 1rem/1.6 system-ui, sans-serif;
}

.guide-emergency a {
  color: inherit;
}

.guide-figure {
  margin: 1.5rem 0 1.85rem;
}

.guide-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.guide-figure figcaption {
  margin: .65rem .1rem 0;
  color: var(--muted);
  font: 400 .875rem/1.55 system-ui, sans-serif;
}

.guide-sources {
  padding-top: 1.65rem;
  border-top: 1px solid var(--line);
}

.guide-sources ol {
  margin-block: .9rem 0;
  padding-inline-start: 1.65rem;
  font: 400 .9rem/1.55 system-ui, sans-serif;
}

.guide-sources li {
  margin-bottom: .5rem;
  padding-inline-start: .2rem;
  overflow-wrap: anywhere;
}

.guide-prose .guide-note {
  margin-bottom: 2.8rem;
  color: var(--muted);
  font: 400 .875rem/1.6 system-ui, sans-serif;
}

.guide-footer {
  border-top: 1px solid var(--line);
  background: var(--hero);
  color: var(--muted);
}

.guide-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  padding-block: 1rem;
  font-size: .8125rem;
  line-height: 1.5;
}

.guide-footer-inner span {
  margin-inline-end: auto;
}

@media (max-width: 760px) {
  .guide-wrap {
    width: min(calc(100% - 32px), 45rem);
  }

  .guide-header-inner {
    min-height: 64px;
    gap: .5rem;
  }

  .guide-brand {
    gap: .3rem;
  }

  .guide-brand img {
    width: 46px;
    height: 45px;
  }

  .guide-brand,
  .guide-home {
    font-size: .82rem;
  }

  .guide-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    margin-block: 1rem 1.6rem;
    border-radius: 19px;
  }

  .guide-hero-copy {
    padding: 1.4rem 1.2rem 1.35rem;
  }

  .guide-cover {
    height: auto;
    aspect-ratio: 16/9;
  }

  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
  }

  .guide-toc {
    position: static;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--hero);
  }

  .guide-toc ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .3rem .6rem;
  }
}

@media (prefers-color-scheme: dark) {
  .alpha-gal-guide {
    --paper: #13231d;
    --ink: #f0f3e9;
    --muted: #c0d0c5;
    --green: #aedbbd;
    --line: #50675b;
    --hero: #213a2e;
    --emergency: #382920;
    --emergency-ink: #ffe0cb;
    --emergency-edge: #e3a284;
  }
}
