/* ===========================================================
   Vertex Solutions — shared styles (warm boutique)
   Colours come from assets/tokens.css (load it FIRST).
   Used by ai-advies.html and the AI-gids pages.
   =========================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none; opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

::selection { background: var(--green); color: var(--paper); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); position: relative; z-index: 2; }

h1, h2, h3, h4 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
a { color: inherit; }

.kicker { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); }

.mark { color: var(--green); position: relative; white-space: nowrap; }
.mark::after {
  content: ''; position: absolute; left: -2%; right: -2%; bottom: -0.14em; height: 0.32em;
  background: no-repeat center/100% 100%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 18' fill='none'%3E%3Cpath d='M2 12C40 6 80 4 120 7c30 2 55 5 78 2' stroke='%232C6A4A' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  opacity: 0.85;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 500;
  padding: 0.8rem 1.5rem; border-radius: 4px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
}
.btn-solid { background: var(--green); border-color: var(--green); color: var(--paper); }
.btn-solid:hover { background: var(--green-2); border-color: var(--green-2); transform: translateY(-2px); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { border-color: var(--green); color: var(--green); transform: translateY(-2px); }
.btn-link { border: none; padding: 0.8rem 0.2rem; border-bottom: 1.5px solid var(--ink); border-radius: 0; }
.btn-link:hover { color: var(--green); border-color: var(--green); }

/* ── NAV ── */
.site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s; border-bottom: 1px solid transparent; }
.site-nav.scrolled { background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 1.15rem var(--pad); display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.nav-logo em { font-style: normal; color: var(--green); }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a { font-size: 0.92rem; color: var(--ink-2); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 1.6rem; }

/* ── page hero (subpages) ── */
.page-hero { padding: 10rem 0 3.5rem; }
.page-hero .kicker { display: block; margin-bottom: 1.1rem; }
.page-hero h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 700; letter-spacing: -0.035em; max-width: 18ch; }
.page-hero .lede { margin-top: 1.6rem; max-width: 58ch; font-size: clamp(1.05rem, 1.5vw, 1.28rem); color: var(--ink-2); }
.breadcrumb { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 1.4rem; }
.breadcrumb a { text-decoration: none; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.breadcrumb a:hover { color: var(--green); border-color: var(--green); }

/* ── resource cards (hub) ── */
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.res {
  display: flex; flex-direction: column; gap: 0.8rem;
  padding: 2rem; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--card); text-decoration: none; color: inherit;
  transition: border-color 0.25s, transform 0.25s;
}
.res:hover { border-color: var(--green); transform: translateY(-3px); }
.res-num { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; color: var(--green); font-size: 0.9rem; }
.res h3 { font-size: 1.45rem; font-weight: 600; }
.res p { color: var(--ink-2); font-size: 0.98rem; }
.res-actions { margin-top: auto; padding-top: 0.6rem; display: flex; gap: 1.2rem; align-items: center; }
.res-actions .go { font-weight: 600; color: var(--green); font-size: 0.92rem; }
.res-actions .pdf { font-size: 0.85rem; color: var(--ink-3); }

/* ── article / guide ── */
.article { max-width: var(--readw); margin: 0 auto; padding: 1rem 0 2rem; }
.article > * + * { margin-top: 1.3rem; }
.article h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; margin-top: 3rem; padding-top: 0.4rem; }
.article h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.8rem; }
.article p { color: var(--ink); font-size: 1.08rem; line-height: 1.7; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { color: var(--ink); font-size: 1.06rem; line-height: 1.65; margin-top: 0.5rem; }
.article strong { font-weight: 600; }
.article a.inline { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

.callout {
  border-left: 3px solid var(--green); background: var(--green-soft);
  padding: 1.2rem 1.4rem; border-radius: 0 8px 8px 0;
}
.callout .callout-label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); display: block; margin-bottom: 0.4rem; }
.callout p { font-size: 1rem; }

.example { border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); overflow: hidden; }
.example .ex-head { display: flex; gap: 0.6rem; padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--line); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.example .ex-body { padding: 1.1rem 1.2rem; }
.example .ex-body p { font-size: 1rem; }
.example .ex-body > * + * { margin-top: 0.8rem; }
.example .bad { color: var(--bad); }
.example .good { color: var(--green-2); }

.leadinfo { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; margin-top: 2rem; font-size: 0.9rem; color: var(--ink-3); }
.leadinfo .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }

/* download band */
.download-band { margin: 3.5rem auto 0; max-width: var(--readw); border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); padding: 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.download-band h3 { font-size: 1.3rem; }
.download-band p { color: var(--ink-2); font-size: 0.95rem; margin-top: 0.3rem; }

/* related */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.related { padding: 1.3rem; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); text-decoration: none; color: inherit; transition: border-color 0.2s, transform 0.2s; }
.related:hover { border-color: var(--green); transform: translateY(-2px); }
.related .k { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); }
.related h4 { font-size: 1.05rem; font-weight: 600; margin-top: 0.4rem; }

/* section rhythm */
.section { padding: 5.5rem 0; }
.section.tint { background: var(--paper-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.section-head { margin-bottom: 3rem; max-width: 60ch; }
.section-head .kicker { display: block; margin-bottom: 1rem; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; }
.section-head p { color: var(--ink-2); margin-top: 1rem; font-size: 1.05rem; }

/* CTA */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 700; letter-spacing: -0.03em; }
.cta-band p { color: var(--ink-2); font-size: 1.08rem; margin: 1rem auto 2rem; max-width: 46ch; }
.cta-actions { display: inline-flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* ── FOOTER ── */
.site-footer { border-top: 1px solid var(--line-2); padding: 2.6rem 0; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.2rem; position: relative; z-index: 2; }
.footer-logo { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 1.05rem; }
.footer-logo em { font-style: normal; color: var(--green); }
.footer-links { display: flex; gap: 1.8rem; list-style: none; }
.footer-links a { font-size: 0.9rem; color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-copy { font-size: 0.85rem; color: var(--ink-3); }

/* print-only masthead for PDF (hidden on screen) */
.print-masthead, .print-footer { display: none; }

/* ── responsive ── */
@media (max-width: 900px) {
  :root { --pad: 1.4rem; }
  .nav-links { display: none; }
  .page-hero { padding: 8rem 0 3rem; }
  .res-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .download-band { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto; } }

/* ===========================================================
   PRINT  →  used by Chrome headless to render the PDF guides
   =========================================================== */
@media print {
  @page { size: A4; margin: 20mm 18mm 18mm; }
  html { scroll-behavior: auto; }
  body { background: var(--print-bg); color: var(--ink); }
  body::before { display: none; }
  .site-nav, .site-footer, .no-print, .download-band, .related-section, .breadcrumb, .cta-band { display: none !important; }
  .wrap { padding: 0; max-width: 100%; }
  .page-hero { padding: 0 0 0.5rem; }
  .article { max-width: 100%; padding: 0; }
  .article p, .article li { font-size: 11.5pt; line-height: 1.55; color: var(--ink); }
  .article h2 { font-size: 16pt; margin-top: 20pt; }
  .article h3 { font-size: 12.5pt; }
  .page-hero h1 { font-size: 24pt; }
  .page-hero .lede { font-size: 12.5pt; color: var(--print-muted); }
  .callout, .example { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }

  .print-masthead {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 2px solid var(--green); padding-bottom: 8pt; margin-bottom: 18pt;
  }
  .print-masthead .pm-logo { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 13pt; color: var(--ink); }
  .print-masthead .pm-logo em { font-style: normal; color: var(--green); }
  .print-masthead .pm-url { font-size: 9pt; color: var(--ink-3); }

  .print-footer {
    display: block; margin-top: 22pt; padding-top: 8pt;
    border-top: 1px solid var(--print-rule); font-size: 8.5pt; color: var(--ink-3); text-align: center;
  }
}
