/* Gallery (js/gallery.js) and Media Kit blocks (js/mediakit.js) — editorial look: sharp tiles, hairline borders, gold accent */
#galleryView { margin-top: 1.25rem; }
.gl-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; font-family: var(--font-display); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.gl-crumbs a { color: var(--tx-accent, var(--gold)); text-decoration: none; } .gl-crumbs a:hover { text-decoration: underline; }
.gl-crumbs span { color: var(--text2); } .gl-crumbs i { font-style: normal; opacity: .45; }
.gl-note { color: var(--text2); }

.gl-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
@media (max-width: 900px) { .gl-tiles { grid-template-columns: repeat(2, 1fr); } }
.gl-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 340px; box-sizing: border-box; overflow: hidden; isolation: isolate; text-decoration: none; color: #fff; background: var(--tile); box-shadow: 0 0 0 1px rgba(255,255,255,.07); transition: box-shadow .2s; }
.gl-tile:hover, .gl-tile:focus-visible { box-shadow: 0 0 0 1px var(--tx-accent, var(--gold)); outline: 0; }
.gl-album { align-items: center; justify-content: center; text-align: center; padding: 28px 18px; }
.gl-album.has-logo::before { content: ''; position: absolute; inset: 6% 8% 22%; z-index: -1; background: var(--logo) center / contain no-repeat; opacity: .55; transition: opacity .2s, transform .3s; }
.gl-album.has-ph::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ph) center / cover no-repeat; opacity: .35; }
.gl-album:hover::before { opacity: .8; transform: scale(1.04); }
.gl-tile-main { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 18px; background: linear-gradient(transparent, rgba(0,0,0,.78)); display: flex; flex-direction: column; gap: 3px; }
.gl-tile-main b, .gl-tile-cap b { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; line-height: 1.15; }
.gl-tile small { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--tx-accent, var(--gold)); }

.gl-sub > img.gl-cov { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: filter .3s; filter: brightness(.82); }
.gl-sub:hover > img.gl-cov { filter: brightness(1); }
.gl-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text2); z-index: -1; }
.gl-tile-cap { display: flex; flex-direction: column; gap: 3px; padding: 44px 16px 16px; background: linear-gradient(transparent, rgba(0,0,0,.82)); }

/* photos: justified rows — every picture keeps its own proportions */
.gl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.gl-ph { position: relative; display: block; overflow: hidden; background: #15151a; aspect-ratio: 16 / 9; box-shadow: 0 0 0 1px rgba(255,255,255,.07); }
.gl-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter .25s; }
.gl-ph:hover img, .gl-ph:focus-visible img { filter: brightness(1.06); }
.gl-ph:focus-visible { outline: 0; }
.gl-ph-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); opacity: 0; transform: translateY(6px); transition: .2s; }
.gl-ph:hover .gl-ph-cap, .gl-ph:focus-visible .gl-ph-cap { opacity: 1; transform: none; }
@media (hover: none) { .gl-ph-cap { display: none; } }

/* lightbox */
.glb { position: fixed; inset: 0; z-index: 9000; display: grid; grid-template-rows: auto 1fr auto auto; background: #050507; color: #fff; outline: 0; animation: glbIn .18s ease; touch-action: none; user-select: none; -webkit-user-select: none; }
@keyframes glbIn { from { opacity: 0; } }
.glb-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-family: var(--font-display); font-weight: 700; letter-spacing: .16em; font-size: 14px; color: var(--text2); }
.glb-btns { display: flex; gap: 4px; }
.glb-btns button, .glb-btns a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: #fff; background: none; border: 0; cursor: pointer; opacity: .8; transition: .15s; }
.glb-btns button:hover, .glb-btns a:hover, .glb-btns button:focus-visible, .glb-btns a:focus-visible { opacity: 1; background: rgba(255,255,255,.1); outline: 0; }
.glb-stage { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; cursor: zoom-in; }
.glb.zoomed .glb-stage { cursor: grab; } .glb.drag .glb-stage { cursor: grabbing; }
.glb-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; will-change: transform; transition: transform .18s ease, filter .3s, opacity .2s; }
.glb.drag .glb-img { transition: none; }
.glb-img.lo { filter: blur(6px) brightness(.8); }
.glb-spin { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--tx-accent, var(--gold)); border-radius: 50%; animation: glbSpin .8s linear infinite; opacity: 0; transition: opacity .2s .25s; pointer-events: none; }
.glb.loading .glb-spin { opacity: 1; }
@keyframes glbSpin { to { transform: rotate(360deg); } }
.glb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 84px; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(0,0,0,.35); border: 0; cursor: pointer; opacity: .55; transition: .15s; z-index: 2; }
.glb-nav:hover, .glb-nav:focus-visible { opacity: 1; background: rgba(0,0,0,.6); color: var(--tx-accent, var(--gold)); outline: 0; }
.glb-nav.prev { left: 0; } .glb-nav.next { right: 0; }
.glb-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; justify-content: center; padding: 10px 16px 6px; text-align: center; }
.glb-cap b { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; }
.glb-cap span { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--tx-accent, var(--gold)); }
.glb-strip { display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px 12px; scrollbar-width: thin; touch-action: pan-x; }
.glb-strip button { flex: 0 0 auto; width: 76px; height: 52px; padding: 0; border: 0; background: #15151a; cursor: pointer; opacity: .45; outline: 2px solid transparent; outline-offset: -2px; transition: .15s; }
.glb-strip button:hover { opacity: .85; } .glb-strip button.on { opacity: 1; outline-color: var(--tx-accent, var(--gold)); }
.glb-strip img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.glb:fullscreen .glb-strip { display: none; }
@media (max-width: 700px) { .glb-nav { width: 38px; height: 64px; } .glb-strip button { width: 60px; height: 42px; } .glb-cap b { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .glb, .glb-img, .gl-ph img, .gl-sub > img.gl-cov { animation: none; transition: none; } }

/* Media Kit: live numbers + premier events */
.mk-block { margin-top: 2.2rem; }
.mk-block .section-header { margin-bottom: 14px; }
.mk-stats { display: grid; grid-template-columns: repeat(4, 1fr); box-shadow: 0 0 0 1px rgba(255,255,255,.07); background: var(--tile); }
.mk-stat { padding: 26px 12px 22px; text-align: center; box-shadow: 1px 0 0 rgba(255,255,255,.07) inset; }
.mk-stat:first-child { box-shadow: none; }
.mk-stat b { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 4.7vw, 68px); line-height: .95; color: #fff; }
.mk-stat span { display: block; margin-top: 10px; font-family: var(--font-display); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-size: 13px; color: var(--text2); }
.mk-lead { color: var(--text2); margin: 0 0 14px; }
.mk-events { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.mk-ev { position: relative; overflow: hidden; isolation: isolate; min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px 14px; text-align: center; background: var(--tile); box-shadow: 0 0 0 1px rgba(255,255,255,.07); text-shadow: 0 2px 14px rgba(0,0,0,.65); }
.mk-ev.has-logo::before { content: ''; position: absolute; inset: 4% 6%; z-index: -1; background: var(--logo) center / contain no-repeat; opacity: .17; filter: saturate(.9) brightness(1.15); }
.mk-ev .mk-res { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 4.7vw, 68px); line-height: .95; color: #fff; }
.mk-ev .mk-cap { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-accent, var(--gold)); }
.mk-ev .mk-name { margin-top: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; line-height: 1.15; }
.mk-ev .mk-tag { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--tx-accent, var(--gold)); }
@media (max-width: 900px) { .mk-events { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .mk-stats { grid-template-columns: repeat(2, 1fr); } .mk-stat:nth-child(odd) { box-shadow: none; } .mk-stat:nth-child(n+3) { box-shadow: 0 1px 0 rgba(255,255,255,.07) inset; } .mk-events { grid-template-columns: 1fr; } .gl-tiles { grid-template-columns: 1fr 1fr; } }
body.ed .mk-block .section-title { font-family: var(--font-display, 'Rajdhani'), sans-serif; font-weight: 700; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; }
body.ed .mk-block .section-header { margin: 0 0 18px; }

/* sub-album tiles: cover photo + series logo in the corner + big year; without a cover the series logo is the backdrop (like Last Races) */
.gl-sub { justify-content: flex-end; }
/* a sub-album without a cover photo looks exactly like an album tile: same logo size, name at the bottom */
.gl-sub.has-logo::before { content: ''; position: absolute; inset: 6% 8% 22%; z-index: -1; background: var(--logo) center / contain no-repeat; opacity: .55; transition: opacity .2s, transform .3s; }
.gl-sub.has-logo:hover::before { opacity: .8; transform: scale(1.04); }
.gl-sub > img.gl-cov { z-index: -1; }
.gl-corner { position: absolute; top: 12px; left: 12px; width: 54px; height: 40px; object-fit: contain; object-position: left top; filter: drop-shadow(0 1px 6px rgba(0,0,0,.8)); }
.gl-year { position: absolute; top: 10px; right: 14px; font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 3.6vw, 52px); line-height: 1; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.75); }
@media (max-width: 600px) { .gl-tile { height: 230px; } }
@media (max-width: 900px) { .gl-grid { grid-template-columns: repeat(2, 1fr); } }
.gl-ph:hover, .gl-ph:focus-visible { z-index: 1; }
/* the same gold frame as the Last Races / Upcoming tiles and the menu, drawn inside the picture so neighbours never cover it */
.gl-ph::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 0 var(--tx-accent, var(--gold)); transition: box-shadow .2s; }
.gl-ph:hover::after, .gl-ph:focus-visible::after { box-shadow: inset 0 0 0 2px var(--tx-accent, var(--gold)); }
/* every tile caption is centred, albums and sub-albums alike */
.gl-tile-main, .gl-tile-cap { align-items: center; text-align: center; }


/* simple copy protection: pictures cannot be dragged, selected or long-pressed to save; the tile (not the <img>) receives every click */
.gl-protect img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; pointer-events: none; }
.gl-protect { -webkit-touch-callout: none; }
.glb.gl-protect .glb-stage { -webkit-touch-callout: none; }
@media print { #galleryView img, .glb { display: none !important; } }
