/* socials.idzan.hr — single page, no third-party resources.
   Colors match idzan.hr (Settings → Colors in the CMS). Change them here. */

/* ---------- Themes ----------
   Dark is the idzan.hr palette. Light is derived from it: yellow stays for
   buttons and fills, links/icons use a darker amber so they stay readable.
   Which theme shows: the visitor's choice (theme button), otherwise their
   system setting. To always start dark, see DEFAULT in assets/js/theme.js. */
:root {
  --c-primary:   #1F2022; /* page background */
  --c-secondary: #2B2B2B; /* cards, bands, footer */
  --c-text:      #FDFBFB; /* all text */
  --c-accent:    #FFB900; /* buttons, fills, highlights */

  --c-accent-ink:    #FFB900;               /* accent used as text, icons, borders */
  --c-accent-hover:  #FFC733;
  --c-accent-soft:   rgba(255, 185, 0, .12); /* icon tiles, pills */
  --c-accent-border: rgba(255, 185, 0, .40);
  --c-muted:   rgba(253, 251, 251, .68);
  --c-line:    rgba(253, 251, 251, .10);
  --c-ghost-border: rgba(253, 251, 251, .28);
  --c-raised:  #333334;                      /* card hover */
  --c-on-accent: #1F2022;
  --c-track:   rgba(253, 251, 251, .22);     /* consent switch, off */
  --c-knob:    #FDFBFB;
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .40);

  --radius: 14px;
  --gap: 12px;
  --maxw: 760px;

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  color-scheme: dark;
}

/* Light theme: when chosen with the button, or when the system is light and
   nothing was chosen. Keep both blocks the same. */
:root[data-theme="light"] {
  --c-primary:   #F5F3EF;
  --c-secondary: #FFFFFF;
  --c-text:      #1F2022;
  --c-accent:    #FFB900;

  --c-accent-ink:    #8A5A00;
  --c-accent-hover:  #FFC733;
  --c-accent-soft:   rgba(255, 185, 0, .18);
  --c-accent-border: rgba(138, 90, 0, .45);
  --c-muted:   #5E5F63;
  --c-line:    rgba(31, 32, 34, .12);
  --c-ghost-border: rgba(31, 32, 34, .30);
  --c-raised:  #FFF8E8;
  --c-on-accent: #1F2022;
  --c-track:   rgba(31, 32, 34, .22);
  --c-knob:    #FFFFFF;
  --shadow-lg: 0 18px 50px rgba(31, 32, 34, .18);
  --shadow-sm: 0 6px 18px rgba(31, 32, 34, .14);

  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --c-primary:   #F5F3EF;
    --c-secondary: #FFFFFF;
    --c-text:      #1F2022;
    --c-accent:    #FFB900;

    --c-accent-ink:    #8A5A00;
    --c-accent-hover:  #FFC733;
    --c-accent-soft:   rgba(255, 185, 0, .18);
    --c-accent-border: rgba(138, 90, 0, .45);
    --c-muted:   #5E5F63;
    --c-line:    rgba(31, 32, 34, .12);
    --c-ghost-border: rgba(31, 32, 34, .30);
    --c-raised:  #FFF8E8;
    --c-on-accent: #1F2022;
    --c-track:   rgba(31, 32, 34, .22);
    --c-knob:    #FFFFFF;
    --shadow-lg: 0 18px 50px rgba(31, 32, 34, .18);
    --shadow-sm: 0 6px 18px rgba(31, 32, 34, .14);

    color-scheme: light;
  }
}

/* Self-hosted Roboto, same as idzan.hr. Copy the woff2 files into assets/fonts/
   (see README). If they're missing, the system font is used instead. */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap;
  src: local("Roboto"), local("Roboto-Regular"), url("../fonts/roboto-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap;
  src: local("Roboto Medium"), local("Roboto-Medium"), url("../fonts/roboto-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap;
  src: local("Roboto Bold"), local("Roboto-Bold"), url("../fonts/roboto-700.woff2") format("woff2"); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--c-primary);
  color: var(--c-text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2 { font-weight: 700; line-height: 1.2; margin: 0; }
p { margin: 0 0 .9em; }
:focus-visible { outline: 2px solid var(--c-accent-ink); outline-offset: 3px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--c-accent); color: var(--c-on-accent);
  padding: 8px 14px; border-radius: 8px; font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 16px 24px;
}
.block { margin-top: 40px; }
.block > h2 {
  font-size: .8rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--c-muted);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.block > h2::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }

/* ---------- Profile ---------- */
.profile { text-align: center; }
.avatar {
  position: relative;
  width: 148px; height: 148px; margin: 0 auto 20px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 200deg, var(--c-accent), rgba(255,185,0,.15) 55%, var(--c-accent));
}
.avatar img, .avatar-fallback {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--c-primary);
  background: var(--c-secondary);
}
.avatar-fallback {
  display: none; place-items: center;
  font-size: 2.6rem; font-weight: 700; color: var(--c-accent-ink);
}
.avatar.no-photo img { display: none; }
.avatar.no-photo .avatar-fallback { display: grid; }

.profile h1 { font-size: clamp(2rem, 6vw, 2.75rem); letter-spacing: -.01em; }
.tagline {
  margin: 14px auto 0; max-width: 34em;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  color: var(--c-muted); font-size: .92rem;
}
.tagline span {
  white-space: nowrap;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--c-line); background: var(--c-secondary);
}

/* ---------- Buttons ---------- */
.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 1rem/1.2 var(--font);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn-primary { background: var(--c-accent); color: var(--c-on-accent); }
.btn-primary:hover { background: var(--c-accent-hover); }
.btn-ghost { background: transparent; color: var(--c-text); border-color: var(--c-ghost-border); }
.btn-ghost:hover { border-color: var(--c-accent-ink); color: var(--c-accent-ink); }
.btn:active { transform: translateY(1px); }

.text-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--c-accent-ink); text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Link cards ---------- */
.links {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap);
}
.link {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 16px;
  background: var(--c-secondary);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  color: var(--c-text); text-decoration: none;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.link > .ico:first-child {
  width: 38px; height: 38px; padding: 9px;
  border-radius: 10px;
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
}
/* Brand icons (official logos, inlined by tools/brand-icons.py).
   --brand-icon: color of single-color logos. White is allowed by nearly every
   brand's guidelines; recoloring logos to the accent usually isn't. */
.link > .ico-brand:first-child {
  --brand-icon: var(--c-text);
  --brand-tile: var(--c-primary);
  fill: currentColor; stroke: none;
  color: var(--brand-icon);
  background: var(--brand-tile);
  padding: 8px;
}
/* These match the shared icon definitions in the sprite, so they can't be scoped to .ico-brand */
.knock { fill: var(--brand-tile, var(--c-primary)); }   /* cut-out parts of a logo, e.g. the "f" in a circle */
.line {                                                 /* generic placeholder until a logo is added */
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.link > .ico-brand.has-placeholder:first-child { color: var(--c-accent-ink); background: var(--c-accent-soft); padding: 9px; }

.link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-name { font-weight: 500; line-height: 1.3; }
.link-handle {
  font-size: .85rem; color: var(--c-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link .arrow { width: 18px; height: 18px; color: var(--c-muted); transition: color .15s, transform .15s; }
.link:hover { border-color: var(--c-accent-ink); background: var(--c-raised); }
.link:hover .arrow { color: var(--c-accent-ink); transform: translate(2px, -2px); }
.link-accent { border-color: var(--c-accent-border); }

/* ---------- QR + vCard ---------- */
.card-row {
  display: flex; align-items: center; gap: 24px;
  background: var(--c-secondary); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 20px;
}
.qr { margin: 0; flex: none; text-align: center; }
.qr img { width: 150px; height: 150px; border-radius: 10px; background: #fff; padding: 8px; }
.qr figcaption { margin-top: 8px; font-size: .8rem; color: var(--c-muted); }
.qr.is-missing { display: none; }
.card-text p { color: var(--c-muted); }

/* ---------- Policy content ---------- */
.consent-status { color: var(--c-text); }

.table-wrap { overflow-x: auto; margin-bottom: .9em; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--c-line); }
th { color: var(--c-text); font-weight: 500; background: var(--c-secondary); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; color: var(--c-accent-ink); }

.cats { margin: 0 0 .9em; }
.cats dt { color: var(--c-text); font-weight: 500; margin-top: 10px; }
.cats dd { margin: 2px 0 0; }
.pill {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: 999px; font-size: .75rem; font-weight: 500;
  background: var(--c-accent-soft); color: var(--c-accent-ink);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px; padding: 28px 16px max(28px, env(safe-area-inset-bottom));
  background: var(--c-secondary);
  border-top: 1px solid var(--c-line);
  text-align: center; font-size: .9rem; color: var(--c-muted);
}
.legal-links {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.legal-links a, .legal-links .text-btn { font-weight: 500; }
.legal-links [aria-current="page"] { color: var(--c-text); text-decoration: none; }
.site-footer p { margin: 0; }

/* ---------- Policy pages ---------- */
.doc { max-width: 680px; }
.back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--c-muted); text-decoration: none; font-weight: 500;
  margin-bottom: 28px;
}
.back:hover { color: var(--c-accent-ink); }
.back .ico { width: 18px; height: 18px; }
.doc-head { padding-bottom: 20px; border-bottom: 1px solid var(--c-line); margin-bottom: 8px; }
.doc-head h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.doc-head p { color: var(--c-muted); margin: 10px 0 0; }
.doc section { padding-top: 24px; }
.doc h2 { font-size: 1.15rem; margin-bottom: 10px; }
.doc section p, .doc section li, .doc .cats dd { color: var(--c-muted); }
.doc section strong { color: var(--c-text); }
.doc ul { margin: 0 0 .9em; padding-left: 1.2em; }
.doc li { margin-bottom: 4px; }
.doc li::marker { color: var(--c-accent-ink); }
.summary-box {
  margin-top: 24px; padding: 18px 20px;
  background: var(--c-secondary); border: 1px solid var(--c-accent-border);
  border-radius: var(--radius);
}
.summary-box p { color: var(--c-text); }
.summary-box p:last-child { margin-bottom: 0; }

/* ---------- Consent banner ---------- */
.consent {
  position: fixed; z-index: 50;
  left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
  background: var(--c-secondary);
  border: 1px solid var(--c-accent-border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: rise .25s ease-out;
}
.consent[hidden] { display: none; }
.consent-inner { padding: 20px; max-height: calc(100vh - 32px); overflow-y: auto; }
.consent h2 { font-size: 1.15rem; margin-bottom: 8px; }
.consent h2:focus { outline: none; }
.consent p { color: var(--c-muted); font-size: .92rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consent-actions .btn { flex: 1 1 auto; min-height: 44px; padding: 10px 16px; font-size: .95rem; }

.consent-prefs fieldset { border: 0; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.switch {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--c-primary);
  cursor: pointer;
}
.switch em { font-style: normal; font-size: .8rem; color: var(--c-accent-ink); margin-left: 6px; }
.switch input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 40px; height: 22px; border-radius: 999px;
  background: var(--c-track); position: relative; cursor: pointer;
  transition: background-color .15s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--c-knob);
  transition: transform .15s;
}
.switch input:checked { background: var(--c-accent); }
.switch input:checked::after { transform: translateX(18px); background: var(--c-on-accent); }
.switch input:disabled { opacity: .6; cursor: not-allowed; }

.consent-fab {
  position: fixed; z-index: 40;
  left: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-secondary); color: var(--c-accent-ink);
  border: 1px solid var(--c-line); cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.consent-fab[hidden] { display: none; }
.consent-fab:hover { border-color: var(--c-accent-ink); }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Theme toggle ---------- */
.page { position: relative; }
.theme-toggle {
  position: absolute; z-index: 5;
  top: max(16px, env(safe-area-inset-top)); right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-secondary); color: var(--c-text);
  border: 1px solid var(--c-line); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--c-accent-ink); color: var(--c-accent-ink); }
.theme-toggle .ico { width: 20px; height: 20px; }
/* Show the icon of the mode you'd switch TO: moon in light mode, sun in dark mode */
.theme-toggle .i-to-light { display: block; }
.theme-toggle .i-to-dark  { display: none; }
:root[data-theme="light"] .theme-toggle .i-to-light { display: none; }
:root[data-theme="light"] .theme-toggle .i-to-dark  { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .i-to-light { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .i-to-dark  { display: block; }
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .page { padding-top: 32px; }
  .links, .cta-row { grid-template-columns: 1fr; }
  .card-row { flex-direction: column; text-align: center; }
  .card-text .btn { width: 100%; }
}

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

@media print {
  .consent, .consent-fab, .skip-link, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
