@import url("/betu/fonts.css");

/* ============ 1. Base and design tokens ============ */
/* Design direction "B": personal voice. Lora carries the reading text, Inter
   every piece of interface (navigation, labels, viewer controls), so the
   documents read like prose and the machinery stays quiet around them. */
:root{
  --paper:#f7f3ec; --paper-alt:#efe9de; --surface:#fff;
  --ink:#2a2119; --ink-soft:#463b2e; --muted:#7c6f5e;
  --rule:#ddd2c0; --rule-soft:#e7dece; --accent:#a8502c;

  --font-body:400 17px/1.75 Lora,Georgia,"Times New Roman",serif;
  --font-ui:400 13.5px/1.5 Inter,system-ui,-apple-system,"Segoe UI",sans-serif;

  --hero-crop:210px;           /* trimmed off the top of the hero backdrop */
  --gutter:1.25rem; --max-width:66rem; --max-width-narrow:42rem;
  --radius:3px;
  --control-height:2.1rem;     /* shared height for buttons and inputs */
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font:var(--font-body);
     -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
img,video{max-width:100%;height:auto;display:block}
a{color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}

/* Sortörés. A böngésző alapból ott tördel, ahol a sor betelik, és így az
   utolsó sorra gyakran egyetlen szó marad – a dokumentumlista felvezetőjén
   például az „olvashatóan.”. A `pretty` ezt a magányos szót kerüli el: a
   böngésző inkább feljebb tördel. A címeknél `balance`: ott a sorok hosszát
   egyenlíti ki, hogy ne lógjon le egy árva szó a nagy betűméret alól.
   Amelyik böngésző nem ismeri, az a szokásos módon tördel – nem romlik el. */
h1,h2,.hero-quote p{text-wrap:balance}
.section-header p,.hero-lead,.doc-header .desc,.doc-list .desc,.card p,
.gallery figcaption,.page p{text-wrap:pretty}

.label{font:var(--font-ui);font-weight:600;font-size:11.5px;letter-spacing:.12em;
       text-transform:uppercase;color:var(--accent)}
.wrap{max-width:var(--max-width);margin-inline:auto;padding-inline:var(--gutter)}
.narrow{max-width:var(--max-width-narrow)}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;
                 clip-path:inset(50%);white-space:nowrap}

/* Skip link for keyboard users */
.skip-link{position:absolute;left:-999px;top:0;background:var(--ink);color:var(--paper);
           padding:.7rem 1rem;font:var(--font-ui);z-index:99}
.skip-link:focus{left:0}

/* ============ 2. Site header and navigation ============ */
.site-header{position:sticky;top:0;z-index:20;background:rgba(247,243,236,.93);
             backdrop-filter:blur(6px);border-bottom:1px solid var(--rule)}
.site-header .wrap{display:flex;flex-wrap:wrap;align-items:baseline;gap:.35rem 1.35rem;
                   padding-block:.85rem}
.brand{font:var(--font-ui);font-weight:600;font-size:14.5px;letter-spacing:-.01em;
       text-decoration:none;margin-right:auto;white-space:nowrap}
.nav{display:flex;flex-wrap:wrap;gap:.35rem 1.35rem;margin:0;padding:0;list-style:none}
.nav a{font:var(--font-ui);color:var(--muted);text-decoration:none;
       border-bottom:1px solid transparent;padding-bottom:2px}
.nav a:hover{color:var(--accent)}
.nav a[aria-current="page"]{color:var(--ink);border-bottom-color:var(--accent)}

/* ============ 3. Home page ============ */
.hero{position:relative;overflow:hidden;border-bottom:1px solid var(--rule)}
/* The montage sits behind the quote rather than beside it: in this direction
   the voice leads and the paper is only an atmosphere. */
/* The dossier cover itself, full bleed -- not the montage, whose four separate
   sheets on a light ground read as blotches once faded this far back. The image
   arrives greyscale and softened from build-montage.py; the wide version is
   only worth its bytes on a wide screen. */
/* Hung 220px above the hero and clipped by its overflow, so that much is cut
   off the top of the picture. Shifting the background inside a `cover` box
   would instead leave a gap at the bottom wherever the box is tall and narrow
   -- on a phone, that is every time. */
.hero-bg{position:absolute;inset:calc(-1 * var(--hero-crop)) 0 0 0;
         opacity:.22;filter:grayscale(1) contrast(1.1);
         background:url("/anyag/kepek/elonezet/hero-800.webp") center top/cover no-repeat}
@media (min-width:1100px){
  .hero-bg{background-image:url("/anyag/kepek/elonezet/hero-1200.webp")}
}
/* The two stops mirror --paper; they are literal because a gradient cannot
   take an alpha channel from a plain colour token. */
.hero-bg::after{content:"";position:absolute;inset:var(--hero-crop) 0 0 0;
  background:linear-gradient(180deg,rgba(247,243,236,.45),rgba(247,243,236,.88))}
.hero-inner{position:relative;max-width:46rem;margin-inline:auto;
            padding:5rem var(--gutter) 4.5rem;text-align:center}
.hero-quote{margin:0}
.hero-quote blockquote{margin:0}
.hero-quote p{font-size:clamp(1.55rem,4.6vw,2.5rem);line-height:1.32;font-style:italic;
              letter-spacing:-.01em;margin:0 0 1.4rem}
.hero-source{font:var(--font-ui);font-size:12.5px;letter-spacing:.1em;text-transform:uppercase;
             color:var(--accent);margin:0 0 2.4rem}
.hero-lead{font-size:1.08rem;color:var(--ink-soft);margin:0 auto;max-width:34rem}
.facts{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:.9rem 2rem;
       margin:2.4rem 0 0;padding:0;font:var(--font-ui);font-size:12.5px;color:var(--muted)}
.facts b{display:block;color:var(--ink);font-weight:600;font-size:14px;margin-bottom:2px}

.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:2rem;padding-block:3rem 3.5rem}
.card{display:block;text-decoration:none}
.card figure{margin:0 0 .9rem;height:92px;overflow:hidden;border-radius:var(--radius);
             border:1px solid var(--rule);background:var(--surface)}
/* Középre igazított kivágás: a kártyakép hol irat, hol fénykép, és a felső
   szélnél vágva a fotókból félbevágott arcok, az iratokból üres papír látszik. */
.card figure img{width:100%;height:100%;object-fit:cover;object-position:center;
                 filter:sepia(.18) contrast(1.04)}
.card h2{font:var(--font-ui);font-weight:600;font-size:15px;margin:0 0 .45rem}
.card p{margin:0;font-size:.97rem;color:var(--ink-soft)}
.card:hover figure{border-color:var(--accent)}
.card:hover h2{color:var(--accent)}

/* ============ 4. Section headers and text pages ============ */
.section-header{padding-block:2.8rem 1.6rem;border-bottom:1px solid var(--rule)}
.section-header h1{font-size:clamp(1.9rem,4.5vw,2.6rem);font-weight:400;letter-spacing:-.015em;
                   margin:.5rem 0 .4rem;line-height:1.15}
/* Teljes szélesség: a rovatfejléc felvezetője egy mondat, és így egy sorba
   fér – a korábbi 40rem-es mérték kettétörte. */
.section-header p{margin:0;color:var(--ink-soft)}
.page{padding-block:2.5rem 4rem}
.page h2{font-size:1.4rem;font-weight:600;margin:2.2rem 0 .6rem}
.page p{margin:0 0 1.1rem}

.meta-list{margin:0;display:grid;grid-template-columns:auto 1fr;gap:.45rem 1.2rem;
           font:var(--font-ui);font-size:13px}
.meta-list dt{color:var(--muted)}
.meta-list dd{margin:0;color:var(--ink)}

/* ============ 5. Document list ============ */
.doc-list{list-style:none;margin:0;padding:0}
.doc-list li{border-bottom:1px solid var(--rule-soft)}
.doc-list a{display:grid;grid-template-columns:auto 1fr auto;gap:.2rem 1.5rem;
            align-items:baseline;padding:1.15rem .25rem;text-decoration:none}
.doc-list a:hover{background:var(--paper-alt)}
.doc-list .num{font:var(--font-ui);color:var(--muted);font-variant-numeric:tabular-nums}
.doc-list .title{font-size:1.12rem}
.doc-list a:hover .title{color:var(--accent)}
.doc-list .pages{font:var(--font-ui);color:var(--muted);white-space:nowrap}
.doc-list .desc{grid-column:2;margin:.25rem 0 0;font-size:.97rem;color:var(--ink-soft)}
.doc-list .ref{grid-column:2;margin:.35rem 0 0;font:var(--font-ui);color:var(--muted)}

/* ============ 6. Single document page ============ */
.doc-header{padding-block:2rem 1.2rem}
.back{font:var(--font-ui);color:var(--muted);text-decoration:none}
.back .arrow{display:inline-block;padding-bottom:3px;transform:translateY(-3px)}
.back:hover{color:var(--accent)}
.doc-header h1{font-size:clamp(1.5rem,3.6vw,2.1rem);font-weight:400;margin:.7rem 0 .5rem;
               line-height:1.2}
.doc-header .desc{margin:0 0 .8rem;color:var(--ink-soft);max-width:44rem}
.doc-meta{display:flex;flex-wrap:wrap;gap:.3rem 1.6rem;font:var(--font-ui);color:var(--muted);
          margin:0;padding:0;list-style:none}

.viewer{border:1px solid var(--rule);background:var(--surface);border-radius:var(--radius);
        overflow:hidden;margin-bottom:2rem}
.viewer-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.6rem .7rem;
            background:var(--paper-alt)}
.viewer-bar--top{border-bottom:1px solid var(--rule)}
.viewer-bar--bottom{border-top:1px solid var(--rule)}
.viewer-bar .spacer{margin-left:auto}
.btn{font:var(--font-ui);line-height:1;background:var(--surface);color:var(--ink);
     border:1px solid var(--rule);border-radius:var(--radius);
     display:inline-flex;align-items:center;justify-content:center;
     min-height:var(--control-height);padding:4px .7rem 0;cursor:pointer;letter-spacing:.01em;
     text-decoration:none;white-space:nowrap;-webkit-appearance:none;appearance:none}
.arrow{display:inline-block}
[data-action="next"] .arrow{padding:0 0 4px 4px}
[data-action="prev"] .arrow{padding:0 4px 4px 0}
.btn:hover:not(:disabled){border-color:var(--accent);color:var(--accent);background:var(--surface)}
.btn:disabled{opacity:.4;cursor:default}
.page-nav{font:var(--font-ui);line-height:1;color:var(--muted);display:flex;
          align-items:center;gap:.35rem}
.page-nav input{font:var(--font-ui);line-height:1;width:3.4rem;height:var(--control-height);
                text-align:center;padding:4px .2rem 0;border:1px solid var(--rule);
                border-radius:var(--radius);background:var(--surface);color:var(--ink);
                -moz-appearance:textfield}
.page-nav input::-webkit-outer-spin-button,
.page-nav input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.page-nav .total{margin-top:4px}
.viewer-canvas{position:relative;min-height:60vh;display:flex;justify-content:flex-start;
               align-items:flex-start;padding:1rem;background:var(--paper-alt);
               overflow-x:auto;overflow-y:hidden}
/* No max-width: past the fitted size the page may overflow and be panned.
   The auto margins centre it while it still fits, and collapse once it does not,
   so the left edge stays reachable. */
.viewer-canvas canvas{margin:0 auto;box-shadow:0 2px 14px -6px rgba(42,33,25,.45);
                      background:#fff}
.viewer-canvas.is-pannable{cursor:grab}
.viewer-canvas.is-panning{cursor:grabbing;user-select:none}

/* Full screen: the viewer fills the screen and the page area scrolls inside it.
   Without a fixed height the stage would keep growing with the page and the
   overflow would simply be clipped, with no way to reach it. */
.viewer:fullscreen{display:flex;flex-direction:column;height:100vh;
                   margin:0;border:0;border-radius:0;background:var(--paper-alt)}
.viewer:fullscreen .viewer-bar{flex:0 0 auto}
.viewer:fullscreen .viewer-bar--bottom{margin-top:auto}
.viewer:fullscreen .viewer-canvas{flex:1 1 auto;min-height:0;overflow:auto}
.viewer-fallback{padding:2rem 1.25rem;text-align:center;color:var(--ink-soft)}
/* Overlaid on the page, not placed next to it: as a flex child it would
   shove the rendered page sideways every time it appeared. */
.viewer-status{position:absolute;inset:0;z-index:2;margin:0;padding:2rem 1.25rem 1.25rem;
               display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
               text-align:center;color:var(--muted);font:var(--font-ui);letter-spacing:.04em;
               pointer-events:none}
.viewer-status[hidden]{display:none}
.viewer-status .bar{display:block;width:11rem;height:2px;margin-top:.5rem;
                    background:var(--rule);overflow:hidden;position:relative}
.viewer-status .bar i{position:absolute;inset:0;background:var(--accent);
                      transform:scaleX(0);transform-origin:left;transition:transform .18s linear}

/* ============ 7. Photo gallery ============ */
.gallery{list-style:none;margin:0;padding:0;display:grid;gap:1.25rem;
         grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
.gallery figure{margin:0}
.gallery button{display:block;width:100%;padding:0;border:1px solid var(--rule);
                background:var(--surface);cursor:pointer;border-radius:var(--radius);overflow:hidden}
.gallery button:hover{border-color:var(--accent)}
.gallery img{width:100%;aspect-ratio:4/3;object-fit:cover}
.gallery figcaption{font-size:.92rem;line-height:1.5;color:var(--ink-soft);margin-top:.5rem}

.lightbox{position:fixed;inset:0;z-index:50;background:rgba(28,22,17,.94);
          display:flex;flex-direction:column;padding:1rem}
.lightbox[hidden]{display:none}
.lightbox .image{flex:1;display:flex;align-items:center;justify-content:center;
                 min-height:0;overflow:hidden}
.lightbox .image img{max-height:100%;max-width:100%;object-fit:contain;
                     transform-origin:center center;
                     -webkit-user-drag:none;user-select:none}
.lightbox .image.is-pannable{cursor:grab;touch-action:none}
.lightbox .image.is-panning{cursor:grabbing;user-select:none}
.lightbox .caption{margin:.9rem 0 0;text-align:center;color:#cdc3b3;font-size:.95rem;
                   line-height:1.5}
.lightbox-bar{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;justify-content:center;
              color:#ece5d9;padding-top:.8rem;font:var(--font-ui)}
.lightbox-bar a{color:#ece5d9}
.lightbox-bar .btn{background:transparent;border-color:#6f6354;color:#ece5d9}
.lightbox-bar .btn:hover{background:rgba(255,255,255,.08);border-color:#c08b6e;color:#fff}

/* ============ 8. Video and audio ============ */
.video-list,.audio-list{list-style:none;margin:0;padding:0;display:grid;gap:2.2rem}
.video-list h2,.audio-list h2{font-size:1.2rem;font-weight:400;margin:0 0 .35rem}
/* The running time is data, not a signpost: the accent colour would give it
   the same weight as the section counts. */
.audio-list .label{color:var(--muted)}
.video-list p,.audio-list p{margin:0 0 .7rem;color:var(--ink-soft);font-size:.99rem}
.poster{position:relative;border:1px solid var(--rule);border-radius:var(--radius);
        overflow:hidden;background:var(--paper-alt);aspect-ratio:16/9;width:100%;
        cursor:pointer;padding:0}
.poster img{width:100%;height:100%;object-fit:cover}
.poster .badge{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
/* line-height:1 plus a little extra padding on top: the all-caps label has no
   descenders, so centring the full line box would leave it sitting high. */
.poster .badge span{display:inline-flex;align-items:center;gap:.55em;
                    background:rgba(42,33,25,.82);color:var(--paper);border-radius:999px;
                    padding:.82rem 1.5rem .66rem;font:var(--font-ui);font-weight:500;
                    line-height:1;letter-spacing:.1em;text-transform:uppercase}
/* An SVG triangle rather than the CSS border trick: it cannot be thrown off
   by the pill's own rounding, and it scales with the label. */
.poster .badge .play{width:.62em;height:.74em;flex:0 0 auto;display:block;
                     margin-top:-.08em;      /* optical centre against the caps */
                     transform:translateY(-1px)}
.poster:hover .badge span{background:var(--accent)}
.embed{aspect-ratio:16/9;width:100%;border:1px solid var(--rule);border-radius:var(--radius)}
/* A saját tárhelyen álló felvétel a maga képarányában áll: a felvételek 4:3-asak,
   egy 16:9-es dobozban fekete sávok közé szorulnának. */
.video-player{width:100%;height:auto;display:block;background:#000;
              border:1px solid var(--rule);border-radius:var(--radius)}
.video-list .label{margin-top:.5rem;color:var(--muted)}
audio{width:100%;margin-top:.3rem}

/* ============ 9. Footer, error page ============ */
.site-footer{border-top:1px solid var(--rule);margin-top:3rem}
.site-footer .wrap{padding-block:1.8rem 3rem;display:flex;flex-wrap:wrap;
                   justify-content:center;gap:.4rem 1.6rem;text-align:center;
                   font:var(--font-ui);font-size:12px;color:var(--muted)}
.site-footer a{color:var(--muted)}
.site-footer a:hover{color:var(--accent)}
.error{padding-block:5rem 6rem;text-align:center}
.error .code{font:400 clamp(4rem,14vw,8rem)/1 Lora,Georgia,serif;color:var(--rule);margin:0}
.error h1{font-size:1.7rem;font-weight:400;margin:.5rem 0 .8rem}

/* ============ 10. Narrow screens ============ */
@media (max-width:760px){
  .hero-inner{padding:3.2rem var(--gutter) 3rem}
  .hero-bg{opacity:.16}
  .facts{gap:.9rem 1.4rem}
  .cards{grid-template-columns:1fr;gap:1.7rem;padding-block:2.2rem 2.8rem}
  .doc-list a{grid-template-columns:auto 1fr;gap:.15rem .9rem}
  .doc-list .pages{grid-column:2;margin-top:.2rem}
  .viewer-canvas{min-height:50vh;padding:.5rem}
  .gallery{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:1rem}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
