/* ==========================================================================
   Alfred — base + global chrome · redesign 2026-07
   Ported from Alfred.dc.html global <style> block + top bar / sticky nav /
   footer markup. Depends on variables.css. Section-specific CSS lives with
   parts 2–6; everything here is the shared contract (see NOTES.md).
   ========================================================================== */

/* ── 1 · reset + document ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  interpolate-size: allow-keywords;   /* soft native <details> open (FAQ) */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* anchor targets clear the fixed sticky bar (62px) */
[id] { scroll-margin-top: var(--sticky-h); }

body {
  background: var(--navy);            /* page body IS navy (prototype)    */
  color: var(--cream);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--brass); color: var(--navy); }

[hidden] { display: none !important; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul[class], ol[class] { list-style: none; }
fieldset { border: none; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }

/* ── 2 · typography ──────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  text-wrap: balance;
}
h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
}
p { text-wrap: pretty; }

.al-eyebrow {
  font: 600 var(--fs-eyebrow) var(--sans);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--brass);
}
.al-eyebrow + h2 { margin-top: 12px; }   /* the recurring eyebrow→H2 rhythm */

.al-lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  max-width: 60ch;
}
.on-navy .al-lead { color: var(--cream-a82); }
.on-cream .al-lead,
.on-cream2 .al-lead,
.on-mist .al-lead { color: var(--graphite); }

/* ── 3 · focus + skip link ───────────────────────────────────────────── */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.al-skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--brass);
  color: var(--navy);
  font: 600 14px var(--sans);
  padding: 12px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.al-skip:focus { left: 12px; }

/* ── 4 · layout + section alternation ────────────────────────────────── */
.al-wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
/* goes on the <section> element itself: <section class="on-navy al-section"> */
.al-section { padding-block: var(--section-y); }

.on-navy   { background: var(--navy);    color: var(--cream); }
.on-cream  { background: var(--cream);   color: var(--navy); }
.on-cream2 { background: var(--cream-2); color: var(--navy); }
.on-mist   { background: var(--mist);    color: var(--graphite); } /* risk strip */

/* ── 5 · buttons ─────────────────────────────────────────────────────── */
.al-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 15px/1.2 var(--sans);
  padding: 15px 24px;
  min-height: 44px;                    /* tap target */
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}

.al-btn--solid { background: var(--brass); color: var(--navy); }
.al-btn--solid:hover { background: var(--brass-hover); }

.al-btn--outline { border-color: var(--brass); color: var(--navy); background: transparent; }
.al-btn--outline:hover { background: var(--brass-a12); }
.on-navy .al-btn--outline,
.al-sticky .al-btn--outline,
.al-topbar .al-btn--outline { border-color: var(--brass-a60); color: var(--cream); }
.on-navy .al-btn--outline:hover,
.al-sticky .al-btn--outline:hover,
.al-topbar .al-btn--outline:hover { background: var(--brass-a14); }

.al-btn--sm { font-size: 13px; padding: 9px 14px; }   /* sticky "Rezerviraj" */
.al-btn--md { font-size: 14px; padding: 12px 18px; }  /* bridge/paketi CTAs  */

/* hero/final CTA row; children go full-width under 640px */
.al-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ── 6 · shared atoms (used by nearly every section) ─────────────────── */
/* line-art SVG default: <svg class="al-illo" …> */
.al-illo {
  stroke: var(--brass);
  stroke-width: var(--illo-sw);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* sage checkmark 15–16px: <svg class="al-check" viewBox="0 0 16 16" …><path d="M3 8.5l3.5 3.5L13 4"/></svg> */
.al-check {
  stroke: var(--sage);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
/* brass separator dot (spec strip) */
.al-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
  flex: none;
}
.al-logo { overflow: visible; }   /* inline logo SVGs (text sticks out)   */

/* ── 7 · shared keyframes (prototype-global; sections reuse) ─────────── */
@keyframes blink    { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pulseDot { 0%, 100% { opacity: .4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }
@keyframes dash     { to { stroke-dashoffset: -100; } }
@keyframes danGrow  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes glow     { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes slideDown{ from { transform: translateY(-100%); } to { transform: none; } }

/* ── 8 · global behaviors from the prototype style block ─────────────── */
/* scroll reveal — progressive enhancement, no JS */
@supports (animation-timeline: view()) {
  [data-reveal] {
    animation: fadeUp .55s ease both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

/* FAQ: native exclusive <details name="faq">, soft open, rotating marker */
details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size .35s ease, content-visibility .35s allow-discrete;
}
details[open]::details-content { block-size: auto; }
details[open] .al-faq-mark { transform: rotate(45deg); }

/* En dan: progress bar pauses on section hover; hidden for reduced motion.
   The En-dan section root must carry class="al-dan". */
.al-dan:hover .al-danbar { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .al-danbar { display: none; } }

/* ── 9 · global chrome: top bar ──────────────────────────────────────── */
.al-topbar { background: var(--navy); }
.al-topbar .al-wrap {
  padding-block: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.al-topbar-cta {                       /* modifier on .al-btn.al-btn--outline */
  font-size: 13px;
  letter-spacing: .01em;
  padding: 10px 17px;
  border-color: var(--brass-a50);
  white-space: nowrap;
}

/* ── 10 · global chrome: sticky mini-nav ─────────────────────────────── */
.al-sticky {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: rgba(11, 25, 41, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--brass-a30);
  animation: slideDown var(--t-slide) var(--ease);
}
.al-sticky .al-wrap {
  padding-block: 9px;                  /* 9 + 44 + 9 = 62px = --sticky-h  */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.al-sticky-links { display: flex; gap: 24px; }
.al-sticky-links a {
  font: 500 13px var(--sans);
  color: var(--cream-a75);
  text-decoration: none;
  padding: 6px 0;
  transition: color var(--t-fast) var(--ease);
}
.al-sticky-links a:hover { color: var(--cream); }
.al-sticky-ctas { display: flex; gap: 10px; align-items: center; }
.al-sticky-ghost {                     /* "Brezplačen posvet" text link   */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 600 13px var(--sans);
  color: var(--cream-a85);
  text-decoration: none;
  padding: 8px 12px;
}
.al-sticky-ghost:hover { color: var(--cream); }

/* ── 11 · global chrome: footer ──────────────────────────────────────── */
.al-footer { background: var(--navy); color: var(--cream); }
.al-footer .al-wrap { padding-block: clamp(40px, 6vw, 64px); }

.al-footer-nav {
  padding-top: 30px;
  border-top: 1px solid var(--brass-a25);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  font: 500 var(--fs-small) var(--sans);
}
.al-footer-nav a {
  color: var(--cream-a75);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.al-footer-nav a:hover { color: var(--cream); }
.al-footer-nav .al-footer-top { color: var(--brass); margin-left: auto; }

.al-footer-brand {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: flex-end;
  justify-content: space-between;
}
.al-footer-imprint {
  font-size: var(--fs-micro);
  line-height: 1.7;
  color: var(--cream-a60);
  text-align: right;
  max-width: none;
}
.al-footer-imprint a {
  color: var(--cream-a75);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--brass-a50);
}
.al-footer-imprint a:hover { color: var(--cream); }

.al-footer-legal {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--brass-a18);
}
.al-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font: 500 var(--fs-small) var(--sans);
}
.al-footer-links a {
  color: var(--cream-a75);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.al-footer-links a:hover { color: var(--cream); }
.al-footer-fine {
  margin-top: 14px;
  font-size: var(--fs-micro);
  line-height: 1.7;
  color: var(--cream-a60);
  max-width: none;
}

/* ── 12 · responsive collapses (prototype-global; breakpoints 820/640) ─ */
@media (max-width: 820px) {
  .al-sticky-links { display: none !important; }
  /* section grids — class contract for parts 2–6 */
  .al-hero      { grid-template-columns: 1fr !important; }
  .al-hero-art  { display: none !important; }
  .al-priv      { grid-template-columns: 1fr !important; }
  .al-steps     { grid-template-columns: 1fr !important; }
  .al-manifesto { grid-template-columns: 1fr !important; }
  .al-form      { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  .al-cta .al-btn, .al-cta a { flex: 1 1 100%; text-align: center; }
}

/* ── 13 · reduced motion: global kill (prototype rule) ───────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   14 · LEGACY COMPAT — keeps rezervacija.html, hvala*.html, legal pages
   and 404 usable while parts 2–6 are being ported (they still load the
   old components.css and old class names). DELETE after the full port.
   ═══════════════════════════════════════════════════════════════════════ */
.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
/* only sections WITHOUT the new .al-section class get auto padding */
section:not(.al-section) { padding-block: clamp(40px, 7vw, 96px); }

.eyebrow {
  font: 600 var(--fs-eyebrow) var(--sans);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 12px;
}
.lead { font-size: var(--fs-lead); line-height: 1.6; max-width: 60ch; }
.micro { font-size: var(--fs-micro); opacity: .75; max-width: var(--measure); }

.skip-link {
  position: absolute;
  left: -999px; top: 0;
  z-index: 100;
  background: var(--brass);
  color: var(--navy);
  padding: 12px 18px;
  text-decoration: none;
}
.skip-link:focus { left: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 15px/1.2 var(--sans);
  text-decoration: none;
  text-align: center;
  padding: 15px 24px;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-primary { background: var(--brass); color: var(--navy); }
.btn-primary:hover { background: var(--brass-hover); }
.btn-ghost { background: transparent; border-color: var(--brass-a60); color: var(--cream); }
.btn-ghost:hover { background: var(--brass-a14); }
.on-cream .btn-ghost, .on-cream2 .btn-ghost { border-color: var(--brass); color: var(--navy); }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* old JS reveal (app.js IntersectionObserver) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

/* old form primitives (rezervacija.html) — inputs on navy use the panel */
label { display: block; font-weight: 600; margin-bottom: 8px; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  font: 400 16px var(--sans);       /* 16px floor — no iOS zoom */
  color: var(--cream);
  background: var(--navy-panel);
  border: 1px solid var(--brass-a40);
  border-radius: var(--radius);
  padding: 13px 15px;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--brass); }
.field { margin-bottom: 24px; }
.field-error { color: #E08D6D; font-size: var(--fs-small); margin-top: 4px; }
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  margin-bottom: 8px;
}
.choice input { width: auto; min-height: 0; margin-top: 5px; }
/* ═══ end LEGACY COMPAT ═══ */
