/* =========================================================================
   Адаптивная надстройка сайта Михаила Савоярова
   Подключается последней в <head> и работает ТОЛЬКО до 1100px.
   Десктопная вёрстка (1101px и шире) остаётся без изменений:
   правила ниже не переопределяют .col1/.col2/.col3/#box/... вне медиазапроса.

   Палитра сайта: бордо #540404, золото #cebc72, акцент #b55a28,
                 тёмное дерево #48230a / #3c1c05, шрифт "Red Sunset".
   ========================================================================= */

/* ---------- Новые элементы: на десктопе их нет ---------- */
.topbar,
.mm,
.zoomBtn { display: none; }

/* Обёртка фрейма: на десктопе просто блок без влияния на вёрстку */
.frameWrap { display: block; line-height: 0; }

/* ===========================  ПЛАНШЕТЫ И ТЕЛЕФОНЫ  ======================= */
@media (max-width: 1100px) {

  /* новые и перестроенные блоки считаем по border-box:
     иначе width:100% + padding даёт горизонтальную прокрутку */
  #maket, #maket *,
  .about, .about *,
  .topbar, .topbar *,
  .mm, .mm * { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  body {
    width: auto;
    height: auto;
    min-width: 0 !important;   /* перебивает inline min-width:1000px */
    min-height: 0;
    background: #540404;
    -webkit-text-size-adjust: 100%;
  }

  /* ---------------- Верхняя полоса ---------------- */
  .topbar {
    display: flex;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(180deg, #400303 0%, #540404 100%);
    border-bottom: 1px solid rgba(206, 188, 114, .45);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .55);
  }

  .topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    color: #f0e9cb;
    text-decoration: none;
    outline: none;
  }

  .topbar__logo {
    display: block;
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    border: 1px solid rgba(206, 188, 114, .65);
    background: #400303;
    object-fit: cover;
  }

  .topbar__txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
  }

  .topbar__txt b {
    font: 700 18px/1.15 "Red Sunset", "Times New Roman", serif;
    letter-spacing: .03em;
    color: #f0e9cb;
    text-shadow: 0 2px 4px #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar__txt small {
    font: 10px/1.3 Arial, Helvetica, sans-serif;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #b55a28;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ---------------- Кнопка-гамбургер ---------------- */
  .burger {
    display: inline-flex;
    flex: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    margin: 0;
    cursor: pointer;
    background: #3c1c05;
    border: 1px solid #cebc72;
    border-radius: 10px;
    -webkit-appearance: none;
    appearance: none;
    transition: background .25s ease;
  }
  .burger:hover { background: #5a2a0a; }

  .burger span {
    display: block;
    height: 2px;
    background: #f0e9cb;
    border-radius: 2px;
    transition: transform .28s ease, opacity .2s ease;
  }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ---------------- Гармошка ---------------- */
  .mm {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 64px 12px 20px;
    background: #400303;
    border-bottom: 1px solid #cebc72;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .65);
  }

  .mm.open {
    display: block;
    -webkit-animation: mm-In .22s ease both;
    animation: mm-In .22s ease both;
  }

  @-webkit-keyframes mm-In {
    from { opacity: 0; -webkit-transform: translateY(-10px); }
    to   { opacity: 1; -webkit-transform: none; }
  }
  @keyframes mm-In {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
  }

  .mm__item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    margin: 0 0 8px;
    padding: 12px 15px;
    text-align: left;
    cursor: pointer;
    font: 400 19px/1.15 "Red Sunset", "Times New Roman", serif;
    letter-spacing: .02em;
    color: #f0e9cb;
    text-decoration: none;
    background: #4a2207;
    border: 1px solid rgba(206, 188, 114, .45);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .45);
    -webkit-appearance: none;
    appearance: none;
  }

  .mm__item small {
    font: 10px/1.3 Arial, Helvetica, sans-serif;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #b55a28;
  }

  .mm__item:hover,
  .mm__item:focus-visible {
    background: #5a2a0a;
    color: #fff;
  }

  .mm__item[aria-expanded="true"] {
    border-color: #f0e9cb;
  }

  .mm__item--book {
    background: #540404;
    border-color: #b55a28;
  }

  .mm__body {
    display: none;
    margin: -4px 0 10px;
    padding: 12px 15px;
    text-align: left;
    background: #2f1503;
    border: 1px solid #cebc72;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, .45);
    color: #d8c98a;
    font: 13px/1.65 Arial, Helvetica, sans-serif;
  }
  .mm__body.open { display: block; }

  .mm__body .stroka4 {
    display: block;
    margin: 6px 0 0;
    font: 12px/1.5 "Times New Roman", serif;
    color: #ff9900;
  }

  /* ---------------- Сцена: старый коллаж остаётся ---------------- */
  #maket {
    display: block;
    width: 100%;
    min-height: 0;
  }

  .col1,
  .col3,
  #footer { display: none !important; }   /* всё это переехало в гармошку */

  .col2 {
    position: static;
    display: block;
    left: auto;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: visible;
    padding: 12px 8px 0;
    background: #540404;
  }

  .frameWrap {
    position: relative;
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    height: 700px;                        /* пересчитывается скриптом */
    overflow: hidden;
    border-radius: 12px;
    background: #400303;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .55);
  }

  .frameWrap.is-zoom {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .frameWrap.is-zoom::-webkit-scrollbar { height: 8px; }
  .frameWrap.is-zoom::-webkit-scrollbar-track { background: #2f1503; }
  .frameWrap.is-zoom::-webkit-scrollbar-thumb { background: #b55a28; border-radius: 4px; }

  #shellFrame {
    display: block;
    max-width: none;
    border: 0;
    background: #540404;
    -webkit-transform-origin: top left;
    transform-origin: top left;
  }

  /* подписи под фреймом: были position:absolute (inline) — гасим !important */
  .col2 .stroka {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    display: block;
    padding: 6px 6px 0;
    text-align: center;
    line-height: 1.8;
  }

  /* ---------------- Блок «О сайте» ---------------- */
  .about {
    width: auto;
    max-width: 850px;
    margin: 0 auto;
    padding: 34px 16px 70px;
    font-size: 17px;
    line-height: 1.75;
    text-align: left;
  }
  .about h1 { font-size: clamp(21px, 6.4vw, 34px); line-height: 1.2; }
  .about h2 { font-size: clamp(18px, 5.2vw, 24px); line-height: 1.3; }
  .about__lead { font-size: 18px; }
  .about__quote { margin: 26px 0; padding: 16px; }
  .about__up { text-align: center; }
  .about__up a {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid rgba(206, 188, 114, .55);
    border-radius: 999px;
  }
}

/* =========================  ТЕЛЕФОНЫ: КРУПНЕЕ  =========================== */
@media (max-width: 620px) {
  .zoomBtn {
    display: block;
    width: -webkit-max-content;
    width: max-content;
    max-width: 100%;
    margin: 4px auto 10px;
    padding: 7px 16px;
    cursor: pointer;
    font: 13px/1 Arial, Helvetica, sans-serif;
    letter-spacing: .06em;
    color: #f0e9cb;
    background: #4a2207;
    border: 1px solid #cebc72;
    border-radius: 999px;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
  }
  .zoomBtn:hover { background: #5a2a0a; color: #fff; }

  .topbar__txt b { font-size: 16px; }
  .topbar__txt small { font-size: 9px; letter-spacing: .12em; }
}

/* =========================  МЕНЬШЕ ДВИЖЕНИЯ  ============================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mm.open { -webkit-animation: none; animation: none; }
  .burger span { transition: none; }
}
