/* Стиль «как в PDF» — пергамент, орнамент, типографика буклета */

:root {
    --rb-paper: #f5edd8;
    --rb-paper-deep: #e8dcc0;
    --rb-paper-shadow: rgba(12, 8, 4, 0.42);
    --rb-text: #2a1810;
    --rb-text-muted: #5c4a38;
    --rb-heading: #8b1a1a;
    --rb-accent: #6b4a0a;
    --rb-border: rgba(80, 55, 30, 0.24);
    --rb-border-strong: rgba(80, 55, 30, 0.48);
    --rb-callout-bg: #fffdf8;
    --rb-table-head: rgba(80, 55, 30, 0.09);
    --rb-font-serif: 'Literata', Georgia, 'Times New Roman', 'Liberation Serif', serif;
    --rb-font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
    --rb-font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Центрирование «листа» в колонке */
.guide-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: none;
    padding: 28px 28px 72px;
}

.guide-hero,
.guide-sheet {
    width: 100%;
    max-width: 780px;
}

/* Титульная полоса — как обложка PDF */
.guide-hero {
    margin-bottom: 24px;
    padding: 36px 32px 32px;
    text-align: center;
    color: var(--rb-text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, transparent 45%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.03) 0%, transparent 18%),
        var(--rb-paper);
    border: 3px double var(--rb-border-strong);
    border-radius: 3px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35) inset,
        0 10px 40px var(--rb-paper-shadow);
    position: relative;
    overflow: hidden;
}

.guide-hero::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid var(--rb-border);
    pointer-events: none;
    border-radius: 1px;
}

.guide-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, transparent, var(--rb-accent), transparent);
    opacity: 0.55;
}

.guide-hero-kicker {
    margin: 0 0 8px;
    font-family: var(--rb-font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rb-text-muted);
}

.guide-hero-title {
    margin: 0 0 10px;
    font-family: var(--rb-font-display);
    font-size: clamp(1.75rem, 4.5vw, 2.35rem);
    font-weight: 700;
    color: var(--rb-heading);
    line-height: 1.12;
    letter-spacing: 0.04em;
}

.guide-hero-sub {
    margin: 0;
    font-family: var(--rb-font-serif);
    font-size: 0.98rem;
    font-style: italic;
    color: var(--rb-text-muted);
}

.guide-hero-pdf {
    margin: 18px 0 0;
    font-family: var(--rb-font-sans);
    font-size: 0.88rem;
}

.guide-hero-pdf a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    color: var(--rb-heading);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--rb-border-strong);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.55);
    transition: background 0.15s, box-shadow 0.15s;
}

.guide-hero-pdf a:hover {
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

/* Лист правил — пергамент с рамкой */
.guide-sheet {
    position: relative;
    background-color: var(--rb-paper);
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E"),
        radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 248, 230, 0.9), transparent 70%),
        linear-gradient(175deg, var(--rb-paper) 0%, var(--rb-paper-deep) 100%);
    color: var(--rb-text);
    padding: 44px 48px 52px;
    border-radius: 3px;
    border: 4px double var(--rb-border-strong);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.28) inset,
        0 14px 52px var(--rb-paper-shadow);
    font-family: var(--rb-font-serif);
    font-size: 17px;
    line-height: 1.75;
}

.guide-sheet::before {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid var(--rb-border);
    pointer-events: none;
    border-radius: 1px;
}

.guide-sheet a {
    color: var(--rb-heading);
    font-weight: 500;
}

.guide-sheet .guide-section {
    margin-bottom: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--rb-border);
    scroll-margin-top: 80px;
}

.guide-sheet .guide-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.guide-sheet .guide-section h2 {
    text-align: center;
    font-family: var(--rb-font-display);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--rb-heading);
    border-bottom: none;
    padding-bottom: 0;
    margin: 0 0 20px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.guide-sheet .guide-section h2::before,
.guide-sheet .guide-section h2::after {
    content: '—';
    margin: 0 0.45em;
    font-weight: 400;
    opacity: 0.45;
    text-transform: none;
}

.guide-sheet .guide-section h2::after {
    content: '—';
}

.guide-sheet .guide-section h3 {
    font-family: var(--rb-font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--rb-heading);
    margin: 28px 0 12px;
    letter-spacing: 0.03em;
}

.guide-sheet .guide-lead {
    color: var(--rb-text-muted);
    font-style: italic;
    text-align: center;
    font-size: 1.05rem;
    max-width: 94%;
    margin: 0 auto 22px;
    line-height: 1.65;
}

.guide-sheet p,
.guide-sheet li {
    color: var(--rb-text);
}

.guide-sheet ul,
.guide-sheet ol {
    padding-left: 1.4em;
}

.guide-sheet li {
    margin-bottom: 9px;
}

.guide-sheet li::marker {
    color: var(--rb-accent);
}

.guide-sheet strong {
    color: var(--rb-text);
    font-weight: 700;
}

/* Нумерованные шаги */
.guide-steps {
    counter-reset: guide-step;
    list-style: none;
    padding: 0;
    margin: 22px 0 24px;
}

.guide-steps > li {
    counter-increment: guide-step;
    position: relative;
    padding: 14px 16px 14px 56px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--rb-border);
    border-radius: 4px;
}

.guide-steps > li::before {
    content: counter(guide-step);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    background: var(--rb-heading);
    color: #fff;
    font-family: var(--rb-font-display);
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Карточки */
.guide-sheet .guide-cards {
    gap: 14px;
}

.guide-sheet .guide-card {
    background: var(--rb-callout-bg);
    border: 1px solid var(--rb-border);
    color: var(--rb-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    font-family: var(--rb-font-serif);
    font-size: 0.95rem;
    line-height: 1.58;
    border-radius: 4px;
}

.guide-sheet .guide-card strong {
    color: var(--rb-heading);
    font-family: var(--rb-font-display);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.guide-sheet .guide-card p {
    margin: 0;
}

.guide-sheet .guide-tip {
    background: rgba(52, 120, 180, 0.07);
    border-left: 4px solid #3a7cb8;
    color: var(--rb-text);
    font-family: var(--rb-font-sans);
    font-size: 0.92rem;
    border-radius: 0 4px 4px 0;
}

.guide-sheet .guide-tip strong {
    color: #2a5a88;
}

.guide-sheet .guide-callout {
    background: rgba(139, 100, 30, 0.07);
    border: 1px solid var(--rb-border-strong);
    color: var(--rb-text);
    font-family: var(--rb-font-serif);
    border-radius: 4px;
}

.guide-sheet .guide-callout strong {
    color: var(--rb-heading);
}

/* Таблицы */
.guide-sheet .guide-table-wrap {
    border: 1px solid var(--rb-border);
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.guide-sheet .guide-table th {
    background: var(--rb-table-head);
    color: var(--rb-heading);
    font-family: var(--rb-font-display);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.guide-sheet .guide-table td {
    color: var(--rb-text);
    font-size: 0.92rem;
}

.guide-sheet .guide-table tr:hover td {
    background: rgba(0, 0, 0, 0.025);
}

/* Иллюстрации — как в буклете */
.guide-sheet .guide-figure {
    border: 2px solid var(--rb-border);
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    overflow: hidden;
}

.guide-sheet .guide-figure figcaption {
    background: rgba(80, 55, 30, 0.07);
    color: var(--rb-text-muted);
    font-family: var(--rb-font-sans);
    font-size: 0.82rem;
    text-align: center;
    padding: 10px 14px;
    border-top: 1px solid var(--rb-border);
}

.guide-sheet .guide-figure--scene img {
    max-height: 380px;
    background: rgba(80, 55, 30, 0.05);
    object-fit: contain;
}

.guide-sheet .guide-figure--memo {
    max-width: min(100%, 480px);
    margin-left: auto;
    margin-right: auto;
    padding: 14px;
    background: rgba(255, 255, 255, 0.75);
    border: 2px solid var(--rb-border-strong);
}

.guide-sheet .guide-figure--memo img {
    max-height: min(720px, 85vh);
    border-radius: 2px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.guide-memo-grid {
    max-width: 100%;
}

/* FAQ */
.guide-sheet .guide-faq-intro {
    background: rgba(139, 100, 30, 0.07);
    border: 1px solid var(--rb-border-strong);
    color: var(--rb-text);
    font-family: var(--rb-font-serif);
    border-radius: 4px;
}

.guide-sheet .guide-faq-category h3 {
    color: var(--rb-heading);
    font-family: var(--rb-font-display);
}

.guide-sheet .guide-faq-item details {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--rb-border);
    border-radius: 4px;
}

.guide-sheet .guide-faq-item summary {
    color: var(--rb-text);
    font-family: var(--rb-font-sans);
    font-size: 0.92rem;
}

.guide-sheet .guide-faq-item summary::before {
    color: var(--rb-heading);
}

.guide-sheet .guide-faq-answer {
    color: var(--rb-text-muted);
    font-family: var(--rb-font-serif);
}

.guide-sheet .guide-checklist li {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--rb-border);
    color: var(--rb-text);
    font-family: var(--rb-font-sans);
    font-size: 0.92rem;
    border-radius: 4px;
}

.guide-sheet .guide-checklist li::before {
    color: var(--rb-heading);
}

.guide-sheet .guide-footer {
    border-top: 1px solid var(--rb-border);
    color: var(--rb-text-muted);
    font-family: var(--rb-font-sans);
    font-size: 0.84rem;
    margin-top: 40px;
    padding-top: 22px;
    text-align: center;
}

.guide-sheet .guide-footer a {
    color: var(--rb-heading);
}

/* Встроенный PDF */
.guide-pdf-viewer {
    margin: 24px 0 0;
    border: 2px solid var(--rb-border-strong);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.guide-pdf-viewer iframe {
    display: block;
    width: 100%;
    height: min(88vh, 960px);
    border: none;
}

.guide-sheet .badge-yellow { background: rgba(180, 140, 20, 0.18); color: #6b4a0a; }
.guide-sheet .badge-blue { background: rgba(40, 90, 160, 0.14); color: #2a5088; }
.guide-sheet .badge-green { background: rgba(40, 120, 60, 0.14); color: #2a6040; }
.guide-sheet .badge-red { background: rgba(160, 50, 50, 0.14); color: #882828; }
.guide-sheet .badge-purple { background: rgba(100, 60, 160, 0.14); color: #5a3a88; }

@media (max-width: 900px) {
    .guide-main {
        padding: 20px 16px 56px;
    }

    .guide-sheet {
        padding: 28px 22px 36px;
        font-size: 16px;
    }

    .guide-hero {
        padding: 26px 20px 22px;
    }

    .guide-steps > li {
        padding-left: 52px;
    }
}

@media print {
    .guide-hero,
    .guide-sheet {
        box-shadow: none;
        break-inside: avoid;
    }

    .guide-sheet {
        border: 1px solid #ccc;
        padding: 24px;
    }

    .guide-sheet .guide-section {
        break-inside: avoid;
    }
}
