@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Lora:ital,wght@0,400;0,600;1,400&family=Source+Code+Pro:wght@400&display=swap');

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

:root {
    --navy:    #0c1a38;
    --navy-mid:#1a3060;
    --crimson: #7a1a1a;
    --cream:   #f7f4ee;
    --parchment: #ede8de;
    --text:    #1c1c1c;
    --muted:   #4e4e4e;
    --border:  #c8c0b2;
    --rule:    #a09080;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    background-color: var(--parchment);
    padding: 1.5rem 1rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── Шапка ── */
.pdf-hero {
    background: var(--navy);
    color: #e8e4da;
    padding: 3rem 3rem 2.5rem;
    border-bottom: 4px solid var(--crimson);
    text-align: center;
}

.pdf-hero h1 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 0.3rem;
    color: #f0ece2;
}

.pdf-hero .subtitle {
    font-family: 'EB Garamond', serif;
    font-size: 1.15rem;
    font-style: italic;
    color: #b8b0a0;
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.pdf-hero .hero-rule {
    width: 60px;
    height: 1px;
    background: var(--crimson);
    margin: 0 auto 1.8rem;
}

.pdf-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    color: #e0dbd2;
    padding: 0.7rem 1.8rem;
    border: 1px solid #a09880;
    text-decoration: none;
    font-family: 'EB Garamond', serif;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.pdf-button:hover {
    background: rgba(255,255,255,0.07);
    border-color: #d0c8b8;
    color: #fff;
}

.pdf-button .btn-icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

.pdf-hero .pdf-note {
    margin-top: 0.8rem;
    font-size: 0.78rem;
    color: #7a7468;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Основний контент ── */
.content {
    padding: 2.5rem 3rem;
}

@media (max-width: 720px) {
    .content { padding: 1.5rem 1.25rem; }
    .pdf-hero { padding: 2rem 1.25rem; }
    .pdf-hero h1 { font-size: 1.7rem; }
}

/* ── Заголовки секцій ── */
.section {
    margin-bottom: 2.8rem;
}

.section-heading {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: 0.02em;
    padding-bottom: 0.4rem;
    margin-bottom: 1.4rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.section-heading::after {
    content: '';
    display: block;
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--crimson);
}

/* ── Передмова ── */
.preface {
    background: var(--cream);
    border: 1px solid var(--border);
    border-left: 3px solid var(--crimson);
    padding: 1.5rem 1.75rem;
    margin-bottom: 2.5rem;
}

.preface h2 {
    font-family: 'EB Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.preface p {
    margin-bottom: 0.9rem;
    text-align: justify;
    font-size: 0.97rem;
    color: var(--muted);
    hyphens: auto;
}

.preface p:last-child { margin-bottom: 0; }

.preface strong {
    color: var(--text);
    font-weight: 600;
}

/* ── Автори ── */
.authors {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.2rem 0 2rem;
    justify-content: center;
}

.author-card {
    flex: 1;
    min-width: 240px;
    max-width: 300px;
    background: var(--cream);
    border: 1px solid var(--border);
    padding: 1.4rem 1.2rem 1.2rem;
    text-align: center;
}

.author-photo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 0.9rem;
    border: 2px solid var(--border);
    filter: grayscale(15%);
}

.author-card strong {
    font-family: 'EB Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
    display: block;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.author-card a {
    color: var(--navy-mid);
    text-decoration: none;
    border-bottom: 1px dotted var(--border);
    transition: border-color 0.15s;
}

.author-card a:hover {
    border-bottom-color: var(--crimson);
    color: var(--crimson);
}

.author-card p {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.5rem;
    line-height: 1.5;
    font-style: italic;
}

/* ── Зміст ── */
.toc-list {
    list-style: none;
    margin: 0.5rem 0;
    border: 1px solid var(--border);
}

.toc-list > li {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--parchment);
    font-size: 0.97rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    background: #fff;
}

.toc-list > li:last-child {
    border-bottom: none;
}

.toc-list > li:nth-child(odd) {
    background: var(--cream);
}

.toc-num {
    font-family: 'EB Garamond', serif;
    font-weight: 600;
    color: var(--crimson);
    min-width: 1.6rem;
    font-size: 1rem;
}

.toc-title {
    font-family: 'EB Garamond', serif;
    font-size: 1.05rem;
    color: var(--navy);
    font-weight: 500;
    flex: 1;
}

.sub-list {
    list-style: none;
    width: 100%;
    padding: 0.3rem 0 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sub-list li {
    font-size: 0.84rem;
    color: var(--muted);
    font-style: italic;
    padding: 0.1rem 0;
    border: none;
    background: transparent;
    line-height: 1.4;
}

.sub-list li::before {
    content: '–\00a0';
    color: var(--rule);
}

/* ── Роздільник ── */
hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

.ref-links {
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
    margin: 0.5rem 0 1.5rem;
    font-family: 'EB Garamond', serif;
    font-style: italic;
    letter-spacing: 0.01em;
}

.ref-links a {
    color: var(--navy-mid);
    text-decoration: none;
    border-bottom: 1px dotted var(--border);
}

.ref-links a:hover {
    color: var(--crimson);
}

/* ── Підвал ── */
footer {
    text-align: center;
    padding: 1.2rem 2rem;
    background: var(--navy);
    color: #7a7468;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: 'EB Garamond', serif;
    border-top: 2px solid var(--crimson);
}

@media (max-width: 768px) {
    .authors { gap: 1rem; }
    .author-card { min-width: 200px; }
    .author-photo { width: 90px; height: 90px; }
}

@media (max-width: 480px) {
    .pdf-hero h1 { font-size: 1.5rem; }
    .author-card { padding: 1rem; }
}
