/* ============================================================
   custom.css — общие кастомные стили сайта annagorbenko.art
   Подключается после {% tailwind_css %} в base.html
   ============================================================ */

/* ---------- Видео на главной: постер + плавное проявление ---------- */
.main-video-container video {
    opacity: 0;
    transition: opacity 0.6s ease;
}
.main-video-container video.loaded.video-fade-in {
    opacity: 1;
}

/* ---------- Шрифты ---------- */
@font-face {
    font-family: 'Jost';
    src: url("../fonts/Jost-VariableFont_wght.0f3fd08fb7d8.ttf") format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Jost';
    src: url("../fonts/Jost-Italic-VariableFont_wght.4f0675559bf7.ttf") format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant';
    src: url("../fonts/Cormorant-VariableFont_wght.f0ec5e293ff5.ttf") format('truetype');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant';
    src: url("../fonts/Cormorant-Italic-VariableFont_wght.04e9e322250d.ttf") format('truetype');
    font-weight: 300 700;
    font-style: italic;
    font-display: swap;
}

/* ---------- Header / навигация ---------- */
.header-nav-link {
    font-family: 'Jost', sans-serif;
    font-size: 1.125rem;
    color: #161616;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}
.header-nav-link:hover {
    transform: scale(1.1);
    color: #666;
}
.header-nav-link:active {
    font-weight: 700;
}
.header-lang-link {
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
}
.header-lang-link:hover {
    color: #161616;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.header-lang-current {
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #161616;
    border-bottom: 2px solid #161616;
    padding-bottom: 0.125rem;
    cursor: default;
}

/* ---------- Footer ---------- */
.footer-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}
.footer-link:hover {
    color: #d1d5db;
}
.footer-icon-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}
.footer-icon-link:hover {
    color: #d1d5db;
}

/* ---------- Общие ссылки / кнопки ---------- */
.link-blue {
    color: #2563eb;
}
.link-blue:hover {
    text-decoration: underline;
}
.btn-primary {
    display: inline-block;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}
.btn-primary:hover {
    background: #1f2937;
}
.btn-secondary {
    display: inline-block;
    background: #fff;
    color: #111;
    border: 2px solid #000;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}
.btn-secondary:hover {
    background: #f9fafb;
}
.download-btn {
    display: inline-block;
    background: #000;
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem 2rem;
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
}
.download-btn:hover {
    background: #1f2937;
}
.footer-download-btn {
    display: inline-block;
    background: #fff;
    color: #000;
    border-radius: 0.375rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.3s;
}
.footer-download-btn:hover {
    background: #f3f4f6;
}
.card-btn {
    display: inline-block;
    width: 100%;
    background: #000;
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.5rem 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s;
}
.card-btn:hover {
    background: #1f2937;
}
.send-request-btn {
    width: 100%;
    padding: 1rem;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Jost', Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    transition: background-color 0.3s;
    margin-top: 1rem;
}
.send-request-btn:hover {
    background: #333;
}
.form-input,
.form-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #000;
    border-radius: 4px;
    font-family: 'Jost', Helvetica, sans-serif;
    font-size: 1rem;
    background: #fff;
    color: #000;
}
.form-textarea {
    min-height: 120px;
    resize: vertical;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs {
    font-size: 0.85rem;
    padding: 0.5rem 0;
}
.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
}
.breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}

/* ---------- Модалки ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.is-open {
    display: flex;
}
.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.modal-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.request-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.request-modal .modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid #000;
}

/* ---------- Каталог / series: ленивые картинки + fallback-заглушка ---------- */
/* Слои по z-index:
   1) .painting-card-placeholder — красивый fallback (если нет/битая картинка)
   2) .image-placeholder        — shimmer во время загрузки
   3) .painting-image           — сама картинка, когда загружена            */

.image-placeholder {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    transition: opacity 0.3s ease;
}
.image-placeholder.is-hidden {
    opacity: 0;
    animation: none;
    pointer-events: none;
}

.painting-image {
    opacity: 0;
    position: relative;
    z-index: 3;
}
.painting-image.loaded {
    opacity: 1;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Базовый блок: паспарту-заглушка */
.painting-card-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 1rem;
    text-align: center;
    background: linear-gradient(135deg, #fafaf9 0%, #f5f5f4 45%, #e7e5e4 100%);
    color: #44403c;
    overflow: hidden;
}
/* Когда .hidden (Tailwind) — гарантированно прячем, невзирая на z-index */
.painting-card-placeholder.hidden {
    display: none;
}

.painting-card-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(120, 113, 108, 0.08) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.6;
    pointer-events: none;
}

.painting-card-placeholder-frame {
    position: absolute;
    inset: 0.5rem;
    border: 1px solid rgba(168, 162, 158, 0.35);
    pointer-events: none;
    transition: border-color 0.3s ease;
}

.painting-card-placeholder-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: #a8a29e;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.painting-card-placeholder-title {
    position: relative;
    z-index: 1;
    font-size: 1.125rem;
    line-height: 1.3;
    color: #292524;
    max-width: 90%;
    overflow-wrap: anywhere;
}

.painting-card-placeholder-meta {
    position: relative;
    z-index: 1;
    font-size: 0.6875rem;
    color: #78716c;
    margin-top: 0.375rem;
    letter-spacing: 0.05em;
}

.painting-card-placeholder-caption {
    position: relative;
    z-index: 1;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #a8a29e;
    margin-top: 1rem;
}

.group:hover .painting-card-placeholder-frame {
    border-color: rgba(120, 113, 108, 0.5);
}
.group:hover .painting-card-placeholder-icon {
    color: #78716c;
    transform: scale(1.05);
}

@media (min-width: 640px) {
    .painting-card-placeholder        { padding: 1.5rem; }
    .painting-card-placeholder-frame  { inset: 0.75rem; }
    .painting-card-placeholder-title  { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .image-placeholder     { animation: none; }
    .painting-image.loaded { animation: none; }
}

/* ---------- Политика конфиденциальности ---------- */
.policy-section {
    scroll-margin-top: 1rem;
}
.policy-h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    font-family: 'Cormorant', serif;
}
.policy-link {
    color: #2563eb;
    font-size: 0.875rem;
}
.policy-link:hover {
    color: #1e40af;
    text-decoration: underline;
}
.policy-table {
    border-collapse: collapse;
    width: 100%;
}
.policy-table th,
.policy-table td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
}
.policy-list {
    padding-left: 1.25rem;
}
.policy-list li {
    margin-bottom: 0.25rem;
}
.policy-list li:last-child {
    margin-bottom: 0;
}

/* ---------- About: video-модалка ---------- */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.video-modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: #000;
    padding: 0;
    border: none;
}
.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}
.video-preview-container {
    position: relative;
    cursor: pointer;
}
.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}
.play-button-overlay:hover {
    background: rgba(0, 0, 0, 0.9);
}
.play-button-overlay::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 20px solid #fff;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 5px;
}
.content-with-gaps br {
    display: block !important;
    margin: 12px 0 !important;
    line-height: 2 !important;
    content: "" !important;
}

/* ---------- Event detail ---------- */
.bg-ivory {
    background-color: #faf0e6;
}
.play-btn {
    font-size: 4rem;
    line-height: 1;
    transition: background 0.2s;
}
.play-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}
.play-btn:focus {
    outline: none;
}
#imageModal {
    backdrop-filter: blur(4px);
    overflow: hidden;
}
.modal-image-wrapper {
    position: absolute;
    inset: 0;
    overflow: auto;
    display: flex;
    padding: 1rem;
}
.modal-image-wrapper img {
    margin: auto;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    display: block;
    flex-shrink: 0;
}
.modal-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}
.modal-controls button,
.modal-controls a {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    text-decoration: none;
}
.modal-controls button:hover,
.modal-controls a:hover {
    background: rgba(0, 0, 0, 0.8);
}
.modal-controls svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}
.media-card img {
    cursor: zoom-in;
}
.event-media-item {
    margin-bottom: 0.5rem;
}
.event-media-item.no-text {
    margin-bottom: 0.75rem;
}
.event-media-item .caption {
    margin-top: 2px;
}
.event-block-text {
    text-indent: 1.5em;
}
.event-description {
    width: 100%;
    max-width: 800px;
}
.caption {
    font-family: 'Jost', sans-serif;
    font-style: italic;
    color: #6b7280;
    text-align: center;
    font-size: 1rem;
    line-height: 1.625;
}
.block-text {
    font-family: 'Jost', sans-serif;
    color: #374151;
    font-size: 1rem;
    line-height: 1.625;
    text-indent: 1.5em;
}

/* ---------- Events list ---------- */
.event-row-link {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    transition: box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}
.event-row-link:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.14);
}

/* ---------- Series list: превью первой картины (справа, 60×60) ---------- */
.series-preview {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    background-color: #f5f5f5;
}

/* ---------- Feedback / отзывы ---------- */
.video-playing video {
    object-fit: contain !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100%;
}
.video-playing .video-play-button {
    opacity: 0;
    pointer-events: none;
}
.card-preview:hover .video-playing .video-play-button {
    opacity: 0.7;
    pointer-events: auto;
}
.card-preview:hover .video-playing .video-play-button:hover {
    opacity: 1;
}
.card-preview img,
.card-preview video {
    height: auto;
    max-height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.media-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f8f8f8;
    position: relative;
}
.navigation-arrows {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 40;
}
.card-preview:hover .navigation-arrows {
    opacity: 1;
}
.arrow {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 0 10px;
    transition: background 0.3s ease;
    pointer-events: auto;
    z-index: 50;
}
.arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}
.single-column .media-container img,
.single-column .media-container video {
    width: 100%;
    height: auto;
}
.multi-column .media-container {
    height: 300px;
}
.multi-column .media-container img,
.multi-column .media-container video {
    max-height: 100%;
    width: auto;
}
.aspect-ratio-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}
video {
    -webkit-playsinline: true;
    playsinline: true;
}
.rectangular_card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
}
.reviews-grid {
    align-items: start;
}
.media-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* ---------- Main: две колонки и видео ---------- */
.main-container-title {
    line-height: 0.95;
}
.main-title-part-1 {
    font-size: clamp(2rem, 4vw + 1rem, 4.5rem);
    right: clamp(0rem, 5vw - 1rem, 16.5rem);
}
.main-title-part-2 {
    font-size: clamp(1.5rem, 3vw + 0.75rem, 3.5rem);
    left: clamp(0rem, 5vw - 1rem, 16.5rem);
}
.main-extra-title {
    font-size: clamp(1.5rem, 3vw + 0.75rem, 3.5rem);
}
.main-horizontal-line {
    height: 1px;
    background: #e5e7eb;
    width: 100%;
}
.container_two_panes {
    display: flex;
    flex-direction: column;
    padding-left: 10px;
    padding-right: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}
.container_two_panes .view-1,
.container_two_panes .view-2 {
    width: 100%;
    margin-bottom: 1rem;
}
.main-frame-1,
.main-frame-3 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.main-frame-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ---------- Главная: две панели (превью серии / рандомная картина) ---------- */
.main-left-pane-link {
    display: block;
    text-decoration: none;
}
.main-left-frame {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}
.main-left-frame-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    object-fit: cover;
}
.main-left-placeholder {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-family: 'Cormorant', serif;
    font-size: 1.4rem;
}
.main-left-caption {
    margin-top: 0.5rem;
}
.main-random-pane {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.main-random-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
.main-random-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-family: 'Cormorant', serif;
    font-size: 1.4rem;
}
.main-random-caption {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-family: 'Jost', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #161616;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}
.main-random-caption-icon {
    width: 1rem;
    height: 1rem;
}
.main-random-pane:hover .main-random-caption-text {
    color: #2563eb;
}
.main-video-container {
    background: #f9fafb;
    width: 100%;
}
.video-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 10px;
    padding-right: 10px;
    width: 100%;
}
.video-item {
    display: none;
    width: 100%;
}
.video-item-1 {
    display: flex;
}
.video {
    width: 100%;
    aspect-ratio: 720 / 1280;
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-clip-path: inset(5% 0 5% 0);
    clip-path: inset(5% 0 5% 0);
}
.video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.main-pane-gap {
    display: none !important;
}
.container_text_block {
    padding-left: 10px;
    padding-right: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 30rem) and (max-width: 79.9375rem) {
    .container_text_block {
        padding-left: 10px;
        padding-right: 10px;
    }
}
@media (min-width: 80rem) {
    .container_text_block {
        padding-left: max(10px, calc((100% - (1200px + 20px)) / 2));
        padding-right: max(10px, calc((100% - (1200px + 20px)) / 2));
    }
}
@media (min-width: 30rem) and (max-width: 59.9375rem) {
    .container_two_panes {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding-left: 10px;
        padding-right: 10px;
    }
    .container_two_panes .view-1,
    .container_two_panes .view-2 {
        width: auto;
        margin-bottom: 0;
    }
    .video-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding-left: 10px;
        padding-right: 10px;
    }
    .video-item-1,
    .video-item-2 {
        display: flex;
    }
    .video-item-3 {
        display: none;
    }
}
@media (min-width: 60rem) and (max-width: 79.9375rem) {
    .container_two_panes {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding-left: 10px;
        padding-right: 10px;
    }
    .container_two_panes .view-1,
    .container_two_panes .view-2 {
        width: auto;
        margin-bottom: 0;
    }
    .video-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        padding-left: 10px;
        padding-right: 10px;
    }
    .video-item-1,
    .video-item-2,
    .video-item-3 {
        display: flex;
    }
}
@media (min-width: 80rem) {
    .container_two_panes {
        display: grid;
        grid-template-columns: 600px 600px;
        gap: 20px;
        justify-content: center;
        padding-left: max(10px, calc((100% - (1200px + 20px)) / 2));
        padding-right: max(10px, calc((100% - (1200px + 20px)) / 2));
    }
    .container_two_panes .view-1,
    .container_two_panes .view-2 {
        width: auto;
        margin-bottom: 0;
    }
    .video-grid {
        display: grid;
        grid-template-columns: repeat(3, 400px);
        gap: 0;
        justify-content: center;
        padding-left: calc((100% - 1200px) / 2);
        padding-right: calc((100% - 1200px) / 2);
    }
    .video-item-1,
    .video-item-2,
    .video-item-3 {
        display: flex;
    }
}

/* ---------- Painting detail ---------- */
.pd-page {
    margin: 0;
    font-family: 'Jost', Helvetica, sans-serif;
    background: #fff;
    color: #000;
    line-height: 1.6;
}
.close-btn-container {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding: 1rem;
    position: relative;
    z-index: 30;
    background: #fff;
}
.close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    border: 0.5px solid #000;
}
.close-btn:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}
.close-btn svg {
    width: 45%;
    height: 45%;
}
.pd-page_container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    min-height: 100vh;
}
.pd-main-content {
    width: 100%;
    max-width: 1200px;
}
.pd-content-row {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    align-items: center;
}
.pd-image-container,
.pd-text-container {
    width: 100%;
}
.pd-image-preview-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.pd-main-image-container {
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    height: 50vh;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: crosshair;
    -webkit-tap-highlight-color: transparent;
}
.pd-main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.pd-zoom-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: none;
    touch-action: none;
}
.pd-zoomed-image {
    position: absolute;
    object-fit: contain;
    will-change: transform;
    max-width: none;
    max-height: none;
}

/* ---- Красивая заглушка главного изображения (нет/битая картинка) ---- */
.pd-main-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #fafaf9 0%, #f5f5f4 45%, #e7e5e4 100%);
    color: #44403c;
    overflow: hidden;
    z-index: 1;
}
.pd-main-placeholder.hidden {
    display: none;
}
.pd-main-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(120, 113, 108, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.6;
    pointer-events: none;
}
.pd-main-placeholder-frame {
    position: absolute;
    inset: 1rem;
    border: 1px solid rgba(168, 162, 158, 0.35);
    pointer-events: none;
}
.pd-main-placeholder-icon {
    width: 4rem;
    height: 4rem;
    color: #a8a29e;
    position: relative;
    z-index: 1;
    margin-bottom: 0.5rem;
}
.pd-main-placeholder-title {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    line-height: 1.3;
    color: #292524;
    max-width: 80%;
    overflow-wrap: anywhere;
}
.pd-main-placeholder-meta {
    position: relative;
    z-index: 1;
    font-size: 0.875rem;
    color: #78716c;
    letter-spacing: 0.05em;
}
.pd-main-placeholder-caption {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #a8a29e;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    .pd-main-placeholder-icon  { width: 5rem; height: 5rem; }
    .pd-main-placeholder-title { font-size: 1.875rem; }
    .pd-main-placeholder-meta  { font-size: 1rem; }
}
@media (min-width: 1024px) {
    .pd-main-placeholder-icon  { width: 6rem; height: 6rem; }
    .pd-main-placeholder-title { font-size: 2.25rem; }
}

/* ---- Миниатюры превью ---- */
.pd-preview-thumbnails {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-left: 0.5rem;
}
.pd-preview-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
}
.pd-preview-thumb.active {
    border-color: #333;
}
.pd-preview-thumb--placeholder {
    object-fit: contain !important;
    background-color: #f5f5f4;
    padding: 4px;
}

/* ---- Основной текст картины ---- */
.pd-text-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.pd-painting-info-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.pd-painting-title {
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pd-painting-author {
    font-size: 0.9rem;
}
.pd-painting-series {
    font-size: 1rem;
    color: #555;
}
.pd-info-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
}
.pd-painting-description {
    font-size: 0.9rem;
    line-height: 1.6;
}
.pd-painting-price {
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 0.1rem;
}
.pd-delivery-info {
    width: 100%;
    max-width: 1280px;
    margin-top: 2rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 8px;
}
.pd-delivery-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.pd-delivery-item {
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    border-left: 2px solid #ddd;
}
.pd-delivery-note {
    margin-top: 1rem;
    font-style: italic;
    color: #666;
}
/* Стили для эталонных классов delivery-* (используются в HTML из админки delivery_html) */
.delivery-info {
    width: 100%;
    max-width: 1280px;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}
.delivery-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.delivery-item {
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    border-left: 2px solid #ddd;
}
.delivery-note {
    margin-top: 1rem;
    font-style: italic;
    color: #666;
}
/* Адаптивные отступы блока «Доставка картин» (по эталонной странице) */
@media (min-width: 961px) and (max-width: 1280px) {
    .pd-delivery-info, .delivery-info { padding: 1rem; }
}
@media (min-width: 1281px) {
    .pd-delivery-info, .delivery-info { padding: 1rem; }
}

/* ---- Слайдер внизу страницы ---- */
.pd-slider-container {
    width: 100%;
    height: 15vh;
    min-height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}
.pd-slider-track {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    width: 80%;
    height: 100%;
    padding: 0 1rem;
}
.pd-slider-preview {
    width: auto;
    height: 100px;
    object-fit: cover;
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
    border-radius: 4px;
    display: none;
}
.pd-slider-preview.active {
    display: block;
    border: 2px solid rgba(0, 0, 0, 0.3);
    cursor: default;
    opacity: 0.9;
}
.pd-slider-preview--placeholder {
    object-fit: contain !important;
    background-color: #f5f5f4;
    padding: 4px;
}
.pd-slider-arrow {
    background: #fff;
    border: 1px solid #000;
    border-radius: 50%;
    cursor: pointer;
    padding: 0.25rem;
    color: #000;
    transition: all 0.3s;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}
.pd-slider-arrow svg {
    width: 70%;
    height: 70%;
}
.pd-slider-arrow:hover:not(:disabled) {
    background: #f5f5f5;
    transform: scale(1.05);
}
.pd-slider-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* ---- Адаптивность слайдера ---- */
/* Мобильный (≤640px): только предыдущая и следующая, текущая скрыта */
@media (max-width: 39.9375rem) {
    .pd-slider-container { width: 100%; max-width: 100vw; height: 16vh; min-height: 110px; }
    .pd-slider-track { width: 100%; gap: 0.5rem; justify-content: center; }
    .pd-slider-preview { display: block; flex: 0 0 auto; height: 90px; max-width: 45vw; }
    .pd-slider-preview.pd-slider-preview--current { display: none !important; }
    .pd-slider-arrow { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
    .pd-slider-arrow svg { width: 60%; height: 60%; }
}
@media (min-width: 50.0625rem) and (max-width: 60rem) {
    .pd-slider-container { width: 100%; max-width: 100vw; overflow: hidden; }
    .pd-slider-track { width: 90%; gap: 0.5rem; }
    .pd-slider-preview { display: block; flex: 0 0 auto; height: 110px; }
    .pd-slider-preview:nth-child(1),
    .pd-slider-preview:nth-child(2),
    .pd-slider-preview:nth-child(3) { display: block; }
    .pd-slider-preview:nth-child(1),
    .pd-slider-preview:nth-child(3) { transform: scale(0.85); opacity: 0.75; }
    .pd-slider-preview:nth-child(2) { transform: scale(1); }
    .pd-slider-preview.active { opacity: 0.9; transform: scale(0.9) !important; }
    .pd-slider-arrow { width: 50px; height: 50px; }
}
@media (min-width: 60.0625rem) and (max-width: 80rem) {
    .pd-slider-track { width: 95%; gap: 0.3rem; }
    .pd-slider-preview { display: block; flex: 0 0 auto; height: 120px; }
    .pd-slider-preview:nth-child(1),
    .pd-slider-preview:nth-child(2),
    .pd-slider-preview:nth-child(3),
    .pd-slider-preview:nth-child(4),
    .pd-slider-preview:nth-child(5) { display: block; }
    .pd-slider-preview:nth-child(1),
    .pd-slider-preview:nth-child(5) { transform: scale(0.70); opacity: 0.5; }
    .pd-slider-preview:nth-child(2),
    .pd-slider-preview:nth-child(4) { transform: scale(0.85); opacity: 0.75; }
    .pd-slider-preview:nth-child(3) { transform: scale(1); }
    .pd-slider-preview.active { opacity: 0.9; transform: scale(0.9) !important; }
    .pd-slider-arrow { width: 65px; height: 65px; }
}
@media (min-width: 80.0625rem) {
    .pd-slider-track { width: 90%; gap: 0.5rem; }
    .pd-slider-preview { display: block; flex: 0 0 auto; height: 130px; }
    .pd-slider-preview:nth-child(1),
    .pd-slider-preview:nth-child(2),
    .pd-slider-preview:nth-child(3),
    .pd-slider-preview:nth-child(4),
    .pd-slider-preview:nth-child(5) { display: block; }
    .pd-slider-preview:nth-child(1),
    .pd-slider-preview:nth-child(5) { transform: scale(0.70); opacity: 0.5; }
    .pd-slider-preview:nth-child(2),
    .pd-slider-preview:nth-child(4) { transform: scale(0.85); opacity: 0.75; }
    .pd-slider-preview:nth-child(3) { transform: scale(1); }
    .pd-slider-preview.active { opacity: 0.9; transform: scale(0.9) !important; }
    .pd-slider-arrow { width: 70px; height: 70px; }
}

/* ---- Адаптивность страницы картины ---- */
@media (max-width: 22.5rem) {
    .close-btn-container { padding: 0.8rem; }
    .close-btn { width: 40px; height: 40px; border-width: 2px; }
    .pd-page_container { padding: 0.8rem; }
    .pd-main-image-container { height: 40vh; min-height: 250px; }
    .pd-painting-title { font-size: 1.8rem; }
    .pd-preview-thumb { width: 50px; height: 50px; }
}
@media (min-width: 35.0625rem) and (max-width: 50rem) {
    .pd-page_container { padding: 2rem; }
    .pd-content-row { flex-direction: column; align-items: flex-start; }
    .pd-image-container { width: 100%; }
    .pd-text-container { width: 100%; padding-left: 2rem; }
    .pd-main-image-container { height: 60vh; }
    .pd-preview-thumb { width: 70px; height: 70px; }
    .pd-painting-title { font-size: 2rem; }
    .send-request-btn { width: 80%; font-size: 1.3rem; }
}
@media (min-width: 50.0625rem) and (max-width: 60rem) {
    .pd-page_container { padding: 2rem; }
    .pd-content-row { flex-direction: row; }
    .pd-image-container { width: 66%; }
    .pd-text-container { width: 33%; padding-left: 2rem; }
    .pd-main-image-container { height: 65vh; }
    .pd-painting-title { font-size: 1rem; }
    .pd-painting-price { font-size: 1rem; }
    .send-request-btn { width: 80%; padding: 1.0rem; font-size: 1.0rem; }
}
@media (min-width: 60.0625rem) and (max-width: 80rem) {
    .pd-page_container { padding: 2rem; }
    .pd-content-row { flex-direction: row; }
    .pd-image-container { width: 66%; }
    .pd-text-container { width: 33%; padding-left: 2.5rem; }
    .pd-main-image-container { height: 70vh; }
    .send-request-btn { width: 75%; padding: 1rem; font-size: 1rem; }
}
@media (min-width: 80.0625rem) {
    .pd-page_container { padding: 3rem; }
    .pd-content-row { flex-direction: row; align-items: flex-start; }
    .pd-image-container { width: 66%; }
    .pd-text-container { width: 33%; padding-left: 3rem; }
    .pd-main-image-container { height: 70vh; }
    .pd-preview-thumb { width: 85px; height: 85px; }
    .pd-painting-title { font-size: 1.5rem; }
    .send-request-btn { width: 70%; padding: 1.2rem; font-size: 1.0rem; }
}
/* ---------- Поля форм: «Контакты» и модалка запроса ----------
   Tailwind-preflight делает фон input прозрачным, а border-gray-300 (#d1d5db)
   на белой карточке на телефоне визуально теряется — поля выглядят «без рамок».
   Здесь рамка задаётся явно и темнее, а фокус/тап даёт подсветку по краям.
   Блок не в @layer, поэтому приоритетнее утилит Tailwind. */
.contact-field,
.request-field {
    width: 100%;
    border: 2px solid #9ca3af;          /* gray-400 — заметно на белом */
    background-color: #ffffff;
    border-radius: 0.5rem;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Поля модалки запроса: у них нет tailwind-утилит отступов */
.request-field {
    padding: 0.75rem 1rem;
}

.contact-field::placeholder,
.request-field::placeholder {
    color: #6b7280;
}

/* Наведение — только там, где есть курсор (на тач-экранах не «залипает») */
@media (hover: hover) and (pointer: fine) {
    .contact-field:hover,
    .request-field:hover {
        border-color: #6b7280;          /* gray-500 */
    }
}

/* Ошибка валидации — только после того, как поле тронули.
   Голый :invalid срабатывает сразу на пустых required-полях (а у полей
   модалки нет placeholder, поэтому :invalid:not(:placeholder-shown) красил
   их в красный ещё до ввода). :user-invalid — современный стандарт;
   на старых браузерах правило просто игнорируется. */
.contact-field:user-invalid,
.request-field:user-invalid {
    border-color: #dc2626;
}

/* Фокус и тап: подсветка по краям (объявлено после :user-invalid,
   чтобы при фокусе синяя рамка выигрывала у красной) */
.contact-field:focus,
.contact-field:focus-visible,
.contact-field:active,
.request-field:focus,
.request-field:focus-visible,
.request-field:active {
    border-color: #2563eb;              /* blue-600 */
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    outline: none;
}

/* Чекбокс согласия: тоже делаем рамку заметной */
.contact-consent,
.request-consent {
    border: 2px solid #9ca3af;
    background-color: #ffffff;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* У чекбокса модалки нет tailwind-утилит размера: без них он сжимается
   до нативного (~13px) и рамка выглядит точкой. */
.request-consent {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.contact-consent:checked,
.request-consent:checked {
    background-color: #161616;
    border-color: #161616;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.5 4.5l-6.5 7-4.5-4.5 1.4-1.4 3.1 3.1 5.1-5.6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 90%;
}

.contact-consent:focus,
.contact-consent:focus-visible,
.request-consent:focus,
.request-consent:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    outline: none;
}

.request-field-textarea {
    min-height: 120px;
    resize: vertical;
}
