:root {
    --desk-dark: #1a0f05;
    --desk-mid: #3b2209;
    --page-h: 98vh;
    --page-w: min(47.5vw, calc(var(--page-h) * 0.72));
    --base-lh: 3.6vh;
}

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

body {
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Crimson Text', Georgia, serif;
    background: radial-gradient(ellipse at 40% 60%, var(--desk-mid) 0%, var(--desk-dark) 70%);

    /* iOS tablet/mobil betűsimítás - ETTŐL LESZ SZÉP A SZÖVEG IPAD-EN ÉS ANDROIDON */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(87deg, transparent, transparent 28px, rgba(0, 0, 0, .07) 28px, rgba(0, 0, 0, .07) 29px),
        repeating-linear-gradient(177deg, transparent, transparent 28px, rgba(0, 0, 0, .05) 28px, rgba(0, 0, 0, .05) 29px);
    pointer-events: none;
}

#scene {
    position: relative;
    perspective: 1800px;
    transform: scale(1);
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), filter 1.2s ease;
    z-index: 5;
}

#scene.idle {
    transform: scale(0.60) translateY(20vh) rotateX(15deg);
    filter: brightness(0.4);
    pointer-events: none;
}

#book {
    position: relative;
    width: calc(var(--page-w) * 2);
    height: var(--page-h);
    cursor: grab;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease-in-out;
}

#book.closed-front {
    transform: translateX(calc(var(--page-w) * -0.5));
}

#book.closed-back {
    transform: translateX(calc(var(--page-w) * 0.5));
}

#book:active {
    cursor: grabbing;
}

#book::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateY(3vh);
    background: rgba(0, 0, 0, .38);
    box-shadow: 0 4vh 8vh rgba(0, 0, 0, .85);
    filter: blur(1vh);
    z-index: -1;
    pointer-events: none;
    width: 100%;
    left: 0;
    transition: opacity 0.6s, width 0.6s, left 0.6s;
}

#book.closed-front::before,
#book.closed-back::before {
    opacity: 0;
}

#touch-indicator {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d4af37;
    font-family: 'IM Fell English', serif;
    font-size: 3vh;
    letter-spacing: 0.3vw;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    z-index: 10;
}

#scene.idle+#touch-indicator {
    opacity: 1;
    animation: pulseText 2s infinite alternate ease-in-out;
}

@keyframes pulseText {
    from {
        transform: translate(-50%, -50%) scale(0.95);
        text-shadow: 0 0.2vh 1vh rgba(0, 0, 0, 0.8);
    }

    to {
        transform: translate(-50%, -50%) scale(1.05);
        text-shadow: 0 0.4vh 2vh rgba(212, 175, 55, 0.6);
    }
}

#bookmark {
    position: absolute;
    top: 3vh;
    right: -3.5vh;
    width: 3.5vh;
    height: 18vh;
    background: #901a1e;
    color: #f1e5c9;
    font-family: 'IM Fell English', serif;
    font-size: 1.4vh;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0.5vh 0.5vh 0;
    cursor: pointer;
    box-shadow: 0.2vh 0.2vh 1vh rgba(0, 0, 0, 0.4);
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.3vh;
    z-index: 0;
    transition: right 0.2s, background 0.2s, opacity 0.3s;
}

#bookmark:hover {
    right: -4vh;
    background: #b02025;
}

#book.closed-back #bookmark {
    opacity: 0;
    pointer-events: none;
}

.static-page {
    position: absolute;
    top: 0;
    width: var(--page-w);
    height: var(--page-h);
    overflow: hidden;
    z-index: 1;
}

#static-left {
    left: 0;
}

#static-right {
    left: var(--page-w);
}

#flip-layer {
    position: absolute;
    top: 0;
    width: var(--page-w);
    height: var(--page-h);
    z-index: 10;
    display: none;
    transform-style: preserve-3d;
    will-change: transform;
    pointer-events: none;
}

#flip-layer.forward {
    left: var(--page-w);
    transform-origin: left center;
}

#flip-layer.backward {
    left: 0;
    transform-origin: right center;
}

.flip-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    box-shadow: 0 1vh 2vh rgba(0, 0, 0, .18);
}

#flip-front {
    transform: translateZ(1px);
}

#flip-back {
    transform: rotateY(180deg) translateZ(1px);
}

/* --- TARTALOM --- */
.page-content {
    width: 100%;
    height: 100%;
    padding: 4vh 4vw 5vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Visszaállítva a biztonságos fentről indulásra */
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 3vh rgba(0, 0, 0, .06);
    color: inherit;
}

.lined::before {
    display: none !important; /* Vonalazás kikapcsolása */
}

/* BORÍTÓK */
.cover-front-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 2vh;
}

.cover-front-title {
    font-family: 'IM Fell English', serif;
    font-size: 5.5vh;
    color: #d4af37;
    margin-bottom: 4vh;
    text-shadow: 0.2vh 0.2vh 1vh rgba(0, 0, 0, 0.9);
    letter-spacing: 0.2vh;
}

.cover-front-logo {
    width: 22vh;
    height: 22vh;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 4vh;
    box-shadow: 0 1.5vh 3vh rgba(0, 0, 0, 0.8), 0 0 0 0.4vh #d4af37;
}

.cover-front-subtitle {
    font-family: 'Crimson Text', serif;
    font-size: 2.8vh;
    color: #f1e5c9;
    letter-spacing: 0.3vh;
    margin-bottom: 2vh;
    text-transform: uppercase;
}

.cover-front-divider {
    width: 6vh;
    height: 0.3vh;
    background-color: #a08c5b;
    margin: 0 auto 2vh;
}

.cover-front-date {
    font-family: 'IM Fell English', serif;
    font-size: 2.5vh;
    color: #d4af37;
    letter-spacing: 0.5vh;
}

.cover-back-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 3vh;
    opacity: 0.6;
}

.cover-back-logo {
    width: 8vh;
    height: 8vh;
    border-radius: 50%;
    opacity: 0.3;
    margin-bottom: 2vh;
    filter: grayscale(100%);
}

.cover-back-text {
    color: #d4af37;
    font-size: 1.5vh;
    letter-spacing: 0.2vh;
    text-align: center;
    font-family: 'IM Fell English', serif;
}

/* KÉPES OLDAL & ÓRIÁS ZSEB */
.image-page-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 2;
}

.main-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-bottom: 1.5vh;
}

.main-page-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 35vh;
    object-fit: contain;
    border: 0.5vh solid #fff;
    box-shadow: 0 0.5vh 1.5vh rgba(0, 0, 0, 0.2);
    border-radius: 0.3vh;
}

/* ---- ZSEB ÉS KILÓGÓ KÉPEK ---- */
.pocket-container {
    height: 32vh;
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 1vh;
}

.pocket-wrapper {
    position: relative;
    width: 85%;
    height: 17vh;
    cursor: pointer;
    margin: 0 auto;
}

.pocket-photos {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.pocket-photo {
    width: auto;
    max-width: 32%;
    height: 16vh;
    object-fit: cover;
    object-position: center 20%;
    border: 0.5vh solid #fff;
    box-shadow: 0 0.8vh 2vh rgba(0, 0, 0, 0.5);
    position: absolute;
    bottom: 2vh;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: center;
}

.pocket-photo.img-0 {
    left: 4%;
    transform: rotate(12deg) translateY(-2vh);
    z-index: 2;
}

.pocket-photo.img-1 {
    left: 36%;
    transform: rotate(-8deg) translateY(-4vh);
    z-index: 1;
}

.pocket-photo.img-2 {
    right: 4%;
    transform: rotate(6deg) translateY(-1vh);
    z-index: 3;
}

.pocket-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #cbb48b;
    border-top: 0.3vh solid #b69d71;
    z-index: 3;
    box-shadow: 0 -0.6vh 2vh rgba(0, 0, 0, 0.15), inset 0 0.8vh 2.5vh rgba(0, 0, 0, 0.05);
    border-radius: 0.8vh 0.8vh 2vh 2vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IM Fell English', serif;
    font-size: 2.8vh;
    color: #5a4220;
    clip-path: polygon(0 0, 5% 15%, 95% 15%, 100% 0, 100% 100%, 0 100%);
    padding: 2.5vh 2vw 0;
    text-align: center;
    line-height: 1.1;
}

.pocket-wrapper:hover .pocket-photo.img-0 {
    transform: rotate(16deg) translateY(-8vh);
}

.pocket-wrapper:hover .pocket-photo.img-1 {
    transform: rotate(-12deg) translateY(-10vh);
}

.pocket-wrapper:hover .pocket-photo.img-2 {
    transform: rotate(10deg) translateY(-7vh);
}

/* SZÖVEG FORMÁZÁS */
.header-area {
    display: block;
    margin-bottom: 0;
    z-index: 2;
    position: relative;
}

.page-header {
    font-family: 'IM Fell English', serif;
    font-size: 1.3vh;
    letter-spacing: 0.4vw;
    color: inherit;
    opacity: 0.6;
    text-transform: uppercase;
    text-align: center;
    height: var(--base-lh);
    margin-bottom: var(--base-lh);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 0;
}

.chapter-title {
    font-family: 'IM Fell English', serif;
    font-size: 2.5vh;
    color: inherit;
    line-height: var(--base-lh);
    margin-bottom: 0;
    text-align: center;
    text-transform: uppercase;
}

.chapter-year {
    font-size: 1.8vh;
    letter-spacing: 0.3vw;
    color: inherit;
    opacity: 0.8;
    line-height: var(--base-lh);
    margin-bottom: 0;
    text-transform: uppercase;
    text-align: center;
}

.chapter-body {
    font-size: 1.8vh; 
    line-height: 1.35; 
    color: inherit;
    text-align: justify;
    hyphens: auto; 
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    position: relative;
    z-index: 1;
    margin: auto 0; /* EZ A BIZTONSÁGOS KÖZÉPRE HÚZÁS: a hosszú szöveg fent marad, a rövid középre megy */
}

.chapter-body p {
    margin-bottom: 0;
    text-indent: 0;
}

.page-footer-links-block {
    display: block;
    margin-top: 0;
}

.page-footer-links-block a {
    display: block;
    margin-bottom: 0.5vh;
}

.chapter-body a {
    color: inherit;
    font-weight: bold;
    text-decoration: underline;
    transition: opacity 0.2s;
    opacity: 0.8;
}

.chapter-body a:hover {
    opacity: 1;
    text-decoration-color: inherit;
}

.chapter-body b,
.chapter-body strong {
    font-weight: 600;
    opacity: 0.95;
}

.chapter-body i,
.chapter-body em {
    font-style: italic;
    opacity: 0.9;
}

.drop-cap::first-letter {
    font-family: 'IM Fell English', serif;
    font-size: 7.5vh;
    float: left;
    line-height: .8;
    margin: 0.6vh 1.2vh 0 0;
    color: inherit;
}

.page-num {
    position: absolute;
    bottom: 2vh;
    font-size: 1.5vh;
    letter-spacing: 0.2vw;
    color: inherit;
    opacity: 0.6;
    z-index: 2;
}

.page-num.left {
    left: 4vw;
}

.page-num.right {
    right: 4vw;
}

/* =========================================================
   HÁTTEREK ÉS SZÍNTÉMÁK (ÚJ SZÍNEK A KÉP ALAPJÁN)
========================================================= */

.era-transparent {
    background: transparent !important;
    box-shadow: none !important;
}

.era-transparent.lined::before {
    display: none !important;
}

.era-cover {
    background: linear-gradient(135deg, #18253b 0%, #0a111a 100%);
    box-shadow: inset 0 0 6vh rgba(0, 0, 0, 0.9);
    border-left: 0.3vh solid #05080c;
    color: #fff;
}

.era-cover.lined::before {
    display: none !important;
}

/* 5. Egyszerű Fekete-fehér (Alap/Bevezető) */
.era-uniform {
    background: #F8F8F8;
    color: #1A1A1A;
}

.era-uniform .pocket-front {
    background: #E8E8E8;
    color: #111111;
    border-top-color: #D0D0D0;
}

/* Bal alsó kép: Pasztell Zöld (Helyszínek) */
.era-helyiseg {
    background: #7E9F76;
    color: #152411;
}

.era-helyiseg .pocket-front {
    background: #698A61;
    color: #0D170A;
    border-top-color: #587551;
}

/* Jobb alsó kép: Pasztell Világoskék (Személyek) */
.era-szemelyek {
    background: #CFE5F5;
    color: #122838;
}

.era-szemelyek .pocket-front {
    background: #B5CDE0;
    color: #0C1E2B;
    border-top-color: #9BB3C7;
}

/* Jobb felső kép: Bézs/Világosbarna (Események) */
.era-esemeny {
    background: #CAA682;
    color: #2B1D10;
}

.era-esemeny .pocket-front {
    background: #B5916D;
    color: #1F140A;
    border-top-color: #9E7D5B;
}

/* Bal felső kép: Pasztell Sárga (Emléktárgyak) */
.era-targyak {
    background: #F2E394;
    color: #332B09;
}

.era-targyak .pocket-front {
    background: #DFCE7B;
    color: #241E05;
    border-top-color: #C7B665;
}

.toc-link {
    color: inherit;
    opacity: 0.8;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    position: relative;
    z-index: 20;
    text-decoration: underline;
    display: block;
    margin-bottom: 0.5vh;
}

.toc-link:hover {
    opacity: 1;
}

/* ---- CSEMPÉS, 2 SOROS GALÉRIA ---- */
#info-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#info-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal-title,
#modal-img {
    display: none !important;
}

.modal-close {
    position: absolute;
    top: 3vh;
    right: 4vw;
    cursor: pointer;
    font-size: 5vh;
    color: rgba(255, 255, 255, 0.6);
    z-index: 50;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-layout {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-tile-grid {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    gap: 3vh;
    padding: 4vh 10vw;
    width: 100vw;
    height: 80vh;
    overflow-x: auto;
    overflow-y: hidden;
    align-content: center;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-tile-grid::-webkit-scrollbar {
    display: none;
}

.gallery-tile-grid.active-drag {
    cursor: grabbing;
}

.gallery-tile-img {
    width: auto;
    max-width: 45vh;
    height: 32vh;
    object-fit: contain;
    border: 0.5vh solid #fff;
    border-radius: 1vh;
    box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-tile-img:hover {
    transform: scale(1.05);
    box-shadow: 0 2vh 4vh rgba(0, 0, 0, 0.6);
}

/* ---- LIGHTBOX ---- */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

#lightbox-img {
    width: 75vw;
    height: 75vh;
    object-fit: contain;
    border: 0.5vh solid #fff;
    border-radius: 0.5vh;
}

.lightbox-close {
    position: absolute;
    top: 3vh;
    right: 4vw;
    color: rgba(255, 255, 255, 0.6);
    font-size: 5vh;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #fff;
}

footer {
    position: fixed;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    color: #a08c5b;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 2vh;
    letter-spacing: 0.3vw;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#scene.idle~footer {
    opacity: 1;
}

/* --- TARTALOMJEGYZÉK (ToC) SPECIÁLIS DESIGN --- */
.era-toc {
    color: #3a2a18;
    background-color: #f4ecd8 !important;
    justify-content: flex-start !important; /* Ez fixálja le, hogy ne középről, hanem fentről induljon mindkét oldal */
    padding-top: 8vh; /* Finom térköz felülről, hogy szép vonalban legyen a cím */
}

.era-toc::before {
    display: none !important;
}

.page-left.era-toc {
    background-color: #f4ecd8 !important;
    /* 0.85-ről 0.93-ra növeltük, így halványabb a kép */
    background-image:
        linear-gradient(rgba(244, 236, 216, 0.93), rgba(244, 236, 216, 0.93)),
        url('KEPEK/0_címlap.jpg') !important;
    background-size: 100% 100%, 200% 100% !important;
    background-position: center, left center !important;
    background-repeat: no-repeat !important;
    background-blend-mode: normal, multiply !important;
}

.page-right.era-toc {
    background-color: #f4ecd8 !important;
    /* Itt is 0.85-ről 0.93-ra növeltük */
    background-image:
        linear-gradient(rgba(244, 236, 216, 0.93), rgba(244, 236, 216, 0.93)),
        url('KEPEK/0_címlap.jpg') !important;
    background-size: 100% 100%, 200% 100% !important;
    background-position: center, right center !important;
    background-repeat: no-repeat !important;
    background-blend-mode: normal, multiply !important;
}

/* --- IMPRESSZUM IGAZÍTÁS --- */
.era-impresszum {
    justify-content: flex-start !important; /* Kikapcsoljuk a középre húzást */
    padding-top: 15vh; /* Felülről toljuk le őket egyszerre, így hajszálpontosan egy vonalban lesz a két lap */
}

.page-left.era-impresszum {
    background-color: #f4ecd8 !important;
    background-image: linear-gradient(rgba(244, 236, 216, 0.93), rgba(244, 236, 216, 0.93)), url('KEPEK/0_címlap.jpg') !important;
    background-size: 100% 100%, 200% 100% !important;
    background-position: center, left center !important;
    background-blend-mode: normal, multiply !important;
}

.page-right.era-impresszum {
    background-color: #f4ecd8 !important;
    background-image: linear-gradient(rgba(244, 236, 216, 0.93), rgba(244, 236, 216, 0.93)), url('KEPEK/0_címlap.jpg') !important;
    background-size: 100% 100%, 200% 100% !important;
    background-position: center, right center !important;
    background-blend-mode: normal, multiply !important;
}

/* --- TARTALOMJEGYZÉK: FIX 2 OSZLOP ÉS BEFÉRÉS JAVÍTÁSA --- */
.page-content.era-toc {
    padding-top: 3vh !important; /* Nyerünk egy kis helyet felül */
    padding-bottom: 2vh !important; /* És alul is */
}

.era-toc .chapter-title {
    margin-bottom: 1.5vh !important; /* Kisebb szünet a főcím alatt */
}

.toc-grid {
    column-count: 2 !important; /* Szigorúan 2 oszlopra kényszerítjük */
    column-gap: 3vw;
    display: block !important;
    height: 100%;
    text-align: left;
}

.toc-grid .toc-link {
    display: inline-block; 
    width: 100%;
    font-size: 1.5vh !important; /* Marad a méret, hogy vízszintesen kiférjen */
    line-height: 1.3 !important; /* Kicsit szellősebb sorköz a 2 soros címeknél */
    margin-bottom: 10px !important; /* Fix 12px távolság az egyes pontok között */
    text-decoration: none;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(244, 236, 216, 0.9);
    break-inside: avoid;
}

.toc-grid .toc-link:hover {
    color: #901a1e;
}

/* --- 101. TANTESTÜLET DUPLA KÉP --- */
.era-tantestulet::before {
    display: none !important; /* Vonalazás kikapcsolása */
}
.era-tantestulet .page-num {
    display: none !important; /* Oldalszám elrejtése a képről */
}
.page-left.era-tantestulet {
    background-color: #fff !important;
    /* A kép nevét itt tudod majd módosítani, ha más lesz a fájlnév */
    background-image: url('KEPEK/101_tantestulet.jpg') !important; 
    background-size: 200% 100% !important;
    background-position: left center !important;
    background-repeat: no-repeat !important;
}
.page-right.era-tantestulet {
    background-color: #fff !important;
    background-image: url('KEPEK/101_tantestulet.jpg') !important;
    background-size: 200% 100% !important;
    background-position: right center !important;
    background-repeat: no-repeat !important;
}

/* =========================================================
   ---- TABLET & KISEBB KÉPERNYŐ OPTIMALIZÁLÁS ----
========================================================= */

/* Fekvő (Landscape) Tablet (pl. iPad Mini fektetve vagy Android 16:10) */
@media (max-aspect-ratio: 16/10) and (min-aspect-ratio: 1/1) {
    :root {
        --page-h: 96vh;
        --page-w: 46vw;
        --base-lh: 4vh;
    }

    .toc-grid .toc-link {
        font-size: 16px !important; /* Fix méret, ami már jól olvasható */
        margin-bottom: 12px !important; /* Fix sorköz a linkek között */
        line-height: 20px !important; /* Fix sormagasság, ha több sorba törne a szöveg */
    }

    .page-content {
        padding: 5vh 5vw 6vh;
    }

    .chapter-title {
        font-size: 3.2vh;
    }

    .chapter-body {
        font-size: 2vh;
    }

    .drop-cap::first-letter {
        font-size: 8vh;
    }
}

/* Álló (Portrait) Tablet és Mobil */
@media (max-aspect-ratio: 1/1) {
    :root {
        --page-h: 96vh;
        --page-w: 47vw;
        --base-lh: 2.5vh;
    }

    .toc-grid .toc-link {
        font-size: 15px !important; /* Picit kisebb, hogy álló nézetben is kiférjen a szűkebb oszlopba */
        margin-bottom: 10px !important; 
        line-height: 18px !important;
    }
    .toc-grid {
        column-gap: 25px !important; /* Fix távolság a két oszlop között */
    }

    .page-content {
        padding: 5vh 5vw 6vh;
    }

    .chapter-title {
        font-size: 2.2vh;
    }

    .chapter-body {
        font-size: 1.6vh;
    }

    .drop-cap::first-letter {
        font-size: 6vh;
    }

    .pocket-wrapper {
        width: 100%;
        height: 12vh;
    }

    .pocket-photo {
        height: 11vh;
    }

    .pocket-front {
        font-size: 2vh;
        padding-top: 1.5vh;
    }

    .cover-front-title {
        font-size: 3.5vh;
    }

    .cover-front-logo {
        width: 14vh;
        height: 14vh;
    }

    #bookmark {
        width: 2.5vh;
        height: 14vh;
        right: -2.5vh;
        font-size: 1.2vh;
    }

    #bookmark:hover {
        right: -3vh;
    }
}

/* --- LAPTOP MAGASSÁG OPTIMALIZÁLÁS TARTALOMJEGYZÉKHEZ --- */
@media (max-height: 850px) {
    .page-content.era-toc {
        padding-top: 2vh !important;
        padding-bottom: 1vh !important;
    }
    .era-toc .chapter-title {
        margin-bottom: 1vh !important;
    }
    .toc-grid .toc-link {
        font-size: 1.35vh !important; /* Kisebb betű a kisképernyős laptopoknak */
        margin-bottom: 6px !important; /* Szorosabb térköz */
        line-height: 1.15 !important;
    }
}





.cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;

    max-width: 900px;
    margin: auto;

    padding: 20px;

    background: #ffffff;
    color: #222;

    border: 1px solid #ccc;
    border-radius: 10px;

    box-shadow: 0 4px 20px rgba(0,0,0,.2);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    z-index: 9999;
}

.cookie-banner p {
    margin: 5px 0 0;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-buttons button {
    padding: 10px 16px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-buttons {
        justify-content: flex-end;
    }
}