/* ==========================================================================
   Vitamin Horgoš — brand.css  (Orbis Premium 2: the brochure layer)
   Wave edge, charcoal texture, script accent, spice-table and duotone section
   grounds. Owned by the sections agent; see _tools/premium2/AGENT_BRIEF.md.

   API
   .wave-top            the pack/brochure wave on the element's top edge, in --wave-color, sitting over the previous
                        section (the element must not clip its overflow). .wave-bottom: the same, mirrored, at the
                        bottom edge. An element takes one of the two (both use ::after); for a second wave, or on an
                        element whose ::after is taken, add <span class="wave wave--top|--bottom" aria-hidden="true"> and .has-wave on the element.
   --wave-color         defaults to the ground of .section--burgundy / --black / --dark / --cream / --white, else burgundy.
   .wave-top--anim      (or .wave--anim) a calm drift, translateX ±12px over 12 s; static under reduced motion.
   .tex-charcoal        low-opacity grain under the content (::before, z-index -1, isolates the element).
                        .section--black / --dark / --burgundy have it by default; .no-tex switches it off.
   .script-accent       decorative Cormorant italic 300 line in gold; --gold-ink on light grounds. Never the only
                        carrier of information.
   .sbg                 a full-bleed section photo layer (aria-hidden, first child of a section): a tiny blurred
                        preview at once, the real file only when the section comes near (js/main.js initGrounds
                        adds .is-near), parallax ±4 % on desktop. Premium 3: every dark band gets one, with the owner's
                        background images (.sbg--pozadina .sbg--p1|2|3).
   ========================================================================== */

/* wave tokens (--wave-h, --wave-tile, --wave-mask): css/base.css – they set paddings, so they must be there at first layout */

/* ---------- wave edge ---------- */
.section--burgundy { --wave-color: var(--ground-burgundy); }
.section--black, .section--dark { --wave-color: var(--ground-black); }
.section--cream { --wave-color: var(--cream); }
.section--white, .section--paper { --wave-color: var(--warm-white); }
/* (home: the trust band under the hero has no wave – the hero ends in a straight line) */
:where(.wave-top, .wave-bottom) { position: relative; }
/* the wave is 16px wider on each side for its drift; clip that sideways only (the wave itself sits outside vertically) */
.wave-top, .wave-bottom { overflow-x: clip; }
/* premium 3: an element that carries a .wave span adds .has-wave itself (an unscoped :has(> .wave) made every style
   recalculation test every element; no page uses a .wave span today) */
.has-wave { overflow-x: clip; }
@supports not (overflow: clip) {
  .wave-top::after, .wave-bottom::after, .wave { left: 0; right: 0; animation: none !important; }
}
.wave-top::after, .wave-bottom::after, .wave {
  content: "";
  position: absolute;
  left: -16px;
  right: -16px;
  z-index: 1;
  height: var(--wave-h);
  background: var(--wave-color, var(--ground-burgundy));
  -webkit-mask: var(--wave-mask) repeat-x 0 0 / var(--wave-tile) 100%;
  mask: var(--wave-mask) repeat-x 0 0 / var(--wave-tile) 100%;
  pointer-events: none;
}
.wave-top::after, .wave--top { bottom: 100%; margin-bottom: -1px; }  /* 1px overlap: no hairline at the seam */
.wave-bottom::after, .wave--bottom { top: 100%; margin-top: -1px; scale: 1 -1; }
.wave-top--anim::after, .wave-bottom.wave-top--anim::after, .wave--anim { animation: vh-wave-drift 6s ease-in-out infinite alternate; }
@keyframes vh-wave-drift {
  from { transform: translateX(-12px); }
  to { transform: translateX(12px); }
}

/* ---------- charcoal texture ---------- */
:where(.tex-charcoal) { position: relative; }
.tex-charcoal, .section--black, .section--dark, .section--burgundy { isolation: isolate; }
.tex-charcoal::before, .section--black::before, .section--dark::before, .section--burgundy::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/textures/grain.png") repeat 0 0 / 160px 160px;
  opacity: 0.7;
  pointer-events: none;
}
.no-tex::before { content: none; }

/* script accent: typography in css/base.css (render-blocking, it sets the line height) */

/* ---------- section photo layer ---------- */
.sbg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.sbg__img {
  position: absolute;
  inset: -5% 0;  /* room for the ±4 % parallax */
  background: var(--ground-black) center / cover no-repeat;
}
.sbg.is-plx .sbg__img { will-change: transform; }
.sbg::after { content: ""; position: absolute; inset: 0; }

/* ---------- Premium 3: the owner's background images under every dark band (js/main.js initGrounds) ----------
   .sbg--pozadina .sbg--p1|2|3: a ~1 KB blurred preview at once, the real file only when the band comes near
   (.is-near): a soft-focus copy (960 on phones, 1920 elsewhere; _tools/images/export-pozadina.py), so the scene's light
   and colour stay but no print on the packs reads through behind body text. The photo covers the top of the band (at most 1300px, so a
   tall band never shows a blown-up crop) and fades into the band's own colour; over it a tint in that colour at
   88 % (90 % on burgundy), solid along the top edge so the band's wave stays seamless; the grain stays on top
   (the layer sits at z-index -2, under the ::before grain). ±4 % parallax on desktop (VH.parallax). Text contrast
   is measured on the rendered pixels by _tools/qa/contrast-rendered.mjs. */
.sbg--pozadina { z-index: -2; }
.sbg--pozadina .sbg__img {
  inset: -4% 0 auto 0;
  height: min(108%, 1300px);
  background-color: transparent;
  background-position: var(--bg-focus, 66% 58%);
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 62%, transparent 100%);
}
.sbg--p1 { --bg-focus: 68% 60%; }
.sbg--p2 { --bg-focus: 64% 58%; }
.sbg--p3 { --bg-focus: 66% 60%; }
.sbg--p1 .sbg__img { background-image: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAA0JCgsKCA0LCgsODg0PEyAVExISEyccHhcgLikxMC4pLSwzOko+MzZGNywtQFdBRkxOUlNSMj5aYVpQYEpRUk//2wBDAQ4ODhMREyYVFSZPNS01T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0//wAARCAAOABgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDi7y7+3vvflzUtppszLvMZK0RQwquVTmrX9q3FvF5atwK579Ed0Ir4pCTWs625YRYRDnNFRyajcT2pDudpPSilp1HzW+E//9k="); }
.sbg--p1.is-near .sbg__img {
  background-image: url("../assets/images/pozadina/pozadina-1-soft-1920.jpg");
  background-image: image-set(url("../assets/images/pozadina/pozadina-1-soft-1920.webp") type("image/webp"), url("../assets/images/pozadina/pozadina-1-soft-1920.jpg") type("image/jpeg"));
}
.sbg--p2 .sbg__img { background-image: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAA0JCgsKCA0LCgsODg0PEyAVExISEyccHhcgLikxMC4pLSwzOko+MzZGNywtQFdBRkxOUlNSMj5aYVpQYEpRUk//2wBDAQ4ODhMREyYVFSZPNS01T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0//wAARCAAOABgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDhri5N580nLVNptg9zJgL71Kvko2BEKeLyS1bzIvlOMcVzt9Ed1OP2mXLmynjs3zHwDyaKqSapcywkM5weooo9DRJSV7H/2Q=="); }
.sbg--p2.is-near .sbg__img {
  background-image: url("../assets/images/pozadina/pozadina-2-soft-1920.jpg");
  background-image: image-set(url("../assets/images/pozadina/pozadina-2-soft-1920.webp") type("image/webp"), url("../assets/images/pozadina/pozadina-2-soft-1920.jpg") type("image/jpeg"));
}
.sbg--p3 .sbg__img { background-image: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAA0JCgsKCA0LCgsODg0PEyAVExISEyccHhcgLikxMC4pLSwzOko+MzZGNywtQFdBRkxOUlNSMj5aYVpQYEpRUk//2wBDAQ4ODhMREyYVFSZPNS01T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0//wAARCAAOABgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDjbm7F3hpD83rRZWjXMuFGeajSOIH7p/OrcV81m4aFQMdK53pojtp92WbxGgtljZNuOvHJoqvdX8l1hpOuOMUUldGvJGauf//Z"); }
.sbg--p3.is-near .sbg__img {
  background-image: url("../assets/images/pozadina/pozadina-3-soft-1920.jpg");
  background-image: image-set(url("../assets/images/pozadina/pozadina-3-soft-1920.webp") type("image/webp"), url("../assets/images/pozadina/pozadina-3-soft-1920.jpg") type("image/jpeg"));
}
/* the tint: the band's own colour – solid at the top edge (the wave), ~86 % over the photo, solid again where the photo
   has faded out */
.sbg--pozadina::after { --tint: 21, 17, 15; --tint-a: 0.88; background: linear-gradient(180deg, rgb(var(--tint)) 0, rgba(var(--tint), var(--tint-a)) 64px, rgba(var(--tint), var(--tint-a)) min(70%, 900px), rgb(var(--tint)) min(100%, 1300px)); }
/* burgundy is the darker ground for gold (7.4:1 when plain), so its tint is a step stronger (the brief: raise the
   overlay where a section would fail) */
.section--burgundy > .sbg--pozadina::after { --tint: 74, 14, 18; --tint-a: 0.88; }
/* text over a photo band: a lighter gold (≥ 8:1 on the tinted ground) and the body text at 90 % cream */
.has-pozadina { --gold: #E4C47A; --on-dark-body: rgba(245, 240, 232, 0.9); }
/* phones, burgundy bands at the 88 % veil (final polish §3.3): the small gold labels one step lighter, still ≥ 7:1 */
@media (max-width: 700px) { .section--burgundy.has-pozadina { --gold: #EDD596; } }
/* the pinned route: the photo stays behind the viewport-sized stage, a little darker under the moving path */
.route .sbg--pozadina .sbg__img { inset: -4% 0; height: auto; -webkit-mask-image: none; mask-image: none; }
.route .sbg--pozadina::after { background: rgba(21, 17, 15, 0.88); }

/* phones: the 960px files */
@media (max-width: 900px) {
  .sbg--p1.is-near .sbg__img {
    background-image: url("../assets/images/pozadina/pozadina-1-soft-960.jpg");
    background-image: image-set(url("../assets/images/pozadina/pozadina-1-soft-960.webp") type("image/webp"), url("../assets/images/pozadina/pozadina-1-soft-960.jpg") type("image/jpeg"));
  }
  .sbg--p2.is-near .sbg__img {
    background-image: url("../assets/images/pozadina/pozadina-2-soft-960.jpg");
    background-image: image-set(url("../assets/images/pozadina/pozadina-2-soft-960.webp") type("image/webp"), url("../assets/images/pozadina/pozadina-2-soft-960.jpg") type("image/jpeg"));
  }
  .sbg--p3.is-near .sbg__img {
    background-image: url("../assets/images/pozadina/pozadina-3-soft-960.jpg");
    background-image: image-set(url("../assets/images/pozadina/pozadina-3-soft-960.webp") type("image/webp"), url("../assets/images/pozadina/pozadina-3-soft-960.jpg") type("image/jpeg"));
  }
}

@media (prefers-reduced-motion: reduce) {
  .wave-top--anim::after, .wave--anim { animation: none; }
  .sbg__img { transform: none !important; }
}
@media print {
  .sbg, .wave, .wave-top::after, .wave-bottom::after, .tex-charcoal::before, .section--black::before, .section--dark::before, .section--burgundy::before { display: none; }
}
