/* ============================================================
   GUIDE — custom styles
   ============================================================ */

/* ── Palette overrides ──────────────────────────────────────── */
:root {
  --syr-orange: #d35400;
  --syr-orange-hi: #e85d04;
  --syr-navy: #0e1b2c;
  --wiki-cream: #faf7f1;
  --wiki-rule: #e1d9c8;
  --wiki-faint: #6b6b6b;
}

[data-md-color-scheme="default"] {
  --md-accent-fg-color: var(--syr-orange);
  --md-accent-fg-color--transparent: rgba(211, 84, 0, 0.1);
  --md-typeset-a-color: var(--syr-orange);
  /* Custom primary — dark navy matching logo */
  --md-primary-fg-color: #ffffff;
  --md-primary-fg-color--light: rgba(255, 255, 255, 0.7);
  --md-primary-fg-color--dark: rgba(255, 255, 255, 0.45);
  --md-primary-bg-color: var(--syr-navy);
  --md-primary-bg-color--light: rgba(14, 27, 44, 0.07);
}

[data-md-color-scheme="slate"] {
  --md-accent-fg-color: var(--syr-orange-hi);
  --md-accent-fg-color--transparent: rgba(232, 93, 4, 0.1);
  --md-typeset-a-color: var(--syr-orange-hi);
  /* Custom primary for dark mode — slightly lighter navy */
  --md-primary-fg-color: #ffffff;
  --md-primary-fg-color--light: rgba(255, 255, 255, 0.7);
  --md-primary-fg-color--dark: rgba(255, 255, 255, 0.45);
  --md-primary-bg-color: #0a1522;
  --md-primary-bg-color--light: rgba(10, 21, 34, 0.07);
}

/* ── Header logo on the right ──────────────────────────────── */
/* Material puts the logo at the far left next to the site name. Move it
   to the right side of the header bar instead. */
.md-header__button.md-logo {
  order: 99;
  margin-left: auto;
  margin-right: 0.4rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.6rem;
  width: auto;
  max-width: 8rem;
}

/* Drawer (mobile sidebar) logo stays where Material puts it */
.md-nav__title .md-logo img,
.md-nav__title .md-logo svg {
  height: 1.6rem;
  width: auto;
  max-width: 8rem;
}

/* ── Hero section on the home page ──────────────────────────── */
.wiki-hero {
  margin: 1rem 0 2.5rem 0;
  padding: 2rem 0 2.5rem 0;
  border-bottom: 1px solid var(--wiki-rule);
}

.wiki-hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 1rem 0;
  color: var(--syr-navy);
}

[data-md-color-scheme="slate"] .wiki-hero h1 {
  color: var(--md-default-fg-color);
}

.wiki-tagline {
  font-size: 1.15rem;
  line-height: 1.55;
  max-width: 48rem;
  color: var(--md-default-fg-color--light);
  margin: 0 0 0.8rem 0;
}

.wiki-hero-meta {
  font-size: 0.92rem;
  color: var(--wiki-faint);
  margin: 0;
}

[data-md-color-scheme="slate"] .wiki-hero-meta {
  color: var(--md-default-fg-color--light);
}

/* ── Status card grid ───────────────────────────────────────── */
.wiki-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem 0;
}

.wiki-status-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  background: var(--md-default-bg-color);
  border: 1px solid var(--wiki-rule);
  text-decoration: none !important;
  color: var(--md-default-fg-color) !important;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.wiki-status-card:hover {
  transform: translateY(-2px);
  border-color: var(--syr-orange);
  box-shadow: 0 4px 16px rgba(14, 27, 44, 0.08);
}

[data-md-color-scheme="slate"] .wiki-status-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.wiki-status-icon {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
  filter: grayscale(0.3);
}

.wiki-status-count {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--syr-navy);
  font-variant-numeric: tabular-nums;
}

[data-md-color-scheme="slate"] .wiki-status-count {
  color: var(--md-default-fg-color);
}

.wiki-status-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wiki-faint);
  margin-top: 0.25rem;
  font-weight: 500;
}

.wiki-status-footer {
  font-size: 0.85rem;
  color: var(--wiki-faint);
  margin: 1rem 0 2.5rem 0;
}

.wiki-status-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--wiki-rule);
  text-underline-offset: 3px;
}

.wiki-status-footer a:hover {
  color: var(--syr-orange);
  text-decoration-color: var(--syr-orange);
}

.wiki-status-date {
  color: var(--syr-navy);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

[data-md-color-scheme="slate"] .wiki-status-date {
  color: var(--md-default-fg-color);
}

/* ── Typography refinements ─────────────────────────────────── */
.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
}

.md-typeset h3 {
  font-weight: 600;
  letter-spacing: -0.005em;
}

.md-typeset a {
  text-decoration-color: rgba(211, 84, 0, 0.3);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.md-typeset a:hover {
  text-decoration-color: var(--syr-orange);
}

/* ── Wiki banner (figures & decorative) ─────────────────────── */
.wiki-banner {
  margin: 0 0 1.5rem 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--md-default-bg-color, #f5f5f5);
  position: relative;
}

.wiki-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.wiki-banner[data-kind="figure"] {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.wiki-banner[data-kind="figure"] img {
  width: 100%;
  height: auto;
  max-height: none;
  display: block;
}

.wiki-banner[data-kind="banner"] {
  margin-left: -0.8rem;
  margin-right: -0.8rem;
  max-height: 280px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wiki-banner[data-kind="banner"] img {
  max-height: 280px;
  object-fit: cover;
  object-position: center;
}

.wiki-banner[data-kind="banner"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 -20px 20px -20px rgba(0, 0, 0, 0.15);
}

[data-md-color-scheme="slate"] .wiki-banner img {
  filter: saturate(0.85) brightness(0.92);
}

@media (max-width: 720px) {
  .wiki-banner[data-kind="banner"] {
    max-height: 160px;
  }
  .wiki-banner[data-kind="banner"] img {
    max-height: 160px;
  }
  .wiki-banner {
    margin-bottom: 1rem;
  }
}

/* ── Video embed ────────────────────────────────────────────── */
.wiki-video {
  margin: 0 -1.2rem 1.5rem -1.2rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  background: #000;
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.wiki-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 720px) {
  .wiki-video {
    margin: 0 -0.6rem 1rem -0.6rem;
    border-radius: 4px;
  }
}

/* ── Footer with DataLab credit ─────────────────────────────── */
.wiki-footer-credit {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--md-footer-fg-color--light);
}

.wiki-footer-credit img {
  height: 1.4rem;
  width: auto;
  opacity: 0.9;
}

.wiki-footer-credit a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.wiki-footer-credit a:hover {
  color: var(--syr-orange-hi);
  border-bottom-color: var(--syr-orange-hi);
}

/* ── Mobile tightening (legacy) ─────────────────────────────── */
@media (max-width: 720px) {
  .wiki-hero h1 {
    font-size: 1.8rem;
  }
  .wiki-tagline {
    font-size: 1rem;
  }
  .wiki-status-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .wiki-status-card {
    padding: 0.7rem 0.8rem;
  }
  .wiki-status-count {
    font-size: 1.4rem;
  }
}

/* ══════════════════════════════════════════════════════════════
   GUIDE — Fancy homepage hero v2 & stats
   ══════════════════════════════════════════════════════════════ */

/* ── Hero panel v2 (full-size logo, single column) ──────────── */
.guide-hero-v2 {
  padding: 2.8rem 3rem 2.2rem;
  background: linear-gradient(160deg, #ffffff 0%, var(--wiki-cream) 100%);
  border-radius: 16px;
  border: 1px solid rgba(14, 27, 44, 0.15);
  border-top: 6px solid var(--syr-navy);
  box-shadow: 0 8px 40px rgba(14, 27, 44, 0.14), 0 2px 8px rgba(14, 27, 44, 0.06);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

[data-md-color-scheme="slate"] .guide-hero-v2 {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: var(--syr-orange-hi);
  box-shadow: none;
}

.guide-hero-logo-full {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(14, 27, 44, 0.1));
}

[data-md-color-scheme="slate"] .guide-hero-logo-full {
  filter: none;
  opacity: 0.92;
}

.guide-hero-v2-tagline {
  font-size: 1.05rem;
  line-height: 1.72;
  color: var(--md-default-fg-color--light);
  margin: 0;
  max-width: 52rem;
}

.guide-hero-v2-meta {
  font-size: 0.84rem;
  color: var(--wiki-faint);
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--wiki-rule);
}

.guide-hero-v2-meta a {
  color: var(--syr-orange);
  font-weight: 600;
  text-decoration: none;
}

.guide-hero-v2-meta a:hover {
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .guide-hero-v2 {
    padding: 2rem 1.8rem 1.8rem;
    border-top-width: 5px;
    gap: 1.1rem;
  }
  .guide-hero-logo-full {
    max-width: 360px;
  }
}

/* ── Stats bar ───────────────────────────────────────────────── */
.guide-stats-bar {
  display: flex;
  flex-wrap: nowrap;
  border: 1px solid var(--wiki-rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--md-default-bg-color);
  box-shadow: 0 2px 12px rgba(14, 27, 44, 0.07);
  margin-bottom: 0;
}

[data-md-color-scheme="slate"] .guide-stats-bar {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.guide-stat-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.3rem 0.5rem 1.1rem;
  text-decoration: none !important;
  color: var(--md-default-fg-color) !important;
  border-right: 1px solid var(--wiki-rule);
  transition: background 0.15s ease;
  position: relative;
  overflow: hidden;
}

[data-md-color-scheme="slate"] .guide-stat-item {
  border-right-color: rgba(255, 255, 255, 0.08);
}

.guide-stat-item:last-child {
  border-right: none;
}

/* Orange underline sweep on hover */
.guide-stat-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--syr-orange);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.guide-stat-item:hover::after {
  transform: scaleX(1);
}

.guide-stat-item:hover {
  background: rgba(211, 84, 0, 0.04);
}

.guide-stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--syr-navy);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.35rem;
}

[data-md-color-scheme="slate"] .guide-stat-num {
  color: var(--md-default-fg-color);
}

.guide-stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--wiki-faint);
  font-weight: 700;
  white-space: nowrap;
}

.guide-stats-footer {
  font-size: 0.78rem;
  color: var(--wiki-faint);
  margin: 0.45rem 0 2.5rem;
  text-align: right;
}

.guide-stats-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--wiki-rule);
  text-underline-offset: 3px;
}

.guide-stats-footer a:hover {
  color: var(--syr-orange);
  text-decoration-color: var(--syr-orange);
}

/* ── Stats bar responsive ────────────────────────────────────── */
@media (max-width: 800px) {
  .guide-stats-bar {
    flex-wrap: wrap;
    border-radius: 10px;
  }

  .guide-stat-item {
    flex: none;
    width: calc(25% - 0.5px);
    padding: 0.85rem 0.3rem 0.7rem;
  }

  .guide-stat-num {
    font-size: 1.35rem;
  }

  .guide-stat-label {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
  }
}
