/* Shared editorial design for the standalone pages and the pre-rendered app shell. */
.editorial-shell {
  --ed-ink: #173052;
  --ed-muted: #526987;
  --ed-line: #d7e3f4;
  --ed-link: #2057b6;
  --ed-canvas: #f7faff;
  --ed-surface: #fff;
  --ed-soft: #edf4ff;
  max-width: 90rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  color: var(--ed-ink);
  background: var(--ed-canvas);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.dark .editorial-shell {
  --ed-ink: #f0f6ff;
  --ed-muted: #c4d5ed;
  --ed-line: #415a7c;
  --ed-link: #a8d3ff;
  --ed-canvas: #101e35;
  --ed-surface: #1b304e;
  --ed-soft: #253f65;
}
.editorial-shell * { box-sizing: border-box; }
.editorial-shell a { color: var(--ed-link); text-decoration: none; }
.editorial-shell a:hover { text-decoration: underline; text-underline-offset: .2em; }
.editorial-shell :is(a, button):focus-visible { outline: 2px solid var(--ed-link); outline-offset: 3px; }
.editorial-theme-transition .editorial-shell,
.editorial-theme-transition .editorial-shell :is(header, footer, section, article, button, p, h1, h2, h3, a) {
  transition-property: background-color, color, border-color, box-shadow;
  transition-duration: 440ms;
  transition-timing-function: cubic-bezier(.2, .75, .2, 1);
}
.editorial-theme-transition .editorial-shell main > * { animation: editorialThemeLayerIn 520ms cubic-bezier(.2, .75, .2, 1) both; }
.editorial-theme-transition .editorial-shell main > :nth-child(2n) { animation-delay: 55ms; }
.editorial-theme-transition .editorial-shell main > :nth-child(3n) { animation-delay: 110ms; }
@keyframes editorialThemeLayerIn { from { opacity: .84; filter: saturate(.8); } to { opacity: 1; filter: saturate(1); } }
@media (prefers-reduced-motion: reduce) {
  .editorial-theme-transition .editorial-shell :is(header, footer, section, article, button, p, h1, h2, h3, a),
  .editorial-theme-transition .editorial-shell main > * { animation: none; transition: none; }
}

.editorial-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5.25rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--ed-line);
}
.editorial-brand {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: none;
  color: var(--ed-ink) !important;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.06em;
}
.editorial-brand span { color: var(--ed-link); font-size: .68rem; letter-spacing: .1em; }
.editorial-brand img { display: block; width: 2.8rem; height: 2.8rem; flex: none; border-radius: .7rem; background: #fff; object-fit: contain; }
.editorial-header nav { display: flex; align-items: center; justify-content: center; gap: .25rem; flex: 1; min-width: 0; }
.editorial-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  padding: .6rem .85rem;
  border-radius: .65rem;
  color: var(--ed-muted);
  font-size: .85rem;
  font-weight: 750;
  white-space: nowrap;
}
.editorial-header nav a:hover { color: var(--ed-link); background: var(--ed-soft); text-decoration: none; }
.editorial-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.8rem;
  min-height: 2.8rem;
  padding: .55rem;
  border: 1px solid var(--ed-line);
  border-radius: .7rem;
  color: var(--ed-ink);
  background: var(--ed-surface);
  font: inherit;
  font-size: .8rem;
  font-weight: 750;
  cursor: pointer;
}
.editorial-theme-toggle[hidden] { display: none; }
.editorial-theme-toggle__label { display: none; }
.editorial-theme-toggle:hover { color: var(--ed-link); background: var(--ed-soft); }
.editorial-theme-toggle svg { width: 1.08rem; height: 1.08rem; }
.editorial-theme-toggle__sun, .dark .editorial-theme-toggle__moon { display: none; }
.dark .editorial-theme-toggle__sun { display: block; }

.editorial-shell main { min-height: 60vh; padding: 2rem 0 5rem; }
.editorial-hero, .editorial-page-head {
  position: relative;
  min-height: 23rem;
  padding: clamp(2rem, 5vw, 5rem);
  overflow: hidden;
  border-radius: 1.5rem;
  color: #fff;
  background: radial-gradient(circle at 94% 0%, #2c68b4, transparent 37%), #102b57;
}
.editorial-page-head { min-height: 18rem; }
.editorial-hero::after, .editorial-page-head::after {
  position: absolute;
  right: -5rem;
  bottom: -12rem;
  width: 28rem;
  height: 28rem;
  border: 1px solid rgba(155, 215, 255, .24);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.dark .editorial-hero, .dark .editorial-page-head {
  background: radial-gradient(circle at 94% 0%, #224a7b, transparent 37%), #10243f;
}
.editorial-kicker { position: relative; z-index: 1; margin: 0 0 .9rem; color: #a2e6ff; font-size: .74rem; font-weight: 850; letter-spacing: .18em; }
.editorial-shell h1 {
  position: relative;
  z-index: 1;
  max-width: 17ch;
  margin: 0 0 1rem;
  color: #fff;
  font-size: clamp(2.6rem, 5.5vw, 5.8rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.065em;
}
.editorial-page-head h1 { font-size: clamp(2.5rem, 4.5vw, 4.7rem); }
.editorial-shell h1 em { color: #a2e6ff; font-style: normal; }
.editorial-hero > p:not(.editorial-kicker), .editorial-page-head > p:not(.editorial-kicker) {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: .8rem 0;
  color: #d5e5f8;
  font-size: 1.02rem;
  line-height: 1.7;
}
.editorial-actions { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-top: 2rem; }
.editorial-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: .75rem 1.2rem;
  border: 1px solid rgba(196, 225, 255, .4);
  border-radius: .7rem;
  color: #fff;
  background: rgba(150, 215, 255, .13);
  font-size: .86rem;
  font-weight: 800;
}
.editorial-actions a:hover { background: rgba(150, 215, 255, .27); text-decoration: none; }
.editorial-actions .editorial-primary { border-color: #a2e6ff; color: #12325c; background: #a2e6ff; }
.editorial-actions .editorial-primary:hover { background: #c5f0ff; }

.editorial-section { margin: clamp(2.5rem, 5vw, 5rem) 0; }
.editorial-section h2 {
  max-width: 31ch;
  margin: 0 0 1.1rem;
  color: var(--ed-ink);
  font-size: clamp(1.8rem, 3.5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.17;
  letter-spacing: -.045em;
}
.editorial-section p, .editorial-section ol {
  max-width: 55rem;
  color: var(--ed-muted);
  font-size: 1rem;
  line-height: 1.8;
}
.editorial-section li { max-width: 54rem; margin: .55rem 0; padding-left: .2rem; }
.editorial-section ol { padding-left: 1.35rem; }
.editorial-section ol li::marker { color: var(--ed-link); font-weight: 850; }
.editorial-section :is(p, li) a { color: var(--ed-link); font-weight: 700; text-decoration: underline; text-underline-offset: .18em; }
.editorial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.6rem; }
.editorial-card {
  display: flex;
  flex-direction: column;
  min-height: 14rem;
  padding: 1.5rem;
  border: 1px solid var(--ed-line);
  border-top: 4px solid #3677df;
  border-radius: 1rem;
  background: var(--ed-surface);
  box-shadow: 0 12px 28px rgba(24, 52, 100, .035);
}
.editorial-card:nth-child(3n+2) { border-top-color: #2aa6d3; }
.editorial-card:nth-child(3n) { border-top-color: #728bdf; }
.editorial-card h3 { max-width: 25ch; margin: 0 0 .5rem; color: var(--ed-ink); font-size: 1.25rem; letter-spacing: -.025em; }
.editorial-card p { margin: .3rem 0 1rem; color: var(--ed-muted); font-size: .92rem; line-height: 1.7; }
.editorial-card a { display: inline-flex; align-items: center; min-height: 2.5rem; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--ed-line); color: var(--ed-link); font-size: .86rem; font-weight: 800; }
.editorial-meta, .editorial-source, .editorial-note {
  padding: 1.1rem 1.3rem;
  border-left: 4px solid #3677df;
  border-radius: .8rem;
  color: var(--ed-muted);
  background: var(--ed-soft);
  line-height: 1.7;
}
.editorial-meta { margin: 1.4rem 0; font-size: .85rem; font-weight: 700; }
.editorial-source { border: 1px solid var(--ed-line); }
.editorial-source a { color: var(--ed-link); text-decoration: underline; text-underline-offset: .18em; }

.editorial-shell:not(.editorial-shell--home) .editorial-section {
  margin: 1rem 0;
  padding: clamp(1.5rem, 3vw, 2.6rem);
  border: 1px solid var(--ed-line);
  border-left: 4px solid #3677df;
  border-radius: 1rem;
  background: var(--ed-surface);
}
.editorial-shell:not(.editorial-shell--home) .editorial-section:nth-of-type(3n) { border-left-color: #2aa7d5; }
.editorial-shell:not(.editorial-shell--home) .editorial-section h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); }
.editorial-shell:not(.editorial-shell--home) .editorial-section .editorial-card { min-height: 12rem; background: var(--ed-soft); }
.editorial-shell--home .editorial-section:first-of-type { padding: clamp(1.5rem, 3vw, 3rem); border-radius: 1.4rem; background: #102b57; }
.editorial-shell--home .editorial-section:first-of-type h2 { color: #fff; }
.editorial-shell--home .editorial-section:first-of-type .editorial-card { min-height: 17rem; border: 1px solid rgba(180, 221, 255, .27); background: linear-gradient(145deg, #204981, #173b6b); }
.editorial-shell--home .editorial-section:first-of-type .editorial-card:nth-child(2) { background: linear-gradient(145deg, #1a5c91, #16446e); }
.editorial-shell--home .editorial-section:first-of-type .editorial-card:nth-child(3) { background: linear-gradient(145deg, #264f9e, #18346c); }
.editorial-shell--home .editorial-section:first-of-type .editorial-card h3 { color: #fff; }
.editorial-shell--home .editorial-section:first-of-type .editorial-card p { color: #d1e2f7; }
.editorial-shell--home .editorial-section:first-of-type .editorial-card a { border-top-color: rgba(180, 221, 255, .3); color: #b5e7ff; }

.editorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  padding: 1.4rem 0 calc(1.4rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ed-line);
  color: var(--ed-muted);
  font-size: .75rem;
}
.editorial-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.editorial-footer a { color: var(--ed-muted); }
.editorial-footer a:hover { color: var(--ed-link); }

@media (min-width: 768px) and (max-width: 1000px) {
  .editorial-theme-toggle { width: 2.8rem; padding: .55rem; }
  .editorial-theme-toggle__label { display: none; }
}
@media (max-width: 767px) {
  .editorial-header { flex-wrap: wrap; gap: .5rem; }
  .editorial-brand { margin-right: auto; }
  .editorial-header nav { order: 3; justify-content: flex-start; flex: 0 0 100%; overflow-x: auto; }
  .editorial-header nav a { flex: none; }
  .editorial-theme-toggle { width: 2.8rem; padding: .55rem; }
  .editorial-theme-toggle__label { display: none; }
  .editorial-shell main { padding-top: 1.1rem; }
  .editorial-hero, .editorial-page-head { min-height: 0; padding: 2rem 1.5rem; }
  .editorial-grid { grid-template-columns: 1fr; }
  .editorial-card, .editorial-shell--home .editorial-section:first-of-type .editorial-card { min-height: 0; }
  .editorial-shell:not(.editorial-shell--home) .editorial-section { padding: 1.35rem; }
}
