/* ══════════════════════════════════════════════════════════════
   Bazzite Home Server Guide  —  Custom Stylesheet
   ══════════════════════════════════════════════════════════════ */

/* ── Google Fonts: Fira Code ligatures ───────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

.md-typeset code,
.md-typeset pre code {
  font-feature-settings: "liga" 1, "calt" 1;
  font-variant-ligatures: contextual;
}

/* ══ COLOR TOKENS ════════════════════════════════════════════════ */

/* Dark theme */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:           #3b82f6;
  --md-primary-fg-color--light:    #60a5fa;
  --md-primary-fg-color--dark:     #1d4ed8;

  --md-accent-fg-color:            #22d3ee;
  --md-accent-fg-color--transparent: rgba(34,211,238,.12);

  --md-default-bg-color:           #0d1117;
  --md-default-bg-color--light:    #161b22;
  --md-default-bg-color--lighter:  #1c2230;
  --md-default-bg-color--lightest: #232a3a;

  --md-default-fg-color:           #e6edf3;
  --md-default-fg-color--light:    #8b949e;
  --md-default-fg-color--lighter:  #6e7681;
  --md-default-fg-color--lightest: #30363d;

  --md-code-bg-color:              #161b22;
  --md-code-fg-color:              #e6edf3;
  --md-code-hl-color:              rgba(34,211,238,.15);

  --c-accent:  #22d3ee;
  --c-warn:    #f59e0b;
  --c-danger:  #ef4444;
  --c-success: #22c55e;
  --c-card-bg: #161b22;
  --c-card-border: #30363d;
}

/* Light theme */
[data-md-color-scheme="default"] {
  --md-primary-fg-color:           #1d4ed8;
  --md-primary-fg-color--light:    #3b82f6;
  --md-primary-fg-color--dark:     #1e3a8a;

  --md-accent-fg-color:            #0891b2;
  --md-accent-fg-color--transparent: rgba(8,145,178,.12);

  --c-accent:  #0891b2;
  --c-warn:    #d97706;
  --c-danger:  #dc2626;
  --c-success: #16a34a;
  --c-card-bg: #f8fafc;
  --c-card-border: #e2e8f0;
}

/* ══ GLOBAL LAYOUT ═══════════════════════════════════════════════ */

.md-content {
  max-width: 900px;
}

/* Smoother body text */
.md-typeset {
  font-size: .875rem;
  line-height: 1.75;
}

.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25em;
}

.md-typeset h2 {
  font-weight: 600;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  padding-bottom: 0.3em;
  margin-top: 2em;
}

.md-typeset h3 {
  font-weight: 600;
}

/* ══ HERO SECTION (index.md) ═════════════════════════════════════ */

.hero {
  background: linear-gradient(135deg,
    var(--md-primary-fg-color--dark) 0%,
    var(--md-primary-fg-color) 60%,
    var(--c-accent) 100%);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  margin-bottom: 2.5rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(34,211,238,.15) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .7;
  margin: 0 0 .5rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 .75rem;
  line-height: 1.15;
  color: white !important;
  border: none;
  padding: 0;
}

.hero-sub {
  font-size: .9rem;
  opacity: .85;
  max-width: 520px;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.hero-badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 99px;
  padding: .25rem .8rem;
  font-size: .75rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* ══ FEATURE CARDS (homepage "what you get") ═════════════════════ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .875rem;
  margin: 1.5rem 0 2rem;
}

.feature-card {
  background: var(--c-card-bg);
  border: 1px solid var(--c-card-border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color .2s, transform .15s, box-shadow .2s;
}

.feature-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: .6rem;
  display: block;
}

.feature-card h3 {
  font-size: .875rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  color: var(--md-default-fg-color);
  border: none;
  padding: 0;
}

.feature-card p {
  font-size: .8rem;
  color: var(--md-default-fg-color--light);
  margin: 0;
  line-height: 1.5;
}

/* ══ PHASE ROADMAP GRID (homepage) ══════════════════════════════ */

.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .875rem;
  margin: 1.5rem 0;
}

.phase-card {
  border: 1px solid var(--c-card-border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  text-decoration: none !important;
  display: block;
  background: var(--c-card-bg);
  transition: border-color .2s, transform .15s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}

.phase-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--md-primary-fg-color);
  border-radius: 12px 0 0 12px;
  opacity: 0;
  transition: opacity .2s;
}

.phase-card:hover {
  border-color: var(--md-primary-fg-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  text-decoration: none !important;
}

.phase-card:hover::before {
  opacity: 1;
}

.card-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: .3rem;
}

.card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--md-default-fg-color);
  margin-bottom: .3rem;
}

.card-desc {
  font-size: .78rem;
  color: var(--md-default-fg-color--light);
  line-height: 1.5;
  margin: 0;
}

/* ══ PHASE HEADER BANNER ════════════════════════════════════════ */

.phase-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, var(--md-primary-fg-color--dark), var(--md-primary-fg-color));
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  color: white;
}

.phase-header .phase-num {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  opacity: .3;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.phase-header-text {}

.phase-header-eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .75;
  margin: 0 0 .25rem;
}

.phase-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  color: white !important;
  border: none;
  padding: 0;
}

.phase-header-sub {
  font-size: .82rem;
  opacity: .8;
  margin: 0;
}

/* ══ STEP ITEMS ══════════════════════════════════════════════════ */

.step {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0 1rem;
  margin-bottom: 1.75rem;
  align-items: start;
}

.step-num {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--md-primary-fg-color);
  color: white;
  font-size: .82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: .15rem;
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
}

.step-body {}

.step-body h3,
.step-body > strong:first-child {
  margin-top: 0 !important;
}

/* ══ REQUIREMENT CHECKLIST ════════════════════════════════════════ */

.req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: 1rem 0 1.5rem;
}

@media (max-width: 600px) {
  .req-grid { grid-template-columns: 1fr; }
}

.req-item {
  display: flex;
  gap: .75rem;
  padding: .875rem;
  border-radius: 10px;
  background: var(--c-card-bg);
  border: 1px solid var(--c-card-border);
  font-size: .82rem;
  align-items: flex-start;
}

.req-item .req-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1.2; }
.req-item strong { display: block; font-size: .83rem; margin-bottom: .15rem; }
.req-item span { color: var(--md-default-fg-color--light); font-size: .78rem; line-height: 1.4; }

/* ══ PORT TABLE HIGHLIGHT ════════════════════════════════════════ */

.md-typeset table:not([class]) {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--c-card-border);
  font-size: .84rem;
}

.md-typeset table:not([class]) thead tr {
  background: var(--md-primary-fg-color);
}

.md-typeset table:not([class]) thead th {
  color: white;
  font-weight: 600;
  border-color: transparent;
}

.md-typeset table:not([class]) tbody tr:hover {
  background: var(--md-accent-fg-color--transparent);
}

/* ══ CODE BLOCKS ════════════════════════════════════════════════ */

.md-typeset pre {
  border-radius: 10px;
  border: 1px solid var(--c-card-border);
}

.md-typeset pre > code {
  font-size: .8rem;
  line-height: 1.65;
}

/* Inline code */
.md-typeset :not(pre) > code {
  background: var(--md-code-bg-color);
  border: 1px solid var(--c-card-border);
  border-radius: 4px;
  padding: .1em .35em;
  font-size: .82em;
  color: var(--c-accent);
}

/* ══ ADMONITIONS ════════════════════════════════════════════════ */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 10px;
  border-width: 1px;
  font-size: .84rem;
}

.md-typeset .admonition-title,
.md-typeset summary {
  border-radius: 9px 9px 0 0;
  font-weight: 600;
}

/* ══ NAVIGATION ═════════════════════════════════════════════════ */

.md-nav__title {
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .04em;
}

.md-nav__item--active > .md-nav__link {
  font-weight: 600;
}

/* ══ NEXT/PREV BAR ══════════════════════════════════════════════ */

.md-footer-meta__inner {
  font-size: .8rem;
}

/* ══ "WHAT NEXT" BUTTON ════════════════════════════════════════ */

.next-phase {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--md-primary-fg-color);
  color: white !important;
  border-radius: 8px;
  padding: .6rem 1.2rem;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .2s, transform .15s;
  margin-top: .5rem;
}

.next-phase:hover {
  background: var(--md-primary-fg-color--dark);
  transform: translateX(2px);
  color: white !important;
}

.next-phase::after {
  content: '→';
}

/* ══ SUMMARY TABLE (status check rows) ══════════════════════════ */

.status-table code {
  color: var(--c-success) !important;
  font-weight: 500;
}

/* ══ RESPONSIVE ═════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .hero { padding: 2rem 1.5rem; }
  .phase-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .phase-header { padding: 1.25rem 1.25rem; }
  .phase-header .phase-num { font-size: 2rem; }
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
}
