/* Mobile overrides for Yatsuna Books
   Load AFTER main style.css */

@media (max-width: 768px) {
  .header-container {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding-block: 0.65rem;
  }

  .logo-img {
    block-size: 50px;
  }

  .nav-wrapper {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.55rem;
  }

  .telegram-button {
    inline-size: 46px;
    block-size: 46px;
  }

  .menu-toggle {
    display: inline-flex;
    inline-size: 46px;
    block-size: 46px;
  }

  .js-nav {
    position: fixed;
    inset-inline: 0;
    inset-block-start: var(--header-offset);
    background: #fff8e1;
    border-top: 1px solid color-mix(in oklab, #000 12%, #fff 88%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
    transform-origin: top center;
    transform: scaleY(0);
    transition: transform 0.24s ease;
    z-index: 1000;
  }

  .js-nav ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 1.2rem 1rem 1.6rem;
    list-style: none;
  }

  .js-nav a {
    color: #2b1b00;
    font-weight: 700;
  }

  .header.is-open .js-nav {
    transform: scaleY(1);
  }

  .header.is-open .menu-lines {
    background: transparent;
  }

  .header.is-open .menu-lines::before {
    transform: translateY(6px) rotate(45deg);
  }

  .header.is-open .menu-lines::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .hero {
    block-size: min(68svh, 620px);
    min-block-size: 470px;
    overflow: hidden;
    background-position: center top;
  }

  .hero-text {
    inset-block-start: 60%;
    inset-inline-start: 50%;
    transform: translate(-50%, -50%);
    max-inline-size: 82vw;
    font-size: clamp(2.5rem, 9.5vw, 3.5rem);
    line-height: 1.05;
    text-align: center;
  }

  .mask {
    inset-inline-start: 7%;
    inset-block-start: 31%;
    inline-size: clamp(42px, 11vw, 62px);
  }

  .compass {
    inset-inline-end: 8px;
    inset-block-start: 10px;
    inline-size: clamp(76px, 18vw, 98px);
  }

  .pen {
    inset-inline-start: 50%;
    inset-block-start: 80%;
    inline-size: clamp(150px, 34vw, 210px);
    block-size: auto;
    transform: translate(-50%, -50%);
  }

  .bottle {
    inset-inline-start: 14%;
    inset-block-start: 93%;
    inline-size: clamp(44px, 12vw, 64px);
    transform: translate(-50%, -50%);
  }

  .reviews__grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .reviews__prev {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
  }

  .review-list {
    grid-column: 1;
    grid-row: 2;
  }

  .reviews__more {
    grid-column: 1;
    grid-row: 3;
    justify-self: center;
  }

  .review-form {
    grid-column: 1;
    grid-row: 4;
    position: static;
    inline-size: 100%;
    max-inline-size: 520px;
    margin-inline: auto;
  }

  .footer-content {
    text-align: center;
    justify-items: center;
  }

  .footer-section {
    text-align: center;
  }

  .footer-section h3::after {
    margin-inline: auto;
  }

  .nav-footer ul {
    justify-items: center;
    text-align: center;
    margin-block-start: 1rem;
  }

  .footer-contact-row,
  .footer-social__list {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero {
    block-size: min(66svh, 580px);
    min-block-size: 440px;
  }

  .hero-text {
    inset-block-start: 60%;
    max-inline-size: 84vw;
    font-size: clamp(2.2rem, 10vw, 3.1rem);
    line-height: 1.05;
  }

.compass {
  inline-size: clamp(34px, 9vw, 44px);
}
 .mask {
  inset-inline-start: 6%;
  inset-block-start: 15%;
  inline-size: clamp(70px, 22vw, 120px);
}

 .pen {
  inset-inline-start: 50%;
  inset-block-start: 83%;
  inline-size: clamp(200px, 52vw, 280px);
  transform: translate(-50%, -50%);
}


  .bottle {
    inset-inline-start: 14%;
    inset-block-start: 92%;
    inline-size: clamp(62px, 11vw, 85px);
  }
}
@media (max-width: 480px) {

  .contact-form {
    position: relative;
    z-index: 2;
  }

  .contacts {
    position: relative;
    overflow: hidden;
  }

  .contacts::before,
  .contacts::after {
    content: "";
    position: absolute;
    inset-block-start: auto;
    inset-block-end: -10%;  
    block-size: 85%;
    inline-size: 50%;
    background-position: bottom center;
    background-repeat: no-repeat;
    background-size: contain;

    z-index: 0;
  }

  .contacts::before {
    inset-inline-start: 0;
  }

  .contacts::after {
    inset-inline-end: 0;
  }
}




/* =========================
   BOOKS — composition fix
   ========================= */
@media (max-width: 768px) {

  /* Секція трохи більша */
  .books {
    min-height: 105svh;
    padding: 1.2rem 0 3.8rem;
  }

  /* Заголовок трохи вище */
  .books h2 {
    margin: 1.8rem 0 0.8rem;
  }

  /* 🔥 РИЦАР — не перекривається */
  .books::before {
    left: -12%;
    top: 70px;
    width: 52%;
    height: 32%;
    opacity: 0.6;
    z-index: 1;
  }

  /* 🔥 ЗАМОК — більший і виразніший */
  .books::after {
    right: -6%;
    bottom: 6%;
    width: 55%;
    height: 22%;
    opacity: 0.55;
    z-index: 1;
  }

  /* Контейнер каруселі */
  .books .carousel-container {
    padding-bottom: 3.6rem;
  }

  /* 🔥 КНИЖКА НИЖЧЕ */
  .books .carousel-item {
    padding-top: 60px; /* головний параметр */
  }

  /* 🔥 КНИЖКА МЕНША */
  .books .carousel-item img,
  .books .book-cover {
    inline-size: min(64vw, 290px);
  }

  /* Кнопка info чітко на книжці */
  .books .book-media {
    position: relative;
  }

  .books .book-info-trigger {
    position: absolute;
    top: 8px;
    left: 8px;
    inline-size: 36px;
    block-size: 36px;
    z-index: 5;
  }

}

@media (max-width: 768px) {
  .books {
    padding: 2.4rem 0 3.6rem;
    min-height: 92svh;
    overflow: hidden;
  }

  .books .container {
    padding-inline: 0;
  }

  .books h2 {
    margin: 1.8rem 0 1.2rem;
    font-size: clamp(2.7rem, 11vw, 4.2rem);
    line-height: 1;
    position: relative;
    z-index: 2;
  }

  .books h2::after {
    margin-top: 0.55rem;
  }

  .books::before {
    left: -12%;
    top: 80px;
    width: 44%;
    height: 28%;
    opacity: 0.45;
    background-position: left top;
    z-index: 1;
  }

  .books::after {
    right: -6%;
    bottom: 2%;
    width: 55%;
    height: 22%;
    opacity: 0.45;
    z-index: 1;
  }

  .books .carousel-container {
    inline-size: 100%;
    block-size: auto;
    min-block-size: 0;
    margin-inline: auto;
    padding: 0 0 3.4rem;
    overflow: visible;
  }

  .books .js-books-carousel {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    block-size: auto;
  }

  .books .carousel-item {
    flex: 0 0 100%;
    block-size: auto;
    min-block-size: 0;
    padding: 0;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 2;
  }

  .books .book-media {
    position: relative;
    display: inline-block;
  }

  .books .carousel-item img,
  .books .book-cover {
   inline-size: min(56vw, 250px);
    max-inline-size: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.16));
  }

  .books .book-info-trigger {
    top: 8px;
    left: 8px;
    inline-size: 34px;
    block-size: 34px;
    z-index: 5;
  }

  .books .carousel-pagination {
    position: static;
    margin-top: 1.4rem;
    justify-content: center;
    gap: 10px;
    z-index: 3;
  }

  .books .carousel-dot {
    inline-size: 12px;
    block-size: 12px;
  }

  .books .carousel-button {
    display: none !important;
  }

  .books .book-overlay {
    inset-block-start: 58%;
    inline-size: min(82vw, 320px);
    max-inline-size: calc(100% - 1.25rem);
  }

  .books {
    scroll-margin-block-start: 86px;
  }
}

@media (max-width: 768px) {
  .books .carousel-item {
    display: grid;
    place-items: center;
    padding-top: 88px;
  }
}


.books h2 {
  margin: 2.2rem 0 1.4rem;
}



.books .book-cover {
  animation: bookFloat 4s ease-in-out infinite;
}

@keyframes bookFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

.books .book-cover {
  transition: transform 0.3s ease;
}

.books .book-cover:active {
  transform: scale(0.97);
}
@media (max-width: 768px) {

  .books .book-info-trigger {
    top: 8px;
    left: 8px;

    width: 32px;
    height: 32px;

    font-size: 14px;
  }

}



/* =========================================
   REVIEWS — FINAL MOBILE 1:1
   ========================================= */
@media (max-width: 768px) {
  .reviews {
    padding: 48px 0 72px;
  }

  .reviews .container {
    padding-inline: 14px;
  }

  .reviews h2 {
    margin-bottom: 14px;
  }

  .reviews h2::after {
    content: "";
    display: block;
    width: 72px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 2px;
    background: #c89b3c;
  }

  /* головна структура — просто колонка */
  .reviews__grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  /* порядок елементів */
  .reviews__list-col {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  .reviews__more {
    order: 2;
  }

  .reviews__stats {
    order: 3;
  }

  .review-form {
    order: 4;
  }

  /* фільтри */
  .reviews__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    justify-content: flex-start;
  }

  .reviews__filter {
    font-size: 0.88rem;
    padding: 6px 12px;
  }

  /* список відгуків */
  .review-list {
    display: grid;
    gap: 14px;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 0;
  }

  .review {
    min-height: 170px;
    padding: 1rem 1rem 0.95rem;
    border-radius: 18px;
  }

  .review__head {
    gap: 0.2rem 0.8rem;
  }

  .review__date {
    font-size: 0.82rem;
  }

  .review__rating {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .review__book {
    margin-top: 0.7rem;
    font-size: 0.94rem;
    line-height: 1.3;
  }

  .review__text {
    margin-top: 0.9rem;
    margin-bottom: 0.45rem;
    font-size: 1rem;
    line-height: 1.55;
    text-align: left;
  }

  .review__signature {
    font-size: 0.92rem;
  }

  /* верхня стрілка */
  .reviews__prev {
    display: inline-flex;
    justify-self: center;
    align-self: center;
    margin: 6px auto 12px;
    inline-size: 46px;
    block-size: 46px;
    position: static;
    z-index: auto;
  }

  /* нижня стрілка */
  .reviews__more {
    display: inline-flex;
    justify-self: center;
    align-self: center;
    margin: 18px auto 18px;
    inline-size: 46px;
    block-size: 46px;
    position: static;
    z-index: auto;
  }

  /* статистика — окремим блоком, без перекриття */
  .reviews__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 28px;
    position: static;
    z-index: auto;
  }

  .stat {
    min-height: 104px;
    padding: 16px 8px;
    border-radius: 16px;
  }

  .stat__value {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }

  .stat__label {
    font-size: 0.8rem;
    line-height: 1.25;
  }

  /* форма — окремо після статистики */
  .review-form {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1rem;
    border-radius: 22px;
    position: static;
    top: auto;
    justify-self: stretch;
    z-index: auto;
  }

  .review-form__title {
    margin-bottom: 0.85rem;
  }

  .field {
    margin-bottom: 0.75rem;
  }

  .field__label {
    margin-bottom: 0.38rem;
    text-align: center;
  }

  .field__control,
  .review-form select,
  .review-form textarea {
    min-height: 46px;
    padding: 0.75rem 0.95rem;
  }

  .field__control--textarea,
  .review-form textarea {
    min-height: 120px;
  }

  .rating {
    margin-bottom: 0.8rem;
  }

  .rating__stars {
    justify-content: center;
    gap: 6px;
  }

  .rating__stars .star {
    inline-size: 28px;
    block-size: 28px;
    font-size: 1rem;
  }

  .review-form__submit,
  .btn--primary {
    min-width: 150px;
    min-height: 48px;
    margin-top: 0.5rem;
  }
}

/* ще дрібніше — щільніше, але без накладання */
@media (max-width: 480px) {
  .reviews {
    padding: 44px 0 76px;
  }

  .reviews__stats {
    gap: 10px;
    margin-bottom: 30px;
  }

  .stat {
    min-height: 98px;
    padding: 14px 8px;
  }

  .stat__value {
    font-size: 1.25rem;
  }

  .stat__label {
    font-size: 0.76rem;
  }

  .review-form {
    padding: 0.95rem;
  }
}
/* =========================================
   REVIEWS — TABLET LAYOUT (768–1024px)
   ========================================= */
@media (min-width: 769px) and (max-width: 1024px) {

  .reviews__grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  /* порядок елементів */
  .reviews__prev       { order: 1; }
  .reviews__list-col   { order: 2; }
  .reviews__more       { order: 3; }
  .reviews__stats      { order: 4; }
  .review-form         { order: 5; }

  /* центруємо стрілки */
  .reviews__prev,
  .reviews__more {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px auto;
  }

  /* список відгуків */
  .review-list {
    max-height: none;
    overflow: visible;
  }

  /* статистика */
  .reviews__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 720px;
  width: 100%;
  margin: 24px auto;
}

  /* форма */
  .review-form {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
  }

}

/* =========================================
   BOOK MODAL — FINAL MOBILE
   ========================================= */

  
@media (max-width: 768px) {
  .modal--details {
    inset: 0;
    padding: 0 !important;
  }

  .modal--details .modal__dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal--details .modal__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    padding: 16px 16px 20px;
  }

  .modal--details .modal__cover {
    display: block;
    width: min(48vw, 220px) !important;
    max-width: 220px !important;
    margin: 4px auto 18px !important;
    flex: 0 0 auto;
  }

  .modal--details .modal__content {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0;
  }

  .modal--details .modal__text {
    width: 100%;
    margin: 0;
    padding: 0 2px;
    font-size: 16px;
    line-height: 1.7;
    text-align: left;

    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: #c89b3c #f3e3bf;
  }

  .modal--details .modal__text::-webkit-scrollbar {
    width: 8px;
  }

  .modal--details .modal__text::-webkit-scrollbar-track {
    background: #f3e3bf;
    border-radius: 999px;
  }

  .modal--details .modal__text::-webkit-scrollbar-thumb {
    background: #c89b3c;
    border-radius: 999px;
  }

  .desc-toggle {
    position: static;
    margin: 16px auto 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff8ee;
    border: 1px solid #9f8a57;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    flex: 0 0 auto;
  }

  .modal--details .modal__cta {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding-top: 8px;
    margin-top: 0;
    flex: 0 0 auto;
  }

  .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 {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 0.95rem 1rem;
    border-radius: 999px;
    font-size: 1.05rem;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .modal--details .modal__content {
    width: 100%;
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    min-height: 0;
  }

  .modal--details .modal__text {
    width: 100%;
    margin: 0;
    padding: 0 2px;
    font-size: 16px;
    line-height: 1.7;
    text-align: left;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #c89b3c #f3e3bf;
  }

  .modal--details .modal__text::-webkit-scrollbar {
    width: 8px;
  }

  .modal--details .modal__text::-webkit-scrollbar-track {
    background: #f3e3bf;
    border-radius: 999px;
  }

  .modal--details .modal__text::-webkit-scrollbar-thumb {
    background: #c89b3c;
    border-radius: 999px;
  }

  .desc-toggle {
    position: static !important;
    bottom: auto !important;
    margin: 14px auto 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff8ee;
    border: 1px solid #9f8a57;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: none !important;
  }
  
  .modal--chapters .chapter-picker {
  display: block;
  margin-bottom: 6px;
}

.modal--chapters .chapter-select {
  width: 100%;
  min-height: 54px;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: #fffdf9;
  border: 1.5px solid rgba(43, 27, 0, 0.35);
  color: #2b1b00;
  font-size: 1rem;
  line-height: 1.25;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  appearance: none;
}

.modal--chapters .chapter-list {
  display: none !important;
}
  
}




/* =========================================================
   ANNOUNCEMENT MODAL — MOBILE LIKE REFERENCE
   ========================================================= */
@media (max-width: 768px) {
  .ann-modal {
    inset: 0;
    padding: 0 !important;
    align-items: stretch;
    justify-items: stretch;
    background: rgba(22, 18, 12, 0.52);
  }

  .ann-modal__dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
    background: #fff9ef;
  }

  /* header */
  .ann-modal .modal__header {
    padding: 18px 18px 10px;
    border-bottom: 0;
    align-items: start;
    background: #fff9ef;
    position: relative;
    z-index: 3;
  }

  .ann-modal .modal__title {
    margin: 0;
    max-width: calc(100% - 64px);
    font-size: clamp(2.1rem, 7vw, 3rem);
    line-height: 1.02;
    text-align: left;
    color: #2b1b00;
  }

  .ann-modal .modal__close {
    inline-size: 48px;
    block-size: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    background: #1f1f1f;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    font-size: 1.3rem;
  }

  /* status pill under title */
  .ann-modal__status {
    margin: 0;
    padding: 0 18px 12px;
    background: #fff9ef;
  }

  .ann-status--pill {
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    line-height: 1.1;
  }

  /* main scrollable area */
  .ann-modal__body {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 18px 16px !important;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .ann-modal__left {
    display: grid;
    gap: 16px;
    overflow: visible;
  }

  .ann-modal__media {
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
  }

  .ann-modal__cover {
    display: block;
    width: 100%;
    aspect-ratio: 1.55 / 1;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: none;
    margin: 0;
  }

  /* meta cards */
  .ann-meta {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
  }

  .ann-meta__item {
    grid-column: span 2;
    min-height: 118px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fffaf2;
    border: 1px solid #e6d4ac;
    box-shadow: none;
  }

  .ann-meta__item:nth-child(1),
  .ann-meta__item:nth-child(2) {
    grid-column: span 3;
    min-height: 110px;
  }

  .ann-meta__label {
    margin: 0 0 8px;
    font-size: 0.98rem;
    line-height: 1.2;
    font-weight: 800;
    color: #7a4a00;
  }

  .ann-meta__value {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.35;
    color: #2b1b00;
  }

  /* right column becomes normal flow */
  .ann-modal__right {
    display: grid;
    grid-template-rows: minmax(0, auto) auto auto;
    min-height: 0;
    margin-top: 18px;
  }

  .ann-modal__desc {
    max-inline-size: none;
    padding-inline-end: 0;
    font-size: 1.07rem;
    line-height: 1.78;
    color: #2b1b00;

    /* collapsed state */
    max-block-size: 12.8em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
            mask-image: linear-gradient(to bottom, #000 78%, transparent);
  }

  .ann-modal__desc.is-expanded {
    max-block-size: 30vh !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-inline-end: 8px;
    -webkit-mask-image: none !important;
            mask-image: none !important;
    scrollbar-width: thin;
    scrollbar-color: #c89b3c #f3e3bf;
  }

  .ann-modal__desc.is-expanded::-webkit-scrollbar {
    width: 8px;
  }

  .ann-modal__desc.is-expanded::-webkit-scrollbar-track {
    background: #f3e3bf;
    border-radius: 999px;
  }

  .ann-modal__desc.is-expanded::-webkit-scrollbar-thumb {
    background: #c89b3c;
    border-radius: 999px;
  }

  /* toggle between text and buttons */
  .ann-modal .desc-toggle,
  .ann-modal .desc-toggle--ann {
    position: static !important;
    bottom: auto !important;
    margin: 14px auto 12px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff8ee;
    border: 1px solid #9f8a57;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: none !important;
    z-index: 2;
  }

/* CTA should always stay the same size on mobile */
.ann-modal .modal__cta,
.ann-modal__right .modal__cta {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 10px 0 4px;
  margin-top: 0;
  align-items: stretch;
  background: linear-gradient(
    to top,
    rgba(255, 249, 239, 0.98) 78%,
    rgba(255, 249, 239, 0)
  );
}

.ann-modal .modal__cta .btn,
.ann-modal .modal__cta .btn-ghost,
.ann-modal .modal__cta .ann-signup,
.ann-modal .modal__cta .ann-share {
  inline-size: 100%;
  min-inline-size: 0;
  block-size: 58px;
  min-block-size: 58px;
  max-block-size: 58px;
  padding: 0 1rem;
  border-radius: 999px;
  font-size: 1.05rem;
  line-height: 1;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  white-space: nowrap;
  box-sizing: border-box;
  align-self: stretch;
}

/* коли опис розгорнутий — ховаємо кнопки, як у модалці книжки */
.ann-modal__right:has(.ann-modal__desc.is-expanded) .modal__cta {
  display: none !important;
}

/* і трохи прибираємо нижній відступ, щоб не лишалась порожнеча */
.ann-modal__right:has(.ann-modal__desc.is-expanded) {
  padding-bottom: 0;
}


  /* hide custom scroll rail on mobile for cleaner look */
  .ann-modal__desc .scroll-rail {
    display: none !important;
  }

/* =========================================
   CHAPTERS MODAL — MOBILE LIKE REFERENCE
   ========================================= */
@media (max-width: 768px) {
  .modal--chapters {
    inset: 0;
    padding: 0 !important;
    background: rgba(22, 18, 12, 0.5);
  }

  .modal--chapters .modal__dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
      linear-gradient(
        180deg,
        #fff9ef 0%,
        #fff8ee 72%,
        #f7ecd8 100%
      );
  }

  /* header */
  .modal--chapters .modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(43, 27, 0, 0.08);
    background: rgba(255, 249, 239, 0.96);
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 3;
  }

  .modal--chapters .modal__title {
    margin: 0;
    max-width: calc(100% - 64px);
    font-size: clamp(2rem, 7vw, 2.8rem);
    line-height: 1.04;
    text-align: left;
    color: #2b1b00;
  }

  .modal--chapters .modal__close {
    inline-size: 48px;
    block-size: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    border: 0;
    background: #1f1f1f;
    color: #fff8e9;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    font-size: 1.35rem;
    display: grid;
    place-items: center;
  }

  /* body scroll */
  .modal--chapters .modal__body {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    gap: 18px;
    padding: 18px 18px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    max-block-size: none !important;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    background:
      linear-gradient(
        180deg,
        rgba(255, 249, 239, 0.92) 0%,
        rgba(255, 249, 239, 0.96) 68%,
        rgba(246, 234, 214, 0.98) 100%
      );
  }

  /* left col becomes normal top block */
  .modal--chapters .chapter-col {
    border-right: 0 !important;
    border-bottom: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block;
  }

  .modal--chapters .chapter-col h4 {
    margin: 0 0 14px;
    font-size: 1.15rem;
    line-height: 1.2;
    font-weight: 800;
    color: #4b2b00;
  }

  .modal--chapters .chapter-list {
    display: grid;
    gap: 10px;
    max-block-size: none !important;
    overflow: visible !important;
    padding-right: 0;
  }

  .modal--chapters .chapter-btn {
    min-height: 54px;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    background: #fffdf9;
    border: 1.5px solid rgba(43, 27, 0, 0.35);
    color: #2b1b00;
    font-size: 1rem;
    line-height: 1.25;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  }

  .modal--chapters .chapter-btn:hover,
  .modal--chapters .chapter-btn:focus-visible {
    background: #fffaf2;
    border-color: #c89b3c;
    outline: none;
  }

  .modal--chapters .chapter-btn.is-active,
  .modal--chapters .chapter-btn[aria-current="true"] {
    background: color-mix(in oklab, var(--m-accent) 16%, #fff 84%);
    border-color: color-mix(in oklab, var(--m-accent) 68%, #000 32%);
    box-shadow:
      inset 0 0 0 2px color-mix(in oklab, var(--m-accent) 38%, #fff 62%),
      0 4px 12px rgba(200, 155, 60, 0.16);
  }

  /* preview block */
  .modal--chapters .preview-col {
    display: grid;
    grid-template-rows: auto 1fr auto;
    row-gap: 16px;
    min-height: 0;
  }

  .modal--chapters .preview-title {
    margin: 0;
    font-size: clamp(1.7rem, 5.8vw, 2.2rem);
    line-height: 1.15;
    font-weight: 800;
    color: #2b1b00;
  }

  .modal--chapters .preview-scroll {
    overflow: visible;
    padding-inline-end: 0;
    scrollbar-gutter: auto;
  }

  .modal--chapters .chapter-summary {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.78;
    color: #3a2a18;
  }

  .modal--chapters .chapter-excerpt {
    margin: 18px 0 0;
    padding: 18px 18px 20px;
    background: rgba(255, 250, 242, 0.95);
    border: 1px solid #e4d2a8;
    border-left: 5px solid #c89b3c;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  }

  .modal--chapters .chapter-excerpt .excerpt-text {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.85;
    font-style: italic;
    color: #59452a;
  }

  .modal--chapters .excerpt-cap {
    display: none;
  }

  /* bottom action */
  .modal--chapters .preview-actions {
    display: flex;
    justify-content: center;
    padding-top: 4px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .modal--chapters .preview-actions .btn,
  .modal--chapters .preview-actions .btn--solid,
  .modal--chapters [data-action="open-chapter"] {
    min-inline-size: min(78vw, 320px);
    min-height: 58px;
    padding: 0.95rem 1.4rem;
    border-radius: 999px;
    font-size: 1.08rem;
    font-weight: 800;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 8px 18px rgba(200, 155, 60, 0.18);
  }
}

/* =========================================
   BOOK DETAILS MODAL — TABLET LAYOUT ONLY
   ========================================= */
@media (min-width: 769px) and (max-width: 1180px) {
  .modal--details {
    padding: 24px;
  }

  .modal--details .modal__dialog {
    width: min(1120px, calc(100vw - 48px));
    max-width: 1120px;
    max-height: min(78vh, 760px);
    border-radius: 28px;
    overflow: hidden;
  }

  .modal--details .modal__header {
    padding: 18px 26px 16px;
  }

  .modal--details .modal__title {
    font-size: clamp(2.2rem, 2vw + 1.2rem, 3.1rem);
    line-height: 1.05;
    text-align: left;
  }

  .modal--details .modal__close {
    inline-size: 52px;
    block-size: 52px;
    flex: 0 0 52px;
    font-size: 1.35rem;
  }

  .modal--details .modal__body {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    padding: 26px 30px 30px;
  }

  .modal--details .modal__cover {
    width: min(100%, 340px);
    margin: 0 auto;
    display: block;
    object-fit: contain;
  }

  .modal--details .modal__content {
    display: grid;
    grid-template-rows: minmax(0, auto) auto auto;
    align-content: center;
    gap: 14px;
    min-width: 0;
  }

  .modal--details .modal__text {
    max-inline-size: none;
    max-block-size: 360px;
    padding-inline-end: 0;
    font-size: clamp(1.05rem, 0.3vw + 0.95rem, 1.18rem);
    line-height: 1.8;
  }

  .modal--details .modal__text.is-expanded {
    max-block-size: 290px;
    overflow-y: auto;
    padding-inline-end: 10px;
  }

  .modal--details .modal__text.is-expanded::-webkit-scrollbar {
    width: 8px;
  }

  .modal--details .desc-toggle {
    position: static;
    margin: 2px auto 4px;
    width: 48px;
    height: 48px;
  }

  .modal--details .modal__cta {
    position: static;
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 0;
    margin-top: 2px;
    background: transparent;
  }

  .modal--details .modal__cta .btn,
  .modal--details .modal__cta .btn--solid,
  .modal--details .modal__cta .btn--ghost {
    min-width: 220px;
    min-height: 58px;
    padding: 0.95rem 1.4rem;
    border-radius: 999px;
    font-size: 1.08rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .modal--details .modal__content .scroll-rail {
    display: none;
  }
}

/* =========================================
   BOOKS — MOBILE LAYOUT FOR FOLD / NARROW TABLET
   ========================================= */
/* ========================================================================
   BOOKS — iPad Air / tablet portrait
   Зберігаємо твої кольори, міняємо тільки композицію
   ======================================================================== */
@media (min-width: 769px) and (max-width: 900px) and (orientation: portrait) {
  .books {
    padding: 2.6rem 0 4.2rem;
    min-height: 100svh;
    overflow: hidden;
    scroll-margin-block-start: 90px;
  }

  .books .container {
    padding-inline: 0;
  }

  .books h2 {
    margin: 2.2rem 0 1.3rem;
    font-size: clamp(4rem, 7vw, 5.2rem);
    line-height: 1;
    position: relative;
    z-index: 2;
  }

  .books h2::after {
    margin-top: 0.65rem;
  }

  /* Рицар */
  .books::before {
    left: -10%;
    top: 110px;
    width: 36%;
    height: 26%;
    opacity: 0.5;
    background-size: contain;
    background-position: left top;
    background-repeat: no-repeat;
    z-index: 1;
  }

  /* Замок */
  .books::after {
    right: -2%;
    bottom: 3%;
    width: 34%;
    height: 16%;
    opacity: 0.5;
    background-size: contain;
    background-position: right bottom;
    background-repeat: no-repeat;
    z-index: 1;
  }

  .books .carousel-container {
    inline-size: 100%;
    block-size: auto;
    min-block-size: 0;
    margin-inline: auto;
    padding: 1.4rem 0 3.6rem;
    overflow: visible;
  }

  .books .js-books-carousel {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    block-size: auto;
  }

  .books .carousel-item {
    flex: 0 0 100%;
    block-size: auto;
    min-block-size: 0;
    padding: 4.4rem 0 0;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 2;
  }

  .books .book-media {
    position: relative;
    display: inline-block;
  }

  .books .carousel-item img,
  .books .book-cover {
    inline-size: min(42vw, 360px);
    max-inline-size: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.16));
  }

  .books .book-info-trigger {
    top: 10px;
    left: 10px;
    inline-size: 42px;
    block-size: 42px;
    z-index: 5;
  }

  .books .book-info-trigger span {
    font-size: 1.1rem;
  }

  /* На такому режимі стрілки прибираємо, як на референсі */
  .books .carousel-button {
    display: none !important;
  }

  .books .carousel-pagination {
    position: static;
    margin-top: 1.7rem;
    justify-content: center;
    gap: 10px;
    z-index: 3;
  }

  .books .carousel-dot {
    inline-size: 12px;
    block-size: 12px;
  }

  .books .book-overlay {
    inset-block-start: 58%;
    inline-size: min(62vw, 360px);
    max-inline-size: calc(100% - 1.5rem);
  }
}
/* mobile dropdown for chapters — повертаємо твій теплий золотий колір */
@media (max-width: 768px) {
  .modal--chapters .chapter-picker {
    display: block;
    margin-bottom: 10px;
  }

  .modal--chapters .chapter-select {
    width: 100%;
    min-height: 54px;
    padding: 0.8rem 1rem;
    border-radius: 16px;

    background: #fffaf2;
    color: #4b2b00;
    border: 1.5px solid #c89b3c;

    font: inherit;
    font-size: 1rem;
    line-height: 1.25;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    appearance: none;
    outline: none;
  }

  .modal--chapters .chapter-select:focus,
  .modal--chapters .chapter-select:focus-visible {
    border-color: #c89b3c;
    box-shadow:
      0 0 0 2px rgba(200, 155, 60, 0.18),
      0 2px 10px rgba(0, 0, 0, 0.04);
    outline: none;
  }

  .modal--chapters .chapter-select option {
    background: #fffaf2;
    color: #2b1b00;
  }
}
/* ========================================================================
   CHAPTERS MODAL — PIXEL 8 / narrow phones
   ======================================================================== */
@media (max-width: 430px) {
  .modal--chapters .modal__header {
    padding: 16px 16px 12px;
    gap: 10px;
  }

  .modal--chapters .modal__title {
    max-width: calc(100% - 56px);
    font-size: clamp(1.6rem, 7.8vw, 2rem);
    line-height: 1.06;
  }

  .modal--chapters .modal__close {
    inline-size: 44px;
    block-size: 44px;
    flex: 0 0 44px;
    font-size: 1.2rem;
  }

  .modal--chapters .modal__body {
    gap: 16px;
    padding: 14px 16px 18px;
  }

  .modal--chapters .chapter-col h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    line-height: 1.2;
  }

  /* показуємо dropdown і ховаємо список кнопок */
  .modal--chapters .chapter-picker {
    display: block !important;
    margin-bottom: 2px;
  }

  .modal--chapters .chapter-select {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 0.95rem;
    border-radius: 18px;
    background: #fffdf9;
    border: 1.5px solid #d2ad57;
    color: #5a3a00;
    font-size: 0.98rem;
    line-height: 1.2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    appearance: none;
  }

  .modal--chapters .chapter-list {
    display: none !important;
  }

  .modal--chapters .preview-col {
    row-gap: 14px;
  }

  .modal--chapters .preview-title {
    margin: 0;
    font-size: clamp(1.7rem, 5.8vw, 2.2rem);
    line-height: 1.15;
    font-weight: 800;
    color: #2b1b00;
  }

  .modal--chapters .chapter-summary {
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .modal--chapters .chapter-excerpt {
    margin-top: 14px;
    padding: 16px 16px 18px;
    border-radius: 18px;
  }

  .modal--chapters .chapter-excerpt .excerpt-text {
    font-size: 0.98rem;
    line-height: 1.78;
  }

  .modal--chapters .preview-actions {
    padding-top: 2px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }

  .modal--chapters .preview-actions .btn,
  .modal--chapters .preview-actions .btn--solid,
  .modal--chapters [data-action="open-chapter"] {
    width: 100%;
    min-inline-size: 0;
    min-height: 54px;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    box-shadow: 0 6px 14px rgba(200, 155, 60, 0.16);
  }
}
/* ========================================================================
   ANNOUNCEMENTS — MOBILE
   2 картки одна під одною, стрілки внизу, пагінація по центру
   ======================================================================== */
@media (max-width: 768px) {
  .announcements {
    padding: 3.5rem 1rem 2.75rem;
  }

  .announcements .custom-carousel {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
      "track track track"
      "prev dots next";
    column-gap: 18px;
    row-gap: 16px;
    max-inline-size: 430px;
    margin-inline: auto;
    padding-inline: 0;
    overflow: visible;
  }

  .announcements .carousel-track {
    grid-area: track;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    transform: none !important;
    transition: none !important;
  }

  .announcements .carousel-item {
    display: block;
    flex: 0 0 auto;
    max-inline-size: none;
  }

  .announcements .carousel-item[hidden] {
    display: none !important;
  }

  .announcements .carousel-button {
    inline-size: 54px;
    block-size: 54px;
    position: static;
    transform: none !important;
  }

  .announcements .carousel-button.prev {
    grid-area: prev;
    justify-self: start;
    align-self: center;
  }

  .announcements .carousel-button.next {
    grid-area: next;
    justify-self: end;
    align-self: center;
  }

  .announcements .carousel-pagination {
    grid-area: dots;
    justify-self: center;
    margin: 0;
    gap: 10px;
  }

  .announcements .carousel-dot {
    inline-size: 12px;
    block-size: 12px;
  }

  .announcement-card {
    max-inline-size: 100%;
    min-block-size: auto;
    padding: 1.3rem 1.2rem 1.45rem;
    border-radius: 28px;
  }

  .announcement-card .card-media img {
    block-size: 190px;
    border-radius: 18px;
  }

  .announcement-card .card-title,
  .announcement-card h3 {
    font-size: clamp(1.8rem, 6.5vw, 2.3rem);
  }

  .announcement-card .card-excerpt {
    max-block-size: none;
    overflow: visible;
    font-size: 1.04rem;
    line-height: 1.68;
  }

  .announcement-card .card-more {
    inline-size: min(100%, 280px);
    min-block-size: 54px;
    margin-top: 8px;
  }
}


/* ========================================================================
   HERO — iPad Air portrait
   ======================================================================== */
@media (min-width: 769px) and (max-width: 900px) and (orientation: portrait) {
  .hero {
    block-size: clamp(620px, 62svh, 740px);
    min-block-size: 620px;
    overflow: hidden;
    background-size: cover;
    background-position: center top;
  }

  .hero::before {
    opacity: 0.52;
  }

  .composition {
    position: relative;
    inline-size: 100%;
    block-size: 100%;
  }

  .compass {
    inset-inline-end: 14px;
    inset-block-start: 14px;
    inline-size: clamp(52px, 6.5vw, 72px);
    transform: rotate(4deg);
    z-index: 4;
  }

  .mask {
    inset-inline-start: 7%;
    inset-block-start: 18%;
    inline-size: clamp(88px, 15vw, 132px);
    opacity: 0.78;
    z-index: 2;
  }

  .hero-text {
    inset-inline-start: 50%;
    inset-block-start: 58%;
    max-inline-size: min(54vw, 440px);
    font-size: clamp(3rem, 5vw, 4.4rem);
    line-height: 1.08;
    text-align: center;
    transform: translate(-50%, -50%);
    z-index: 3;
  }

  .pen,
  .bottle {
    position: absolute;
    block-size: auto;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.32));
  }

  .pen {
    inline-size: clamp(150px, 20vw, 220px);
    inset-inline-start: 50%;
    inset-block-start: 82%;
    transform: translate(-50%, -50%);
    z-index: 3;
  }

  .bottle {
    inline-size: clamp(50px, 7vw, 72px);
    inset-inline-start: 13%;
    inset-block-start: 91%;
    transform: translate(-50%, -50%);
    z-index: 2;
  }
}


