/* ═══════════════════════════════════════════════════════════════
   cross-origin.com — Main Stylesheet
   Design: Vintage Chic · Olive · Taupe · Soft Gold · Umber
   ═══════════════════════════════════════════════════════════════ */

/* ── Custom Properties ─────────────────────────────────────────── */
:root {
  --bg:        #f5f0e8;
  --surface:   #ede8dc;
  --surface-2: #e4ddd0;
  --olive:     #6b7c4b;
  --olive-dk:  #556038;
  --gold:      #c9a84c;
  --gold-lt:   #e2c97e;
  --taupe:     #8c7b6b;
  --umber:     #5c4033;
  --umber-dk:  #3e2b20;
  --ink:       #2e2a24;
  --ink-lt:    #4a443c;
  --border:    #d4ccc0;
  --header-h:  64px;
  --radius:    8px;
  --shadow:    0 2px 12px rgba(46,42,36,.10);
  --shadow-lg: 0 6px 32px rgba(46,42,36,.14);
  --font-body: Georgia, 'Times New Roman', serif;
  --font-ui:   system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
  --max-w:     1320px;
  --content-w: 900px;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Scroll offset for sticky header ──────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

/* ── Typography ────────────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 4vw, 2.8rem); font-family: var(--font-ui); font-weight: 700; color: var(--olive); line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-family: var(--font-ui); font-weight: 600; color: var(--umber); margin: 2.5rem 0 .75rem; border-bottom: 2px solid var(--border); padding-bottom: .4rem; }
h3 { font-size: 1.2rem; font-family: var(--font-ui); font-weight: 600; color: var(--taupe); margin: 1.75rem 0 .5rem; }
h4 { font-size: 1.05rem; font-family: var(--font-ui); font-weight: 600; color: var(--ink-lt); margin: 1.25rem 0 .4rem; }
p  { margin-bottom: 1.1rem; }

a {
  color: var(--olive);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color .18s, text-decoration-color .18s;
}
a:hover, a:focus {
  color: var(--olive-dk);
  text-decoration-color: var(--gold);
}

strong { color: var(--ink); }
em     { color: var(--taupe); }

ul, ol { margin: .75rem 0 1rem 1.5rem; }
li     { margin-bottom: .3rem; }

/* Inline code */
:not(pre) > code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: rgba(107, 124, 75, .08);
  color: var(--ink-lt);
  padding: .1em .35em;
  border-radius: 3px;
}

/* ── Layout Wrapper ────────────────────────────────────────────── */
.page-wrapper {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

/* ── Sticky Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img { width: 40px; height: 40px; transition: transform .2s; }
.logo-link:hover .logo-img { transform: scale(1.08); }
.logo-text {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.logo-accent { color: var(--olive); }

/* Nav */
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: .9rem;
  font-weight: 500;
  color: var(--taupe);
  transition: background .18s, color .18s;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover, .nav-link:focus {
  background: var(--surface-2);
  color: var(--olive);
  text-decoration: none;
}
.nav-link--active {
  background: var(--olive);
  color: #fff !important;
}
.nav-link--active:hover { background: var(--olive-dk); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ── Breadcrumbs ────────────────────────────────────────────────── */
.breadcrumbs {
  padding: .9rem 0 .75rem;
  margin-bottom: 1.5rem;
}
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  align-items: center;
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--taupe);
}
.breadcrumbs a { color: var(--taupe); text-decoration: none; }
.breadcrumbs a:hover { color: var(--olive); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--olive); font-weight: 600; }
.breadcrumbs .sep { color: var(--border); margin: 0 .15rem; }

/* ── Page Content Area ──────────────────────────────────────────── */
.page-content {
  width: 100%;
}

/* ── Related / Child Cards ──────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--gold);
  text-decoration: none;
  color: var(--ink);
}
.card-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--olive);
  margin: 0 0 .4rem;
}
.card-desc { font-size: .9rem; color: var(--taupe); margin: 0; }

.child-pages        { margin-top: 3rem; }
.child-pages-heading { border: none; padding: 0; color: var(--taupe); font-size: 1.1rem; margin-bottom: 1rem; }

/* Related pages sidebar */
.related-pages { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--border); }
.related-heading { font-size: 1.1rem; color: var(--taupe); border: none; padding: 0; margin: 0 0 .75rem; }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { margin-bottom: .35rem; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: .9rem;
}
thead { background: var(--olive); color: #fff; }
thead th { padding: .75rem 1rem; text-align: left; font-weight: 600; }
tbody tr:nth-child(even) { background: var(--surface); }
tbody tr:nth-child(odd)  { background: var(--bg); }
tbody tr:hover           { background: var(--surface-2); }
td, th { padding: .65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }

/* ── Code Blocks ────────────────────────────────────────────────── */
.code-wrapper {
  position: relative;
}
.code-lang {
  position: absolute;
  top: .5rem;
  left: .75rem;
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--taupe);
  opacity: .75;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}
/* Push code down so it doesn't sit under the label */
.code-wrapper pre[class*="language-"] {
  padding-top: 2rem;
}
.copy-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  padding: .25rem .65rem;
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--taupe);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, color .15s;
  z-index: 2;
}
.copy-btn:hover { background: var(--olive); color: #fff; border-color: var(--olive); }
.copy-btn.copied { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* ── Checkboxes (interactive) ───────────────────────────────────── */
.task-list-item { list-style: none; margin-left: -1rem; }
.task-list-item input[type="checkbox"] {
  margin-right: .5rem;
  accent-color: var(--olive);
  cursor: pointer;
  width: 1em;
  height: 1em;
}
.task-list-item.is-checked > label,
.task-list-item input[type="checkbox"]:checked + span,
.task-list-item input[type="checkbox"]:checked ~ * {
  text-decoration: line-through;
  color: var(--taupe);
}

/* markdown-it-checkbox renders differently — target the pattern */
li:has(> input[type="checkbox"]) {
  list-style: none;
  margin-left: -1.25rem;
}
li > input[type="checkbox"] {
  margin-right: .5rem;
  accent-color: var(--olive);
  cursor: pointer;
}
li:has(> input[type="checkbox"]:checked) {
  text-decoration: line-through;
  color: var(--taupe);
}

/* ── FAQ Accordions ─────────────────────────────────────────────── */
.faq   { margin-top: 1rem; }
details.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  background: var(--surface);
  overflow: hidden;
}
details.faq-item[open] { border-color: var(--gold); }
summary.faq-question {
  padding: .9rem 3rem .9rem 1.25rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  color: var(--umber);
  list-style: none;
  position: relative;
  transition: background .15s;
  /* Let text + inline code flow naturally — no flex */
}
summary.faq-question::-webkit-details-marker { display: none; }
summary.faq-question::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--gold);
  line-height: 1;
  transition: transform .2s;
  pointer-events: none;
}
details.faq-item[open] summary.faq-question::after { content: "−"; }
summary.faq-question:hover { background: var(--surface-2); }
.faq-answer {
  padding: .75rem 1.25rem 1.1rem;
  color: var(--ink);
  border-top: 1px solid var(--border);
}
.faq-answer p:last-child { margin-bottom: 0; }

/* ── Home Page ──────────────────────────────────────────────────── */
.home { max-width: 100%; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border-bottom: 2px solid var(--border);
  padding: 5rem 2rem 4rem;
  text-align: center;
}
.hero-inner { max-width: 800px; margin: 0 auto; }
.hero-logo { margin-bottom: 1.5rem; }
.hero-title {
  font-family: var(--font-ui);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 1.25rem;
  scroll-margin-top: 0;
}
.hero-accent { color: var(--olive); }
.hero-sub {
  font-size: 1.1rem;
  color: var(--taupe);
  max-width: 660px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.cta-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.cta-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; filter: brightness(1.08); }
.cta-btn--olive  { background: var(--olive);  color: #fff; }
.cta-btn--gold   { background: var(--gold);   color: var(--ink); }
.cta-btn--umber  { background: var(--umber);  color: #fff; }

/* About */
.home-about {
  padding: 3.5rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.about-inner {
  max-width: 860px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--ink-lt);
}
.about-inner p { margin-bottom: 1.1rem; }

/* Section cards */
.home-sections { padding: 3.5rem 2rem 5rem; }
.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
  transition: box-shadow .2s, transform .2s;
}
.section-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.section-card--olive { border-top: 4px solid var(--olive); }
.section-card--gold  { border-top: 4px solid var(--gold); }
.section-card--umber { border-top: 4px solid var(--umber); }
.section-card-icon { margin-bottom: 1rem; }
.section-card-icon svg { width: 48px; height: 48px; }
.section-card h2 {
  font-size: 1.2rem;
  margin: 0 0 .75rem;
  border: none;
  padding: 0;
  color: var(--ink);
  scroll-margin-top: 0;
}
.section-card h2 a { color: inherit; text-decoration: none; }
.section-card h2 a:hover { color: var(--olive); }
.section-card p { font-size: .95rem; color: var(--taupe); margin-bottom: 1rem; }
.section-card ul { margin: 0; padding: 0; list-style: none; }
.section-card li { margin-bottom: .35rem; font-size: .9rem; }
.section-card li a { color: var(--taupe); }
.section-card li a:hover { color: var(--olive); }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  background: var(--umber-dk);
  color: #c8b8a8;
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
}
.footer-heading {
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold-lt);
  margin-bottom: .75rem;
  border: none;
  padding: 0;
  scroll-margin-top: 0;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; font-size: .88rem; }
.site-footer a { color: #a89888; text-decoration: none; transition: color .15s; }
.site-footer a:hover { color: var(--gold-lt); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  text-align: center;
  padding: 1rem 2rem;
  font-family: var(--font-ui);
  font-size: .8rem;
  color: #7a6a5a;
}
.footer-bottom a { color: var(--gold-lt); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
  :root { --header-h: 56px; }

  .header-inner { padding: 0 1rem; }
  .logo-text { font-size: 1rem; }

  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: .75rem 1rem 1rem;
    margin: 0;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: .25rem; }
  .nav-link { padding: .65rem .75rem; }

  .page-wrapper { padding: 1.5rem 1rem 3rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .home-about, .home-sections { padding-left: 1rem; padding-right: 1rem; }
  .footer-inner { padding: 2rem 1rem 1.5rem; }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .section-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1200px) {
  .page-wrapper { padding: 2.5rem 3rem 5rem; }
  .hero { padding: 6rem 2rem 5rem; }
}

