
/* ========================================================================
   STYLE.CSS — BASE + DESKTOP / NON-MOBILE
   Мобільні override-стилі тримай окремо в mobile.css.
   ======================================================================== */

:root {
  /* ====================================================================
     CORE BRAND PALETTE
     Світлі градієнти секцій зберігаються у їхніх власних background-правилах.
     Тут зібрані тільки повторювані кольори інтерфейсу.
     ==================================================================== */
  --color-dark: #222222;
  --color-dark-strong: #1c1c1c;
  --color-ink: #1c1b18;
  --color-brown: #3a2b0e;
  /* One lighter gold source of truth for the whole interface. */
  --color-yellow: #d4af37;
  --color-gold: var(--color-yellow);
  --color-ochre: var(--color-yellow);
  --color-ochre-hover: var(--color-brown);
  --color-gold-soft: color-mix(in oklab, var(--color-yellow) 18%, #fff 82%);
  --color-border-brown: #8e6f22;
  --color-field-border: #c6a15a;
  /* Experimental darker form-field border kept for comparison: #a77a1e. */
  --color-link-brown: #6f5315;
  --color-review-book: var(--color-link-brown);

  /* Existing names kept as aliases so old selectors continue to work. */
  --main-bg-color: #f5f5f5;
  --text-color: var(--color-ink);
  --dark-bg: var(--color-dark);
  --c-accent: var(--color-gold);
  --primary-color: var(--color-gold);

  /* Accent variants */
  --accent-ink: color-mix(in oklab, var(--c-accent) 92%, #000 8%);
  --accent-soft: color-mix(in oklab, var(--primary-color) 15%, #fff 85%);

  /* Typography */
  --ff-serif: "Tinos", serif;
  --ff-decor: "Great Vibes", cursive;
  --ff-hero: "Great Vibes Dotless", "Great Vibes", cursive;

  /* Fluid font sizes */
  --fs-100: clamp(0.875rem, 0.84rem + 0.2vw, 1rem);
  --fs-200: clamp(1rem, 0.96rem + 0.6vw, 1.25rem);
  --fs-300: clamp(1.25rem, 1.02rem + 1.2vw, 1.6rem);
  --fs-400: clamp(1.6rem, 1.2rem + 2.2vw, 2.2rem);
  --fs-500: clamp(2rem, 1.4rem + 3.4vw, 3rem);

  /* Layout helpers */
  --container-max: 1288px;

  /* Books */
  --books-safe: clamp(48px, 10vw, 180px);
  --books-gap: clamp(8px, 1.2vw, 18px);
  --book-w-sm: 360px;
  --book-w-md: 480px;
  --book-w-lg: 560px;
  --book-stage-h-md: 640px;
  --book-stage-h-lg: 720px;
  --book-stage-h-xl: 780px;
  --arrow-size: 44px;
  --arrow-inset: 200px;
  --track-width: min(90vw, 980px);
  --track-h: clamp(560px, 64vh, 820px);

  /* Announcements */
  --ann-arrow-size: 44px;
  --ann-edge-gap: clamp(12px, 2vw, 28px);
  --ann-track-gap: clamp(18px, 2.6vw, 10px);
  --ann-rail: 8px;
  --ann-card-w: clamp(360px, 35vw, 480px);
  --ann-pad-x: clamp(16px, 2.6vw, 28px);
  --ann-left-w: 320px;
  --ann-cover-maxh: 220px;
  --ann-cover-minh: 140px;

  /* Contacts */
  --contact-card-max: 700px;
  --contact-card-pad: clamp(14px, 1.6vw, 20px);
  --contact-gap: clamp(12px, 1.6vw, 18px);
  --contact-field-pad: clamp(0.75rem, 1.5vw, 0.95rem);
  --contact-social-size: 44px;
  --contact-social-gap: 8px;

  /* Footer */
  --footer-text-copyright: #e9e3d7;
  --footer-accent: var(--color-gold);
  --footer-accent-ink: #8e6f22;
  --footer-line: var(--decor-line-color);
  --footer-text: var(--text-color, #1f1607);
  --footer-subtle: color-mix(in oklab, #000 18%, #fff 82%);
  --footer-radius: 18px;
  --footer-maxw: 1280px;
  --footer-gap: clamp(18px, 2.5vw, 28px);
  --footer-pad: clamp(16px, 2.2vw, 28px);
  --social-size: 40px;
  --footer-bg-1: #2a2a2a;
  --footer-bg-2: #262626;
  --footer-bg-3: #232323;

  /* Decorative title line
     One source of truth for section/footer heading underlines.
     Change these variables only here, in style.css.
     Mobile.css may only align headings; it must not redefine line size/color. */
  --decor-line-width: clamp(80px, 8vw, 110px);
  --decor-line-height: 2px;
  --decor-line-radius: 999px;
  --decor-line-gap: 0.6rem;
  --decor-line-color: var(--c-accent);

  /* Radius / shadow */
  --radius: 16px;
  --shadow-paper: 0 6px 16px rgba(71, 49, 8, 0.10);
  --shadow-object: 0 12px 28px rgba(28, 20, 10, 0.18);
  --shadow-control: 0 3px 8px rgba(58, 43, 14, 0.14);
  --shadow: var(--shadow-object);

  /* Buttons */
  --btn-radius: 9999px;
  --btn-pad-y: 0.7rem;
  --btn-pad-x: 1.2rem;

  /* Book overlay */
  --book-overlay-inset: clamp(46px, 4.6vw, 64px);
  --book-overlay-max-block: 60%;
  --book-overlay-radius: 14px;
  --book-overlay-bg: var(--m-bg);
  --book-overlay-border: 1px solid rgba(0, 0, 0, 0.06);
  --book-overlay-shadow: 0 6px 22px rgba(0, 0, 0, 0.15);

  /* Modal */
  --m-bg: #fff9ef;
  --m-ink: #2b1b00;
  --m-muted: #6b5a3a;
  --m-accent: var(--color-ochre);
  --m-accent-ink: #1b1200;
  --m-radius: 20px;
  --m-shadow: 0 28px 60px rgba(0, 0, 0, .28);
  --divider: #eadfcf;
  --m-divider: rgba(122, 88, 50, 0.45);
  --modal-max-w: 1140px;
  --modal-h-pad: 20px;
  --modal-v-pad: 12px;
  --m-btn-ring: color-mix(in oklab, var(--m-accent) 35%, #fff 65%);
  --m-btn-bdr: color-mix(in oklab, var(--m-accent) 55%, #000 45%);
  --m-btn-bdr-h: color-mix(in oklab, var(--m-accent) 70%, #000 30%);

  /* Buttons */
  --btn-dark: var(--color-dark-strong);
  --btn-dark-hover: var(--color-brown);
  --btn-light: #f7f2e7;
  --btn-light-hover: #fffaf0;
  --btn-gold: var(--color-ochre);
  --btn-gold-hover: var(--color-ochre-hover);
  --btn-ink: #232323;
  --btn-radius-pill: 999px;
  --btn-shadow-soft: 0 6px 16px rgba(120, 80, 20, 0.18);
  --btn-shadow-hover: 0 10px 22px rgba(120, 80, 20, 0.24);

}


/* ========================================================================
   БАЗА ТА СКИДАННЯ
   ======================================================================== */
@font-face {
  font-family: 'Great Vibes';
  src: url('../fonts/GreatVibes-Cyrillic.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Great Vibes';
  src: url('../fonts/GreatVibes-Latin.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
    U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Great Vibes Dotless';
  src: url('../fonts/GreatVibes-Dotless-Cyrillic.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Great Vibes Dotless';
  src: url('../fonts/GreatVibes-Dotless-Latin.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
    U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Tinos';
  src: url('../fonts/Tinos-Cyrillic-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Tinos';
  src: url('../fonts/Tinos-Latin-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
    U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Tinos';
  src: url('../fonts/Tinos-Cyrillic-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Tinos';
  src: url('../fonts/Tinos-Latin-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
    U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Tinos';
  src: url('../fonts/Tinos-Cyrillic-Italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Tinos';
  src: url('../fonts/Tinos-Latin-Italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
    U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


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

html:focus-within {
  scroll-behavior: smooth;
}

/*
 * Залишає місце під закріпленою шапкою під час переходу з меню.
 * Використовуємо класи секцій, тому заголовок не ховається під header.
 */
.hero,
.about,
.books,
.announcements,
.reviews,
.contacts {
  scroll-margin-top: 110px;
}

body {
  margin: 0;
  font-family: var(--ff-serif);
  font-size: var(--fs-200);
  line-height: 1.6;
  color: var(--text-color);
  background: var(--main-bg-color);
  content-visibility: visible;
    contain-intrinsic-size: auto;
}
 html,
  body {
    background: #222222;
    overflow-x: clip;
  }

html.no-scroll,
body.no-scroll {
  overflow: hidden;
}

body.no-scroll {
  touch-action: none;
}
img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--primary-color) 70%, white);
  outline-offset: 2px;
}

/* Skip link */
.u-skip {
  position: absolute;
  inset-inline-start: -9999px;
  inset-block-start: auto;
}

.u-skip:focus {
  inset-inline-start: 1rem;
  inset-block-start: 1rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-radius: 0.5rem;
  z-index: 9999;
}

/* Visually hidden but accessible */
.u-visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

/* Container */
.container {
  max-inline-size: var(--container-max);
  inline-size: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
}


/* -------------------- Headings -------------------- */
h1,
h2,
h3 {
  font-family: var(--ff-decor);
  font-weight: 400;
}

h2 {
  margin: 0 0 2rem;
  font-size: var(--fs-500);
  text-align: center;
  color: #3a2b0e
 /*color: #4b3512 */
  
}

main h2::after,
.logo-title::after,
.footer-brand__title::after,
.footer-section h3::after {
  content: "";
  display: block;
  inline-size: var(--decor-line-width);
  block-size: var(--decor-line-height);
  margin-block-start: var(--decor-line-gap);
  margin-inline: auto;
  border-radius: var(--decor-line-radius);
  background: var(--decor-line-color);
}


/* ========================================================================
   ШАПКА САЙТУ
   ======================================================================== */
.header {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  background: #222222;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  --header-offset: clamp(60px, 11vw, 92px);
  will-change: transform;
  transition: transform .24s ease, background-color .2s ease;
}

section[id] {
  scroll-margin-block-start: var(--header-offset);
}

.header-container {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "logo navwrap";
  align-items: center;
  gap: 1rem;
  padding-block: clamp(0.8rem, 2vw, 1.5rem);
  transition: padding-block .22s ease;
}

.brand-group {
  grid-area: logo;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 18px);
  min-inline-size: 0;
}

.brand-group > .logo {
  grid-area: auto;
}

.logo-img {
  block-size: clamp(56px, 6vw, 90px);
  transition: block-size .22s ease;
}

.nav-wrapper {
  grid-area: navwrap;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  /*justify-content: center;*/
  justify-content: flex-start;
    margin-inline-start: clamp(-42px, -2.2vw, -24px);
  align-items: center;
  gap: clamp(8px, 1.5vw, 24px);
}

.js-nav {
  position: static;
  transform: none;
}

.js-nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  /*gap: clamp(0.8rem, 2vw, 2rem);*/
   gap: clamp(1.2rem, 1.65vw, 1.85rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  color: #fdf5e6;
  font-weight: 700;
}

nav a:hover {
  color: #ffffff;
}

.nav-wrapper nav a {
  white-space: nowrap;
}

.nav-wrapper nav a.is-active,
.nav-wrapper nav a[aria-current="page"] {
  text-decoration-line: underline;
  text-decoration-color: var(--c-accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  text-decoration-skip-ink: auto;
}

.nav-wrapper nav a:focus-visible {
  text-decoration-line: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--c-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, 1vw, 16px);
  min-inline-size: 0;
}

.header-language-switcher {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-inline-size: 0;
  line-height: 1;
}

.header-language-switcher > * {
  margin: 0 !important;
}

.telegram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 35px;
  block-size: 35px;
  border-radius: 50%;
  border: 2px solid #bfa16d;
  box-shadow:
    inset 0 0 4px rgba(0,0,0,0.25),
    0 0 8px rgba(255, 223, 150, 0.45);
  background: radial-gradient(circle at 30% 25%, #fff8e6 0%, #f8f0e1 100%);
  transition:
    background-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.telegram-button svg {
  width: 25px;
  height: 25px;
  fill: #1a1410;
  transition: fill 0.25s ease;
}

.telegram-button:hover,
.telegram-button:focus-visible {
  background: #f1e0b3;
  box-shadow: 0 0 14px color-mix(in srgb, var(--color-yellow) 30%, transparent);
  transform: translateY(-1px);
}

.telegram-button:hover svg,
.telegram-button:focus-visible svg {
  fill: #000;
}

.menu-toggle {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  inline-size: 42px;
  block-size: 42px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 2px solid var(--c-accent);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: #fff2d1;
  border-color: var(--color-border-brown);
  box-shadow: 0 0 14px color-mix(in srgb, var(--color-yellow) 30%, transparent);
  transform: translateY(-1px);
}

.menu-toggle:hover .menu-lines,
.menu-toggle:hover .menu-lines::before,
.menu-toggle:hover .menu-lines::after,
.menu-toggle:focus-visible .menu-lines,
.menu-toggle:focus-visible .menu-lines::before,
.menu-toggle:focus-visible .menu-lines::after {
  background: var(--color-brown);
}

.menu-toggle:focus-visible {
  outline: 3px solid var(--color-border-brown);
  outline-offset: 3px;
}

.menu-toggle:active {
  transform: scale(0.98);
}

.menu-lines,
.menu-lines::before,
.menu-lines::after {
  position: relative;
  display: block;
  inline-size: 22px;
  block-size: 2px;
  background: var(--c-accent);
  transition: transform 0.2s ease, background-color 0.2s ease;
  content: "";
}

.menu-lines::before {
  position: absolute;
  inset-block-start: -6px;
  inset-inline-start: 0;
}

.menu-lines::after {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-start: 0;
}

.header.header--hidden {
  transform: translateY(-100%);
}

.header.header--compact .header-container {
  padding-block: clamp(0.35rem, 1.2vw, 0.7rem);
}

.header.header--compact .logo-img {
  block-size: clamp(42px, 4.5vw, 58px);
}

.header.header--compact .nav-wrapper {
  gap: clamp(6px, 1vw, 16px);
}

.header.is-open.header--compact {
  padding-block: revert-layer;
}

/* ========================================================================
   HERO — CLEAN DESKTOP / NON-MOBILE
   Один актуальний блок без старих дублікатів.
   Мобільні правки мають бути тільки в mobile.css.
   ======================================================================== */

.hero {
  position: relative;
  min-block-size: 0;
  block-size: auto;
  aspect-ratio: 1920 / 828;
  margin-block-end: clamp(3.25rem, 6vw, 6rem);
  overflow: visible;
  background-color: #222222;
  background-image: url("../images/bghiro-optimized.webp");
  background-size: 100% 100%;
  background-position: center top;
  background-repeat: no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background: radial-gradient(
    120% 60% at 50% 55%,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.25) 30%,
    rgba(0, 0, 0, 0) 60%
  );
  mix-blend-mode: multiply;
  opacity: 0.18;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.composition {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
}

.composition img,
.hero .mask,
.hero .compass,
.hero .bottle,
.hero .pen {
  position: absolute;
  display: block;
  block-size: auto;
  max-inline-size: none;
  pointer-events: none;
}

.hero .mask,
.mask {
  z-index: 8;
  opacity: 1;
  inline-size: clamp(280px, 21vw, 420px);
  inset-inline-start: clamp(54px, 5.4vw, 104px);
  inset-block-start: clamp(20px, 5vw, 78px);
  transform: rotate(var(--hero-mask-rotate, -5deg));
  transform-origin: 50% 50%;
  filter:
    sepia(22%)
    grayscale(18%)
    drop-shadow(2px 7px 6px rgba(0, 0, 0, 0.38))
    drop-shadow(4px 16px 18px rgba(0, 0, 0, 0.20));
}

.hero .compass,
.compass {
  z-index: 7;
  inline-size: clamp(125px, 11.5vw, 205px);
  inset-inline-end: 45px;
  inset-block-start: 24px !important;
  transform: rotate(var(--hero-compass-rotate, -6deg));
  transform-origin: 50% 50%;
  filter:
    sepia(8%)
    drop-shadow(2px 6px 5px rgba(0, 0, 0, 0.34))
    drop-shadow(4px 14px 17px rgba(0, 0, 0, 0.18));
}

.hero .bottle,
.bottle {
  z-index: 6;
  inline-size: clamp(90px, 9vw, 173px);
  inset-inline-start: clamp(220px, 23vw, 450px);
  inset-block-start: clamp(320px, 50vw, 540px);
  filter:
    sepia(16%)
    grayscale(28%)
    drop-shadow(0 14px 18px rgba(0, 0, 0, 0.35));
}

.hero .pen,
.pen {
  z-index: 10;
  /*
    Не показуємо запасну CSS-позицію під час першого кадру.
    JavaScript відкриє ручку тільки після встановлення адаптивних координат.
  */
  opacity: 0;
  visibility: hidden;
  /*
    Керуємо саме довжиною вертикального файла пера,
    а не його шириною. Після повороту розмір залишається передбачуваним.
  */
  inline-size: auto;
  block-size: var(
    --hero-pen-size,
    clamp(250px, 46.3vw, 872px)
  );
  max-block-size: none;
  inset-inline-start: var(--hero-pen-x, 50%);
  inset-block-start: var(
    --hero-pen-y,
    clamp(405px, 58vw, 640px)
  );
  transform:
    translate(-50%, -50%)
    rotate(var(--hero-pen-rotate, 0deg));
  transform-origin: 50% 50%;
  filter:
    drop-shadow(3px 5px 4px rgba(18, 10, 4, 0.44))
    drop-shadow(0 2px 1px rgba(0, 0, 0, 0.26));
}

.hero.hero--positioned .pen {
  opacity: 1;
  visibility: visible;
}

.hero-text {
  position: absolute;
  z-index: 5;
  display: block;
  box-sizing: border-box;
  margin: 0;
  inset-inline-start: 50%;
  inset-block-start: var(--hero-text-y, 41.5%);
  max-inline-size: clamp(520px, 54vw, 860px);
  transform: translate(-50%, -50%);
  font-family: var(--ff-hero);
  font-size: var(--hero-text-size, clamp(3.4rem, 5vw, 5.15rem));
  line-height: var(--hero-text-line-height, 0.9);
  font-weight: 400;
  -webkit-text-stroke: 0.35px currentColor;
  letter-spacing: 0;
  text-align: center;
  color: #7a4f12;
  text-shadow:
    0 1px 2px rgba(255, 245, 215, 0.22),
    0 3px 8px rgba(0, 0, 0, 0.16);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hero-title {
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Посилання з HERO до секції книжок */
.hero-books-link {
  position: absolute;
  z-index: 9;
  inset-inline-start: 50%;
  inset-block-start: var(--hero-link-y, calc(64% - 18px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.8rem, 1.2vw, 1.25rem);
  inline-size: max-content;
  max-inline-size: calc(100% - 2rem);
  transform: translateX(-50%);
  color: #4b2f0b;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.hero-books-link__text {
  font-family: var(--ff-serif);
  font-size: clamp(1.25rem, 1.04rem + 0.72vw, 1.8rem);
  line-height: 1.2;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 245, 215, 0.28);
}

.hero-books-link__button {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  inline-size: clamp(54px, 5.4vw, 88px);
  block-size: clamp(54px, 5.4vw, 88px);
  border: 2px solid var(--color-yellow);
  border-radius: 50%;
  color: var(--color-yellow);
  background:
    radial-gradient(circle at 35% 28%, #815718 0%, #67400b 54%, #4b2b04 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 224, 137, 0.16),
    inset 0 2px 5px rgba(255, 233, 172, 0.1),
    0 2px 6px rgba(74, 42, 6, 0.3),
    0 0 9px rgba(205, 157, 46, 0.22);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.hero-books-link__button svg {
  inline-size: 56%;
  block-size: 56%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgba(43, 23, 2, 0.45));
}

.hero-books-link:hover .hero-books-link__button {
  transform: translateY(-1px) scale(1.035);
  filter: brightness(1.07);
  box-shadow:
    inset 0 0 0 2px rgba(255, 224, 137, 0.2),
    inset 0 2px 5px rgba(255, 233, 172, 0.13),
    0 4px 9px rgba(74, 42, 6, 0.34),
    0 0 13px rgba(205, 157, 46, 0.32);
}

.hero-books-link:active .hero-books-link__button {
  transform: translateY(1px) scale(0.96);
  color: var(--color-yellow);
  box-shadow:
    inset 0 0 0 2px rgba(255, 224, 137, 0.16),
    inset 0 3px 7px rgba(43, 23, 2, 0.34),
    0 1px 3px rgba(74, 42, 6, 0.3);
  filter: brightness(0.95);
  transition-duration: 0.08s;
}

.hero-books-link:focus-visible {
  outline: none;
}

.hero-books-link:focus-visible .hero-books-link__button {
  outline: 3px solid var(--color-yellow);
  outline-offset: 4px;
}

@supports not (inset-block-start: 50%) {
  .hero-text {
    top: var(--hero-text-y, 41.5%);
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .hero-books-link {
    top: var(--hero-link-y, calc(64% - 18px));
    left: 50%;
  }
}

/* ========================================================================
   ABOUT — ЧИСТИЙ БЛОК
   Один блок без дублів
   ======================================================================== */

/* ------------------------------------------------------------------------
   БАЗА
   ------------------------------------------------------------------------ */
.about {
  padding: calc(clamp(3.2rem, 5vw, 6.5rem) + 10px) 1rem clamp(3.2rem, 5vw, 6.5rem);
  background: #222222;
  color: #ffffff;
  text-align: center;
}

.about h2 {
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
  font-family: var(--ff-decor);
  font-size: var(--fs-500);
  color: #ffffff;
}


.about-content {
  max-inline-size: 1280px;
  margin-inline: auto;
}

.about-text {
  text-align: left;
}

.about-lead {
  margin: 0 0 1.5rem;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  line-height: 1.65;
  color: #fffaf0;
}

.about-block + .about-block {
  margin-top: 1.55rem;
}

.about-block h3 {
  margin: 0 0 0.55rem;
  font-family: var(--ff-serif);
  font-size: clamp(1.4rem, 1.2rem + 0.35vw, 1.7rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.about-block p {
  margin: 0;
  font-size: clamp(0.98rem, 0.94rem + 0.2vw, 1.12rem);
  line-height: 1.72;
  color: #fffaf0;
}

.about-note {
  position: relative;
  margin: 2rem 0 0;
  padding: 1.25rem 1.35rem 1.2rem 1.5rem;
  background: #fff8e9;
  border: 1px solid rgba(201, 161, 41, 0.22);
  border-radius: 20px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.about-note::before {
  content: "";
  position: absolute;
  inset-block: 1.1rem 1.1rem;
  inset-inline-start: 1.05rem;
  inline-size: 4px;
  border-radius: 999px;
  background: var(--c-accent);
}

.about-note p {
  margin: 0;
  padding-inline-start: 1.2rem;
  font-size: clamp(0.95rem, 0.92rem + 0.18vw, 1.06rem);
  line-height: 1.68;
  color: #4b4034;
  font-style: italic;
}

/* ------------------------------------------------------------------------
   КАРУСЕЛЬ / ФОТО
   ------------------------------------------------------------------------ */
.about-carousel-container,
.about-media {
  justify-self: center;
  align-self: center;
  inline-size: min(100%, 620px);
}

.about-carousel-container {
  padding: 18px 28px 24px;
  border-radius: 24px;
  overflow: hidden; /* видно тільки 1 слайд */
  background: transparent;
  box-shadow: none;
  touch-action: pan-y;
  isolation: isolate;
}

.about-carousel {
  display: flex;
  inline-size: 100%;
  gap: 0;
  transition: transform 0.5s ease;
  will-change: transform;
}

.about-carousel .carousel-item {
  flex: 0 0 100%;
  min-inline-size: 100%;
  inline-size: 100%;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 10px 18px 16px;
  margin: 0;
}

.about-carousel .carousel-item[hidden] {
  display: none !important;
}

.about-carousel .carousel-item .about-photo-frame,
.about-media .about-photo-frame {
  inline-size: min(100%, 430px);
  margin-inline: auto;
}

/* ------------------------------------------------------------------------
   РАМКА ФОТО
   ------------------------------------------------------------------------ */
.about-photo-frame {
  position: relative;
  display: inline-block;
  padding: clamp(12px, 1.8vw, 18px);
  background: #fffaf0;
  border-radius: 24px;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

.about-photo-frame > img {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
}

.about-photo-frame::before,
.about-photo-frame::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  z-index: -1;
}

.about-photo-frame::before {
  background: var(--color-yellow);
  transform: rotate(-2deg) translate(-8px, 6px);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25));
}

.about-photo-frame::after {
  background: #f7e4bf;
  transform: rotate(2deg) translate(6px, -4px);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25));
}

.about-corners {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border-radius: 16px;
  background:
    linear-gradient(var(--color-yellow) 0 0, var(--color-yellow) 0 0) left 0 top 0 / 38px 2px no-repeat,
    linear-gradient(var(--color-yellow) 0 0, var(--color-yellow) 0 0) left 0 top 0 / 2px 38px no-repeat,
    linear-gradient(var(--color-yellow) 0 0, var(--color-yellow) 0 0) right 0 top 0 / 38px 2px no-repeat,
    linear-gradient(var(--color-yellow) 0 0, var(--color-yellow) 0 0) right 0 top 0 / 2px 38px no-repeat,
    linear-gradient(var(--color-yellow) 0 0, var(--color-yellow) 0 0) left 0 bottom 0 / 38px 2px no-repeat,
    linear-gradient(var(--color-yellow) 0 0, var(--color-yellow) 0 0) left 0 bottom 0 / 2px 38px no-repeat,
    linear-gradient(var(--color-yellow) 0 0, var(--color-yellow) 0 0) right 0 bottom 0 / 38px 2px no-repeat,
    linear-gradient(var(--color-yellow) 0 0, var(--color-yellow) 0 0) right 0 bottom 0 / 2px 38px no-repeat;
}

/* ========================================================================
   DESKTOP
   ======================================================================== */
@media (min-width: 981px) {
  .hero {
    margin-block-end: -0.5rem;
  }

  .about {
    padding-block-start: 40px;
  }

  .about-content {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: clamp(24px, 4vw, 64px);
    text-align: left;
  }

  .about-text {
    max-inline-size: 58ch;
  }

  .about-carousel-container,
  .about-media {
    inline-size: min(100%, 620px);
  }

  .about-carousel .carousel-item .about-photo-frame,
  .about-media .about-photo-frame {
    inline-size: min(100%, 430px);
  }
}

/* ---------- НИЗЬКІ ДЕСКТОПИ ---------- */
@media (min-width: 1024px) and (max-height: 930px) {
  .about {
    padding: 40px 1rem 2.4rem;
  }

  .about h2 {
    margin-bottom: 1rem;
    font-size: clamp(2.8rem, 3.4vw, 4rem);
  }

  .about-content {
    gap: 28px;
    max-inline-size: 1080px;
    align-items: center;
  }

  .about-text {
    max-inline-size: 54ch;
  }

  .about-lead {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.55;
  }

  .about-block + .about-block {
    margin-top: 1.15rem;
  }

  .about-block h3 {
    margin-bottom: 0.4rem;
    font-size: 1.5rem;
    line-height: 1.08;
  }

  .about-block p {
    font-size: 0.98rem;
    line-height: 1.58;
  }

  .about-note {
    margin-top: 1.2rem;
    padding: 0.95rem 1rem 0.95rem 1.15rem;
    border-radius: 16px;
  }

  .about-note p {
    font-size: 0.94rem;
    line-height: 1.5;
  }
  .about-carousel-container,
  .about-media {
    inline-size: min(100%, 560px);
    padding: 10px 16px 14px;
  }

  .about-carousel .carousel-item {
    padding: 6px 10px 10px;
  }

  .about-carousel .carousel-item .about-photo-frame,
  .about-media .about-photo-frame {
    inline-size: min(100%, 360px);
  }

}


/* ========================================================================
   СЕКЦІЯ КНИЖОК
   ======================================================================== */

.books {
  position: relative;
  min-block-size: 100svh;
  padding: clamp(28px, 3vw, 48px) 1rem clamp(24px, 3vw, 44px);
  text-align: center;
  color: #2b1b00;
  background:
    radial-gradient(1200px 600px at 50% -120px, rgba(255, 255, 255, 0.55), transparent 70%),
    radial-gradient(800px 400px at 85% 45%, rgba(255, 215, 130, 0.2), transparent 60%),
    linear-gradient(180deg, #fff5e6 0%, #f7e4bf 40%, #f0cf97 100%);
  content-visibility: auto;
  contain-intrinsic-size: 900px 600px;

  --arrow-size: 44px;
  --arrow-inset: clamp(120px, 21vw, 300px);
  --track-width: min(96vw, 1260px);
  --track-h: clamp(560px, calc(100svh - 170px), 660px);
}


.books::before,
.books::after {
  content: "";
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.9;
  z-index: 1;
  pointer-events: none;
}

.books::before {
  left: 0;
  width: 25%;
  height: 45%;
  opacity: 0.6;
  background-image: url("../images/balduin-on-horseback.webp");
  background-position: left bottom;
}

.books::after {
  right: 0;
  bottom: 20%;
  width: 30%;
  height: 25%;
  opacity: 0.55;
  background-image: url("../images/castle.webp");
  background-position: right bottom;
}

.books .carousel-container {
  display: grid;
  grid-template-areas: "track";
  align-items: center;
  justify-items: center;
  inline-size: var(--track-width);
  max-inline-size: 100%;
  block-size: var(--track-h);
  margin-inline: auto;
  position: relative;
  overflow: hidden;
  transform: translateY(clamp(-86px, -8vh, -46px));
}

.books .js-books-carousel,
.books .carousel-button.prev,
.books .carousel-button.next {
  grid-area: track;
}

.books .js-books-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-inline-size: 0;
  block-size: 100%;
}

.books .carousel-item {
  flex: 0 0 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: clamp(16px, 2.2vh, 24px);
  position: relative;
  block-size: 100%;
  padding: 0;
}

.books .carousel-item img,
.books .book-cover {
  --book-hover-scale: 1;
  inline-size: clamp(250px, 21vw, 315px);
  aspect-ratio: 3 / 4;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,.20));
  animation: bookFloat 4s ease-in-out infinite;
  transition: filter 0.22s ease;
}

.books .carousel-item:hover img,
.books .carousel-item:hover .book-cover {
  --book-hover-scale: 1.03;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.32));
}

.books .carousel-item.is-zoomed img,
.books .carousel-item.is-zoomed .book-cover {
  --book-hover-scale: 1.03;
}

.books .carousel-button {
  inline-size: var(--arrow-size);
  block-size: var(--arrow-size);
  color: #1b1200;
  background: var(--color-gold-soft);
  border: 1px solid var(--color-border-brown);
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  transition: transform .2s ease, background-color .2s ease;
  z-index: 2;
}

.books .carousel-button.prev {
  justify-self: start;
  align-self: center;
  transform: translateX(var(--arrow-inset));
}

.books .carousel-button.next {
  justify-self: end;
  align-self: center;
  transform: translateX(calc(-1 * var(--arrow-inset)));
}

.books .carousel-button:hover,
.books .carousel-button:focus-visible {
  color: #1b1200;
  background: var(--color-yellow);
  outline: 3px solid var(--color-border-brown);
  outline-offset: 2px;
}

.books .carousel-button.next:hover,
.books .carousel-button.next:focus-visible {
  transform: translateX(calc(-1 * var(--arrow-inset))) scale(1.06);
}


.books .carousel-button:disabled,
.books .carousel-button[aria-disabled="true"] {
  background: #f3ead7;
  border: 1px solid #d9c79a;
  border-color: #d9c79a;
  color: rgba(43, 27, 0, 0.42);
  opacity: 0.82;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}
.books .carousel-pagination {
  position: absolute;
  inset-block-end: clamp(18px, 3vh, 30px);
  inset-inline: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 6;
}

.books .carousel-dot {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--c-accent) 18%, #fff 82%);
  border: 1px solid color-mix(in oklab, var(--c-accent) 50%, #000 50%);
  transition: background-color .15s, border-color .15s, transform .15s;
}

.books .carousel-dot.is-active {
  background: var(--c-accent);
  border-color: color-mix(in oklab, var(--c-accent) 75%, #000 25%);
}

.books .carousel-dot:hover,
.books .carousel-dot:focus-visible {
  transform: scale(1.08);
  outline: 3px solid color-mix(in oklab, var(--c-accent) 35%, #fff 65%);
  outline-offset: 2px;
}

.books .carousel-pagination.is-hidden {
  display: none;
}
/* =========================
   BOOK INFO TRIGGER — final
   ========================= */

.books .book-media {
  position: relative;
  display: inline-block;
  line-height: 0;
  transform: translateY(-clamp(18px, 3.5vh, 36px));
}

/* кнопка info на обкладинці */
.books .book-info-trigger {
  position: absolute;
  inset-block-start: clamp(22px, 1.55vw, 26px);
  inset-inline-start: clamp(48px, 3.05vw, 56px);

  inline-size: 36px;
  block-size: 36px;

  border-radius: 50%;
  border: 1px solid var(--color-border-brown);
  background: #fff8e1;
  color: #5a3a00;

  font-weight: 700;
  display: inline-grid;
  place-items: center;

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  opacity: 0.95;
  z-index: 6;

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background-color .18s ease,
    border-color .18s ease;
}

.books .book-info-trigger:hover,
.books .book-info-trigger:focus-visible {
  /* A slightly deeper warm cream keeps the hover clearly visible. */
  background: #f1e0b3;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
  border-color: var(--color-border-brown);
  outline: none;
}

.books .book-info-trigger:active {
  transform: translateY(0) scale(0.97);
}

.books .book-info-trigger span {
  display: block;
  font-size: 1rem;
  line-height: 1;
}
.book-overlay {
  position: absolute;
  inset-block-start: 63%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  inline-size: clamp(220px, 32vw, 320px);
  max-inline-size: calc(100% - 2rem);
  padding: clamp(10px, 1.6vw, 14px);
  background-color: var(--book-overlay-bg);
  border: var(--book-overlay-border);
  border-radius: var(--book-overlay-radius);
  box-shadow: var(--book-overlay-shadow);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: .45rem;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.book-overlay__header {
  position: relative;
  width: 100%;
  padding-block-end: .25rem;
  margin-block-end: .25rem;
  border-bottom: 0;
}

.book-overlay__header::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--m-divider) 8%,
    var(--m-divider) 92%,
    transparent 100%
  );
  pointer-events: none;
}

.book-overlay h3 {
  margin: 0;
  font-family: var(--ff-decor);
  font-size: clamp(1.1rem, 0.95rem + .5vw, 1.4rem);
  color: #3a2b0e;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}


.book-overlay__desc,
.book-overlay p {
  margin: 0;
  font-size: var(--fs-100);
  /*color: #2b2a28;*/
  color: #4b4034;
}

.carousel-item.is-open .book-overlay {
  opacity: 1;
  pointer-events: auto;
}

.carousel-item.is-open .book-cover {
  transform: scale(1.02);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.35));
  transition: transform 0.25s ease, filter 0.25s ease;
}

@supports not ((backdrop-filter: blur(3px))) {
  .book-overlay {
    background-color: var(--m-bg);
  }
}


/* ========================================================================
   СЕКЦІЯ АНОНСІВ
   ======================================================================== */

.announcements {
  position: relative;
  padding: 4rem 1rem 3rem;
  text-align: center;
  color: #ffffff;
  background: #222222;

  --ann-arrow-size: clamp(48px, 4.2vw, 60px);
  --ann-side-col: clamp(56px, 6vw, 78px);
  --ann-gap: 18px;
  --ann-row-gap: 20px;
}

.announcements h2 {
  color: #ffffff;
}

.announcements .custom-carousel {
  position: relative;
  display: grid;
  grid-template-columns: var(--ann-side-col) minmax(0, 1fr) var(--ann-side-col);
  grid-template-areas:
    "prev track next"
    ". dots .";
  align-items: center;
  column-gap: 18px;
  row-gap: var(--ann-row-gap);
  max-inline-size: min(1320px, 100%);
  margin-inline: auto;
  padding-inline: 0;
  overflow: visible;
}

.announcements .carousel-track {
  grid-area: track;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: var(--ann-gap);
  min-inline-size: 0;
  transition: transform 0.6s ease;
}

.announcements .carousel-item {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex: 0 0 calc((100% - (var(--ann-gap) * 2)) / 3);
  max-inline-size: calc((100% - (var(--ann-gap) * 2)) / 3);
}

.announcements .carousel-item[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------------
   Стрілки
   ------------------------------------------------------------------------ */
.announcements .carousel-button {
  display: grid;
  place-items: center;
  inline-size: var(--ann-arrow-size);
  block-size: var(--ann-arrow-size);
  margin: 0;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  color: #1b1200;
  background: var(--color-gold-soft);
  border: 1px solid var(--color-border-brown);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.18s ease,
    opacity 0.2s ease;
  cursor: pointer;
}

.announcements .carousel-button.prev {
  grid-area: prev;
  justify-self: center;
  align-self: center;
}

.announcements .carousel-button.next {
  grid-area: next;
  justify-self: center;
  align-self: center;
}

.announcements .carousel-button:hover,
.announcements .carousel-button:focus-visible {
  background: var(--color-yellow);
  border-color: var(--color-border-brown);
  transform: scale(1.06);
  outline: 3px solid var(--color-border-brown);
  outline-offset: 2px;
}

.announcements .carousel-button:disabled,
.announcements .carousel-button[aria-disabled="true"] {
  background: linear-gradient(145deg, #4a4a4a 0%, #383838 45%, #292929 100%);
  color: #999999;
  opacity: 0.7;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  cursor: default;
  pointer-events: none;
}

/* ------------------------------------------------------------------------
   Пагінація
   ------------------------------------------------------------------------ */
.announcements .carousel-pagination {
  grid-area: dots;
  justify-self: center;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0;
  z-index: 3;
}

.announcements .carousel-dot {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--c-accent) 18%, #fff 82%);
  border: 1px solid color-mix(in oklab, var(--c-accent) 50%, #000 50%);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.announcements .carousel-dot[aria-current="true"],
.announcements .carousel-dot.is-active {
  background: var(--c-accent);
  border-color: color-mix(in oklab, var(--c-accent) 75%, #000 25%);
}

.announcements .carousel-dot:hover,
.announcements .carousel-dot:focus-visible {
  background: color-mix(in oklab, var(--c-accent) 30%, #fff 70%);
  border-color: color-mix(in oklab, var(--c-accent) 70%, #000 30%);
  transform: scale(1.08);
  outline: 3px solid color-mix(in oklab, var(--c-accent) 35%, #fff 65%);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------------
   Картка
   ------------------------------------------------------------------------ */
.announcement-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  inline-size: 100%;
  max-inline-size: 360px;
  min-block-size: 520px;
  padding: 1.55rem 1.1rem 1.35rem;
  text-align: center;
  color: #2b1b00;
  background: #fff8e9;
  border-radius: 26px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.announcement-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.announcement-card .card-media {
  margin: 0;
}

.announcement-card .card-media img {
  inline-size: 100%;
  block-size: clamp(160px, 18vw, 190px);
  object-fit: cover;
  border-radius: 16px;
}

.announcement-card .card-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  block-size: 100%;
}

.announcement-card .date {
  margin: 0 0 10px;
  padding-top: 6px;
  font-size: 1.14rem;
  line-height: 1.15;
  font-weight: 700;
  color: #4a2600;
}

.announcement-card h3,
.announcement-card .card-title {
  margin: 0;
  line-height: 1.08;
}

.announcement-card .card-excerpt {
  margin: 0;
  max-block-size: 4.6em;
  overflow: hidden;
}

.announcement-card .card-more {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 180px;
  min-block-size: 44px;
  padding: 0.55rem 1.25rem;
  margin-top: clamp(14px, 2vw, 22px);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  color: #2b1b00;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 48%, transparent);
  border-radius: 999px;
  box-shadow:
    var(--shadow-control),
    0 0 0 transparent;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.announcement-card .card-more:hover,
.announcement-card .card-more:focus-visible {
  background: var(--color-gold-soft);
  border-color: var(--color-border-brown);
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(120, 80, 20, 0.22),
    0 0 12px color-mix(in srgb, var(--color-yellow) 20%, transparent);
  outline: none;
}

.announcement-card .ann-status {
  position: absolute;
  inset-block-start: 14px;
  inset-inline-start: 16px;
  padding-block: 0.1rem;
  padding-inline: 0.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2b1b00;
  background: #fff1c7;
  border: 1px solid #e0c36a;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
  z-index: 2;
}

/* Коли немає фото */
.announcement-card.is-no-image {
  padding-block-start: 1.5rem;
}

.announcement-card.is-no-image .card-body {
  margin-top: 18px;
}

/* ------------------------------------------------------------------------
   TABLET — 2 картки
   ------------------------------------------------------------------------ */


/* ========================================================================
   ANNOUNCEMENTS — desktop refined
   Менші картки, спокійніші заголовки, більше повітря біля пагінації
   ======================================================================== */
@media (min-width: 1024px) {
  .announcements {
    padding: 3rem 1rem 4.2rem;
  }

  .announcements .custom-carousel {
    --ann-side-col: 64px;
    --ann-gap: 16px;
    --ann-row-gap: 28px;

    max-inline-size: min(1180px, 100%);
    column-gap: 16px;
    row-gap: 28px;
  }

  .announcement-card {
    max-inline-size: 310px;
    min-block-size: 440px;
    padding: 0.95rem 0.9rem 1rem;
    border-radius: 22px;
  }

  .announcement-card .date {
    margin: 0 0 8px;
    padding-top: 10px;
    font-size: 1.02rem;
    line-height: 1.15;
  }

  .announcement-card h3,
  .announcement-card .card-title {
    font-size: clamp(1.85rem, 0.8vw + 1.2rem, 2.25rem);
   line-height: 1.08;

  }

  .announcement-card .card-excerpt {
    font-size: 0.98rem;
    line-height: 1.52;
    max-block-size: 4.7em;
  }

  .announcement-card .card-more {
    min-inline-size: 168px;
    min-block-size: 40px;
    padding: 0.5rem 1rem;
    margin-top: 18px;
  }

  .announcements .carousel-pagination {
    margin-top: 8px;
  }

  .announcements .carousel-dot {
    inline-size: 11px;
    block-size: 11px;
  }
  
}

/* ========================================================================
   NEWSLETTER — INSIDE ANNOUNCEMENTS
   ======================================================================== */

.newsletter-signup {
  inline-size: min(100%, 720px);
  margin: 34px auto 0;
  padding: 28px 32px 24px;
  color: #2b1b00;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.74), transparent 48%),
    linear-gradient(180deg, #fffaf0 0%, #fff3df 100%);
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 34%, transparent);
  border-radius: 24px;
  box-shadow: var(--shadow-object);
  text-align: center;
}

.newsletter-signup__title {
  margin: 0;
  font-family: var(--ff-decor);
  font-size: clamp(1.9rem, 1.35rem + 1.45vw, 2.55rem);
  line-height: 1.08;
  font-weight: 400;
  color: #3a2b0e;
}

.newsletter-signup__title::after {
  content: \"\";
  display: block;
  inline-size: var(--decor-line-width);
  block-size: var(--decor-line-height);
  margin: var(--decor-line-gap) auto 0;
  border-radius: var(--decor-line-radius);
  background: var(--decor-line-color);
}

.newsletter-signup__intro {
  max-inline-size: 520px;
  margin: 12px auto 18px;
  font-family: var(--ff-serif);
  font-size: 1rem;
  line-height: 1.55;
  color: #4b4034;
}

.newsletter-signup__form {
  max-inline-size: 610px;
  margin-inline: auto;
}

.newsletter-signup__form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.newsletter-signup__email {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 48px;
  padding: 0.8rem 1.05rem;
  font-family: var(--ff-serif);
  font-size: 1rem;
  color: #2b1b00;
  background: #fef3d8;
  border: 1px solid var(--color-field-border);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.newsletter-signup__email::placeholder {
  color: #7b6b54;
  opacity: .9;
}

.newsletter-signup__button {
  min-inline-size: 168px;
  min-block-size: 48px;
  padding: 0.65rem 1.35rem;
  font-family: var(--ff-serif);
  font-size: 1rem;
  font-weight: 700;
  color: #2b1b00;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 52%, transparent);
  border-radius: 999px;
  box-shadow: var(--shadow-control);
  cursor: pointer;
  transition:
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}

.newsletter-signup__button:hover,
.newsletter-signup__button:focus-visible {
  background: var(--color-gold-soft);
  border-color: var(--color-border-brown);
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(120, 80, 20, 0.22),
    0 0 12px color-mix(in srgb, var(--color-yellow) 20%, transparent);
  outline: none;
}

.newsletter-signup__button:active {
  transform: translateY(0) scale(.985);
}

.newsletter-signup__privacy {
  margin: 12px auto 0;
  font-size: .8rem;
  line-height: 1.45;
  color: #72634e;
}

.newsletter-signup__privacy a {
  color: #6b4b13;
  text-decoration: underline;
  text-decoration-color: rgba(201, 161, 41, .75);
  text-underline-offset: 3px;
}

.newsletter-signup__message {
  max-inline-size: 610px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .96rem;
  line-height: 1.4;
}

.newsletter-signup__message--success {
  color: #31502b;
  background: #eef9e9;
  border: 1px solid #b7d5ad;
}

.newsletter-signup__message--error {
  color: #6b2e27;
  background: #fff0ed;
  border: 1px solid #dfb0a8;
}

.newsletter-signup__hp {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* ========================================================================
   REVIEWS 
   ======================================================================== */

.reviews {
  padding: clamp(56px, 7vw, 96px) 1rem;
  background:
    radial-gradient(1200px 600px at 50% -120px, rgba(255,255,255,0), transparent 70%),
    radial-gradient(800px 400px at 85% 45%, rgba(255,215,130,0), transparent 60%),
    linear-gradient(180deg, #f0cf97 0%, #f7e4bf 60%, #fff5e6 100%);
  text-align: center;
}

.reviews h2 {
  margin-bottom: 1.6rem;
}

.reviews .container {
  max-width: 1180px;
  margin-inline: auto;
}

/* GRID */
.reviews__grid {
  display: grid;
  grid-template-columns: minmax(0, 714px) minmax(380px, 430px);
  align-items: start;
  column-gap: 36px;
  justify-content: center;
}

/*
 * JS збирає стрілки, список і статистику в незалежну ліву колонку.
 * Її висота залежить тільки від кількості та довжини відгуків,
 * тому висока форма праворуч більше не відсуває статистику вниз.
 */
.reviews__content-col {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: start;
}

.reviews__grid > .review-form {
  grid-column: 2;
  grid-row: 1;
}

/* Відокремлюємо статистику від останньої картки відгуку на десктопі. */
@media (min-width: 1025px) {
  .reviews__content-col > .reviews__stats {
    margin-top: 24px;
  }
}

/* LEFT COLUMN */
.reviews__list-col {
  grid-area: list;
  min-width: 0;
}

/* filters */
.reviews__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  justify-content: flex-start;
}

.reviews__filter {
  appearance: none;
  padding: 7px 14px;
  border: 1px solid var(--color-border-brown);
  border-radius: 999px;
  background: #fff6dd;
  color: #5a3a00;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: var(--shadow-control);
  cursor: pointer;
  transition:
    background-color .2s ease,
    border-color .2s ease,
    color .2s ease,
    transform .2s ease,
    box-shadow .2s ease;
}

.reviews__filter:hover,
.reviews__filter:focus-visible {
  background: #fff2d1;
  border-color: var(--color-field-border);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.reviews__filter:focus-visible {
  outline: 3px solid var(--color-border-brown);
  outline-offset: 2px;
}

.reviews__filter.is-active {
  background: var(--color-ochre);
  color: #2b1b00;
  border: 1px solid var(--color-border-brown);
  box-shadow: 0 4px 12px rgba(120, 80, 20, 0.16);
}

.reviews__filter.is-active:hover,
.reviews__filter.is-active:focus-visible {
  background: var(--color-ochre);
  color: #2b1b00;
  border-color: var(--color-border-brown);
  transform: none;
  box-shadow: 0 6px 14px rgba(120, 80, 20, 0.18);
}

.reviews__filter.is-active:focus-visible {
  outline: 3px solid var(--color-border-brown);
  outline-offset: 2px;
}

/* arrows */
.reviews__prev,
.reviews__more {
  inline-size: 52px;
  block-size: 52px;
  border-radius: 50%;
  border: 1px solid var(--color-border-brown);
  background: #fff8e9;
  color: #2b1b00;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    background-color .2s ease,
    border-color .2s ease,
    color .2s ease,
    transform .2s ease,
    box-shadow .2s ease,
    opacity .2s ease;
}

.reviews__prev:hover,
.reviews__more:hover,
.reviews__prev:focus-visible,
.reviews__more:focus-visible {
  background: var(--color-gold-soft);
  border-color: var(--color-border-brown);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.10);
  outline: none;
}

.reviews__prev:disabled,
.reviews__more:disabled,
.reviews__prev[aria-disabled="true"],
.reviews__more[aria-disabled="true"] {
  background: #f3ead7;
  border-color: #e2d4ad;
  color: rgba(43,27,0,0.35);
  opacity: .65;
  cursor: default;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.reviews__prev {
  grid-area: prev;
  display: inline-flex;
  justify-self: center;
  align-self: end;
  margin: 0 auto 14px;
  position: relative;
  z-index: 3;
}

.reviews__more {
  grid-area: more;
  display: inline-flex;
  justify-self: center;
  align-self: start;
  margin: 14px auto 6px;
  position: relative;
  z-index: 3;
}

/* list */
.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  max-height: none;
  overflow: visible;
}

.review {
  width: 100%;
  min-height: 165px;
  height: auto;
  padding: 22px 24px;
  background: #fff8e9;
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 34%, transparent);
  border-radius: 16px;
  box-shadow: var(--shadow-paper);
  text-align: left;
  display: flex;
  flex-direction: column;
}

.review__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.25rem 1rem;
}

.review__date {
  grid-column: 1;
  font-size: 0.88rem;
  line-height: 1.2;
  color: rgba(35,35,35,0.48);
}

.review__rating {
  grid-column: 2;
  justify-self: end;
  align-self: start;
  margin-top: 2px;
  font-size: 1.08rem;
  line-height: 1;
  letter-spacing: 2px;
  color: #e0a600;
}

.review__book {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--color-review-book);
  font-weight: 700;
}

.review__book::before {
  content: "Книжка: ";
  opacity: 0.72;
}

/* English version: CSS-generated label is not translated automatically. */
html[lang^="en"] .review__book::before {
  content: "Book: ";
}

.review__text {
  margin-top: 0.9rem;
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
  line-height: 1.58;
  color: #2c2c2c;
  text-align: justify;
  text-align-last: start;
  hyphens: auto;
}
.review__signature::before {
  content: "— ";
}
.review__signature {
  margin-top: auto;
  margin-bottom: 0;
  text-align: right;
  font-size: 0.98rem;
  line-height: 1.3;
  color: #9a6b1a;
  font-weight: 700;
  opacity: 0.92;
}

/* FORM */
.review-form {
  grid-area: form;
  position: sticky;
  top: 1rem;
  max-inline-size: 430px;
  inline-size: 100%;
  justify-self: stretch;
  background: #fff8e9;
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 34%, transparent);
  border-radius: 28px;
  padding: 28px 26px;
  box-shadow: var(--shadow-paper);
}

.review-form__title {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: var(--fs-400);
}

.field {
  display: block;
  margin-bottom: 0.8rem;
}

.field__label {
  display: block;
  margin-bottom: 0.42rem;
  text-align: center;
  font-weight: 700;
  color: #222;
}

.field__control,
.review-form select,
.review-form textarea {
  inline-size: 100%;
  min-block-size: 54px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-field-border);
  border-radius: 20px;
  background: #fef3d8;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  font-family: var(--ff-serif);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.field__control--textarea,
.review-form textarea {
  min-block-size: 145px;
  border-radius: 16px;
  resize: vertical;
}

.rating {
  margin-bottom: 0.85rem;
  border: 0;
}

.rating__stars {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.rating__stars .star {
  inline-size: 30px;
  block-size: 30px;
  border: 1px solid #e0cfaf;
  border-radius: 8px;
  background: #fff1cf;
  color: #6b4a00;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.rating__stars .star.is-active {
  border-color: #d4af38;
  background: #ffe7a2;
  color: #9a6b00;
}

.rating__stars .star:focus-visible {
  background: #fff2d1;
  border-color: #d4af37;
  color: #9a6b00;
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.22);
  outline: 2px solid #b88d33;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .rating__stars .star:hover {
    background: #fff2d1;
    border-color: #d4af37;
    color: #9a6b00;
    transform: scale(1.06);
    box-shadow: 0 5px 12px rgba(120, 80, 20, 0.16);
  }
}

/* message */
.review-form__message {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.review-form__message.is-visible {
  display: block;
}

.review-form__message.is-success {
  background: #eaf7ed;
  color: #1f6b36;
  border: 1px solid #95cf8c;
}

.review-form__message.is-error {
  background: #fdecec;
  color: #9f2f2f;
  border: 1px solid #e0a0a0;
}

/* stats */
.reviews__stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 760px;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.stat {
  padding: 18px 12px;
  border-radius: 16px;
  background: #fff8e9;
  border: 1.5px solid var(--color-border-brown);
  box-shadow: var(--shadow-paper);
  text-align: center;
}

.stat__value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-ochre);
  margin-bottom: 4px;
}

.stat__label {
  font-size: 0.95rem;
  color: #3b2a00;
  opacity: 0.8;
}

/* tablet */


/* ========================================================================
   КОНТАКТИ
   ======================================================================== */
.contacts {
  position: relative;
  padding: 3rem 1rem;
  background:
    radial-gradient(1200px 600px at 50% -120px, rgba(255, 255, 255, 0), transparent 70%),
    radial-gradient(800px 400px at 85% 45%, rgba(255, 215, 130, 0), transparent 60%),
    linear-gradient(180deg, #fff5e6 0%, #f7e4bf 40%, #f0cf97 100%);
  z-index: 0;
  content-visibility: auto;
  contain-intrinsic-size: 900px 700px;
}

.contacts h2 {
  margin: 0 0 1.5rem;
  font-family: var(--ff-decor);
  font-size: clamp(2rem, 5vw, 3.5rem);
 
}

.contacts-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "card"
    "socials";
  align-items: start;
  justify-items: center;
  gap: clamp(14px, 1.6vw, 20px);
  max-inline-size: 1120px;
  margin-inline: auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  z-index: 2;
}

.contact-form {
  grid-area: card;
  position: relative;
  inline-size: min(100%, var(--contact-card-max));
  min-block-size: clamp(360px, 44vh, 520px);
  padding: var(--contact-card-pad);
  padding-block-end: 40px;
  background: #fff8e9;
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 34%, transparent);
  border-radius: 20px;
  box-shadow: var(--shadow-object);
  justify-self: center;
   z-index: 3;
}


.contact-form h3 {
  text-align: center;
  margin: 0 0 clamp(10px, 1.4vw, 14px);
  font-size: var(--fs-400);
}

.contact-form form {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--contact-gap);
}

.form-group {
  margin: 0;
}

.form-group input,
.form-group textarea {
  inline-size: 100%;
  padding: var(--contact-field-pad) 1rem;
  border: 1px solid var(--color-field-border);
  border-radius: 24px;
  background: #fef3d8;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  font-family: var(--ff-serif);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  accent-color: var(--c-accent);
}

.form-group textarea {
  min-block-size: 120px;
  resize: vertical;
}

/* FORM FIELDS — one shared color system for newsletter, review and contact */
.newsletter-signup__email:hover,
.review-form .field__control:hover,
.contact-form .form-group :is(input, textarea, select):hover {
  border-color: var(--color-field-border);
}

.newsletter-signup__email:focus,
.review-form .field__control:focus,
.contact-form .form-group :is(input, textarea, select):focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  background: #fef3d8;
  border-color: var(--color-border-brown);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--color-yellow) 22%, transparent),
    0 4px 10px rgba(120, 80, 20, 0.08);
}

.form-error {
  font-size: var(--fs-100);
  line-height: 1.4;
  font-weight: 700;
  color: #b00020;
  margin-block-start: 0.35rem;
}

.is-invalid {
  border-color: #b00020 !important;
  background: #fff3f3 !important;
}

.form-group:has(input:is(:focus, .is-invalid)),
.form-group:has(textarea:is(:focus, .is-invalid)) {
  padding-block-end: 0.15rem;
  border-block-end: 2px solid color-mix(in oklab, #b00020 35%, var(--primary-color) 65%);
}

.form-group--hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.contact-form__notice {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 12px;
}

.contact-form__notice--success {
  background: #eaf7ed;
  color: #1f6b36;
}

.contact-form__notice--error,
.contact-form__notice--invalid {
  background: #fdecec;
  color: #9f2f2f;
}

.contact-form .form-group label {
  display: block;
  text-align: center;
  margin-bottom: 6px;
  font-weight: 700;
  color: #222222;
}

.contacts::before,
.contacts::after {
  content: "";
  position: absolute;

  inset-block-start: auto;

  inline-size: clamp(180px, 30vw, 420px);
  block-size: clamp(360px, 85vh, 720px);

  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;

  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
}

.contacts::before {
  inset-block-end: clamp(-70px, -5vw, -35px);
   inset-inline-start: clamp(-22px, -1.5vw, -7px);
  background-image: url("../images/tree-left.webp");
}

.contacts::after {
   inset-block-end: clamp(-95px, -6vw, -55px);
  inset-inline-end: clamp(-42px, -2.4vw, -18px);
  block-size: clamp(420px, 90vh, 760px);
  background-image: url("../images/tree-right.webp");
  opacity: 0.55;
}

@media (min-width: 768px) {
  .contact-form form {
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(12px, 1.3vw, 18px);
    row-gap: var(--contact-gap);
  }

  .contact-form form > .form-group--full,
  .contact-form form > button {
    grid-column: 1 / -1;
  }
}


/* ========================================================================
   ФУТЕР
   ======================================================================== */
.footer {
  position: relative;
  background: linear-gradient(
    180deg,
    var(--footer-bg-1, #191714) 0%,
    var(--footer-bg-2, #201d19) 55%,
    var(--footer-bg-3, #26231e) 100%
  );
  padding-block: clamp(24px, 3.5vw, 44px);
  padding-inline: 1rem;
}

.footer-content {
  max-inline-size: var(--footer-maxw);
  margin-inline: auto;
  border-radius: var(--footer-radius);
  background: #fff8e9;
  padding: var(--footer-pad);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  display: grid;
  gap: var(--footer-gap);
  grid-template-columns: 1fr;
}


.footer-brand__title {
  grid-column: 2;
  position: relative;
  display: block;
  inline-size: max-content;
  max-inline-size: 100%;
  margin: 0 auto;
  padding-block-end: 0.55rem;
  line-height: 1;
  text-align: center;
}

.footer-section h3 {
  display: block;
  inline-size: max-content;
  max-inline-size: 100%;
  margin: 0 auto;
  font-family: var(--ff-decor, "Cormorant", serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.15;
  color: var(--footer-accent);
  letter-spacing: .4px;
  position: relative;
  padding-block-end: .55rem;
  text-align: center;
}

.footer-section,
.footer-section p,
.nav-footer a,
.footer-contacts a {
  color: var(--footer-text);
}

.footer-platforms {
  inline-size: 100%;
  margin-block-start: 1.15rem;
}

.footer-platforms__title {
  margin: 0 0 .72rem;
  color: var(--footer-text);
  font-family: var(--ff-main, "Tinos", serif);
  font-size: clamp(.96rem, .9rem + .18vw, 1.08rem);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.footer-platforms__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .62rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-platforms__list li {
  min-inline-size: 0;
}

.footer-platforms__link {
  display: grid;
  grid-template-columns: 19px auto 15px;
  align-items: center;
  justify-content: center;
  column-gap: .48rem;
  min-inline-size: 142px;
  min-block-size: 44px;
  padding: .62rem .78rem;
  border: 1px solid rgba(142, 111, 34, .48);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf8 0%, #fff5de 100%);
  color: #6f5315;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .88) inset,
    0 5px 14px rgba(71, 49, 8, .09);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}

.footer-platforms__icon,
.footer-platforms__arrow {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.footer-platforms__icon {
  fill: currentColor;
}

.footer-platforms__arrow {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-platforms__label {
  white-space: nowrap;
}

.footer-platforms__link:focus-visible {
  border-color: var(--color-border-brown);
  outline: 3px solid var(--color-border-brown);
  outline-offset: 3px;
}

.nav-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .48rem;
  justify-items: center;
  text-align: center;
}

.nav-footer a {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.nav-footer a:hover,
.nav-footer a:focus-visible,
.footer-contacts a:hover,
.footer-contacts a:focus-visible {
  color: var(--footer-accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-contact-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-block: .45rem;
  color: var(--footer-text);
}

.footer-contact-row .ico {
  inline-size: 28px;
  block-size: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff3d4;
  color: var(--footer-accent-ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.06) inset;
  font-size: .95rem;
}

.footer-social {
  inline-size: max-content;
  max-inline-size: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-social__list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin: .45rem auto 0;
  list-style: none;
}

.footer-social__link {
  inline-size: 44px;
  block-size: 44px;
  border: 1px solid rgba(142, 111, 34, .32);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff7e5;
  color: var(--footer-accent-ink);
  box-shadow:
    0 2px 0 rgba(0,0,0,.06) inset,
    0 6px 18px rgba(0,0,0,.10);
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.footer-social__link svg {
  display: block;
  inline-size: 20px;
  block-size: 20px;
  fill: currentColor;
}

.footer-platforms__link:hover,
.footer-platforms__link:focus-visible,
.footer-social__link:hover,
.footer-social__link:focus-visible {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(142, 111, 34, .48);
  background: #fff2d1;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--color-yellow) 18%, transparent);
}

.footer-social__hint {
  inline-size: max-content;
  max-inline-size: 100%;
  margin: .55rem auto 0;
  color: var(--footer-text);
  line-height: 1.35;
  text-align: center;
}

.footer-social__hint-line {
  display: block;
  inline-size: 100%;
  text-align: center;
}

.footer-social__hint-line--1 {
  white-space: nowrap;
}

.footer-social__hint-line--2 {
  margin-block-start: .12rem;
}

.footer p.copyright {
  max-inline-size: var(--footer-maxw);
  margin-inline: auto;
  margin-block-start: clamp(10px, 1.2vw, 14px);
  padding-block: clamp(12px, 2vw, 16px);
  padding-inline: clamp(10px, 2vw, 20px);
  border-top: 1px solid var(--footer-subtle);
  text-align: center;
  color: var(--footer-text-copyright);
}

.footer-legal {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  transition:
    color .18s ease,
    text-shadow .18s ease;
}

.footer-legal:hover {
  color: var(--color-yellow);
  text-decoration: none;
  text-shadow: 0 0 10px color-mix(in srgb, var(--color-yellow) 16%, transparent);
}

.footer-legal:focus-visible {
  color: var(--color-yellow);
  text-decoration: none;
  outline: 2px solid var(--color-yellow);
  outline-offset: 4px;
  border-radius: 4px;
  text-shadow: none;
}

.footer-contact-icon {
  inline-size: 22px;
  block-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-yellow);
  flex: 0 0 22px;
}

.footer-contact-icon svg {
  inline-size: 18px;
  block-size: 18px;
  fill: currentColor;
  display: block;
}

.back-to-top {
  display: block;
  margin: 2rem auto 0;
  min-block-size: 44px;
  padding: .66rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-brown);
  background: var(--footer-accent);
  color: #1a1205;
  font-weight: 600;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--color-yellow);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .24);
}

.back-to-top:focus-visible {
  background: var(--color-yellow);
  outline: 3px solid var(--color-border-brown);
  outline-offset: 4px;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--color-yellow) 16%, transparent),
    0 12px 26px rgba(0, 0, 0, .22);
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

@media (min-width: 960px) {
  .footer-content {
    grid-template-columns: 1.15fr 0.9fr 1fr;
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .footer-content {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: clamp(24px, 3vw, 48px);
  }
}


/* ========================================================================
   ЗМЕНШЕНИЙ РУХ
   ======================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
.about-carousel,
  .carousel-track,
  .books .carousel-item img {
    transition: none !important;
  }

  .hero-books-link__button {
    transition: none;
  }

  .book-hint {
    animation: none;
  }
}


/* ========================================================================
   МОДАЛКИ
   ======================================================================== */

/* БАЗА МОДАЛОК
   Використовується як для .modal (книги/розділи),
   так і для .ann-modal (анонси) */
.modal,
.ann-modal{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(22,18,12,.6);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity .25s ease;
}
.modal.is-visible,
.ann-modal.is-visible{
  opacity: 1;
  pointer-events: auto;
}

/* Вікно/коробка */
.modal .modal__dialog,
.ann-modal__dialog{
  inline-size: min(1060px, 94vw);          /* базова ширина */
  max-block-size: min(82vh, 760px);        /* контроль висоти */
  background: var(--m-bg);
  color: var(--m-ink);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow);
  overflow: clip;                          /* чисте обрізання країв */
}

/* Анонси трохи вужчі за макетом */
.ann-modal__dialog{ inline-size: min(920px, 92vw); }

/* =========================================================
   ЄДИНИЙ ХЕДЕР ДЛЯ ВСІХ МОДАЛОК
   (заголовок зліва, хрестик-коло праворуч)
   ======================================================= */
.modal .modal__header,
.ann-modal .modal__header{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: clamp(14px, 2.2vw, 22px) clamp(16px, 2.6vw, 28px);
  border-bottom: 0;
}

.modal .modal__header::after,
.ann-modal .modal__header::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--m-divider) 8%,
    var(--m-divider) 92%,
    transparent 100%
  );
  pointer-events: none;
}
.modal .modal__title,
.ann-modal .modal__title{
  margin: 0;
  font-family: var(--ff-decor, "Great Vibes", cursive);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.1rem + 1.2vw, 2.4rem);
  line-height: 1.1;
}
.modal .modal__close,
.ann-modal .modal__close{
  inline-size: 40px;
  block-size: 40px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 48%, transparent);
  border-radius: 50%;
  background: #181818;
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.18),
    0 0 0 transparent;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.modal .modal__close:hover,
.modal .modal__close:focus-visible,
.ann-modal .modal__close:hover,
.ann-modal .modal__close:focus-visible{
  background: #3a2b0e;
  border-color: rgba(201, 154, 46, 0.85);
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    0 8px 18px rgba(58, 43, 14, 0.25),
    0 0 10px rgba(201, 154, 46, 0.18);
  outline: none;
}

/* =========================================================
   КНОПКИ (єдиний стиль усередині модалок)
   ======================================================= */
.modal .btn,
.modal .btn-ghost,
.modal .btn.btn--solid,
.modal .btn.btn--ghost,
.ann-modal .cta-bar button{
  font: inherit;
  font-weight: 800;
  padding: .7rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .18s, border-color .18s, transform .12s, box-shadow .18s;
}

/* Primary (золото) */
.modal .btn,
.modal .btn.btn--solid,
.ann-modal .cta-bar .btn--primary{
  background: var(--m-accent);
  color: var(--m-accent-ink);
  border: 1px solid var(--m-btn-bdr);
  box-shadow: 0 6px 16px rgb(0 0 0 / .12);
}
.modal .btn:hover,
.modal .btn.btn--solid:hover,
.ann-modal .cta-bar .btn--primary:hover{
  background: color-mix(in oklab, var(--m-accent) 94%, #000 6%);
  border-color: var(--m-btn-bdr-h);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgb(0 0 0 / .16);
}
.modal .btn:focus-visible,
.modal .btn.btn--solid:focus-visible,
.ann-modal .cta-bar .btn--primary:focus-visible{
  outline: 3px solid var(--m-btn-ring);
  outline-offset: 2px;
}

/* Secondary (біла / ghost) */
.modal .btn-ghost,
.modal .btn.btn--ghost,
.ann-modal .cta-bar .btn--ghost{
  background: #fff;
  color: var(--m-ink);
  border: 1px solid var(--m-btn-bdr);
  box-shadow: 0 4px 12px rgb(0 0 0 / .06);
}
.modal .btn-ghost:hover,
.modal .btn.btn--ghost:hover,
.ann-modal .cta-bar .btn--ghost:hover{
  background: #fffaf2;
  border-color: var(--m-btn-bdr-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgb(0 0 0 / .10);
}

/* Disabled-стан */
.modal :is(.btn,.btn-ghost)[disabled],
.ann-modal .cta-bar :is(button)[disabled]{
  filter: grayscale(.3) opacity(.55);
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* =========================================================
   МОДАЛКА КНИГИ — «ДЕТАЛІ»
   (обкладинка + опис зі стрілочкою й липкою панеллю кнопок)
   ======================================================= */
.modal--details .modal__body{
  display: grid;
  grid-template-columns: clamp(240px, 28vw, 360px) 1fr;
  gap: clamp(14px, 2.4vw, 28px);
  padding: clamp(16px, 2.4vw, 28px);
}
.modal--details .modal__cover{
  inline-size: 90%;
  border-radius: 14px;
  object-fit: cover;
}
.modal--details .modal__content{
  display: grid;
  align-content: start;
  gap: 1rem;
}
.modal--details .modal__text,
.ann-modal__desc {
  /* згорнуто за замовчуванням */
  --desc-collapsed: clamp(14rem, 30vh, 20rem);
  --desc-expanded:  clamp(22rem, 48vh, 32rem);
  max-inline-size: 62ch;
  max-block-size: var(--desc-collapsed);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
          mask-image: linear-gradient(to bottom, #000 72%, transparent);
  padding-inline-end: 1.75rem; /* місце під рейку */
  transition: max-block-size .28s ease;
  scrollbar-width: none;
}


/* прибираємо fade для короткого тексту в анонсах */
.ann-modal__desc {
  -webkit-mask-image: none;
          mask-image: none;
}

/* повертаємо fade тільки коли toggle реально видимий */
.ann-modal__right:has(.desc-toggle--ann:not(.is-hidden)) .ann-modal__desc:not(.is-expanded) {
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
          mask-image: linear-gradient(to bottom, #000 72%, transparent);
}


/* Липка панель кнопок унизу (видима в згорнутому стані) */
.modal--details .modal__cta,
.ann-modal .modal__cta,
.modal--chapters .modal__cta{
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: .6rem .25rem .25rem;
  background: linear-gradient(to top, var(--m-bg) 70%, transparent);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}


/* Кнопка-коло для згортання/розгортання */
.modal--details .desc-toggle,
.ann-modal .desc-toggle{
  inline-size: 36px;
  block-size: 36px;
  display: inline-grid;
  place-items: center;
  margin: .35rem auto 0;
  border-radius: 50%;
  background: #fffaf2;
  color: var(--m-ink);
  border: 1px solid var(--m-btn-bdr);
  box-shadow: 0 2px 8px rgb(0 0 0 / .08);
  transition: background-color .18s, border-color .18s, transform .18s;
}
.modal--details .desc-toggle:hover,
.modal--details .desc-toggle:focus-visible,
.ann-modal .desc-toggle:hover,
.ann-modal .desc-toggle:focus-visible{
  background:#fffaf2;
  border-color: var(--m-btn-bdr-h);
  outline: 3px solid var(--m-btn-ring);
  outline-offset: 2px;
}
.modal--details .desc-toggle .chev,
.ann-modal .desc-toggle .chev{
  inline-size:10px; block-size:10px;
  border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.modal--details .desc-toggle[aria-expanded="true"] .chev,
.ann-modal .desc-toggle[aria-expanded="true"] .chev{ transform: rotate(-135deg); }

.modal--details .modal__text.is-expanded,
.ann-modal__desc.is-expanded {
  max-block-size: var(--desc-expanded);
  overflow: auto;
  -webkit-mask-image: none;
          mask-image: none;
  scrollbar-width: none;
}


.modal--details .modal__text.is-expanded::-webkit-scrollbar,
.ann-modal__desc.is-expanded::-webkit-scrollbar {
  display: none;
}


/* Коли опис розгорнуто — ховаємо нижню панель з кнопками */
.modal--details .modal__content:has(.modal__text.is-expanded) .modal__cta,
.ann-modal__right:has(.ann-modal__desc.is-expanded) .modal__cta {
  display: none !important;
}


/* ── BOOK / DETAILS: параметри рейки і повзунка ─────────────────────── */
.modal--details .modal__text .scroll-rail,
.ann-modal__desc .scroll-rail{
  --rail-h: 220px;    /* висота треку */
  --rail-w: 6px;      /* товщина треку */
  position: absolute;
  inset-inline-end: 1rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
  inline-size: var(--rail-w);
  block-size: var(--rail-h);
  background: color-mix(in oklab, var(--m-accent) 18%, #000 6%);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
.modal--details .modal__text .scroll-thumb,
.ann-modal__desc .scroll-thumb{
  --thumb-h: 54px;    /* висота повзунка (можете змінити) */
  position: absolute;
  inset-inline: 0;
  inline-size: 100%;
  block-size: var(--thumb-h);
  transform: translateY(var(--thumb-y, 0px)); /* ← JS оновлює цю змінну */
  background: var(--m-accent);
  border-radius: 999px;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--m-accent) 65%, #000 35%) inset;
  transition: transform .06s linear;
}
/* =========================================================
   МОДАЛКА «ВИБІР РОЗДІЛІВ»
   (ліва колонка — список, права — прев’ю з уривком у рамці)
   ======================================================= */
.modal--chapters .modal__body{
  display: grid;
  grid-template-columns: 36% 1fr;
  gap: clamp(14px, 2.4vw, 28px);
  padding: clamp(16px, 2.4vw, 28px);
  max-block-size: clamp(560px, 80dvh, 820px);
  overflow: hidden;
}

/* Ліва колонка */
.modal--chapters .chapter-col{
  border-right: 1px solid var(--m-divider);
  padding-right: clamp(10px, 1.6vw, 18px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal--chapters .chapter-col h4{
  margin: 0 0 .75rem 0;
  font-weight: 800;
}
.modal--chapters .chapter-list{
  display: grid;
  gap: .5rem;
  min-height: 0;
  max-block-size: clamp(240px, 42vh, 420px);
  overflow: auto;
  padding-right: 4px;
}
.modal--chapters .chapter-btn{
  text-align: left;
  background: #fff;
  color: var(--m-ink);
  border: 1px solid color-mix(in oklab, var(--m-accent) 45%, #000 55%);
  border-radius: 12px;
  padding: .65rem .8rem;
  cursor: pointer;
}
.modal--chapters .chapter-btn:hover{ background: #fffaf2; }

/* Активний елемент (і aria-версія) */
.modal--chapters .chapter-btn.is-active,
.modal--chapters .chapter-btn[aria-current="true"],
.modal [aria-current="page"]{
  background: color-mix(in oklab, var(--m-accent) 18%, #fff 82%);
  border-color: color-mix(in oklab, var(--m-accent) 70%, #000 30%);
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--m-accent) 50%, #fff 50%);
}

/* Права колонка (прев’ю) */
.modal--chapters .preview-col{
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: 14px;
  align-content: start;
}
.modal--chapters .preview-title{
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.05rem, .9rem + .6vw, 1.35rem);
  color: var(--m-ink);
}
.modal--chapters .preview-scroll{
  min-height: 0;
  overflow: auto;
  padding-inline-end: .25rem;
  scrollbar-gutter: stable both-edges;
}
.modal--chapters .chapter-summary{
  margin: 0;
  color: #3a2a18;
  line-height: 1.65;
  font-size: 1.04rem;
}

/* Уривок у «золотій» рамці як на еталоні */
.modal--chapters .chapter-excerpt{
  margin: 16px 0 0;
  padding: 14px 16px;
  background: #fffaf2;
  border: 1px solid #e6d4ac;
  border-left: 4px solid var(--color-yellow);
  border-radius: 12px;
}
.modal--chapters .chapter-excerpt .excerpt-text{ margin: 0; font-style: italic; color: #59452a; }
.modal--chapters .chapter-excerpt .excerpt-cap{ display: none; }
.modal--chapters .chapter-picker {
  display: none;
}

.modal--chapters .chapter-select {
  inline-size: 100%;
  min-block-size: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in oklab, var(--m-accent) 45%, #000 55%);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--m-ink);
  font: inherit;
  line-height: 1.25;
}

/* Кнопки читання/завантаження та компактні списки форматів */
.modal--chapters .preview-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  overflow: visible;
}

.modal--details .book-download,
.modal--chapters .chapter-download {
  position: relative;
  display: inline-flex;
  min-inline-size: 0;
}

.modal--details .book-download > .btn,
.modal--chapters .chapter-download > .btn {
  inline-size: 100%;
}

.modal--details .book-download__formats,
.modal--chapters .chapter-download__formats {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-end: calc(100% + 4px);
  z-index: 8;
  display: grid;
  inline-size: 112px !important;
  min-inline-size: 112px !important;
  max-inline-size: 112px !important;
  padding: 3px;
  border: 1px solid color-mix(in oklab, var(--m-accent) 58%, #000 42%);
  border-radius: 10px;
  background: #fffdf9;
  box-shadow: 0 6px 14px rgb(43 27 0 / .14);
  transform: translateX(-50%);
  box-sizing: border-box;
}

.modal--details .book-download__formats[hidden],
.modal--chapters .chapter-download__formats[hidden] {
  display: none;
}

.modal--details .book-download__format,
.modal--chapters .chapter-download__format {
  display: grid;
  grid-template-columns: 17px 42px;
  align-items: center;
  justify-content: center;
  column-gap: 7px;
  inline-size: 100%;
  block-size: 34px;
  min-block-size: 34px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--m-ink);
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1;
  text-align: left;
  text-decoration: none;
  transition: background-color .18s, color .18s, box-shadow .18s;
  box-sizing: border-box;
}

.modal--details .book-download__format::before,
.modal--details .book-download__format.has-inline-download-icon::before,
.modal--chapters .chapter-download__format::before,
.modal--chapters .chapter-download__format.has-inline-download-icon::before {
  content: "" !important;
  display: block !important;
  flex: 0 0 17px;
  inline-size: 17px;
  block-size: 17px;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m0 0 4-4m-4 4-4-4' fill='none' stroke='%238a650e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6 21h12' fill='none' stroke='%238a650e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 17px 17px !important;
  -webkit-mask: none !important;
          mask: none !important;
}

.modal--details .download-format__icon,
.modal--chapters .download-format__icon {
  display: none !important;
  inline-size: 17px;
  block-size: 17px;
  flex: 0 0 17px;
  color: color-mix(in oklab, var(--m-accent) 68%, #000 32%);
}

.modal--details .book-download__format > span,
.modal--chapters .chapter-download__format > span {
  min-inline-size: 0;
  text-align: left;
}

.modal--details .book-download__format:hover,
.modal--details .book-download__format:focus-visible,
.modal--chapters .chapter-download__format:hover,
.modal--chapters .chapter-download__format:focus-visible {
  /* Той самий світло-бежевий фон, що й у вибраного розділу. */
  background: color-mix(in oklab, var(--m-accent) 18%, #fff 82%);
  color: var(--m-ink);
  outline: none;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--m-accent) 70%, #000 30%);
}

@media (max-width: 900px) {
  .modal--details.is-visible .book-download {
    inline-size: 100%;
    min-inline-size: 0;
  }
}


/* =========================================================
   МОДАЛКА АНОНСІВ
   (ліва колонка з медіа/мета, праворуч — опис з контролем висоти)
   Кнопки вирівняні ЗЛІВА — як просили.
   ======================================================= */


.ann-modal__body{
  display: grid;
  grid-template-columns: var(--ann-left-w) 1fr;
  gap: clamp(14px, 2.2vw, 28px);
  padding: 14px var(--ann-pad-x) 22px;

}
/* було: gap: 12px; — дає трохи зайвий інтервал між статусом і фото */
.ann-modal__left{
  display: grid;
  align-content: start;
  gap: clamp(6px, 1vw, 10px); /* щільніше: 6–10px замість ~12px */
  min-height: 0;
  overflow: auto;
}

.ann-modal__right {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto; /* заголовок/декор | текст | CTA */
  position: relative;
}

/* Фото + бейдж у лівій колонці */
.ann-modal__media{ position: relative; margin: 0; }
.ann-modal__cover {
  display: block;
  margin-block-end: 2px;
  inline-size: 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.ann-badge{
  position: absolute;
  inset-inline-start: 10px;
  inset-block-start: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .9rem;
  background: #fff1c7;
  color: var(--m-ink);
  border: 1px solid #e0c36a;
  box-shadow: 0 2px 8px rgb(0 0 0 / .12);
}

/* Статус під фото (пілл з кольором, співпадає з карткою) */
.ann-modal__status{ margin-block: .25rem .5rem; }
.ann-modal__status[hidden]{ display: none; }
.ann-status--pill{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .55rem;
  border-radius: 999px;
  font: 600 .9rem/1.2 var(--ff-serif);
  background: #fff1c7;
  border: 1px solid #e0c36a;
  color: #2b1b00;
  box-shadow: 0 2px 8px rgb(0 0 0 / .08);
  margin-inline-start: var(--ann-pad-x); /* по одній вертикалі з фото */
  margin-block-start: 2px;               /* було 6px — трішки ближче до хедера */
}

/* Мета-блоки (дата/місце тощо) */
.ann-meta{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.ann-meta__item{
  background: #fffaf2;
  border: 1px solid #e6d4ac;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgb(0 0 0 / .06);
}
.ann-meta__label{ margin: 0 0 3px; font-weight: 800; color:#7a4a00; font-size: .93rem; line-height: 1.2; }
.ann-meta__value {
  margin: 0;
  color:#3a2a18;
  font-size:.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;   /* сучасний, найнадійніший */
  word-break: break-word;    /* запасний варіант */
  white-space: normal;
}


/* Акцент на організаторі — важливо видно */
.ann-modal .ann-meta__item--organizer .ann-meta__value{
  font-weight: 700;
  font-size: 1.06rem;
  color: #2b1b00;
}
/* Значення не рве макет, переносить довгі назви організаторів тощо */
/* Права колонка: опис -> (прогрес/стрілка) -> кнопки внизу */
/* Фото робимо адаптивним, щоб не стрибав макет */
/* Якщо фото немає — нічого не “виїдає” місце */
.ann-modal__media:empty{
  display: none;
}
/* Ann modal: неактивна "Записатися" */
.ann-modal .ann-signup.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none; /* блокує кліки по <a> */
}


/* Прихована стрілка — без зрушення макета */
.desc-toggle.is-hidden{
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Більший проміжок між круглою кнопкою та CTA у модалці анонсів */
.ann-modal .desc-toggle {
  /* було: margin: .35rem auto 0; */
  margin: .5rem auto 16px;   /* ↑ верхній, auto по боках, 16px знизу */
}


/* ========================================================================
   СПІЛЬНІ КНОПКИ ТА ПОВІДОМЛЕННЯ ФОРМ
   ======================================================================== */

.contact-form__message {
  grid-column: 1 / -1;
  display: block;
  min-height: 24px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease;
}

.contact-form__message.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.contact-form__message.is-success {
  background: #eaf7ed;
  color: #1f6b36;
  border: 1px solid #95cf8c;
}

.contact-form__message.is-error {
  background: #fdecec;
  color: #9f2f2f;
  border: 1px solid #e0a0a0;
}
.field-error {
  margin-top: 6px;
  font-size: 13px;
  color: #b3261e;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.field-error.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* базова кнопка */
.btn,
.reviews__filter,
.reviews__prev,
.reviews__more {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

/* Чітко показуємо, які елементи справді можна натиснути. */
.announcement-card .card-more:not(:disabled),
.reviews__filter:not(:disabled),
.reviews__prev:not(:disabled),
.reviews__more:not(:disabled),
.review-form__submit:not(:disabled),
.contact-form button:not(:disabled),
.back-to-top.is-visible,
.modal button:not(:disabled),
.ann-modal button:not(:disabled) {
  cursor: pointer;
}

/* FORM SUBMIT BUTTONS — one canonical visual definition */
.review-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.35rem auto 0;
  border-radius: var(--btn-radius-pill);
}

.contact-form button[type="submit"] {
  justify-self: center;
  margin: 0.25rem 0 0;
  border-radius: var(--btn-radius-pill);
}

.review-form__submit,
.contact-form button[type="submit"] {
  inline-size: min(100%, 200px);
  min-block-size: 58px;
  padding: 0 1.5rem;
  background: var(--color-yellow);
  color: #2b1b00;
  font-weight: 700;
  border: 1px solid var(--color-border-brown);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    var(--shadow-control);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

.review-form__submit:not(:disabled):hover,
.contact-form button[type="submit"]:not(:disabled):hover {
  background: var(--color-brown);
  color: #fff;
  border-color: var(--color-yellow);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 5px 12px rgba(58, 43, 14, 0.18);
}

.review-form__submit:not(:disabled):focus-visible,
.contact-form button[type="submit"]:not(:disabled):focus-visible {
  background: var(--color-brown);
  color: #fff;
  border-color: var(--color-yellow);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 5px 12px rgba(58, 43, 14, 0.18);
  outline: 3px solid var(--color-border-brown);
  outline-offset: 3px;
}

.review-form__submit:disabled,
.contact-form button[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

/* MODAL DOWNLOAD BUTTONS — same visual language as footer platforms */
.modal--details [data-action="download-book"],
.modal--chapters [data-action="download-chapter"] {
  background: #fffaf2;
  color: var(--color-link-brown);
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 48%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 5px 14px rgba(71, 49, 8, 0.09);
}

.modal--details [data-action="download-book"]:hover,
.modal--details [data-action="download-book"]:focus-visible,
.modal--chapters [data-action="download-chapter"]:hover,
.modal--chapters [data-action="download-chapter"]:focus-visible {
  background: var(--color-gold-soft);
  color: var(--color-link-brown);
  border-color: var(--color-border-brown);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--color-yellow) 18%, transparent);
}

.modal--details [data-action="download-book"]:focus-visible,
.modal--chapters [data-action="download-chapter"]:focus-visible {
  outline: 3px solid var(--color-border-brown);
  outline-offset: 2px;
}


/* ========================================================================
   ЛОКАЛЬНІ ФІКСИ
   ======================================================================== */

/* Коли немає фото — опускаємо контент вниз */
.announcement-card:where(:not(:has(img))) .card-body {
  margin-top: 18px;
}

.footer-brand__top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.footer-brand__logo-link {
  flex-shrink: 0;
}

.footer-brand__logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  display: block;
  margin-top: -8px;
}

.footer-brand__title a {
  display: inline-block;
  font-size: clamp(2rem, 2.2vw, 3rem);
  line-height: 1;
  color: inherit;
  text-decoration: none;
  transition:
    color .18s ease,
    transform .18s ease,
    text-shadow .18s ease;
}

.footer-brand__title a:hover {
  color: var(--footer-accent-ink, #8e6f22);
  transform: translateY(-1px);
  text-shadow: 0 4px 12px rgba(142, 111, 34, .16);
}

.footer-brand__title a:focus-visible {
  color: var(--footer-accent-ink, #8e6f22);
  outline: 2px solid rgba(200, 155, 60, .72);
  outline-offset: 4px;
  border-radius: 6px;
  transform: none;
  text-shadow: none;
}


.books .carousel-button:disabled:hover,
.books .carousel-button[aria-disabled="true"]:hover {
  background: #f3ead7;
  border-color: #d9c79a;
  color: rgba(43, 27, 0, 0.42);
  box-shadow: none;
  transform: none;
}


/* ========================================================================
   MOVED FROM mobile.css — global rules that are not mobile-only
   ======================================================================== */

@keyframes bookFloat {
  0% { transform: translateY(0) scale(var(--book-hover-scale, 1)); }
  50% { transform: translateY(-6px) scale(var(--book-hover-scale, 1)); }
  100% { transform: translateY(0) scale(var(--book-hover-scale, 1)); }
}

.books .book-cover:active {
  --book-hover-scale: 0.97;
}


/* ========================================================================
   HEADER — desktop brand layout, compact like reference
   ======================================================================== */

@media (min-width: 901px) {
  .header {
    z-index: 1000;
    background:
      radial-gradient(900px 160px at 50% 0%, color-mix(in srgb, var(--color-yellow) 7%, transparent), transparent 70%),
      linear-gradient(180deg, #171717 0%, #222222 100%);
    border-bottom: 1px solid color-mix(in srgb, var(--color-yellow) 14%, transparent);
    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.32);
  }

  .header-container {
    display: grid;
    grid-template-columns: minmax(330px, 0.95fr) minmax(0, 1.6fr);
    grid-template-areas: "logo navwrap";
    align-items: center;
    gap: clamp(24px, 3vw, 46px);

    /* Оце головне: хедер нижчий */
    min-block-size: 92px;
    padding-block: 8px;
  }

  .brand-group {
    grid-area: logo;
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.25vw, 20px);
    min-inline-size: 0;
  }

  .logo {
    display: inline-flex;
    align-items: center;
    gap: 16px;

    min-inline-size: 0;
    inline-size: max-content;
    color: var(--c-accent);
  }

  .logo-img {
    inline-size: 74px;
    block-size: 74px;
    object-fit: contain;
    flex: 0 0 74px;

    border-radius: 50%;
    filter: drop-shadow(0 0 9px color-mix(in srgb, var(--color-yellow) 18%, transparent));
  }

  .logo-title {
    position: relative;
    display: inline-block;
    align-self: center;
    padding: 0;

    font-family: var(--ff-decor);
    font-size: clamp(2.35rem, 2.65vw, 3.35rem);
    line-height: 1;
    font-weight: 400;

    color: #f7ecd8;
    white-space: nowrap;

    text-shadow:
      0 1px 2px rgba(0, 0, 0, 0.65),
      0 0 10px rgba(247, 236, 216, 0.12);
  }

  .logo-title::after {
    position: absolute;
    inset-inline-start: 50%;
    inset-inline-end: auto;
    inset-block-end: -7px;
    inline-size: var(--decor-line-width);
    margin: 0;
    transform: translateX(-50%);
  }

  .nav-wrapper {
    grid-area: navwrap;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: end;
    gap: clamp(18px, 2.3vw, 34px);

    min-inline-size: 0;
  }

  .header-actions {
    gap: clamp(10px, 1.25vw, 18px);
  }

  .js-nav {
    justify-self: center;
    position: static;
    transform: none;
  }

  .js-nav ul {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: clamp(20px, 2.4vw, 40px);

    margin: 0;
    padding: 0;
    list-style: none;
  }

  .js-nav a {
    position: relative;

    display: inline-block;
    padding-block: 4px 9px;

    font-family: var(--ff-serif);
    font-size: clamp(1.05rem, 0.42vw + 0.95rem, 1.32rem);
    line-height: 1.1;
    font-weight: 700;

    color: #f7ecd8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  }

  .nav-wrapper nav a.is-active,
  .nav-wrapper nav a[aria-current="page"] {
    text-decoration: none;
  }

  .js-nav a.is-active::after,
  .js-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;

    block-size: 3px;
    border-radius: 999px;

    background: var(--c-accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--color-yellow) 38%, transparent);
  }

  .telegram-button {
    inline-size: 58px;
    block-size: 58px;
    border-color: color-mix(in oklab, var(--c-accent) 72%, #ffffff 28%);
    box-shadow:
      inset 0 0 7px rgba(0, 0, 0, 0.28),
      0 0 16px color-mix(in srgb, var(--color-yellow) 34%, transparent);
  }

  .telegram-button img,
  .telegram-button svg {
    inline-size: 58%;
    block-size: 58%;
  }

  .menu-toggle {
    display: none !important;
  }
}

/* ========================================================================
   HEADER — COMPACT ENGLISH DESKTOP NAVIGATION
   Англійські назви довші, тому на широких екранах ущільнюємо лише EN-меню.
   Українська версія зберігає початкові розміри та відступи.
   ======================================================================== */

@media (min-width: 1401px) {
  .header-language-switcher {
    inset-inline-start: clamp(10px, 0.8vw, 16px);
  }

  html[lang^="en"] .header-container {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: clamp(18px, 1.8vw, 30px);
  }

  html[lang^="en"] .brand-group {
    gap: clamp(10px, 1vw, 16px);
  }

  html[lang^="en"] .nav-wrapper {
    gap: clamp(14px, 1.35vw, 24px);
  }

  html[lang^="en"] .js-nav ul {
    gap: clamp(14px, 1.35vw, 24px);
  }

  html[lang^="en"] .js-nav a {
    font-size: clamp(0.98rem, 0.22vw + 0.88rem, 1.16rem);
  }
}

/* ========================================================================
   DESKTOP MODALS — CENTER CTA BUTTONS
   Кнопки у всіх desktop-модалках по центру:
   - модалка книги
   - модалка розділів
   - модалка анонсів
   ======================================================================== */

@media (min-width: 901px) {

  /* Chapters modal: long summary/excerpt scrolls inside the preview.
     The action row below stays visible and is not pushed outside the modal. */
  .modal--chapters .preview-scroll {
    max-block-size: clamp(240px, 40vh, 390px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-inline-end: 0.65rem;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--color-field-border) transparent;
  }

  .modal--chapters .preview-scroll::-webkit-scrollbar {
    inline-size: 6px;
  }

  .modal--chapters .preview-scroll::-webkit-scrollbar-track {
    background: transparent;
  }

  .modal--chapters .preview-scroll::-webkit-scrollbar-thumb {
    background: var(--color-field-border);
    border-radius: 999px;
  }

  .modal--chapters .preview-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-brown);
  }

  .modal--details .modal__cta,
  .modal--chapters .modal__cta,
  .modal--chapters .preview-actions,
  .ann-modal .modal__cta,
  .ann-modal .ann-modal__right .modal__cta {
    position: sticky;
    bottom: 0;
    z-index: 2;

    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;

    align-items: center !important;
    justify-content: center !important;

    gap: 0.9rem !important;

    inline-size: 100% !important;
    max-inline-size: 560px !important;

    margin-inline: auto !important;
    margin-block-start: 0.75rem !important;

    padding: 0.7rem 0.25rem 0.35rem !important;

    background: linear-gradient(to top, var(--m-bg) 70%, transparent) !important;
    box-sizing: border-box !important;
  }

  .modal--details .modal__cta .btn,
  .modal--details .modal__cta .btn-ghost,
  .modal--details .modal__cta .btn.btn--solid,
  .modal--details .modal__cta .btn.btn--ghost,
  .ann-modal .modal__cta .btn,
  .ann-modal .modal__cta .btn-ghost,
  .ann-modal .modal__cta .ann-signup,
  .ann-modal .modal__cta .ann-share,
  .modal--chapters .modal__cta .btn,
  .modal--chapters .modal__cta .btn-ghost,
  .modal--chapters .preview-actions .btn,
  .modal--chapters .preview-actions .btn--solid {
    min-inline-size: 180px !important;
    min-block-size: 48px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;
    white-space: nowrap !important;
  }

  .ann-modal .desc-toggle,
  .modal--details .desc-toggle {
    margin-inline: auto !important;
  }

  .modal--details .modal__content:has(.modal__text.is-expanded) .modal__cta,
  .ann-modal__right:has(.ann-modal__desc.is-expanded) .modal__cta {
    display: none !important;
  }
}


/* ========================================================================
   FIX — DESKTOP / DEVTOOLS LOW HEIGHT MODALS
   Причина: на висоті 600–760px старе max-block-size: 82vh робило вікно
   занадто низьким і обрізало нижні кнопки. Тут діалог бере майже всю
   доступну висоту, а скрол залишається всередині тексту.
   ======================================================================== */

@media (min-width: 1181px) and (max-height: 760px) {
  .modal.is-visible,
  .ann-modal.is-visible {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left)) !important;
    overflow: hidden !important;
  }

  .modal.is-visible .modal__dialog,
  .ann-modal.is-visible .ann-modal__dialog {
    max-block-size: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;

    display: flex !important;
    flex-direction: column !important;

    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .modal.is-visible .modal__header,
  .ann-modal.is-visible .modal__header {
    flex: 0 0 auto !important;
    min-block-size: 70px !important;
    padding: 12px 28px !important;
    box-sizing: border-box !important;
  }

  .modal.is-visible .modal__title,
  .ann-modal.is-visible .modal__title {
    font-size: clamp(1.8rem, 3.2vh, 2.35rem) !important;
    line-height: 1.05 !important;
  }

  .modal.is-visible .modal__body,
  .ann-modal.is-visible .ann-modal__body {
    flex: 1 1 auto !important;
    min-block-size: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .modal--details.is-visible .modal__body {
    grid-template-columns: minmax(220px, 330px) minmax(0, 1fr) !important;
    gap: 24px !important;
    padding: 18px 28px 20px !important;
    align-items: start !important;
  }

  .modal--details.is-visible .modal__cover {
    inline-size: min(100%, 300px) !important;
    max-block-size: calc(100dvh - 210px) !important;
    object-fit: contain !important;
    align-self: start !important;
  }

  .modal--details.is-visible .modal__content {
    min-block-size: 0 !important;
    block-size: 100% !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) auto auto !important;
    row-gap: 12px !important;
    overflow: hidden !important;
  }

  .modal--details.is-visible .modal__text {
    min-block-size: 0 !important;
    max-block-size: none !important;
    overflow: hidden !important;
    line-height: 1.52 !important;
  }

  .modal--details.is-visible .modal__text.is-expanded {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .modal--details.is-visible .modal__cta,
  .ann-modal.is-visible .modal__cta,
  .modal--chapters.is-visible .preview-actions {
    flex: 0 0 auto !important;
    margin-block-start: 0 !important;
  }

  .modal--details.is-visible .desc-toggle,
  .ann-modal.is-visible .desc-toggle {
    flex: 0 0 auto !important;
  }
}

@supports not (height: 100dvh) {
  @media (min-width: 1181px) and (max-height: 760px) {
    .modal.is-visible .modal__dialog,
    .ann-modal.is-visible .ann-modal__dialog {
      max-block-size: calc(100vh - 24px) !important;
      max-height: calc(100vh - 24px) !important;
    }

    .modal--details.is-visible .modal__cover {
      max-block-size: calc(100vh - 210px) !important;
    }
  }
}

/* ========================================================================
   FIX — no fade when modal text fully fits / no toggle button
   Keeps JS logic unchanged. When JS hides the round expand button, the text
   must look finished, not blurred on the last line.
   ======================================================================== */

.modal--details .modal__content:has(.desc-toggle.is-hidden) .modal__text,
.modal--details .modal__content:has(.desc-toggle[hidden]) .modal__text,
.ann-modal__right:has(.desc-toggle.is-hidden) .ann-modal__desc,
.ann-modal__right:has(.desc-toggle--ann.is-hidden) .ann-modal__desc,
.ann-modal__right:has(.desc-toggle[hidden]) .ann-modal__desc,
.ann-modal__right:has(.desc-toggle--ann[hidden]) .ann-modal__desc {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

.modal--details .modal__content:has(.desc-toggle.is-hidden) .desc-toggle,
.modal--details .modal__content:has(.desc-toggle[hidden]) .desc-toggle,
.ann-modal__right:has(.desc-toggle.is-hidden) .desc-toggle,
.ann-modal__right:has(.desc-toggle--ann.is-hidden) .desc-toggle--ann,
.ann-modal__right:has(.desc-toggle[hidden]) .desc-toggle,
.ann-modal__right:has(.desc-toggle--ann[hidden]) .desc-toggle--ann {
  display: none !important;
}

/* ========================================================================
   FIX — seamless light transition between Reviews and Contacts
   Prevents the dark body background from showing between two light sections.
   ======================================================================== */

.reviews {
  margin-block-end: -1px;
}

.contacts {
  margin-block-start: -1px;
}

.reviews + .contacts,
#reviews + #contacts {
  border-block-start: 0 !important;
}

/* ========================================================================
   FOOTER — COLUMN CENTERING ONLY
   Центрує колонки футера без дублювання стилів заголовків і ліній.
   ======================================================================== */

.footer-brand__top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 16px;
}

.footer-brand__logo-link {
  grid-column: 1;
}

.footer-section {
  min-inline-size: 0;
}

.nav-footer {
  inline-size: max-content;
  max-inline-size: 100%;
  margin-inline: auto;
  text-align: center;
}

.footer-content > .footer-section:last-child {
  inline-size: max-content;
  max-inline-size: 100%;
  justify-self: center;
  text-align: center;
}

.footer-content > .footer-section:last-child .footer-contact-row {
  justify-content: center;
  margin-inline: auto;
}

/* ========================================================================
   BOOKS — READ LINK ONLY UNDER COVER
   Тільки напис/іконка/стрілочка під книжкою.
   Не змінює розмір книжки, трек, стрілки, пагінацію і perView.
   ======================================================================== */

.books .book-caption {
  position: absolute;
  z-index: 5;
  inset-inline-start: 50%;
  inset-block-start: calc(50% + clamp(144px, 12vw, 184px));
  transform: translateX(-50%);
  inline-size: min(92%, 620px);
  display: grid;
  justify-items: center;
  gap: 0.42rem;
  text-align: center;
  pointer-events: auto;
}

.books .book-caption__title {
  margin: 0;
  font-family: var(--ff-serif, "Tinos", serif);
  font-size: clamp(1.45rem, 1.1rem + 0.65vw, 1.9rem);
  line-height: 1.15;
  font-weight: 700;
  color: #2b1b00;
}

.books .book-read-online {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-block-size: 34px;
  padding: 0.08rem 0.45rem;
  border: 0;
  background: transparent;
  color: var(--color-link-brown);
  font-family: var(--ff-serif, "Tinos", serif);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.16rem);
  line-height: 1.15;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.books .book-read-online:hover,
.books .book-read-online:focus-visible {
  color: var(--color-brown);
  text-decoration: none;
  text-shadow: 0 4px 12px rgba(58, 43, 14, 0.14);
}

.books .book-read-online:focus-visible {
  outline: 2px solid var(--color-border-brown);
  outline-offset: 4px;
  border-radius: 6px;
}

.books .book-read-online__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 1.35em;
  block-size: 1.35em;
  color: currentColor;
  transition: transform 0.2s ease;
}

.books .book-read-online__icon svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.books .book-read-online__arrow {
  font-size: 1.18em;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

.books .book-read-online:hover .book-read-online__icon,
.books .book-read-online:focus-visible .book-read-online__icon {
  transform: translateY(-2px);
}

.books .book-read-online:hover .book-read-online__arrow,
.books .book-read-online:focus-visible .book-read-online__arrow {
  transform: translate(4px, -1px);
}

/* ========================================================================
   BOOKS — HIDE TITLE WHEN INFO IS OPEN
   Коли шторка інформації відкрита, назву книги під нею не показуємо.
   Кнопку "Читати онлайн", книжку, карусель і позиції не чіпає.
   ======================================================================== */

.books .carousel-item.is-open .book-caption__title {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ========================================================================
   CAROUSELS — HIDE CONTROLS ONLY WHEN NO NAVIGATION EXISTS
   Кольори й активні/неактивні стани не змінюємо.
   ======================================================================== */

/* Одна книжка: обидва напрямки недоступні. */
.books .carousel-container:has(> .carousel-button.prev:disabled):has(> .carousel-button.next:disabled)
  > .carousel-button {
  display: none !important;
}

/* Усі анонси одночасно вміщуються у видимій області. */
.announcements .custom-carousel:has(> .carousel-button.prev:disabled):has(> .carousel-button.next:disabled)
  > .carousel-button {
  display: none !important;
}

/* Один екран відгуків: старі display-правила не повинні скасовувати hidden. */
.reviews__prev[hidden],
.reviews__more[hidden],
.reviews__grid:has(> .reviews__prev.disabled):has(> .reviews__more.disabled)
  > :is(.reviews__prev, .reviews__more) {
  display: none !important;
}


/* ========================================================================
   ENGLISH DESKTOP HEADER — MENU LARGER + TELEGRAM SMALLER
   Тільки англійська версія на широкому desktop.
   Українська версія та інші елементи хедера не змінюються.
   ======================================================================== */

@media (min-width: 1401px) {
  html[lang^="en"] .js-nav a {
    font-size: clamp(1.05rem, 0.24vw + 0.93rem, 1.24rem) !important;
  }

  html[lang^="en"] .telegram-button {
    inline-size: 50px !important;
    block-size: 50px !important;
    min-inline-size: 50px !important;
    flex: 0 0 50px !important;
  }

  html[lang^="en"] .telegram-button img,
  html[lang^="en"] .telegram-button svg {
    inline-size: 56% !important;
    block-size: 56% !important;
  }
}


/* ========================================================================
   DESKTOP HEADER — SMALLER TELEGRAM FOR BOTH LANGUAGES
   Зменшуємо Telegram однаково для української та англійської версій.
   Інші елементи хедера не змінюються.
   ======================================================================== */

@media (min-width: 1401px) {
  .telegram-button {
    inline-size: 50px !important;
    block-size: 50px !important;
    min-inline-size: 50px !important;
    flex: 0 0 50px !important;
  }

  .telegram-button img,
  .telegram-button svg {
    inline-size: 56% !important;
    block-size: 56% !important;
  }
}


/* ========================================================================
   ANNOUNCEMENT CARDS — TITLES IN GREAT VIBES
   Змінюємо тільки заголовки карток анонсів.
   Колір, дата, опис, кнопки та модалки не змінюються.
   ======================================================================== */

.announcement-card h3,
.announcement-card .card-title {
  font-family: var(--ff-decor, "Great Vibes", cursive) !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-size: clamp(1.88rem, 1.72rem + 0.35vw, 2rem) !important;
  line-height: 1.13 !important;
}


/* ========================================================================
   ANNOUNCEMENT CARDS — DATE CLOSER TO TITLE
   Трохи опускаємо дату візуально до заголовка, не змінюючи інші елементи.
   ======================================================================== */

.announcement-card .date {
  margin-bottom: 2px !important;
}


/* ========================================================================
   MAILPOET SERVICE PAGES
   Dedicated confirmation/manage/unsubscribe pages without the homepage hero.
   ======================================================================== */

.mailpoet-service-page {
  min-block-size: 72svh;
  padding: clamp(48px, 7vw, 92px) 1rem;
  color: #2b1b00;
  background:
    radial-gradient(900px 460px at 50% -90px, rgba(255,255,255,.45), transparent 72%),
    linear-gradient(180deg, #f0cf97 0%, #f7e4bf 58%, #fff5e6 100%);
}

.mailpoet-service-page__container {
  display: grid;
  place-items: center;
}

.mailpoet-service-card {
  inline-size: min(100%, 820px);
  padding: clamp(30px, 4vw, 48px);
  text-align: center;
  background: #fff9ef;
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 30%, transparent);
  border-radius: 24px;
  box-shadow: 0 16px 38px rgba(74, 42, 6, 0.14);
}

.mailpoet-service-card__eyebrow {
  margin: 0 0 4px;
  font-family: var(--ff-serif);
  font-size: .92rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9a6b1a;
}

.mailpoet-service-card__title {
  margin: 0;
  font-family: var(--ff-decor);
  font-size: clamp(2.35rem, 1.8rem + 2vw, 3.65rem);
  line-height: 1.06;
  font-weight: 400;
  color: #3a2b0e;
}

.mailpoet-service-card__title::after {
  content: "";
  display: block;
  inline-size: var(--decor-line-width);
  block-size: var(--decor-line-height);
  margin: .8rem auto 1.35rem;
  border-radius: var(--decor-line-radius);
  background: var(--decor-line-color);
}

.mailpoet-service-card__divider {
  display: inline-block;
  margin-inline: .16em;
  color: #9a6b1a;
}

.mailpoet-service-card__copy {
  max-inline-size: 650px;
  margin-inline: auto;
  font-family: var(--ff-serif);
  font-size: clamp(1rem, .95rem + .22vw, 1.12rem);
  line-height: 1.62;
  color: #4b4034;
}

.mailpoet-service-card__copy p {
  margin: 0;
}

.mailpoet-service-card__copy p + p {
  margin-block-start: .9rem;
  padding-block-start: .9rem;
  border-block-start: 1px solid #eadfcf;
}

.mailpoet-service-card__dynamic {
  margin-block-start: 1.8rem;
  padding-block-start: 1.4rem;
  border-block-start: 1px solid #eadfcf;
  text-align: start;
}

.mailpoet-service-card__dynamic form {
  max-inline-size: 620px;
  margin-inline: auto;
}

.mailpoet-service-card__dynamic label {
  font-family: var(--ff-serif);
  color: #3a2b0e;
}

.mailpoet-service-card__dynamic input[type="text"],
.mailpoet-service-card__dynamic input[type="email"],
.mailpoet-service-card__dynamic select,
.mailpoet-service-card__dynamic textarea {
  inline-size: 100%;
  min-block-size: 48px;
  padding: .7rem .9rem;
  font: inherit;
  color: #2b1b00;
  background: #fffdf8;
  border: 1px solid var(--color-field-border);
  border-radius: 14px;
}

.mailpoet-service-card__dynamic input[type="submit"],
.mailpoet-service-card__dynamic button {
  min-block-size: 48px;
  padding: .68rem 1.45rem;
  font-family: var(--ff-serif);
  font-weight: 700;
  color: #2b1b00;
  background: var(--color-yellow);
  border: 1px solid var(--color-border-brown);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(120, 80, 20, .16);
  cursor: pointer;
}

.mailpoet-service-card__dynamic input[type="submit"]:hover,
.mailpoet-service-card__dynamic button:hover,
.mailpoet-service-card__dynamic input[type="submit"]:focus-visible,
.mailpoet-service-card__dynamic button:focus-visible {
  background: var(--color-gold-soft);
  border-color: var(--color-border-brown);
  outline: none;
  box-shadow: 0 9px 20px rgba(120, 80, 20, .20);
}

.mailpoet-service-card__manage-link {
  margin-block-start: 1.2rem;
}

.mailpoet-service-card__manage-link a,
.mailpoet-service-card__dynamic a {
  color: #8e6f22;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mailpoet-service-card__home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  min-block-size: 46px;
  margin-block-start: 1.8rem;
  padding: .62rem 1.35rem;
  font-family: var(--ff-serif);
  font-size: 1rem;
  font-weight: 700;
  color: #2b1b00;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--color-border-brown) 48%, transparent);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0,0,0,.07);
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.mailpoet-service-card__home:hover,
.mailpoet-service-card__home:focus-visible {
  background: var(--color-gold-soft);
  border-color: var(--color-border-brown);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 8px 18px rgba(120, 80, 20, .16);
}


/* ==========================================================================
   BOOK MODAL — READ PLATFORM CHOOSER
   Different from the Download-format menu and opens ABOVE "Читати".
   ========================================================================== */

.modal--details .book-read-choice {
  position: relative;
  display: flex;
  inline-size: auto;
  min-inline-size: 180px;
  align-items: center;
  justify-content: center;
  overflow: visible;
  z-index: 12;
}

.modal--details .book-read-choice__trigger {
  inline-size: 100%;
  gap: .72rem;
}

.modal--details .book-read-choice__chevron {
  inline-size: 9px;
  block-size: 9px;
  flex: 0 0 9px;
  border-inline-end: 1.7px solid currentColor;
  border-block-end: 1.7px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}

.modal--details .book-read-choice.is-open .book-read-choice__chevron {
  transform: translateY(2px) rotate(225deg);
}

.modal--details .book-read-menu {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-end: calc(100% + 13px);
  z-index: 40;
  inline-size: min(292px, calc(100vw - 42px));
  padding: 7px;
  border: 1px solid rgba(142, 111, 34, .42);
  border-radius: 15px;
  background: #fffaf2;
  color: #2b1b00;
  box-shadow:
    0 16px 34px rgba(65, 43, 8, .17),
    inset 0 1px 0 rgba(255, 255, 255, .92);
  transform: translate(-50%, 7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .18s ease,
    transform .18s ease,
    visibility .18s ease;
  box-sizing: border-box;
}

.modal--details .book-read-menu[hidden] {
  display: block;
}

.modal--details .book-read-choice.is-open .book-read-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.modal--details .book-read-menu::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 100%;
  inline-size: 12px;
  block-size: 12px;
  background: #fffaf2;
  border-inline-end: 1px solid rgba(142, 111, 34, .42);
  border-block-end: 1px solid rgba(142, 111, 34, .42);
  transform: translate(-50%, -6px) rotate(45deg);
}

.modal--details .book-read-menu__item {
  appearance: none;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  align-items: center;
  column-gap: 10px;
  inline-size: 100%;
  min-block-size: 47px;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3d2d12;
  font-family: var(--ff-serif, "Tinos", serif);
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.18;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color .18s ease,
    color .18s ease,
    transform .18s ease;
  box-sizing: border-box;
}

.modal--details .book-read-menu__item + .book-read-menu__item {
  border-block-start: 1px solid rgba(142, 111, 34, .15);
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}

.modal--details .book-read-menu__item:hover,
.modal--details .book-read-menu__item:focus-visible {
  background: #fff2d1;
  color: #6f5315;
  outline: none;
  transform: translateX(1px);
}

.modal--details .book-read-menu__item-icon,
.modal--details .book-read-menu__end-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8a650e;
}

.modal--details .book-read-menu__item-icon {
  inline-size: 22px;
  block-size: 22px;
}

.modal--details .book-read-menu__end-icon {
  inline-size: 18px;
  block-size: 18px;
  justify-self: end;
}

.modal--details .book-read-menu__icon,
.modal--details .book-read-menu__external {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal--details .book-read-menu__label {
  min-inline-size: 0;
}

.modal--details .book-read-menu--single {
  inline-size: min(245px, calc(100vw - 42px));
}



/* ========================================================================
   DESKTOP — download menus match the “Читати” dropdown.
   Applies to book and chapter download menus on desktop only.
   ======================================================================== */
@media (min-width: 901px) {
  .modal--details .book-download,
  .modal--chapters .chapter-download {
    position: relative;
    display: flex;
    inline-size: auto;
    min-inline-size: 180px;
    align-items: center;
    justify-content: center;
    overflow: visible;
    z-index: 12;
  }

  .modal--details .book-download > .btn,
  .modal--chapters .chapter-download > .btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .72rem;
    padding-inline: 1.35rem 3rem;
  }

  .modal--details [data-action="download-book"]::after,
  .modal--chapters [data-action="download-chapter"]::after {
    content: "";
    inline-size: 9px;
    block-size: 9px;
    flex: 0 0 9px;
    border-inline-end: 1.7px solid currentColor;
    border-block-end: 1.7px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s ease;
  }

  .modal--details .book-download.is-open [data-action="download-book"]::after,
  .modal--chapters .chapter-download.is-open [data-action="download-chapter"]::after {
    transform: translateY(2px) rotate(225deg);
  }

  .modal--details .book-download__formats,
  .modal--chapters .chapter-download__formats {
    inset-inline-start: 50%;
    inset-block-end: calc(100% + 13px);
    z-index: 40;
    display: block;
    inline-size: min(292px, calc(100vw - 42px)) !important;
    min-inline-size: min(292px, calc(100vw - 42px)) !important;
    max-inline-size: min(292px, calc(100vw - 42px)) !important;
    padding: 7px;
    border: 1px solid rgba(142, 111, 34, .42);
    border-radius: 15px;
    background: #fffaf2;
    color: #2b1b00;
    box-shadow:
      0 16px 34px rgba(65, 43, 8, .17),
      inset 0 1px 0 rgba(255, 255, 255, .92);
    transform: translate(-50%, 7px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity .18s ease,
      transform .18s ease,
      visibility .18s ease;
    box-sizing: border-box;
  }

  .modal--details .book-download__formats[hidden],
  .modal--chapters .chapter-download__formats[hidden] {
    display: block;
  }

  .modal--details .book-download.is-open .book-download__formats,
  .modal--chapters .chapter-download.is-open .chapter-download__formats {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
  }

  .modal--details .book-download__formats::after,
  .modal--chapters .chapter-download__formats::after {
    content: "";
    position: absolute;
    inset-inline-start: 50%;
    inset-block-start: 100%;
    inline-size: 12px;
    block-size: 12px;
    background: #fffaf2;
    border-inline-end: 1px solid rgba(142, 111, 34, .42);
    border-block-end: 1px solid rgba(142, 111, 34, .42);
    transform: translate(-50%, -6px) rotate(45deg);
  }

  .modal--details .book-download__format,
  .modal--chapters .chapter-download__format {
    position: relative;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 20px;
    align-items: center;
    column-gap: 10px;
    inline-size: 100%;
    min-block-size: 47px;
    padding: 8px 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #3d2d12;
    font-family: var(--ff-serif, "Tinos", serif);
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.18;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    transition:
      background-color .18s ease,
      color .18s ease,
      transform .18s ease;
    box-sizing: border-box;
  }

  .modal--details .book-download__format + .book-download__format,
  .modal--chapters .chapter-download__format + .chapter-download__format {
    border-block-start: 1px solid rgba(142, 111, 34, .15);
    border-start-start-radius: 0;
    border-start-end-radius: 0;
  }

  .modal--details .book-download__format:hover,
  .modal--details .book-download__format:focus-visible,
  .modal--chapters .chapter-download__format:hover,
  .modal--chapters .chapter-download__format:focus-visible {
    background: #fff2d1;
    color: #6f5315;
    outline: none;
    transform: translateX(1px);
    box-shadow: none;
  }

  .modal--details .book-download__format::before,
  .modal--details .book-download__format.has-inline-download-icon::before,
  .modal--chapters .chapter-download__format::before,
  .modal--chapters .chapter-download__format.has-inline-download-icon::before {
    content: "" !important;
    display: block !important;
    inline-size: 22px;
    block-size: 22px;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m0 0 4-4m-4 4-4-4' fill='none' stroke='%238a650e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6 21h12' fill='none' stroke='%238a650e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
    -webkit-mask: none !important;
            mask: none !important;
  }

  .modal--details .book-download__format::after,
  .modal--chapters .chapter-download__format::after {
    content: "";
    justify-self: end;
    inline-size: 18px;
    block-size: 18px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 17 17 7M9 7h8v8' fill='none' stroke='%238a650e' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }

  .modal--details .book-download__format > span,
  .modal--chapters .chapter-download__format > span {
    min-inline-size: 0;
    text-align: left;
  }
}


/* ========================================================================
   NEWS & ANNOUNCEMENTS — BRAND PALETTE BADGES
   Uses only the site's existing gold / ochre / brown palette.
   ======================================================================== */

/* main.js currently sets modal badge colors inline, so !important is needed
   here to keep the modal badge in the same brand palette too. */
.ann-modal__status .ann-status--pill {
  background: #fff1c7 !important;
  border-color: #e0c36a !important;
  color: #2b1b00 !important;
}


/* ========================================================================
   ANNOUNCEMENT MODAL — COMPACT SINGLE METADATA ON DESKTOP
   1–3 metadata fields + no image: place them beside the publication status.
   With an image, or 4+ fields: keep the existing metadata grid.
   Mobile/tablet layout stays unchanged.
   ======================================================================== */

.ann-modal__single-meta {
  display: none;
}

@media (min-width: 901px) {
  .ann-modal.ann-modal--meta-single .ann-modal__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-inline-end: var(--ann-pad-x);
  }

  .ann-modal.ann-modal--meta-single .ann-modal__status .ann-status--pill {
    flex: 0 0 auto;
    margin-inline-end: 0;
  }

  .ann-modal.ann-modal--meta-single .ann-modal__single-meta {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px 8px;
    max-inline-size: min(360px, calc(100% - 150px));
    padding: .34rem .68rem;
    border: 1px solid #e6d4ac;
    border-radius: 11px;
    background: #fffaf2;
    box-shadow: 0 1px 4px rgb(0 0 0 / .06);
    color: #3a2a18;
    font-family: var(--ff-serif);
    line-height: 1.25;
  }

  .ann-modal.ann-modal--meta-single .ann-modal__single-meta-label {
    color: #7a4a00;
    font-size: .88rem;
    font-weight: 800;
  }

  .ann-modal.ann-modal--meta-single .ann-modal__single-meta-value {
    color: #3a2a18;
    font-size: .92rem;
    font-weight: 400;
    overflow-wrap: anywhere;
  }

  /* On desktop the original single metadata card is hidden because its
     compact copy is now shown beside the status. */
  .ann-modal.ann-modal--meta-single .ann-meta {
    display: none;
  }

  /* If there is no image either, remove the now-empty left column so the
     description can use the full modal width. */
  .ann-modal.ann-modal--no-media.ann-modal--meta-single .ann-modal__body,
  .ann-modal.ann-modal--no-media.ann-modal--meta-none .ann-modal__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .ann-modal.ann-modal--no-media.ann-modal--meta-single .ann-modal__left,
  .ann-modal.ann-modal--no-media.ann-modal--meta-none .ann-modal__left {
    display: none;
  }
}


/* ========================================================================
   ANNOUNCEMENT MODAL — CENTER DESCRIPTION ON DESKTOP
   Only the main publication text is changed.
   ======================================================================== */
@media (min-width: 901px) {
  .ann-modal .ann-modal__desc {
    inline-size: 100%;
    margin-inline: auto;
    padding-inline: 1.75rem;
    box-sizing: border-box;
    text-align: center;
  }
}


/* ========================================================================
   ANNOUNCEMENT MODAL — CENTER THE CONTENT COLUMN, KEEP TEXT LEFT-ALIGNED
   Desktop only. For publications without media and with 0–2 metadata fields:
   the content column is centered, while the paragraph itself remains left.
   ======================================================================== */
@media (min-width: 901px) {
  /* Undo the previous centered paragraph alignment. */
  .ann-modal .ann-modal__desc {
    text-align: start;
    padding-inline-start: 0;
    padding-inline-end: 1.75rem;
  }

  /* When there is no media and metadata is compact, center the whole
     content column instead of centering the text itself. */
  .ann-modal.ann-modal--no-media.ann-modal--meta-single .ann-modal__right,
  .ann-modal.ann-modal--no-media.ann-modal--meta-none .ann-modal__right {
    inline-size: min(100%, 760px);
    max-inline-size: 760px;
    margin-inline: auto;
  }

  .ann-modal.ann-modal--no-media.ann-modal--meta-single .ann-modal__desc,
  .ann-modal.ann-modal--no-media.ann-modal--meta-none .ann-modal__desc {
    inline-size: 100%;
    max-inline-size: none;
    margin-inline: 0;
  }

  /* Put status + 1–2 compact metadata chips on the same left edge
     as the centered text column. */
  .ann-modal.ann-modal--no-media.ann-modal--meta-single .ann-modal__status,
  .ann-modal.ann-modal--no-media.ann-modal--meta-none .ann-modal__status {
    inline-size: min(760px, calc(100% - (2 * var(--ann-pad-x))));
    max-inline-size: 760px;
    margin-inline: auto;
    padding-inline: 0;
    box-sizing: border-box;
  }

  .ann-modal.ann-modal--no-media.ann-modal--meta-single .ann-modal__status .ann-status--pill,
  .ann-modal.ann-modal--no-media.ann-modal--meta-none .ann-modal__status .ann-status--pill {
    margin-inline-start: 0;
  }
}


/* ========================================================================
   ANNOUNCEMENT MODAL — STATUS/METADATA BACK TO THE START
   Desktop only: keep the centered text column, but place the publication
   badge + 1–2 compact metadata fields at the original left start of modal.
   ======================================================================== */
@media (min-width: 901px) {
  .ann-modal.ann-modal--no-media.ann-modal--meta-single .ann-modal__status,
  .ann-modal.ann-modal--no-media.ann-modal--meta-none .ann-modal__status {
    inline-size: 100%;
    max-inline-size: none;
    margin-inline: 0;
    padding-inline-start: var(--ann-pad-x);
    padding-inline-end: var(--ann-pad-x);
    box-sizing: border-box;
  }
}


/* ========================================================================
   STANDARD WORDPRESS PAGES
   Privacy Policy, Terms of Use and other ordinary Pages.
   One dedicated block; no duplicated legacy homepage styles.
   ======================================================================== */
.site-page {
  min-block-size: 60vh;
  padding-block: clamp(2.5rem, 6vw, 5.5rem);
  background:
    linear-gradient(180deg, #f8e9c5 0%, #f4d79b 100%);
}

.site-page__container {
  max-inline-size: 980px;
}

.site-page__card {
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid rgba(200, 155, 60, .42);
  border-radius: clamp(18px, 2.5vw, 28px);
  background: #fffaf2;
  box-shadow: 0 14px 38px rgba(58, 43, 14, .12);
}

.site-page__title {
  position: relative;
  margin: 0 0 clamp(2rem, 4vw, 2.8rem);
  padding-block-end: 1.05rem;
  color: #3a2b0e;
  font-family: var(--ff-decor);
  font-size: clamp(2.35rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.08;
  text-align: center;
}

.site-page__title::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  inset-block-end: 0;
  inline-size: 72px;
  block-size: 2px;
  border-radius: 999px;
  background: var(--color-yellow);
  transform: translateX(-50%);
}

.site-page__content {
  inline-size: min(100%, 820px);
  margin-inline: auto;
  color: #2b2113;
  font-family: var(--ff-serif);
  font-size: clamp(1rem, 1.2vw, 1.08rem);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.site-page__content > :first-child {
  margin-block-start: 0;
}

.site-page__content > :last-child {
  margin-block-end: 0;
}

.site-page__content p {
  margin-block: 0 1.05em;
}

.site-page__content h2,
.site-page__content h3,
.site-page__content h4 {
  color: #3a2b0e;
  font-family: var(--ff-serif);
  font-weight: 700;
  line-height: 1.25;
  text-align: start;
}

.site-page__content h2 {
  margin-block: 2.15em .8em;
  font-size: clamp(1.4rem, 2.1vw, 1.72rem);
}

.site-page__content h3 {
  margin-block: 2em .72em;
  padding-inline-start: .85rem;
  border-inline-start: 3px solid var(--color-yellow);
  font-size: clamp(1.18rem, 1.75vw, 1.42rem);
}

.site-page__content h4 {
  margin-block: 1.7em .62em;
  font-size: 1.08em;
}

.site-page__content h2::after,
.site-page__content h3::after,
.site-page__content h4::after {
  content: none;
}

.site-page__content strong {
  color: #3a2b0e;
  font-weight: 700;
}

.site-page__content a {
  color: #6b4b13;
  text-decoration: underline;
  text-decoration-color: rgba(200, 155, 60, .75);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  transition:
    color .18s ease,
    text-decoration-color .18s ease;
}

.site-page__content a:hover,
.site-page__content a:focus-visible {
  color: var(--color-link-brown);
  text-decoration-color: var(--color-yellow);
}

.site-page__content ul,
.site-page__content ol {
  margin-block: 1.15rem 1.45rem;
  padding-inline-start: 1.6em;
}

.site-page__content ol {
  padding: 1.05rem 1.2rem 1.05rem 2.75rem;
  border: 1px solid rgba(200, 155, 60, .28);
  border-radius: 16px;
  background: rgba(255, 247, 230, .72);
}

.site-page__content li {
  padding-inline-start: .22rem;
}

.site-page__content li + li {
  margin-block-start: .62rem;
}

.site-page__content li::marker {
  color: #8e6f22;
  font-weight: 700;
}

.site-page__content hr {
  block-size: 1px;
  margin-block: 2rem;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(200, 155, 60, .48),
    transparent
  );
}

@media (max-width: 600px) {
  .site-page {
    padding-block: 1rem 2rem;
  }

  .site-page__card {
    padding: 1.35rem 1rem 1.6rem;
    border-radius: 18px;
  }

  .site-page__title {
    margin-block-end: 1.7rem;
    padding-block-end: .9rem;
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .site-page__title::after {
    inline-size: 60px;
  }

  .site-page__content {
    font-size: 1rem;
    line-height: 1.68;
  }

  .site-page__content h2 {
    margin-block-start: 1.8em;
  }

  .site-page__content h3 {
    margin-block-start: 1.75em;
    padding-inline-start: .7rem;
    font-size: 1.18rem;
  }

  .site-page__content ol {
    padding: .9rem .85rem .9rem 2.35rem;
    border-radius: 14px;
  }
}
