/*
Theme Name: De Mari
Theme URI: https://www.demari.hr
Author: De Mari
Description: Custom WordPress theme for De Mari Art Studio — a Swiss-informed, gallery-minded design built from native Gutenberg blocks. No shop, no front-end accounts. Forms are handled through Web3Forms.
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: demari
*/

/* ============================================================
   1. Tokens
   ============================================================ */

:root {
  --ink: #0e273c;
  --ink-80: rgba(14, 39, 60, 0.8);
  --blue: #2b5672;
  --blue-deep: #1f4157;
  --paper: #f8f4ef;
  --sand: #e6ddd1;
  --white: #ffffff;
  --seal: #c8553d;
  --line: rgba(14, 39, 60, 0.16);
  --line-strong: rgba(14, 39, 60, 0.4);
  --paper-line: rgba(248, 244, 239, 0.24);

  --font-body: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-display: "EB Garamond", Georgia, "Times New Roman", serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(56px, 8vw, 112px);

  --fs-sm: 0.875rem;
  --fs-md: 1.0625rem;
  --fs-lg: clamp(1.25rem, 2vw, 1.5rem);
  --fs-h1: clamp(2.5rem, 6vw, 4.5rem);
  --fs-h2: clamp(1.9rem, 3.6vw, 3rem);
  --fs-h3: clamp(1.3rem, 2vw, 1.7rem);
  --fs-h4: clamp(1.1rem, 1.4vw, 1.3rem);
  --fs-eyebrow: 0.72rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   2. Base
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;

  /* Rem base - EB Garamond reads small; whole site sized +20% (19.2px) */
  font-size: 19.2px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.demari-nav-open {
  overflow: hidden;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(43, 86, 114, 0.4);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

a:hover {
  color: var(--seal);
  text-decoration-color: var(--seal);
}

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ============================================================
   3. Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.6em;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1, .wp-block-heading.is-style-h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2, .wp-block-heading {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-h4);
}

p {
  margin: 0 0 1.15em;
  max-width: 64ch;
}

p:last-child {
  margin-bottom: 0;
}

.has-text-align-center {
  max-width: none;
}

ul, ol {
  max-width: 64ch;
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.35em;
}

strong {
  font-weight: 600;
}

/* ============================================================
   4. Layout scaffolding
   ============================================================ */

.site-main {
  display: block;
  overflow: clip;
}

.page-content {
  margin: 0;
  padding: 0;
}

.page-content > .wp-block-group,
.page-content > *:first-child {
  margin-top: 0;
}

/* Section shell — every page section is a constrained group */
.demari-section {
  position: relative;
  padding: var(--section-y) var(--gutter);
}

.demari-section > * {
  max-width: var(--wrap);
  margin-left: auto;
  margin-right: auto;
}

/* Alternating surfaces — colour only, no repeating wave patterns */
.demari-section--standard:nth-of-type(even) {
  background-color: var(--sand);
}

.demari-section--standard:nth-of-type(odd) {
  background-color: var(--paper);
}

/* Decorative suminagashi on selected sections (the system's core motif) */
.demari-section--standard::after {
  content: "";
  position: absolute;
  right: -420px;
  top: 50%;
  transform: translateY(-50%);
  width: min(1260px, 132vw);
  aspect-ratio: 1;
  background: url("assets/img/suminagashi.svg") center / contain no-repeat;
  color: var(--ink);
  opacity: 0.115;
  pointer-events: none;
  z-index: 0;
}

/* Every decor tile dissolves at its edges — no hard seams mid-background */
.demari-section--standard::after,
.demari-section--hero::after,
.site-footer::before,
.site-drawer::after {
  -webkit-mask-image: radial-gradient(closest-side, #000 58%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 58%, transparent 100%);
}

.demari-section--standard:nth-of-type(4n + 3)::after {
  right: auto;
  left: -480px;
  background-image: url("assets/img/suminagashi.svg");
  opacity: 0.1;
}

.demari-section > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   5. Headings, rules, eyebrows
   ============================================================ */

.demari-section .wp-block-heading::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--seal);
  margin-top: 0.55em;
}

.demari-section .wp-block-heading:not(:first-of-type) {
  font-size: var(--fs-h3);
}

.demari-section .wp-block-heading:not(:first-of-type)::after {
  width: 36px;
  height: 2px;
  background: var(--blue);
}

h1.wp-block-heading::after {
  display: none;
}

/* ============================================================
   6. Hero
   ============================================================ */

.demari-section--hero {
  --hero-img-h: clamp(460px, 88vh, 980px);
  background: var(--ink);
  color: var(--paper);
  padding-top: 0;
  padding-bottom: clamp(48px, 7vw, 96px);
}

.demari-section--hero::after {
  content: "";
  position: absolute;
  right: -390px;
  top: -420px;
  width: min(1800px, 186vw);
  aspect-ratio: 1;
  background: url("assets/img/suminagashi-water.svg") center / contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

/* Imageless heroes (forms, short intros): breathing room + centred textures */
.demari-section--hero:not(:has(.wp-block-image)) {
  padding-top: clamp(48px, 7vw, 96px);
}

.demari-section--hero:not(:has(.wp-block-image))::after {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}

/* Full-bleed hero image — tall, anchored to the artwork at the bottom */
.demari-section--hero > .wp-block-image {
  position: relative;
  z-index: 1;
  max-width: none;
  width: calc(100% + 2 * var(--gutter));
  margin-top: 0;
  margin-bottom: clamp(32px, 5vw, 60px);
  margin-left: calc(var(--gutter) * -1) !important;
  margin-right: calc(var(--gutter) * -1) !important;
  overflow: hidden;
  height: var(--hero-img-h);
}

/* Photo oversized by 22% top and bottom — the JS parallax slides it
   between those bounds (pure translate, never scales) */
.demari-section--hero > .wp-block-image img {
  position: absolute;
  top: -22%;
  left: 0;
  display: block;
  width: 100%;
  height: 144%;
  object-fit: cover;
  object-position: center bottom;
  will-change: transform;
}

/* Brand mark overlaid on the image, echoed by an offset coral frame */
.demari-section--hero > .wp-block-image::before {
  content: "";
  position: absolute;
  top: clamp(30px, 5vw, 74px);
  left: clamp(24px, 6vw, 88px);
  width: clamp(104px, 13vw, 190px);
  aspect-ratio: 512 / 419;
  border: 3px solid var(--seal);
  transform: rotate(-4deg) translate(-14px, -14px);
  z-index: 2;
  pointer-events: none;
}

.demari-section--hero > .wp-block-image::after {
  content: "";
  position: absolute;
  top: clamp(30px, 5vw, 74px);
  left: clamp(24px, 6vw, 88px);
  width: clamp(104px, 13vw, 190px);
  aspect-ratio: 512 / 419;
  background: url("assets/img/logo-light.png") center / contain no-repeat;
  z-index: 2;
  pointer-events: none;
}

/* Image heroes — the page title sits directly on the photo: bottom-left,
   aligned to the content column, lifted by a soft ink scrim */
.demari-section--hero:has(> .wp-block-image)::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--hero-img-h);
  background: linear-gradient(
    to top,
    rgba(14, 39, 60, 0.76) 0%,
    rgba(14, 39, 60, 0.34) 28%,
    rgba(14, 39, 60, 0) 55%
  );
  z-index: 2;
  pointer-events: none;
}

.demari-section--hero:has(> .wp-block-image) > .wp-block-heading {
  position: absolute;
  top: var(--hero-img-h);
  left: var(--gutter);
  right: var(--gutter);
  transform: translateY(-100%);
  z-index: 3;
  max-width: var(--wrap);
  margin-top: 0;
  margin-bottom: 0;
  padding-bottom: clamp(24px, 3vw, 44px);
}

.demari-section--hero .wp-block-quote {
  position: relative;
  margin: 0;
  padding: 0.2rem 0 0.2rem clamp(18px, 2.4vw, 34px);
  border-left: 4px solid var(--seal);
}

.demari-section--hero .wp-block-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 34ch;
  color: var(--paper);
}

.demari-section--hero .wp-block-quote cite {
  display: block;
  margin-top: 1.3rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--sand);
}

/* Featured review on recenzije — sized for long copy */
.demari-section--hero .demari-lead-quote p {
  font-size: clamp(1.35rem, 2.6vw, 2.05rem);
  line-height: 1.42;
  max-width: 68ch;
  font-style: italic;
}

.demari-section--hero p.has-text-align-center {
  margin-top: 1.4rem;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(248, 244, 239, 0.72);
}

.demari-section--hero a {
  color: var(--paper);
}

/* Home hero — centred full-logo lockup over a centred crop of the artwork */
.page-id-22 .demari-section--hero {
  --hero-img-h: clamp(560px, calc(100vh - 86px), 1020px);
  padding-bottom: 0;
}

/* Home keeps its centred light lockup — no dark scrim under it */
.page-id-22 .demari-section--hero::before {
  display: none;
}

.page-id-22 .demari-section--hero > .wp-block-image {
  overflow: hidden;
  margin-bottom: 0;
  height: var(--hero-img-h);
}

.page-id-22 .demari-section--hero > .wp-block-image::before,
.page-id-22 .demari-section--hero > .wp-block-image::after {
  display: none;
}

/* Photo is oversized by 22% top and bottom — the parallax slides it
   between those bounds (JS translates, never scales) */
.page-id-22 .demari-section--hero > .wp-block-image img {
  position: absolute;
  top: -22%;
  left: 0;
  width: 150%;
  max-width: none;
  height: 144%;
  object-fit: cover;
  object-position: left 88%;
  will-change: transform;
}

.demari-section--hero .demari-hero-lockup {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(14px, 2.6vh, 30px);
  padding: clamp(24px, 5vh, 64px) var(--gutter);
  max-width: none;
  margin: 0;
  pointer-events: none;
}

.demari-section--hero .demari-hero-lockup p,
.demari-section--hero .demari-hero-lockup blockquote {
  margin-top: 0;
  margin-bottom: 0;
}

.demari-section--hero .demari-hero-logo {
  width: clamp(148px, 16vw, 224px);
  max-width: none;
  margin: 0 !important;
}

.demari-section--hero .demari-hero-logo img {
  width: 100%;
  height: auto;
  background: none;
  object-fit: contain;
}

.demari-section--hero .demari-hero-lockup .wp-block-quote {
  position: relative;
  margin: 0;
  padding: 0;
  border-left: 0;
}

.demari-section--hero .demari-hero-lockup .wp-block-quote p {
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  max-width: 32ch;
  color: var(--ink);
  text-shadow: 0 0 16px rgba(248, 244, 239, 0.9), 0 0 44px rgba(248, 244, 239, 0.75);
}

.demari-section--hero .demari-hero-lockup p.has-text-align-center {
  margin-top: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--ink);
  text-shadow: 0 0 14px rgba(248, 244, 239, 0.9), 0 0 36px rgba(248, 244, 239, 0.7);
}

/* Parallax handled in JS — pure translate between the photo's 22% bounds */

/* ============================================================
   6b. Welcome intro — flowing ink flanks, lead box + body box, centred CTA
   ============================================================ */

.demari-intro {
  text-align: center;
  padding-top: clamp(56px, 7vh, 96px);
  padding-bottom: clamp(48px, 6vh, 84px);
  background-color: var(--sand);
  /* Strip art first, then sand washes that dissolve every box edge —
     top/bottom band + inner-edge fades, so slice-cropped art never cuts hard */
  background-image: linear-gradient(
      rgba(230, 221, 209, 0.4),
      rgba(230, 221, 209, 0.4)
    ),
    linear-gradient(
      to bottom,
      var(--sand) 0,
      rgba(230, 221, 209, 0) 12%,
      rgba(230, 221, 209, 0) 88%,
      var(--sand) 100%
    ),
    linear-gradient(
      to right,
      rgba(230, 221, 209, 0) 0,
      rgba(230, 221, 209, 0) 60%,
      var(--sand) 100%
    ),
    linear-gradient(
      to left,
      rgba(230, 221, 209, 0) 0,
      rgba(230, 221, 209, 0) 60%,
      var(--sand) 100%
    ),
    url("assets/img/suminagashi-strip-l.svg"),
    url("assets/img/suminagashi-strip-r.svg");
  background-repeat: no-repeat;
  background-position: 0 0, 0 0, left top, right top, left top, right top;
  background-size: 100% 100%, 100% 100%, min(410px, 32vw) 100%,
    min(410px, 32vw) 100%, min(410px, 32vw) 100%, min(410px, 32vw) 100%;
}

/* Rings step aside here — this section gets flowing ink instead */
.demari-section--standard.demari-intro::after {
  display: none;
}

.demari-intro::before {
  content: "";
  display: block;
  width: clamp(46px, 6vw, 68px);
  height: 3px;
  background: var(--seal);
  margin: 0 auto clamp(26px, 3.4vw, 40px);
}

.demari-intro > p {
  max-width: 62ch;
  margin: 0 auto 1.1em;
  line-height: 1.8;
  color: var(--ink-80);
}

.demari-intro > p:first-of-type {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.3;
  color: var(--ink);
  max-width: none;
  margin-bottom: clamp(14px, 2vw, 24px);
}

.demari-intro .wp-block-buttons {
  justify-content: center;
  margin-top: clamp(24px, 3.4vw, 42px);
}

/* ============================================================
   7. Quotes & testimonials
   ============================================================ */

.wp-block-quote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.4rem;
  border-left: 3px solid var(--seal);
}

.wp-block-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink);
}

.demari-testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.demari-testimonial {
  position: relative;
  margin: 0;
  padding: clamp(22px, 3vw, 34px);
  background: rgba(248, 244, 239, 0.06);
  border: 1px solid var(--paper-line);
}

.demari-testimonial::before {
  content: "\201C";
  position: absolute;
  top: 0.15em;
  right: 0.35em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 4.4rem;
  line-height: 1;
  color: var(--seal);
  opacity: 0.9;
}

.demari-testimonial .wp-block-quote {
  margin: 0;
  padding: 0;
  border: 0;
}

.demari-testimonial .wp-block-quote p {
  font-size: 1.12rem;
  color: var(--paper);
}

.demari-testimonial .demari-testimonial-author {
  margin-top: 1.2rem;
  font-size: var(--fs-eyebrow) !important;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sand);
}

/* Testimonial section = dark, with light suminagashi rings */
.demari-section:has(.demari-testimonial) {
  background-color: var(--ink);
  color: var(--paper);
  padding-block: clamp(48px, 6vw, 80px);
}

/* Testimonial section = dark, drifting with layered suminagashi flow */
.demari-section:has(.demari-testimonial)::after {
  background-image: url("assets/img/suminagashi-water.svg");
  opacity: 0.19;
}

.demari-section:has(.demari-testimonial) .wp-block-heading {
  color: var(--paper);
}

.demari-section:has(.demari-testimonial) .wp-block-heading::after {
  background: var(--seal);
}

/* One review at a time — slider chrome (cards stay editable blocks) */
.demari-testimonials.is-slider {
  display: block;
  position: relative;
  max-width: 1140px;
  min-height: 250px;
  margin-inline: auto;
}

.demari-testimonials.is-slider .demari-testimonial {
  display: none;
}

/* Height probe — used to lock the track to the tallest slide */
.demari-testimonials.is-slider .demari-testimonial.is-measuring {
  display: block;
  visibility: hidden;
}

.demari-testimonials.is-slider .demari-testimonial.is-active {
  display: block;
  position: relative;
  text-align: center;
  padding: clamp(30px, 3.4vw, 44px) clamp(56px, 6vw, 92px) clamp(26px, 3vw, 40px);
  background: transparent;
  border: 0;
  animation: dm-fade 0.45s var(--ease);
}

/* Thin coral rule above, quiet rule below — centred editorial slides */
.demari-testimonials.is-slider .demari-testimonial::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 3px;
  background: var(--seal);
}

.demari-testimonials.is-slider .demari-testimonial .wp-block-quote p {
  font-size: clamp(1.25rem, 2.1vw, 1.65rem);
  line-height: 1.5;
  max-width: 64ch;
  margin-inline: auto;
}

.demari-testimonials.is-slider .demari-testimonial .demari-testimonial-author {
  margin-top: 1.5rem;
  position: relative;
  padding-top: 1.2rem;
}

.demari-testimonials.is-slider .demari-testimonial .demari-testimonial-author::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 2px;
  background: rgba(248, 244, 239, 0.4);
}

@keyframes dm-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demari-testimonials.is-slider .demari-testimonial.is-active {
    animation: none;
  }
}

/* Sleek chrome — circular arrows pinned to the sides, counter tucked away */
.demari-slider-bar {
  position: absolute;
  inset: 0;
  display: block;
  margin: 0;
  pointer-events: none;
}

.demari-slider-bar .demari-slider-btn {
  position: absolute;
  top: 50%;
  margin-top: -23px;
  pointer-events: auto;
}

.demari-slider-bar .demari-slider-prev {
  left: -78px;
}

.demari-slider-bar .demari-slider-next {
  right: -78px;
}

.demari-slider-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(248, 244, 239, 0.45);
  background: transparent;
  color: var(--paper);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.2s var(--ease);
}

.demari-slider-btn:hover {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--paper);
  transform: translateY(-2px);
}

.demari-slider-btn:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.demari-slider-count {
  position: absolute;
  right: 4px;
  bottom: -34px;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sand);
  min-width: 0;
  text-align: right;
  opacity: 0.85;
}

@media (max-width: 1100px) {
  .demari-slider-bar .demari-slider-prev {
    left: -8px;
  }

  .demari-slider-bar .demari-slider-next {
    right: -8px;
  }
}

@media (max-width: 560px) {
  .demari-slider-bar .demari-slider-prev {
    left: -2px;
  }

  .demari-slider-bar .demari-slider-next {
    right: -2px;
  }
}

/* ============================================================
   8. Images & gallery
   ============================================================ */

.wp-block-image {
  margin: 1.8rem 0;
}

.wp-block-image img {
  background: var(--sand);
}

/* Editorial mosaic — varied spans, fixed rhythm, click to enlarge */
.demari-section > .demari-gallery {
  max-width: 1560px;
}

.demari-gallery {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(200px, 21vw, 330px);
  grid-auto-flow: dense;
  gap: clamp(12px, 1.6vw, 22px);
}

.demari-gallery .wp-block-image {
  margin: 0;
}

.demari-gallery figure {
  position: relative;
  overflow: hidden;
  height: 100%;
  cursor: zoom-in;
}

.demari-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.demari-gallery figure::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 0 var(--seal);
  transition: box-shadow 0.35s var(--ease);
  pointer-events: none;
}

.demari-gallery figure:hover img {
  transform: scale(1.05);
}

.demari-gallery figure:hover::after {
  box-shadow: inset 0 0 0 8px var(--seal);
}

/* 13 images: tall block + stacked pair, triplet row, panorama, halves.
   Desktop placements only — below 1000px the span resets must win. */
@media (min-width: 1001px) {
  .demari-gallery .wp-block-image:nth-child(1) {
    grid-column: span 4;
    grid-row: span 2;
  }

  .demari-gallery .wp-block-image:nth-child(2),
  .demari-gallery .wp-block-image:nth-child(3) {
    grid-column: span 2;
  }

  .demari-gallery .wp-block-image:nth-child(4),
  .demari-gallery .wp-block-image:nth-child(5),
  .demari-gallery .wp-block-image:nth-child(6) {
    grid-column: span 2;
  }

  .demari-gallery .wp-block-image:nth-child(7) {
    grid-column: span 6;
    grid-row: span 2;
  }

  .demari-gallery .wp-block-image:nth-child(8),
  .demari-gallery .wp-block-image:nth-child(9),
  .demari-gallery .wp-block-image:nth-child(12),
  .demari-gallery .wp-block-image:nth-child(13) {
    grid-column: span 3;
  }

  .demari-gallery .wp-block-image:nth-child(10) {
    grid-column: span 2;
  }

  .demari-gallery .wp-block-image:nth-child(11) {
    grid-column: span 4;
  }
}

@media (max-width: 1000px) {
  .demari-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: clamp(220px, 34vw, 380px);
  }

  .demari-gallery .wp-block-image {
    grid-column: span 1;
    grid-row: auto;
  }

  .demari-gallery .wp-block-image:nth-child(7) {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .demari-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: clamp(240px, 62vw, 340px);
  }

  .demari-gallery .wp-block-image:nth-child(7) {
    grid-column: span 1;
  }
}

/* Scroll hint — fixed pill floating over the screen while a gallery is in view */
.dm-scroll-hint {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 3.4vh, 36px);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(248, 244, 239, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(14, 39, 60, 0.16);
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(14, 39, 60, 0.18);
  color: var(--ink);
  font-size: 0.65625rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}

.dm-scroll-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.dm-lb-open .dm-scroll-hint {
  opacity: 0;
}

.dm-scroll-hint__chev {
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--seal);
  border-bottom: 2px solid var(--seal);
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
  .dm-scroll-hint__chev {
    animation: dm-scroll-hint 1.7s var(--ease) infinite;
  }
}

@keyframes dm-scroll-hint {
  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 1;
  }

  50% {
    transform: rotate(45deg) translate(5px, 5px);
    opacity: 0.4;
  }
}

/* Lightbox */
.dm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(14, 39, 60, 0.94);
}

.dm-lightbox[hidden] {
  display: none;
}

.dm-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.dm-lightbox-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(248, 244, 239, 0.5);
  background: rgba(248, 244, 239, 0.06);
  color: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.dm-lightbox-btn:hover {
  background: var(--seal);
  border-color: var(--seal);
}

.dm-lightbox-close {
  top: clamp(12px, 2vw, 26px);
  right: clamp(12px, 2vw, 26px);
}

.dm-lightbox-prev {
  left: clamp(12px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
}

.dm-lightbox-next {
  right: clamp(12px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
}

.dm-lightbox-count {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 3vh, 30px);
  transform: translateX(-50%);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sand);
}

body.dm-lb-open {
  overflow: hidden;
}

/* ============================================================
   9. Buttons
   ============================================================ */

.wp-block-button__link,
.button,
button[type="submit"],
input[type="submit"] {
  display: inline-block;
  padding: 0.95em 1.9em;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.wp-block-button__link:hover,
.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--paper);
  transform: translateY(-2px);
}

/* Light sweep across the label on hover */
.wp-block-button__link {
  position: relative;
  overflow: hidden;
}

.wp-block-button__link::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.32) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease);
  pointer-events: none;
}

.wp-block-button__link:hover::after {
  left: 135%;
}

.wp-block-buttons {
  gap: 14px;
}

.button-secondary {
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ============================================================
   10. FAQ (details)
   ============================================================ */

.wp-block-details {
  border-top: 1px solid var(--line-strong);
}

.wp-block-details:last-child {
  border-bottom: 1px solid var(--line-strong);
}

.wp-block-details summary {
  position: relative;
  padding: 1.05rem 3rem 1.05rem 0;
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s var(--ease);
}

.wp-block-details summary::-webkit-details-marker {
  display: none;
}

.wp-block-details summary::after {
  content: "";
  position: absolute;
  right: 0.4rem;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background:
    linear-gradient(var(--seal), var(--seal)) center / 14px 2px no-repeat,
    linear-gradient(var(--seal), var(--seal)) center / 2px 14px no-repeat;
  transition: transform 0.3s var(--ease);
}

.wp-block-details[open] summary::after {
  transform: translateY(-50%) rotate(90deg);
  background:
    linear-gradient(var(--seal), var(--seal)) center / 14px 2px no-repeat;
}

.wp-block-details summary:hover {
  color: var(--blue);
}

.wp-block-details > p,
.wp-block-details > div {
  padding: 0 3rem 1.3rem 0;
  margin: 0;
  color: var(--ink-80);
}

/* ============================================================
   11. Forms
   ============================================================ */

.demari-form {
  max-width: 820px;
}

.demari-form h2 {
  font-size: var(--fs-h2);
  margin-bottom: 1.6rem;
}

.demari-form h3 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--fs-h4);
  margin-top: 0.4rem;
}

.demari-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 0 32px;
}

.demari-form-grid > label,
.demari-field {
  display: block;
  margin-bottom: 1.7rem;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

.demari-full,
fieldset.demari-full,
.demari-form-grid > label.demari-full {
  grid-column: 1 / -1;
}

.demari-form input[type="text"],
.demari-form input[type="email"],
.demari-form input[type="tel"],
.demari-form input[type="date"],
.demari-form input[type="number"],
.demari-form select,
.demari-form textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s var(--ease);
}

.demari-form textarea {
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--line-strong);
  min-height: 140px;
  resize: vertical;
}

.demari-form select {
  padding-right: 2rem;
}

.demari-form input:focus,
.demari-form select:focus,
.demari-form textarea:focus {
  border-color: var(--seal);
}

.demari-form input::placeholder,
.demari-form textarea::placeholder {
  color: rgba(14, 39, 60, 0.38);
}

.demari-form fieldset {
  margin: 0 0 1.7rem;
  padding: 0;
  border: 0;
}

.demari-form legend {
  margin-bottom: 0.7rem;
  padding: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

.demari-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.demari-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0.5em 1.1em;
  border: 1.5px solid var(--line-strong);
  font-size: var(--fs-sm);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.demari-radio-group label:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.demari-radio-group label:has(input:focus-visible) {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

.demari-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 1.6rem 0;
  font-size: var(--fs-sm);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.55;
  color: var(--ink-80);
}

.demari-consent input {
  margin-top: 0.3em;
  width: 17px;
  height: 17px;
  accent-color: var(--seal);
  flex: none;
}

.demari-form-status {
  min-height: 1.5em;
  margin-top: 1rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--blue);
}

.demari-botcheck {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Dark form variant — forms sitting on ink surfaces (contact page) */
.demari-section--hero .demari-form {
  color-scheme: dark;
}

.demari-section--hero .demari-form h2,
.demari-section--hero .demari-form h3 {
  color: var(--paper);
}

.demari-section--hero .demari-form-intro {
  color: rgba(248, 244, 239, 0.78);
}

.demari-section--hero .demari-form-grid > label,
.demari-section--hero .demari-field,
.demari-section--hero .demari-form legend {
  color: var(--sand);
}

.demari-section--hero .demari-form input[type="text"],
.demari-section--hero .demari-form input[type="email"],
.demari-section--hero .demari-form input[type="tel"],
.demari-section--hero .demari-form input[type="date"],
.demari-section--hero .demari-form input[type="number"],
.demari-section--hero .demari-form select,
.demari-section--hero .demari-form textarea {
  color: var(--paper);
  border-color: rgba(248, 244, 239, 0.42);
}

.demari-section--hero .demari-form textarea {
  border-color: rgba(248, 244, 239, 0.42);
}

.demari-section--hero .demari-form input::placeholder,
.demari-section--hero .demari-form textarea::placeholder {
  color: rgba(248, 244, 239, 0.4);
}

.demari-section--hero .demari-radio-group label {
  border-color: rgba(248, 244, 239, 0.42);
  color: var(--paper);
}

.demari-section--hero .demari-radio-group label:has(input:checked) {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.demari-section--hero .demari-consent {
  color: rgba(248, 244, 239, 0.78);
}

.demari-section--hero .demari-consent a {
  color: var(--paper);
}

.demari-section--hero .demari-form-status {
  color: var(--sand);
}

.demari-section--hero .demari-form button[type="submit"],
.demari-section--hero .demari-form input[type="submit"] {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--paper);
}

.demari-section--hero .demari-form button[type="submit"]:hover,
.demari-section--hero .demari-form input[type="submit"]:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

/* ============================================================
   11b. Poklon bon — price tiers + voucher card
   ============================================================ */

.demari-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: clamp(14px, 2.4vw, 26px);
  margin-top: clamp(26px, 3.5vw, 44px);
}

/* Blockgap margins would double the grid gap and misalign card tops */
.demari-tiers > * {
  margin-top: 0;
  margin-bottom: 0;
}

.demari-tier {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--seal);
  padding: clamp(20px, 2.8vw, 32px);
}

.demari-tier-label {
  margin: 0 0 1rem;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--seal);
}

.demari-tier-price {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  line-height: 1.05;
  color: var(--ink);
}

.demari-tier-note {
  margin: 0.7rem 0 0;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-80);
}

.demari-note {
  margin-top: clamp(22px, 3vw, 34px);
  padding: 14px 18px;
  background: rgba(248, 244, 239, 0.72);
  border-left: 3px solid var(--seal);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink);
}

/* Voucher card — replaces the stock image */
.demari-voucher-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 34px 34px 16px;
}

.demari-voucher {
  position: relative;
  width: min(560px, 100%);
  background: var(--ink);
  color: var(--paper);
  padding: clamp(30px, 4.5vw, 48px);
}

.demari-voucher::after {
  content: "";
  position: absolute;
  top: -14px;
  left: -14px;
  right: -30px;
  bottom: -30px;
  border: 3px solid var(--seal);
  pointer-events: none;
}

.demari-voucher-brand {
  margin: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--seal);
}

.demari-voucher-title {
  margin: 0.5rem 0 1.4rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.1;
  color: var(--paper);
}

.demari-voucher .wp-block-heading::after {
  display: none;
}

.demari-voucher-amount {
  margin: 0;
  padding-top: 1.3rem;
  border-top: 1px solid var(--paper-line);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1;
  color: var(--paper);
}

.demari-voucher-note {
  margin: 0.7rem 0 0;
  font-size: var(--fs-sm);
  color: rgba(248, 244, 239, 0.72);
}

.demari-voucher-valid {
  margin: 1.6rem 0 0;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sand);
}

/* ============================================================
   12. Header — dark top bar with dropdowns (desktop) + drawer (mobile)
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink);
  border-bottom: 1px solid rgba(248, 244, 239, 0.14);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 8px var(--gutter);
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 52px;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--paper);
  white-space: nowrap;
}

/* Horizontal nav — desktop only (hidden below 1120px) */
.site-nav {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-cta {
  padding: 0.75em 1.5em;
  font-size: 0.72rem;
  background: var(--seal);
  border-color: var(--seal);
  color: var(--paper);
}

.header-cta:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

/* Hamburger — tablet & mobile only */
.demari-nav-toggle {
  display: block;
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  background: none;
  border: 1.5px solid rgba(248, 244, 239, 0.55);
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.demari-nav-toggle:hover {
  background: rgba(248, 244, 239, 0.12);
  border-color: var(--paper);
}

.demari-nav-toggle > span:not(.screen-reader-text) {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--paper);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), top 0.3s var(--ease);
}

.demari-nav-toggle > span:nth-child(1) { top: 15px; }
.demari-nav-toggle > span:nth-child(2) { top: 22px; }
.demari-nav-toggle > span:nth-child(3) { top: 29px; }

.demari-nav-toggle[aria-expanded="true"] > span:nth-child(1) {
  top: 22px;
  transform: rotate(45deg);
}

.demari-nav-toggle[aria-expanded="true"] > span:nth-child(2) {
  opacity: 0;
}

.demari-nav-toggle[aria-expanded="true"] > span:nth-child(3) {
  top: 22px;
  transform: rotate(-45deg);
}

/* Dimmed page behind the drawer */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 39, 60, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.645, 0.045, 0.355, 1),
    visibility 0s linear 0.4s;
  z-index: 70;
}

body.demari-nav-open .nav-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Drawer — slides in from the right (mobile / tablet) */
.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 88vw);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(14, 39, 60, 0.18);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.645, 0.045, 0.355, 1),
    visibility 0s linear 0.4s;
  z-index: 80;
}

body.demari-nav-open .site-drawer {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* Ink drifting under the drawer's links */
.site-drawer::after {
  content: "";
  position: absolute;
  right: -34%;
  bottom: -10%;
  width: 132%;
  aspect-ratio: 1;
  background: url("assets/img/suminagashi.svg") center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
  z-index: -1;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(20px, 5vw, 32px);
  border-bottom: 1px solid var(--line);
}

.drawer-title {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--seal);
}

.drawer-close {
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.drawer-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(20px, 5vw, 32px);
}

.site-drawer .menu,
.site-drawer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-drawer .menu > li {
  border-bottom: 1px solid var(--line);
}

.site-drawer .menu > li:last-child {
  border-bottom: 0;
}

.site-drawer .menu a {
  display: block;
  padding: 13px 0;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}

.site-drawer .menu a:hover,
.site-drawer .current-menu-item > a,
.site-drawer .current_page_item > a {
  color: var(--seal);
  padding-left: 8px;
}

/* Drawer: children always visible, indented */
.site-drawer .menu-item-has-children > a {
  padding-bottom: 4px;
}

.site-drawer .sub-menu a {
  padding: 8px 0 8px 18px;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--ink-80);
}

.site-drawer .sub-menu a:hover {
  color: var(--seal);
  padding-left: 26px;
}

.drawer-foot {
  padding: 0 clamp(20px, 5vw, 32px) 22px;
}

.drawer-cta {
  display: block;
  width: 100%;
  text-align: center;
}

.drawer-contact {
  display: grid;
  gap: 6px;
  padding: 20px clamp(20px, 5vw, 32px);
  border-top: 1px solid var(--line);
  background: var(--sand);
}

.drawer-contact a {
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  color: var(--ink-80);
  text-decoration: none;
}

.drawer-contact a:hover {
  color: var(--seal);
}

@media (max-width: 640px) {
  .header-cta {
    display: none;
  }

  .brand-logo {
    height: 46px;
  }

  .brand-name {
    font-size: 0.92rem;
    letter-spacing: 0.2em;
  }
}

/* ------------------------------------------------------------
   Desktop: everything in the top bar with dropdowns (like original)
   ------------------------------------------------------------ */
@media (min-width: 1120px) {
  .site-nav {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: clamp(18px, 3vw, 52px);
  }

  .demari-nav-toggle {
    display: none;
  }

  .site-drawer,
  .nav-overlay {
    display: none;
  }

  .site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: none;
  }

  .brand-name {
    display: none;
  }

  .site-nav .menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(8px, 1.4vw, 24px);
  }

  .site-nav li {
    position: relative;
  }

  .site-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 2px;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(248, 244, 239, 0.88);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s var(--ease);
  }

  .site-nav .menu > li > a {
    padding: 13px 2px;
  }

  .site-nav a:hover,
  .site-nav li:hover > a,
  .site-nav li:focus-within > a,
  .site-nav .current-menu-item > a,
  .site-nav .current-menu-ancestor > a,
  .site-nav .current_page_item > a {
    color: var(--seal);
  }

  /* Coral underline draws in from the left on hover / current page */
  .site-nav .menu > li > a {
    position: relative;
  }

  .site-nav .menu > li > a::before {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 7px;
    height: 2px;
    background: var(--seal);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.35s var(--ease);
  }

  .site-nav .menu > li:hover > a::before,
  .site-nav .menu > li:focus-within > a::before,
  .site-nav .menu > li.current-menu-item > a::before,
  .site-nav .menu > li.current-menu-ancestor > a::before,
  .site-nav .menu > li.current_page_item > a::before {
    transform: scaleX(1);
    transform-origin: left center;
  }

  /* Caret for the dropdown parent */
  .site-nav .menu-item-has-children > a::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s var(--ease);
  }

  .site-nav li.menu-item-has-children:hover > a::after,
  .site-nav li.menu-item-has-children:focus-within > a::after,
  .site-nav li.menu-item-has-children.is-open > a::after {
    transform: translateY(2px) rotate(225deg);
  }

  /* Dropdown panel */
  .site-nav .sub-menu {
    position: absolute;
    top: 100%;
    left: -18px;
    min-width: 274px;
    padding: 8px 0;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: 0 22px 48px rgba(14, 39, 60, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
      visibility 0s linear 0.25s;
    z-index: 70;
  }

  .site-nav li:hover > .sub-menu,
  .site-nav li:focus-within > .sub-menu,
  .site-nav li.is-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
      visibility 0s linear 0s;
  }

  .site-nav .sub-menu li {
    border-left: 2px solid transparent;
    transition: border-color 0.15s var(--ease);
  }

  .site-nav .sub-menu li:hover,
  .site-nav .sub-menu li:focus-within {
    border-left-color: var(--seal);
  }

  .site-nav .sub-menu a {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 20px;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--ink);
    white-space: normal;
  }

  .site-nav .sub-menu a:hover,
  .site-nav .sub-menu li:hover > a {
    background: var(--sand);
    color: var(--seal);
    padding-left: 24px;
  }

  .site-nav .sub-menu .current-menu-item > a,
  .site-nav .sub-menu .current_page_item > a {
    color: var(--seal);
  }
}
/* ============================================================
   13. Footer
   ============================================================ */

.site-footer {
  background-color: var(--ink);
  color: rgba(248, 244, 239, 0.82);
  padding: clamp(40px, 5vw, 64px) 0 26px;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  left: -540px;
  bottom: -660px;
  width: min(1560px, 162vw);
  aspect-ratio: 1;
  background: url("assets/img/suminagashi-water.svg") center / contain no-repeat;
  opacity: 0.17;
  pointer-events: none;
}

/* Slim footer — brand mark and link column share one compact row */
.footer-brand {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(22px, 4vw, 56px);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.footer-logo {
  height: clamp(56px, 7vw, 84px);
  width: auto;
  margin-bottom: 0;
}

.footer-links {
  position: relative;
}

.footer-links h2 {
  margin-bottom: 0.75rem;
}

.site-footer h2 {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--seal);
  margin-bottom: 1.1rem;
}

.site-footer p {
  line-height: 1.8;
}

.site-footer a {
  color: rgba(248, 244, 239, 0.82);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--seal);
}

.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-menu a {
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
}

.copyright {
  position: relative;
  max-width: var(--wrap);
  margin: clamp(26px, 4vw, 44px) auto 0;
  padding: 22px var(--gutter) 0;
  border-top: 1px solid var(--paper-line);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(248, 244, 239, 0.55);
}

/* ============================================================
   14. Columns, tables & misc blocks
   ============================================================ */

.wp-block-columns {
  gap: clamp(24px, 4vw, 56px);
}

.wp-block-column p {
  max-width: none;
}

/* Two-column profile — framed portrait left, copy right (VODITELJICA) */
.demari-voditeljica {
  align-items: center;
}

.demari-voditeljica__img {
  position: relative;
  margin: 0;
  padding: clamp(10px, 1.1vw, 16px);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--seal);
  box-shadow: 16px 16px 0 -1px rgba(14, 39, 60, 0.07);
}

.demari-voditeljica__img img {
  display: block;
  width: 100%;
  height: auto;
}

.demari-voditeljica__label {
  margin: 0 0 0.7rem;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--seal);
}

.demari-voditeljica .wp-block-heading {
  margin-top: 0;
}

/* Orange note call-out (suminagashi page) */
.demari-napomena {
  color: var(--seal);
}

/* Original-page promo reel (362×640) centred under ULAZNICE */
.demari-video {
  width: min(380px, 100%);
  margin: clamp(20px, 2.5vw, 32px) auto 0;
}

.demari-video video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--ink);
}

@media (max-width: 782px) {
  .wp-block-columns {
    flex-wrap: wrap;
  }

  .wp-block-column {
    flex-basis: 100% !important;
    max-width: 100% !important;
  }
}

.wp-block-table {
  margin: 2rem 0;
}

.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.wp-block-table th,
.wp-block-table td {
  padding: 0.8em 1em;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.wp-block-table thead th {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  border-bottom: 1.5px solid var(--line-strong);
}

.wp-block-table tbody tr:hover {
  background: rgba(230, 221, 209, 0.5);
}

.wp-block-separator {
  border: 0;
  border-top: 1px solid var(--line-strong);
  margin: 2.5rem auto;
  max-width: 96px;
}

.wp-block-group.demari-gallery {
  background: none;
  padding: 0;
}

.demari-form-intro {
  margin-bottom: 1.8rem;
  color: var(--ink-80);
}

.demari-admin-note {
  padding: 14px 18px;
  background: var(--sand);
  border-left: 3px solid var(--seal);
  font-size: var(--fs-sm);
}

/* ============================================================
   15. Contact band with map
   ============================================================ */

.demari-section--contact {
  padding-block: clamp(44px, 5vw, 72px);
}

.demari-section--contact .wp-block-columns {
  gap: clamp(24px, 3vw, 56px);
  align-items: stretch;
}

.demari-section--contact .wp-block-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demari-map {
  height: clamp(300px, 36vw, 440px);
  border: 1px solid rgba(14, 39, 60, 0.16);
  background: var(--sand);
  overflow: hidden;
}

.demari-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.35) contrast(1.04);
}

/* ============================================================
   16. Motion
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  .dm-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }

  .dm-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* Fine film grain over the whole page — the paper stock of a print portfolio */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
  .demari-intro {
    background-size: 100% 100%, 100% 100%, min(140px, 34vw) 100%,
      min(140px, 34vw) 100%, min(140px, 34vw) 100%, min(140px, 34vw) 100%;
  }

  /* Suminagashi must stay on screen on phones — pull the tiles in from
     the desktop's far-offscreen offsets, keep the dissolving edge masks */
  .demari-section--standard::after {
    right: -30vw;
    width: min(900px, 155vw);
  }

  .demari-section--standard:nth-of-type(4n + 3)::after {
    right: auto;
    left: -45vw;
  }

  .demari-section--hero::after {
    right: -40vw;
    top: -25vw;
    width: min(1100px, 170vw);
  }

  .site-footer::before {
    left: -35vw;
    bottom: -55vw;
    width: min(1000px, 170vw);
  }
}

/* ============================================================
   17. Small screens
   ============================================================ */

@media (max-width: 640px) {
  .demari-section--hero .wp-block-quote p {
    max-width: none;
  }

  .wp-block-details > p {
    padding-right: 0;
  }

  .demari-testimonials.is-slider {
    min-height: 0;
  }

  .demari-voucher-wrap {
    padding: 10px 20px 26px 10px;
  }

  .demari-voucher::after {
    top: -8px;
    left: -8px;
    right: -16px;
    bottom: -16px;
  }
}


/* ============================================================
   18. Sto nudimo - colour bands, offer cards, image strips
   ============================================================ */

.demari-hero-lines {
  margin-top: clamp(6px, 1vw, 18px);
}

.demari-hero-lines .wp-block-column p {
  max-width: none;
  padding-left: 1.05rem;
  border-left: 3px solid var(--seal);
  color: rgba(248, 244, 239, 0.92);
}

.wp-block-button.demari-btn-seal .wp-block-button__link {
  background: var(--seal);
  border-color: var(--seal);
  color: var(--paper);
}

.wp-block-button.demari-btn-seal .wp-block-button__link:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.demari-section.demari-section--seal {
  background: var(--seal);
  color: var(--paper);
}

.demari-section--seal::after {
  filter: brightness(0) invert(1);
  opacity: 0.13;
}

.demari-section--seal .wp-block-heading {
  color: var(--paper);
}

.demari-section--seal .wp-block-heading::after {
  background: var(--ink);
}

.demari-section--seal p {
  color: rgba(248, 244, 239, 0.94);
}

.demari-section.demari-section--deep {
  background: var(--ink);
  color: var(--paper);
}

.demari-section--deep::after {
  filter: brightness(0) invert(1);
  opacity: 0.15;
}

.demari-section--deep .wp-block-heading {
  color: var(--paper);
}

.demari-section--deep .wp-block-heading::after {
  background: var(--seal);
}

.demari-section--deep p,
.demari-section--deep li {
  color: rgba(248, 244, 239, 0.88);
}

.demari-section--deep .demari-frame {
  box-shadow: 16px 16px 0 -1px rgba(248, 244, 239, 0.14);
}

.demari-frame {
  position: relative;
  margin: 0;
  padding: clamp(10px, 1.1vw, 16px);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--seal);
  box-shadow: 16px 16px 0 -1px rgba(14, 39, 60, 0.07);
}

.demari-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.demari-imgrow .wp-block-image {
  margin: 0;
}

.demari-imgrow img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}

.demari-offer {
  align-items: center;
}

.demari-offer .wp-block-heading {
  margin-top: 0;
}

.demari-offer .demari-frame img {
  aspect-ratio: 4 / 3;
}

.demari-offer .wp-block-buttons {
  justify-content: flex-start;
  margin-top: clamp(14px, 2vw, 26px);
}

.demari-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.15em;
  max-width: 64ch;
}

.demari-bullets li {
  position: relative;
  padding-left: 1.35em;
}

.demari-bullets li + li {
  margin-top: 0.45em;
}

.demari-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.55em;
  height: 0.55em;
  background: var(--seal);
}

/* ============================================================
   19. Contact + thank-you pages — one suminagashi square centred
   on the seam between the ink hero (form/message) and the ink
   footer, so the pattern runs straight across the boundary
   without a visible break. Both halves are the same virtual
   square (same image, size, horizontal anchor, opacity); each
   container clips its own half.
   ============================================================ */

.page-id-6 .demari-section--hero::after,
.page-id-21 .demari-section--hero::after {
  top: auto;
  bottom: 0;
  transform: translateY(50%);
}

.page-id-6 .site-footer::before,
.page-id-21 .site-footer::before {
  top: 0;
  bottom: auto;
  left: auto;
  right: -390px;
  transform: translateY(-50%);
  width: min(1800px, 186vw);
  opacity: 0.18;
}

@media (max-width: 782px) {
  .page-id-6 .demari-section--hero::after,
  .page-id-6 .site-footer::before,
  .page-id-21 .demari-section--hero::after,
  .page-id-21 .site-footer::before {
    right: -40vw;
    left: auto;
    width: min(1100px, 170vw);
  }
}


/* ============================================================
   10. Recenzije — editorial hero, film stage, seam join
   ============================================================ */

/* Hero: centred quote with a big glyph, more air (like the original) */
.page-id-14 .demari-section--hero {
  text-align: center;
  padding-top: clamp(72px, 9vw, 124px);
}

.page-id-14 .demari-section--hero .demari-lead-quote {
  border-left: 0;
  padding-left: 0;
  max-width: 940px;
  margin-inline: auto;
}

.page-id-14 .demari-section--hero .demari-lead-quote::before {
  content: "\201C";
  display: block;
  margin-bottom: 0.18em;
  font-family: var(--font-display);
  font-size: clamp(4.8rem, 9vw, 7.2rem);
  line-height: 0.6;
  color: rgba(248, 244, 239, 0.3);
}

.page-id-14 .demari-section--hero .demari-lead-quote p {
  margin-inline: auto;
}

/* Film — light stage, wide player with a circular play mark */
.demari-film {
  padding-block: clamp(56px, 7vw, 96px);
}

.demari-film__stage {
  position: relative;
  max-width: min(965px, 100%);
  margin-inline: auto;
}

.demari-film__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  box-shadow: 0 22px 48px -26px rgba(14, 39, 60, 0.5);
}

.demari-film__player {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demari-film__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(64px, 7vw, 84px);
  height: clamp(64px, 7vw, 84px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(248, 244, 239, 0.92);
  background: rgba(14, 39, 60, 0.22);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    opacity 0.25s var(--ease);
}

.demari-film__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 53%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--paper);
}

.demari-film__play:hover,
.demari-film__play:focus-visible {
  background: rgba(14, 39, 60, 0.38);
  transform: translate(-50%, -50%) scale(1.06);
}

.demari-film__play:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.demari-film__frame.is-playing .demari-film__play {
  opacity: 0;
  pointer-events: none;
}

.demari-film__frame.is-error .demari-film__play {
  display: none;
}

/* Slider dots — echo the original review pager (counter stays) */
.demari-slider-dots {
  position: absolute;
  left: 50%;
  bottom: -42px;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  pointer-events: auto;
}

.demari-slider-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid rgba(248, 244, 239, 0.55);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.demari-slider-dot.is-active {
  background: var(--paper);
  border-color: var(--paper);
}

.demari-slider-dot:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .demari-slider-count {
    display: none;
  }
}

/* Ink review section flows straight into the ink footer — one suminagashi
   square centred on the seam (same trick as Kontakt). Both halves keep the
   section decor's left anchor and size; equal opacity; radial edge mask. */
.page-id-14 .demari-section:has(.demari-testimonial)::after {
  top: auto;
  bottom: 0;
  transform: translateY(50%);
}

.page-id-14 .site-footer::before {
  top: 0;
  bottom: auto;
  left: -480px;
  right: auto;
  transform: translateY(-50%);
  width: min(1260px, 132vw);
  opacity: 0.19;
}

@media (max-width: 782px) {
  .page-id-14 .demari-section:has(.demari-testimonial)::after,
  .page-id-14 .site-footer::before {
    left: -45vw;
    right: auto;
    width: min(900px, 155vw);
  }
}

/* ============================================================
   11. Poklon bon — two-column buy module (voucher + configurator)
   ============================================================ */

/* Original copy: price ranges picked out in seal red */
.demari-intro-prices strong {
  color: var(--seal);
}

.demari-buy {
  align-items: center;
}

/* Card flush with the intro text grid (seal frame overflows into the gap) */
.demari-voucher-wrap {
  padding-left: 0;
}

.demari-buy-price {
  margin: 0.2rem 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 2.9rem);
  line-height: 1;
  color: var(--ink);
}

.demari-buy .demari-radio-group label {
  min-width: 78px;
  justify-content: center;
  padding: 0.7em 1.4em;
  font-size: var(--fs-md);
  font-weight: 600;
}

.demari-custom {
  display: block;
  margin-top: 1rem;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

.demari-custom[hidden] {
  display: none;
}

.demari-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--line-strong);
}

.demari-stepper-btn {
  width: 46px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.demari-stepper-btn:hover:not(:disabled) {
  color: var(--seal);
}

.demari-stepper-btn:disabled {
  color: rgba(14, 39, 60, 0.3);
  cursor: default;
}

.demari-form .demari-stepper input[type="number"] {
  width: 68px;
  margin-top: 0;
  padding: 0.7rem 0;
  text-align: center;
  border: 0;
  border-inline: 1.5px solid var(--line-strong);
  -moz-appearance: textfield;
  appearance: textfield;
}

.demari-form .demari-stepper input[type="number"]::-webkit-outer-spin-button,
.demari-form .demari-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.demari-buy .demari-form > button[type="submit"] {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
}

@media (max-width: 782px) {
  .demari-buy {
    gap: 30px;
  }
}

/* ============================================================
   18. Touch — no sideways page pan while dragging (iOS/Android
   rubber-band + swipe-navigation), slides keep vertical scroll
   ============================================================ */

html {
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  overscroll-behavior-x: none;
}

.site-main {
  overflow: hidden;
  overflow: clip;
}

.demari-testimonials.is-slider {
  touch-action: pan-y;
  overscroll-behavior-x: contain;
}

/* ============================================================
   19. Hero action buttons (light buttons on dark sections)
   ============================================================ */

.demari-section--hero .wp-block-button__link {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.demari-section--hero .wp-block-button__link:hover,
.demari-section--hero .wp-block-button__link:focus-visible {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--paper);
}
