/* Turnier 2026 in Bildern (/turnier/bilder/): nine chapters, each named by a Japanese character.
   Builds on site.css (colours, fonts, .wrap, .eyebrow, .lead); everything here is scoped to .gal-*. */
.galerie { --serif-jp: "Noto Serif CJK JP", "Noto Serif JP", "Source Han Serif", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif; }
.galerie .cta-band { margin-top: 0; }
html:has(.galerie) { scroll-padding-top: 132px; }

/* Opening picture */
.gal-hero { position: relative; min-height: min(88vh, 820px); display: flex; align-items: flex-end; overflow: hidden; }
.gal-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.gal-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,11,11,.2) 0%, rgba(11,11,11,0) 30%, rgba(11,11,11,.55) 62%, rgba(11,11,11,.97) 100%); }
.gal-hero__in { position: relative; z-index: 1; padding: 140px 0 56px; }
.gal-hero__kanji { font: 900 clamp(84px, 17vw, 240px)/.86 var(--serif-jp); margin: 0 0 .12em -.04em; letter-spacing: -.02em; }
.gal-hero__kanji em { font-style: normal; color: var(--red); }
.gal-hero h1 { font-size: clamp(1.9rem, 4.6vw, 3.4rem); margin-bottom: .3em; }
.gal-hero .lead { max-width: 40rem; margin: 0; }

/* Chapter navigation: stays under the site header */
/* Solid bars on this page: a blurred backdrop over large pictures makes scrolling stutter. */
.galerie .top { backdrop-filter: none; background: #0b0b0b; }
.gal-nav { position: sticky; top: 72px; z-index: 15; background: #0b0b0b; border-block: 1px solid var(--line); }
.gal-nav__in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.gal-nav__in::-webkit-scrollbar { display: none; }
.gal-nav a { flex: none; display: flex; align-items: center; gap: .55em; padding: .5em .85em; border-radius: 999px; text-decoration: none; color: var(--muted); font: 700 .85rem/1 var(--head); white-space: nowrap; }
.gal-nav a span { font: 700 1.05rem/1 var(--serif-jp); color: var(--text); }
.gal-nav a:hover, .gal-nav a.ist { background: var(--red); color: #fff; }

/* Chapters */
.gal-ch { padding-top: clamp(64px, 10vw, 128px); }
.gal-ch__head { position: relative; padding-bottom: 28px; }
.gal-ch__kanji { position: absolute; right: 0; top: -.34em; font: 900 clamp(110px, 21vw, 300px)/.8 var(--serif-jp); color: transparent; -webkit-text-stroke: 1.5px #333; pointer-events: none; user-select: none; white-space: nowrap; }
.gal-ch__head > :not(.gal-ch__kanji) { position: relative; }
.gal-ch__head h2 { font-size: clamp(2rem, 5.2vw, 4.2rem); text-transform: uppercase; margin-bottom: .25em; }
.gal-ch__head .lead { margin: 0; max-width: 38rem; }
.gal-ch--kumite { background: #000; }
.gal-ch--hyosho .gal-ch__kanji { -webkit-text-stroke-color: #4a3d18; }

/* Pictures. Each one is a plain link to the large file, so the page also works without JavaScript. */
.g { position: relative; display: block; overflow: hidden; background: var(--bg-2); cursor: zoom-in; }
.g img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s; }
.g__cap { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: 34px 14px 10px; font-size: .85rem; line-height: 1.3; background: linear-gradient(180deg, transparent, rgba(0,0,0,.78)); opacity: 0; transition: opacity .25s; }
.g__cap b { font-weight: 600; }
.g__cap i { font-style: normal; color: #ddd; font-variant-numeric: tabular-nums; }
.g:hover img { transform: scale(1.03); }
.g:hover .g__cap, .g:focus-visible .g__cap { opacity: 1; }

/* Chapter opener: the whole picture, never cropped */
.gal-auf { display: flex; justify-content: center; }
.g--auf { width: min(100%, calc(88vh * var(--ar))); aspect-ratio: var(--ar); }
.g--auf img { object-fit: contain; }
.g--auf .g__cap { opacity: 1; font-size: .95rem; padding: 60px clamp(16px, 4vw, 40px) 16px; }

/* Rows of equal height, each picture in its own proportions */
.gal-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; }
.gal-grid .g { flex-grow: calc(var(--ar)); flex-basis: calc(var(--ar) * var(--rh, 280px)); aspect-ratio: var(--ar); }
.gal-grid::after { content: ""; flex-grow: 1000000; }
.gal-ch--hyosho .gal-grid { --rh: 240px; }
@media (max-width: 700px) {
  .gal-grid { --rh: 150px; gap: 4px; padding: 4px; }
  .gal-ch--hyosho .gal-grid { --rh: 140px; }
  .gal-nav { top: 72px; }
  .g__cap { display: none; }
  .g--auf .g__cap { display: flex; font-size: .85rem; }
}

/* Kumite in black and white where a pointer can hover; colour returns on hover. Touch screens show colour. */
@media (hover: hover) {
  .gal-ch--kumite .g img { filter: grayscale(1) contrast(1.15); }
  .gal-ch--kumite .g:hover img { filter: none; }
}
@media (hover: none) { .gal-nurmaus { display: none; } }

/* Thanks under the helpers' picture */
.gal-dank { text-align: center; padding-block: clamp(32px, 6vw, 80px) clamp(16px, 3vw, 40px); }
.gal-dank__jp { font: 900 clamp(1.25rem, 4.6vw, 4.4rem)/1.1 var(--serif-jp); margin: 0; letter-spacing: .04em; white-space: nowrap; }
.gal-dank__jp::after { content: ""; display: block; width: 72px; height: 4px; background: var(--red); margin: .45em auto 0; }
.gal-dank__rd { margin: 1.1em 0 0; font: 700 clamp(.65rem, 1.05vw, .9rem)/1 var(--head); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.gal-dank__de { margin: .6em 0 0; font: 700 clamp(1rem, 1.9vw, 1.6rem)/1.3 var(--head); }

/* Large view (added by galerie.js) */
.gal-lb { position: fixed; inset: 0; z-index: 60; background: rgba(5,5,5,.97); display: none; grid-template-rows: 1fr auto; }
.gal-lb.auf { display: grid; }
.gal-lb__b { min-height: 0; display: grid; place-items: center; padding: 14px; }
.gal-lb__b img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; width: auto; height: auto; }
.gal-lb__u { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px clamp(14px, 4vw, 40px) 16px; font-size: .95rem; }
.gal-lb__u b { font: 700 1.05rem/1.3 var(--head); }
.gal-lb__u span { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gal-lb button { position: absolute; background: rgba(0,0,0,.55); color: #fff; border: 1px solid #444; border-radius: 999px; width: 48px; height: 48px; font: 400 1.5rem/1 var(--body); cursor: pointer; }
.gal-lb button:hover { background: var(--red); border-color: var(--red); }
.gal-lb__x { top: 14px; right: 14px; }
.gal-lb__l { left: 14px; top: 50%; transform: translateY(-50%); }
.gal-lb__r { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 700px) { .gal-lb__l, .gal-lb__r { top: auto; bottom: 64px; transform: none; } }

/* Picture reached by a direct link */
.g:target { outline: 3px solid var(--red); outline-offset: -3px; }

/* The film, before the chapters */
.gal-film { background: #000; padding-bottom: clamp(24px, 4vw, 56px); }
.gal-film__b { display: flex; justify-content: center; padding-inline: 6px; }
.gal-film__v { display: block; width: min(100%, calc(82vh * 16 / 9), 1600px); height: auto; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); }
.gal-film__q { margin: 12px auto 0; color: var(--muted); font-size: .85rem; }
