:root {
    --bg-page: #f5e0bc;
    --bg-inner: #f7e9cf;
    --head: #980f19;
    --gold: #c79b55;
    --text: #5a3822;
    --frame-size: 25px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #fff5e8;
    font-family: "Old Standard TT", serif;
    font-size: 17px;
    color: var(--text);
    display: flex;
    justify-content: center;
    padding: 30px 10px;
}

html {
    scroll-behavior: smooth;
}

.frame {
    position: relative;
    max-width: 1100px;
    width: 100%;
    background: var(--head);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
    padding: var(--frame-size);
    /* Место для рамки */
}

/* ОБЩИЕ стили */
.frame-border {
    position: absolute;
    background-size: auto var(--frame-size);
    /* высота твоей полоски */
    pointer-events: none;
}

/* --- верхняя рамка --- */
.frame-top {
    top: 0;
    left: 0;
    right: 0;
    height: var(--frame-size);
    background-image: url("../img/poloska_36.png");
    background-repeat: repeat-x;
}

/* --- нижняя рамка --- */
.frame-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--frame-size);
    background-image: url("../img/poloska_36.png");
    background-repeat: repeat-x;
}

/* --- боковые рамки --- */
/* Нужен тот же узор, повернутый на 90° */
.frame-left,
.frame-right {
    width: var(--frame-size);
    top: var(--frame-size);
    bottom: var(--frame-size);
    background-image: url("../img/poloska_36_v.png");
    /* поверни png и сохрани как poloska_36_v.png */
    background-repeat: repeat-y;
    background-size: var(--frame-size) auto;
}

.frame-left {
    left: 0;
}

.frame-right {
    right: 0;
}


.inner {
    border: 2px solid #e2c796;
    padding: 0 0 30px;
    background: var(--bg-inner);
}

main {
    padding: 26px 30px 0;
}

/* HEADER */
.header-band {
    background: var(--head);
    color: #f8e9d2;
    padding: 30px 30px 20px;
    border-top: 3px solid #b98c4d;
    border-bottom: 3px solid #b98c4d;
    text-align: center;
    position: relative;
    overflow: hidden;
    --ornament-shift-y: 0px;
    --ornament-width: clamp(140px, 22vw, 220px);
}

.header-band::before,
.header-band::after {
    content: "";
    position: absolute;
    top: calc(50% + var(--ornament-shift-y));
    display: block;
    width: var(--ornament-width);
    aspect-ratio: 203 / 129;
    transform: translateY(-70%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    opacity: 0.5;
    z-index: 0;
}

.header-band::before {
    left: 2px;
    background-image: url("../img/pattern_header.png");
    transform: translateY(-70%) scaleX(-1);
    transform-origin: center;
}

.header-band::after {
    right: 2px;
    background-image: url("../img/pattern_header.png");
}

.header-title {
    font-family: "Miroslav", "Playfair Display", serif;
    font-size: 34px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.header-sub {
    margin-top: 10px;
    letter-spacing: 0.22em;
    display: flex;
    justify-content: center;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.header-sub span {
    white-space: nowrap;
}

.icon-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px auto 30px;
    gap: 18px;
}

.icon-line {
    flex: 1;
    border-top: 1px solid #cda86c;
    max-width: 160px;
}

.icon-square {
    width: 250px;
    height: 288px;
    border: 5px solid var(--gold);
    /* border-radius: 50%; */
    margin: 20px 50px 0px;
    /* Путь к изображению относительно css файла: ../img/irina.jpeg */
    background: #f5e0bc url("../img/irina.jpeg") center/cover no-repeat;
    box-shadow:
        0 0 10px 10px rgba(255, 250, 200, 0.9),
        0 0 20px 5px rgba(255, 215, 0, 0.6),
        0 0 80px 40px rgba(255, 180, 0, 0.3);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.icon-square:hover {
    box-shadow: 0 0 13px 12px rgba(255, 250, 200, 0.95), 0 0 25px 10px rgba(255, 215, 0, 0.7), 0 0 90px 65px rgba(255, 180, 0, 0.6);
}

.header-btn {
    display: inline-block;
    padding: 14px 20px;
    border: 1px solid #5b151c;
    background: #7a1620;
    color: #fbead4;
    font-family: "Miroslav", "Playfair Display", serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    /* border-radius: 999px; */
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

#letter-btn,
#letter-btn:visited {
    color: #fbead4;
    /* Или ваш цвет #d1b37f, но fbead4 светлее и лучше читается на темном */
}

.header-btn:hover {
    background: #8c1b25;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
    color: #fbead4;
    text-decoration: none;
}

.header-btn--outline {
    background: transparent;
    color: var(--head);
    border-color: var(--head);
    box-shadow: none;
}

.header-btn--outline:hover {
    background: rgba(152, 15, 25, 0.08);
    color: var(--head);
    text-decoration: none;
}


/* INTRO BLOCK */
.intro-block {
    text-align: center;
    padding: 32px 30px 28px;
    margin: 0 30px;
    /* border-top: 1px solid #c79b55; */
    border-bottom: 1px solid #c79b55;
}

.intro-title {
    font-family: "Miroslav", "Playfair Display", serif;
    font-size: 26px;
    letter-spacing: 0.15em;
    color: var(--head);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.intro-text {
    font-size: 20px;
    line-height: 1.7;
    color: var(--head);
    max-width: 900px;
    margin: 0 auto;
}

/* FLICKITY GALLERY */
.slider-section {
    padding: 40px 30px;
    margin: 0 30px;
}

.flickity-gallery {
    max-width: 1100px;
    margin: 0 auto;
    background: transparent;
    position: relative;
    overflow: hidden;
    padding: 30px 0 60px;
}

.flickity-gallery .flickity-viewport {
    overflow: visible;
}

.flickity-gallery .gallery-cell {
    width: 500px;
    max-width: 82vw;
    height: 315px;
    margin-right: -20px;
    margin-top: 18px;
    position: relative;
    overflow: hidden;
    /* border-radius: 24px; */
    background: #fff;
    z-index: 1;
    opacity: 0.45;
    transform: scale(0.95);
    transition:
        transform 0.35s ease,
        opacity 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 4px solid transparent;
}

.flickity-gallery .gallery-cell.is-selected {
    z-index: 2;
    opacity: 1;
    height: 350px;
    margin-top: 0;
    transform: scale(1);
    box-shadow: 0 0 25px rgb(255, 245, 150);
    border-color: #c79b55;
}

.flickity-gallery .gallery-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.flickity-gallery .flickity-prev-next-button {
    background: rgba(122, 22, 32, 0.9);
    border: 2px solid #c79b55;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.flickity-gallery .flickity-prev-next-button:hover {
    background: rgba(140, 27, 37, 0.95);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.4);
}

.flickity-gallery .flickity-prev-next-button:active {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.flickity-gallery .flickity-prev-next-button .arrow {
    fill: #fbead4;
}

.flickity-gallery .flickity-page-dots {
    bottom: 18px;
}

.flickity-gallery .flickity-page-dots .dot {
    width: 12px;
    height: 12px;
    opacity: 1;
    background: #d1b37f;
    border: 2px solid #c79b55;
    margin: 0 6px;
}

.flickity-gallery .flickity-page-dots .dot.is-selected {
    background: var(--head);
    border-color: var(--head);
    width: 14px;
    height: 14px;
}

@media (max-width: 900px) {
    .slider-section {
        padding: 30px 18px 30px;
        margin: 0 18px;
    }

    .flickity-gallery .gallery-cell {
        height: 252px;
        margin-top: 14px;
        transform: scale(0.88);
    }

    .flickity-gallery .gallery-cell.is-selected {
        height: 280px;
        margin-top: 0;
        transform: scale(1);
    }

    .flickity-gallery .flickity-prev-next-button {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 600px) {
    .flickity-gallery .gallery-cell {
        height: 198px;
        margin-top: 11px;
        transform: scale(0.92);
    }

    .flickity-gallery .gallery-cell.is-selected {
        height: 220px;
        margin-top: 0;
        transform: scale(1);
    }

    .flickity-gallery .flickity-prev-next-button {
        width: 40px;
        height: 40px;
    }
}

/* MAIN GRID */
.grid-main {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.card {
    background: #f7e3c4;
    padding: 24px 22px 26px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.12);
    border: 1px solid #d3b180;
}

.card-title {
    font-family: "Miroslav", "Playfair Display", serif;
    font-size: 20px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 14px;
    text-align: center;
}

.card-text {
    line-height: 1.4;
    text-align: justify;
}

.gallery-block {
    background: #e9d7b6;
    padding: 14px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.18);
    border: 1px solid #d3b180;
    text-align: center;
}


.gallery-frame {
    border: 14px solid #d1b37f;
    padding: 8px;
    background: #f3e1c0;
}

.card-text .gallery-frame {
    float: left;
    margin: 0 20px 10px 0;
    width: 100%;
    /* max-width: 300px; */
}

.gallery-img {
    display: block;
    width: 100%;
    /* занимает всю ширину рамки */
    height: auto;
    /* сохраняет реальные пропорции */
    border: 2px solid #d9c5a1;
    background: #b39a7b;
    /* можно убрать, если не нужен фон вокруг картинки */
}

/* по желанию */
.gallery-caption {
    margin-top: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* SCHEDULE */
.schedule-section {
    margin-bottom: 40px;
    padding: 22px 22px 30px;
    background: linear-gradient(135deg, #fff1da 0%, #fff6e5 45%, #f7ebd5 100%);
    border: 1px solid #d3b180;
    box-shadow: 0 10px 28px rgba(50, 70, 100, 0.14);
}

.schedule-anchor {
    display: block;
    height: 0;
    line-height: 0;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.schedule-title {
    font-family: "Miroslav", "Playfair Display", serif;
    font-size: 20px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.schedule-subtitle {
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #88725f;
}

.schedule-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-share {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.schedule-share .header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.schedule-share .share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.schedule-head {
    display: grid;
    grid-template-columns: 90px 90px auto 1fr;
    gap: 12px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
}

.schedule-section--no-holidays .schedule-head {
    grid-template-columns: 90px 90px auto;
}

.schedule-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(56, 69, 92, 0.2);
}

.schedule-row:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.schedule-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.schedule-date-box {
    width: auto;
    text-align: center;
    font-family: "Miroslav", "Playfair Display", serif;
    padding: 14px 10px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #980f196b;
}

.schedule-date-main {
    display: block;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
    white-space: nowrap;
}

.schedule-weekday {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    background: #d9b584;
}

.schedule-weekday--5,
.schedule-weekday--6 {
    background: #b23c2f;
    color: #fff;
}


.schedule-entries {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-entry {
    display: grid;
    grid-template-columns: 90px auto 1fr;
    grid-template-areas: "time service holiday";
    gap: 12px;
    align-items: start;
}

.schedule-section--no-holidays .schedule-entry {
    grid-template-columns: 90px auto;
    grid-template-areas: "time service";
}

.schedule-time {
    grid-area: time;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
    color: var(--head);
    align-self: start;
    margin-left: 10px;
}

.schedule-time-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.schedule-time-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.schedule-time-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin-bottom: 3px;
}

.schedule-event {
    grid-area: service;
    font-weight: 600;
    line-height: 1.4;
    margin-left: 10px;
    font-size: 18px;
}

.schedule-holiday {
    grid-area: holiday;
    line-height: 1.4;
}

/* BOTTOM GRID */
.grid-bottom {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.bottom-title {
    font-family: "Miroslav", "Playfair Display", serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.bottom-text {
    line-height: 1.6;
}

.contact-line {
    margin-bottom: 6px;
}

/* Базовые стили для ссылок */
a {
    color: var(--head);
    text-decoration: none;

}

a:visited {
    color: #6b1515;
}

a:hover {
    color: #c79b55;
    text-decoration: underline;
}

a:active {
    opacity: 0.7;
}

/* Стиль для Telegram ссылки */
.telegram-link {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}



.map-section {
    text-align: center;
    padding: 6px 6px 0px 6px;
    border: 1px solid #d3b180;
    background-color: #fff;
}

/* Контейнер для карты и загрузчика */
.map-loader-container {
    position: relative;
    min-height: 250px;
}

/* Скелетон-загрузчик */
.map-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            #e9d7b6 0%,
            #f5e8d0 20%,
            #e9d7b6 40%,
            #e9d7b6 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Анимация скелетона */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Скрыть скелетон когда карта загружена */
.map-skeleton.loaded {
    opacity: 0;
}

.don-cross {
    font-size: 28px;
    margin-bottom: 10px;
}

.btn {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 24px;
    border: 1px solid #5b151c;
    background: #7a1620;
    color: #fbead4;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-decoration: none;
}

.news li {
    margin-bottom: 6px;
}

.footer {
    margin-top: 26px;
    border-top: 1px solid #d4b585;
    padding-top: 8px;
    font-size: 13px;
    text-align: center;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.7;
}

@media (max-width: 900px) {
    .inner {
        padding: 0 0 22px;
    }

    main {
        padding: 20px 18px 0;
    }

    .icon-line {
        display: none;
    }

    .icon-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        grid-template-areas:
            "icon icon"
            "btn1 btn2";
        gap: 12px 16px;
        justify-items: center;
    }

    .icon-square {
        grid-area: icon;
        width: 230px;
        height: 265px;
        max-width: 70vw;
        margin-bottom: 30px;
        flex: none;
    }

    .header-btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }

    .header-btn:first-of-type {
        grid-area: btn1;
    }

    .header-btn--outline {
        grid-area: btn2;
    }

    .grid-main {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .grid-bottom {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .schedule-section {
        padding: 18px 18px 20px;
    }

    .schedule-head {
        grid-template-columns: 80px 80px auto 1fr;
    }

    .schedule-row {
        grid-template-columns: 80px 1fr;
    }

    .schedule-entry {
        grid-template-columns: 80px auto 1fr;
    }

    .schedule-section--no-holidays .schedule-head {
        grid-template-columns: 80px 80px auto;
    }

    .schedule-section--no-holidays .schedule-entry {
        grid-template-columns: 80px auto;
    }

    .header-title {
        font-size: 26px;
        letter-spacing: 0.18em;
    }

    .intro-block {
        padding: 24px 18px 20px;
        margin: 0 18px;
    }

    .intro-title {
        font-size: 20px;
    }

    .intro-text {
        font-size: 16px;
    }
}


@media (max-width: 700px) {
    .schedule-head {
        display: none;
    }

    .schedule-date {
        flex-direction: row;
        justify-content: flex-start;
    }

}

@media (max-width: 640px) {
    .icon-bar {
        grid-template-columns: 1fr;
        grid-template-areas:
            "icon"
            "btn1"
            "btn2";
        gap: 16px;
    }
    .icon-square {
        margin: 25px 0 35px;
    }
    .header-btn {
        width: 90%;
        max-width: 100%;
        margin: 0;
    }

    .schedule-head {
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .schedule-date-main {
        font-size: 16px;
    }



    .header-band {
        --ornament-width: clamp(91px, 14.3vw, 143px);
    }

}

@media (max-width: 700px) {
    .schedule-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .schedule-date {
        align-items: center;
        justify-self: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .header-title {
        font-size: 23px
    }

    .icon-square {
        margin: 25px 0 35px;
    }

    .frame {
        padding: 2px;
    }

    .frame-top,
    .frame-bottom,
    .frame-left,
    .frame-right {
        display: none;
    }

    .slider-section {
        padding: 20px 22px 20px;
    }

    .flickity-gallery .flickity-prev-next-button {
        width: 30px;
        height: 30px;
    }

    .flickity-prev-next-button {
        top: 46%;
    }

    .intro-text, .card-text {
        line-height: 1.3;
    }

    .schedule-head {
        display: none;
    }

    .schedule-entry {
        grid-template-columns: 70px 1fr;
        grid-template-areas:
            "time service"
            "time holiday";
    }

    .schedule-holiday {
        padding-left: 10px;
    } 

    .schedule-section--no-holidays .schedule-entry {
        grid-template-areas: "time service";
    }

}

@font-face {
    font-family: "Miroslav";
    src: url("../fonts/Miroslav.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}


@media (max-width: 960px) {
    .header-band {
        --ornament-width: clamp(105px, 16.5vw, 165px);
    }
}

@media (max-width: 600px) {
    .header-band::before,
    .header-band::after {
        display: none;
    }
}

@media (max-width: 512px) {
    .icon-bar {
        grid-template-columns: 1fr;
        grid-template-areas:
            "icon"
            "btn1"
            "btn2";
        gap: 10px;
    }

    .icon-square {
        max-width: 82vw;
        margin: 0 auto;
    }

    .header-btn {
        width: 100%;
        max-width: 240px;
    }
}
