.gallery-page { margin-block:24px; }
.gallery-header { padding:6cqw 6cqw 4cqw; }
.gallery-header>a,.gallery-footer a { color:var(--ink); font:400 18px/1.3 "tondu",sans-serif; text-decoration:none; }
.gallery-header h1 { font:400 clamp(48px,10cqw,112px)/1 "tondu",sans-serif; margin:4cqw 0 1cqw; }
.gallery-header p { font:400 18px/1.4 "news-gothic-std",sans-serif; }
.gallery-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:1.2cqw; padding:0 6cqw 6cqw; }
.gallery-tile { display:block; aspect-ratio:1; overflow:hidden; background:#b8b5a5; }
.gallery-tile img { display:block; width:100%; height:100%; object-fit:cover; }
.gallery-tile:focus-visible { outline:3px solid var(--orange); outline-offset:3px; }
.gallery-footer { padding:4cqw 6cqw; background:var(--orange); }
.lightbox { position:fixed; inset:0; margin:auto; padding:52px 55px 40px; width:100vw; height:100dvh; max-width:none; max-height:none; border:0; background:#191815f5; color:#eee8d9; }
.lightbox::backdrop { background:#191815; }
.lightbox[open] { display:grid; grid-template-columns:1fr; align-items:center; }
.lightbox figure { margin:0; min-height:0; text-align:center; }
.lightbox-image { display:block; max-width:100%; max-height:calc(100dvh - 180px); width:auto; height:auto; margin:0 auto; object-fit:contain; }
.lightbox figcaption { max-width:800px; margin:18px auto 0; font:400 18px/1.4 "news-gothic-std",sans-serif; }
.lightbox button { position:absolute; border:0; background:#292723; color:#eee8d9; cursor:pointer; min-width:44px; min-height:44px; font:400 20px/1 "news-gothic-std",sans-serif; }
.lightbox button:focus-visible { outline:2px solid #eee8d9; outline-offset:3px; }
.lightbox-close { top:8px; right:12px; padding:10px; }
.lightbox-prev { left:6px; top:45%; }
.lightbox-next { right:6px; top:45%; }
.lightbox-count { position:absolute; left:0; right:0; bottom:8px; text-align:center; margin:0; font:400 14px/1.4 "news-gothic-std",sans-serif; }
html:has(.lightbox[open]) { overflow:hidden; }
@media(max-width:800px) { .gallery-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:2cqw; } }
@media(max-width:500px) { .gallery-page { margin-block:0; } .gallery-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .lightbox { padding:56px 38px 40px; } .lightbox figcaption { font-size:16px; } }

/* Samma topp och meny som startsidan. Pappersmasken täcker bildrutornas område. */
.gallery-page { margin-block:0; }
.gallery-header { padding-top:2cqw; }
.menu [aria-current="page"] { text-decoration:underline; text-underline-offset:.2em; text-decoration-thickness:1px; }
/* Bild och bildtext delar skärmhöjden; kontrollerna ligger fria från innehållet. */
.lightbox[open] { display:grid; grid-template-rows:minmax(0,1fr); }
.lightbox figure { height:100%; display:flex; flex-direction:column; justify-content:center; gap:14px; overflow:auto; }
.lightbox-image { min-height:0; max-height:100%; flex:0 1 auto; object-fit:contain; }
.lightbox figcaption { flex:0 0 auto; margin:0 auto; overflow-wrap:anywhere; }
@media(max-width:500px) {
.lightbox { padding:60px 44px 44px; }
.lightbox figcaption { font-size:15px; line-height:1.35; }
.lightbox-close { top:max(8px,env(safe-area-inset-top)); }
}
@media(max-height:500px) { .lightbox { padding-top:52px; padding-bottom:32px; } .lightbox figcaption { font-size:14px; } }

.gallery-tile { border-radius:10px; }
.content-paper .gallery-header { padding-inline:1.5cqw; }
.content-paper .gallery-grid { padding-inline:1.5cqw; }
@media(max-width:600px) {
.content-paper .gallery-header, .content-paper .gallery-grid { padding-inline:3cqw; }
}
