/* viktorszabo.com v2: light theme + header preferences (language, theme).
   Dark stays byte-for-byte the #105 look; light swaps the tokens to Paper/Ink
   and keeps Amber as the accent. Loaded last on every page. */

/* ---------- theme-specific images (logo) ---------- */
.th-l { display: none !important; }
html[data-theme="light"] .th-d { display: none !important; }
html[data-theme="light"] .logo-full.th-l, html[data-theme="light"] .foot-logo.th-l { display: block !important; }
html[data-theme="light"] .logo-mark.th-l { display: none !important; }
@media (max-width: 520px) {
  html[data-theme="light"] .logo-full.th-l { display: var(--logo-full-display, block) !important; }
}

/* ---------- header preferences ---------- */
.prefs { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.lang-sw, .theme-sw {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 44px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent;
  color: var(--ivory); font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-decoration: none; cursor: pointer; transition: border-color .4s var(--ease), color .4s var(--ease), background-color .4s var(--ease);
}
.nav-menu a.lang-sw { min-height: 40px; color: var(--ivory); font-size: 12px; }
.lang-sw .lang-on { color: var(--amber); }
.lang-sw .lang-sep, .lang-sw .lang-off { color: var(--muted); }
.lang-sw:hover .lang-off { color: var(--ivory); }
.lang-sw:hover, .theme-sw:hover { border-color: var(--ivory); }
.theme-sw { width: 40px; min-width: 40px; padding: 0; }
.theme-sw .i-moon { display: none; }
html[data-theme="light"] .theme-sw .i-sun { display: none; }
html[data-theme="light"] .theme-sw .i-moon { display: block; }
.lang-sw:focus-visible, .theme-sw:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

@media (max-width: 900px) {
  .nav-menu > :nth-child(6) { --k: 5; }
  .nav-menu > :nth-child(7) { --k: 6; }
  .nav-menu > :nth-child(8) { --k: 7; }
  .nav-menu > :nth-child(9) { --k: 8; }
  .nav-menu .prefs { order: 99; margin: 22px 0 0; gap: 10px; }
  .nav-menu .prefs .lang-sw, .nav-menu .prefs .theme-sw { min-height: 44px; }
  .nav-menu .prefs .lang-sw { padding: 0 16px; font-size: 13px; }
  .nav-menu .prefs .theme-sw { width: 44px; min-width: 44px; }
}

/* ---------- CMS image focal points ---------- */
.home-now .pf-portrait img { object-fit: cover; object-position: var(--pos, 50% 50%); }
@media (max-width: 900px) { .home-now .pf-portrait img { object-position: var(--pos-m, 50% 18%); } }
.kit-vid video, .kit-vid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prose > :first-child { margin-top: 0; }

/* =================== LIGHT THEME =================== */
html[data-theme="light"] {
  --onyx: #f6f1e7;          /* Paper */
  --ivory: #17140f;         /* Ink */
  --s1: #ede6d8;
  --s2: #e4dbc9;
  --muted: #5a5348;
  --line: rgba(23, 20, 15, 0.12);
  --line-strong: rgba(23, 20, 15, 0.24);
  --amber-ink: #8a4e00;     /* Amber for text on Paper: 5.9:1 */
  color-scheme: light;
}
html[data-theme="light"] body { background-color: #f6f1e7; }
html[data-theme="light"] body::before {
  background-color: #f6f1e7;
  background-image:
    radial-gradient(55% 50% at 72% -8%, rgba(255, 183, 3, 0.22), transparent 70%),
    radial-gradient(42% 45% at -6% 38%, rgba(251, 86, 7, 0.07), transparent 70%),
    radial-gradient(circle, rgba(23, 20, 15, .10) 0.8px, transparent 1.3px);
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: 0 0, 0 0, 0 0;
  background-size: auto, auto, 14px 14px;
}
html[data-theme="light"] body::after { filter: invert(1); opacity: .5; }

/* Amber used as TEXT gets the darker ink so it passes WCAG AA on Paper. */
html[data-theme="light"] :is(.idx, .crumbs a, .card a, .note-go .arr, .bw.ser .c, .h1 .wd.ai, .banner strong, .soc a:hover, .kit-go, .kit-go .arr, .lang-sw .lang-on),
html[data-theme="light"] :is(.h1, .h2, .pf-h1, h2, h3) em,
html[data-theme="light"] .prose a, html[data-theme="light"] .lede a, html[data-theme="light"] main p a:not(.btn) { color: var(--amber-ink); }
html[data-theme="light"] .mq-track em { color: var(--ivory); }

/* Buttons and chips that sit on Amber keep dark Ink text. */
html[data-theme="light"] :is(.btn-amber, .btn-amber:hover, .nav-menu a.btn-amber, .nav-menu a.btn-amber:hover, .now-ar .now-tag, .cc button:hover, .readbar a:hover, .lang a[aria-current="true"]) { color: #17140f; }

/* Header, readbar and menu panels: translucent Paper instead of Onyx glass. */
html[data-theme="light"] .nav { background: rgba(246, 241, 231, 0.82); }
html[data-theme="light"] .readbar { background: rgba(246, 241, 231, .9); }
html[data-theme="light"] .nav-btn:hover { border-color: rgba(23, 20, 15, .4); }
html[data-theme="light"] .nav.is-open .nav-btn { border-color: rgba(23, 20, 15, .3); }
@media (max-width: 900px) {
  html[data-theme="light"] .nav-menu {
    background:
      radial-gradient(60% 40% at 80% 0%, rgba(255, 183, 3, .18), transparent 70%),
      radial-gradient(circle, rgba(23, 20, 15, .10) 0.8px, transparent 1.3px) 0 0 / 14px 14px,
      #f6f1e7;
  }
}

/* Hero: the dot fold is drawn in Ivory on a canvas; invert it to Ink dots. */
html[data-theme="light"] canvas[data-hero-fold] { filter: invert(1) sepia(.25); opacity: .55; }
html[data-theme="light"] .home-now .pf-portrait {
  border-color: rgba(23, 20, 15, .14);
  box-shadow: 0 0 0 4px rgba(246, 241, 231, .95), 0 0 0 5px rgba(138, 78, 0, .35), 0 24px 70px rgba(255, 183, 3, .22);
  background: #e9e1d1;
}

/* Featured project cards: in dark they are Ivory cards. In light they become
   Ink cards so they still stand off the Paper page. */
html[data-theme="light"] .now-card { background: #17140f; color: #f2f2f2; box-shadow: 0 1px 0 rgba(255, 183, 3, .3) inset, 0 20px 50px -30px rgba(23, 20, 15, .5); }
html[data-theme="light"] .now-body h3 { color: #f2f2f2; }
html[data-theme="light"] .now-d { color: rgba(242, 242, 242, .74); }
html[data-theme="light"] .now-kicker { color: rgba(242, 242, 242, .62); }
html[data-theme="light"] .now-tag { background: #f2f2f2; color: #17140f; }
html[data-theme="light"] .now-ar .now-visual { background: #f2f2f2; }

/* Free guide cards */
html[data-theme="light"] .kit { box-shadow: 0 16px 40px -28px rgba(23, 20, 15, .45); }
html[data-theme="light"] .kit::before, html[data-theme="light"] .kit::after { filter: none; }

/* Cookie banner */
html[data-theme="light"] .cc { box-shadow: 0 20px 50px -24px rgba(23, 20, 15, .35); border-color: rgba(23, 20, 15, .3); }
html[data-theme="light"] .cc-icon circle:not(:first-child) { fill: #17140f; }

/* ---- v2: notes back, combined Guides & Notes page ---- */
.note-lang { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
html[data-theme="light"] .note::before { background: var(--onyx); border-color: rgba(23, 20, 15, .45); }
.gn-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 32px 0 8px; }
.gn-filter-l { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.gn-filter button { font: inherit; font-size: 14px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ivory); cursor: pointer; transition: background-color .3s, color .3s, border-color .3s; }
.gn-filter button:hover { border-color: var(--amber); }
.gn-filter button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #020202; }
.gn-group { margin-top: 56px; scroll-margin-top: 96px; }
.gn-group > h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.03em; margin: 0 0 8px; }
.gn-group > .gn-note { color: var(--muted); margin: 0; }
.gn-group .log { margin-top: 24px; }
[data-gn-hidden] { display: none !important; }
.gn-pointer { margin: 56px 0 0; color: var(--muted); }
.gn-pointer a { color: var(--amber); }

/* ---- v2: light mode for the EN static article pages (notes, privacy, facts, tools) ---- */
html[data-force-theme] .theme-sw { display: none !important; }
html[data-theme="light"] .post :is(p, li, td, th, dd, dt, strong, em, b, figcaption, blockquote, summary) { color: #2b261e; }
html[data-theme="light"] .post :is(.byline, .upd, .note p, .note-x, .disc, small) { color: var(--muted); }
html[data-theme="light"] .post .crumbs ol, html[data-theme="light"] .post .crumbs li { color: var(--muted); }
html[data-theme="light"] .post :is(.tag, .crumbs a) { color: var(--amber-ink); }
html[data-theme="light"] .post a:not([class*="btn"]):not(.copy):not(.b):not(.note-t a) { color: var(--amber-ink); }
html[data-theme="light"] .post .note-t a { color: var(--ivory); }
html[data-theme="light"] .post .codebox pre, html[data-theme="light"] .post .codebox pre code { color: #f2f2f2; }
html[data-theme="light"] .post .codebox .lbl { color: var(--amber); }
html[data-theme="light"] :is(.post .codebox .copy, .card a.b, a.b, .post a.btn-amber, .post .btn-amber) { color: #020202; }

/* ---- v2 #108: Studio live QA (P2.2–P2.4, P3.1, P3.2) ---- */
/* P2.2: footer .roll clips “Guides & Notes” / “Útmutatók és jegyzetek” at ≤430px. */
.foot .roll > span { white-space: nowrap; }
@media (max-width: 480px) {
  .foot-grid > div { grid-template-columns: 72px minmax(0, 1fr); }
  .foot ul { grid-template-columns: minmax(0, 1fr); }
}

/* P2.3: HU mobile menu label fit only; ≤900px menu otherwise unchanged. */
@media (max-width: 900px) {
  #nav-menu a .roll > span { white-space: nowrap; }
  html[lang="hu"] #nav-menu > a:not(.btn) { font-size: clamp(22px, 7.2vw, 34px); }
}

/* P2.4: light-mode :focus-visible outline must meet ≥3:1 (amber-ink, not amber-on-paper). */
html[data-theme="light"] :focus-visible { outline-color: var(--amber-ink); }
html[data-theme="light"] :is(.lang-sw, .theme-sw):focus-visible { outline-color: var(--amber-ink); }
html[data-theme="light"] .note:has(:focus-visible) { outline-color: var(--amber-ink); }
html[data-theme="light"] .kit:has(:focus-visible)::before { box-shadow: inset 0 0 0 2px var(--amber-ink); }

/* P3.1: skip link is dark ink on amber in light mode (no --ink token; --ivory is ink then). */
html[data-theme="light"] a.skip { color: var(--ivory); }

/* P3.2: visible breadcrumb separators. */
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }

/* 2026-12-01: longer menu labels (Claude handbook / Free guides) must never wrap or clip.
   Desktop only; the mobile menu (<=900px) is untouched. Between 901 and 1180px the social
   icons leave the header (they stay in the footer) so the bar still fits on one line. */
@media (min-width: 901px) {
  .nav-menu > a .roll, .nav-menu > a .roll > span { white-space: nowrap; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .nav-menu > .soc { display: none; }
}
