/*
Theme Name: SAMA
Theme URI: https://samarecordings.net
Description: Custom block theme for SAMA - Verein zur Förderung von Musik und Kunst. One look, "Index": hairline grid, mono details. Releases, events and a Bandcamp import.
Version: 0.9.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: sama
License: GPL-2.0-or-later
*/

/* Look "Index". Fonts, colours and sizes: theme.json. */

:root {
	--sama-line: 1px solid var(--wp--preset--color--line);
	--sama-pad: 24px;
	--sama-mono: var(--wp--preset--font-family--mono);
	--sama-label: var(--wp--preset--font-family--text);
	--sama-muted: var(--wp--preset--color--muted);
}

/* Never scroll sideways (the flag canvases reach a little past their images). */
html, body { overflow-x: clip; }

/* Divider between items: a fine vertical line instead of dots. */
.sama-sep { display: inline-block; width: 1px; height: .85em; margin: 0 .35em; background: currentColor; opacity: .35; vertical-align: -.08em; }

.sama-label, .sama-mono { font-family: var(--sama-label); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }

/* Everything shares one left edge (contentSize = wideSize). Running text keeps a readable measure. */
.wp-block-post-content > p, .wp-block-post-content > ul, .wp-block-post-content > ol,
.sama-text p, .sama-pagetext p { max-width: 45em; } /* em, not ch: ch changes when the web font arrives (the text box would jump) */
.wp-block-post-content > p, .wp-block-post-content > ul, .wp-block-post-content > ol { margin-left: 0 !important; margin-right: auto !important; } /* the narrower text stays on the shared left edge (WordPress would centre it) */
.sama-pagetext { padding-block: var(--sama-pad); margin-block: 0 !important; }

/* Links in texts that leave the site get a small ↗. */
.wp-block-post-content a[href^="http"]:not([href*="samarecordings.net"]):not([href*="samarecordings.local"]):not(.sama-btn)::after {
	content: "↗";
	font-size: .8em;
	margin-left: .15em;
	text-decoration: none;
	display: inline-block;
}
.wp-block-post-content a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }

/* ---------- Header ---------- */
.wp-site-blocks > header { margin-block: 0; }
/* Space above the footer, so the last section's line and the newsletter line never touch. */
.wp-site-blocks > footer { margin-block: 64px 0; }
.sama-header-wrap { border-bottom: var(--sama-line); }
.sama-header { padding-block: 14px !important; }
.sama-header .wp-block-site-logo img { width: 26px; height: auto; }
.sama-header .wp-block-navigation__container { gap: 0 !important; }
.sama-header .wp-block-navigation-item > a { display: block; padding: 4px 14px; border-left: var(--sama-line); text-decoration: none; }
.sama-header .wp-block-navigation-item.current-menu-item > a { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }

/* Mobile menu (WordPress's navigation overlay, below 600 px), after HHV: a full panel sliding in from the
   left, close where the menu button was, the links large and left-aligned with room for a finger. */
.sama-header .wp-block-navigation__responsive-container-open, .sama-header .wp-block-navigation__responsive-container-close { padding: 10px; margin: -10px; }
.sama-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--base) !important; color: var(--wp--preset--color--contrast) !important; padding: 0 !important; animation: sama-menu-in .32s var(--sama-ease, ease) both; }
@keyframes sama-menu-in { from { transform: translateX(-100%); } }
.sama-header .is-menu-open .wp-block-navigation__responsive-close { max-width: none; }
.sama-header .is-menu-open .wp-block-navigation__responsive-container-close { top: 22px; right: var(--wp--style--root--padding-right, 24px); }
.sama-header .is-menu-open .wp-block-navigation__responsive-container-content { padding: 76px var(--wp--style--root--padding-right, 24px) 32px var(--wp--style--root--padding-left, 24px) !important; align-items: stretch !important; }
.sama-header .is-menu-open .wp-block-navigation__container { flex-direction: column !important; align-items: stretch !important; gap: 0 !important; width: 100%; border-top: var(--sama-line); }
.sama-header .is-menu-open .wp-block-navigation-item { width: 100%; }
.sama-header .is-menu-open .wp-block-navigation-item > a { border: 0 !important; border-bottom: var(--sama-line) !important; padding: 15px 0 !important; font-size: 22px; line-height: 1.25; width: 100%; background: none !important; color: inherit !important; }
.sama-header .is-menu-open .wp-block-navigation-item.current-menu-item > a { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .sama-header .wp-block-navigation__responsive-container.is-menu-open { animation: none; } }

/* Back to the top (motion.js) */
.sama-top { position: fixed; left: max(16px, calc((100vw - var(--wp--style--global--wide-size, 1440px)) / 2 + var(--wp--style--root--padding-left, 24px))); bottom: var(--wp--style--root--padding-left, 24px); /* on the page edge, as far from the bottom as the page side margin */ z-index: 60; width: 46px; height: 46px; padding: 0; border: 1px solid currentColor; border-radius: 50%; background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); display: flex; align-items: center; justify-content: center; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: 0; transform: translateY(32px); pointer-events: none; transition: opacity .35s ease, transform .45s var(--sama-ease, ease); } /* comes up from the bottom, with a slight fade */
.sama-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.sama-top.is-out { opacity: 1; transform: translateX(var(--sama-top-out, -120px)); transition: transform .45s var(--sama-ease, ease); } /* leaves to the left, no fade */
.sama-top.is-reset { transition: none !important; }
.sama-top:hover { opacity: .55; } /* a soft fade like the links, no fill */

/* ---------- Section bars: heading left, note or link right ---------- */
.sama-bar { border-top: var(--sama-line); padding: 10px 0 !important; margin-block: 0 !important; }
/* A long heading may wrap; the link on the right (Archive, All releases) stays in one piece, on the right. */
/* The heading keeps its one line (the waving flag is drawn from it); when the link on the right no longer fits
   beside it, the link moves underneath. */
.sama-bar { flex-wrap: wrap !important; column-gap: 24px; row-gap: 8px; }
.sama-bar > :last-child:not(:first-child) { flex: 0 0 auto; white-space: nowrap; }
.sama-bar > * { margin: 0 !important; }
/* Sticky section heads (motion.js wraps head + list in .sama-section): the head stays under the top edge while its
   list scrolls by; stuck, it has a line underneath. */
.sama-section { margin-block: 0 !important; }
.sama-bar.is-sticky { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 5; background: var(--wp--preset--color--base); }
.sama-bar.is-sticky.is-stuck { box-shadow: 0 1px 0 var(--wp--preset--color--line); }
@media (max-width: 600px) { .sama-bar.is-sticky { top: 0; } } /* phones: the admin bar scrolls away there */
.sama-bar p { font-family: var(--sama-label); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.sama-bar a { text-decoration: none; }
.sama-bar + * { margin-block-start: 0 !important; }
/* Never two lines on top of each other: a bar right after a grid or list reuses its closing line. */
:is(.sama-grid, .sama-events, .sama-strip) + .sama-bar,
:is(.sama-grid, .sama-events) + .sama-nl { border-top: 0; }
/* The photo strip opening a page (front page, About): the same space above it as at its sides. */
:root body .entry-content > .sama-strip:first-child { margin-top: calc(var(--wp--style--root--padding-left, 24px) - var(--wp--style--block-gap, 16px)) !important; }
/* A heading bar that opens a page (e.g. Contact): no line on top, the same top space as the other pages. */
:root body .entry-content > .sama-bar:first-child { border-top: 0; padding-top: var(--sama-pad) !important; margin-top: 0 !important; }

/* ---------- Front page ---------- */
.sama-strip { margin-block: 0 !important; border-bottom: var(--sama-line); }
.sama-intro { margin-block: 0 !important; gap: 0 !important; }
.sama-intro > .wp-block-column { padding: var(--sama-pad) var(--sama-pad) var(--sama-pad) 0; margin: 0 !important; }
.sama-intro > .wp-block-column + .wp-block-column { border-left: var(--sama-line); padding-left: var(--sama-pad); }
.sama-intro .sama-text p { font-size: 17px; font-weight: 300; line-height: 1.5; max-width: 41em; }
.sama-emph { font-family: var(--sama-label); font-size: 12px !important; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Release grid ---------- */
.sama-grid { --cols: 6; display: grid; grid-template-columns: repeat(var(--cols), 1fr); border-top: var(--sama-line); border-left: var(--sama-line); margin-block-start: 0; }
.sama-rel { min-width: 0; border-right: var(--sama-line); border-bottom: var(--sama-line); text-decoration: none !important; color: inherit; display: flex; flex-direction: column; }
/* Tiles in a row share one picture height (subgrid): the columns come out a fraction of a pixel apart, and
   the line under each cover would otherwise drift by a pixel from tile to tile. */
.sama-grid > .sama-rel { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
/* The picture box is a fixed square that only follows its column: the pictures sit inside it (absolutely), so
   nothing inside can make it wider or taller, in any browser (Firefox sized it by the swipe pictures). */
.sama-cover { display: block; position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; min-width: 0; min-height: 0; align-self: start; } /* full tile width */
.sama-cover > img, .sama-cover > .sama-cover-empty, .sama-cover-track { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.sama-cover-track > img { width: 100% !important; height: 100% !important; }
.sama-cover-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.sama-cover-track::-webkit-scrollbar { display: none; }
.sama-cover-track > img { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
/* Arrows on touch devices only (a mouse moves across the cover instead) */
.sama-cover-btn { display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: rgba(255,255,255,.82); color: #111; font-size: 18px; line-height: 1; z-index: 3; -webkit-tap-highlight-color: transparent; }
.sama-cover-btn.is-prev { left: 6px; }
.sama-cover-btn.is-next { right: 6px; }
@media (hover: none) { .sama-cover.has-more .sama-cover-btn { display: flex; } }
/* With a mouse (motion.js adds .is-fade): the pictures lie on top of each other and crossfade. */
.sama-cover-track.is-fade { display: grid; overflow: hidden; scroll-snap-type: none; }
.sama-cover-track.is-fade > img { grid-area: 1 / 1; transition: opacity .4s ease !important; }
.sama-js .sama-cover-track.is-fade > img:not(.is-shown):not(.is-prev) { opacity: 0 !important; }
.sama-cover-track.is-fade > img.is-prev { z-index: 1; }
.sama-cover-track.is-fade > img.is-shown { z-index: 2; }
.sama-js .sama-cover-track.is-fade:not(:has(> img.is-shown)) > img:first-child { opacity: 1 !important; } /* safety net: never an empty tile */
.sama-cover img, .sama-cover-empty { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; }
.sama-cover-empty { background: var(--wp--preset--color--tile); }
/* Card text (option A): artist full width, title, then cat. no. and formats below. */
.sama-rel-meta { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 12px; border-top: var(--sama-line); min-width: 0; overflow: hidden; } /* long lines end in an ellipsis inside the tile */
.sama-artist { font-weight: 500; }
.sama-artist, .sama-title, .sama-rel .sama-pre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line each: cards never re-wrap */
.sama-cat { order: 3; margin-top: 6px; font-family: var(--sama-mono); font-size: 11px; color: var(--sama-muted); }
.sama-title { order: 2; color: var(--sama-muted); }
.sama-pre { order: 5; font-family: var(--sama-label); font-size: inherit; text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; } /* same size as the album title */
.sama-pre-date { color: var(--sama-muted); }
.sama-rel .sama-pre { font-size: 12px; margin-top: 6px; }
.sama-release-single .sama-pre { margin: 0 0 16px; }
.sama-fmt { order: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.sama-fmt .sama-price { border: 0; padding: 0; margin-left: auto; font-family: inherit; font-size: 12px; letter-spacing: 0; text-transform: none; color: inherit; } /* like HHV: format, then the price */
.sama-fmt span, .sama-release-single .sama-formats span { font-family: var(--sama-label); font-size: 10px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: var(--sama-muted); border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 22%, transparent); padding: 3px 5px 2px; }
.sama-yearrow { display: none; }

/* ---------- Events ---------- */
.sama-events { display: grid; grid-template-columns: 200px 1fr; border-block: var(--sama-line); }
.sama-years { border-right: var(--sama-line); padding: 14px var(--sama-pad) 14px 0; }
.sama-years ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.sama-years a { text-decoration: none; font-family: var(--sama-label); font-size: 12px; }
.sama-years a.is-current { text-decoration: underline; text-underline-offset: 3px; }
.sama-evlist { min-width: 0; transition: opacity .18s var(--sama-ease, ease); } /* a quick fade, no movement */
.sama-events { overflow: hidden; overflow-anchor: none; box-sizing: border-box; } /* no scroll anchoring jumps while the list swaps */
.sama-events.is-loading .sama-evlist { opacity: 0; }
.sama-events.is-entering .sama-evlist { opacity: 0; transition: none; }
.sama-ev { display: grid; grid-template-columns: 110px 1fr auto; align-items: baseline; gap: 16px; padding: 10px 0 10px var(--sama-pad); border-bottom: var(--sama-line); text-decoration: none !important; color: inherit; }
.sama-ev:last-child { border-bottom: 0; }
.sama-ev-date { font-variant-numeric: tabular-nums; }
.sama-ev-date small { display: block; margin-top: 3px; font-family: var(--wp--preset--font-family--text, inherit); font-size: 13px; text-transform: none; color: var(--sama-muted); } /* the venue, under the date */
.sama-ev-date, .sama-ev-tag { font-family: var(--sama-label); font-size: 12px; text-transform: uppercase; }
.sama-ev-name { display: block; min-width: 0; } /* date, title and Tickets/Info on the first line */
.sama-ev-name small { color: var(--sama-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }
.sama-empty { color: var(--sama-muted); padding: 10px var(--sama-pad); margin: 0; }

/* ---------- Release / event page ---------- */
.sama-release-single { display: grid; grid-template-columns: 1fr 1fr; margin-block: 0 !important; padding-bottom: 48px; }
.sama-release-single:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 1fr; }
.sama-release-single > * { margin: 0 !important; }
.sama-release-single > .wp-block-group { padding: var(--sama-pad) 0 0 var(--sama-pad); }
.sama-release-single:not(:has(.wp-block-post-featured-image)) > .wp-block-group { padding-left: 0; }
.sama-release-single .wp-block-post-featured-image { margin-top: var(--sama-pad) !important; }
.sama-release-single > * { align-self: start; }
.sama-single-text > :first-child { margin-top: 0 !important; }
.sama-release-single .wp-block-post-title { font-size: 22px; font-weight: 500; }
.sama-release-single .sama-artist { font-size: 15px; margin: 6px 0 0; }
.sama-release-single .sama-cat { margin: 4px 0 16px; color: var(--sama-muted); }
.sama-release-single .sama-formats { display: flex; gap: 4px; margin-bottom: 16px; } /* same light badges as on the cards */

/* Play + Buy (the Bandcamp player loads into .sama-player-slot on click) */
.sama-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.sama-btn { transition: background-color .15s ease, color .15s ease; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--wp--preset--color--contrast); border-radius: 0; background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); font: inherit; font-size: 14px; padding: 8px 18px; cursor: pointer; text-decoration: none !important; }
.sama-btn-line { background: transparent; color: var(--wp--preset--color--contrast); }
.sama-btn:hover { background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); }
.sama-btn-line:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.sama-btn:disabled { opacity: .4; cursor: default; }
.sama-player-slot:not(:empty) { margin: 16px 0 20px !important; } /* gap between Play/Buy and the loaded player */

/* Physical copies on the release page: name, (status only if not in stock), price */
/* Release page picture: cover and edition photos, thumbnails below */
.sama-gallery-photo { aspect-ratio: 1; background: #fafaf8; margin: 0; }
.sama-gallery-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sama-gallery-photo img[hidden] { display: none; }
.sama-gallery-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sama-gallery-thumbs button { padding: 0; border: 1px solid transparent; background: none; cursor: pointer; width: 52px; height: 52px; opacity: .6; transition: opacity .2s ease; }
.sama-gallery-thumbs button[aria-pressed="true"] { border-color: currentColor; opacity: 1; }
.sama-gallery-thumbs button:hover { opacity: 1; }
.sama-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 1 !important; }
/* From tablet width up (as on HHV): every picture large, one under the other; the text column stays in view
   while they scroll past (its top is set by motion.js so that a long text can still be read to its end).
   Phones keep one picture with the small thumbnails. */
@media (min-width: 861px) {
	.sama-gallery-photo { aspect-ratio: auto; background: none; display: grid; gap: 8px; }
	.sama-gallery-photo img, .sama-gallery-photo img[hidden] { display: block; height: auto; contain-intrinsic-size: none; } /* the box has the picture's own proportions (width/height attributes) from the start; WordPress's 3000×1500 stand-in for lazy pictures made long grey boxes */
	.sama-gallery-thumbs { display: none; }
	/* More than three: the first two stay, the third place shows the picture picked below (inc/shortcodes.php). */
	.sama-gallery.has-more .sama-gallery-photo img[data-i]:not([data-i="0"]):not([data-i="1"]):not(.is-slot) { display: none; }
	.sama-gallery.has-more .sama-gallery-thumbs { display: flex; }
	.sama-gallery.has-more .sama-gallery-thumbs .is-top { display: none; }
	.sama-release-single > .sama-single-text { position: sticky; top: var(--sama-stick, 24px); }
}
/* Editions above Play / Buy: name and price, then size and details (two lines at most) */
.sama-edition { margin: 0 0 10px; }
.sama-edition-copies { color: var(--sama-muted); }
.sama-edition .sama-stock { margin: 0; }
.sama-edition-note { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--sama-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sama-stock { display: flex; gap: 10px; align-items: baseline; margin: 0 0 6px; font-size: 15px; } /* like HHV: edition and price in body size */
.sama-stock-name { font-weight: 400; }
.sama-stock-status { display: inline-flex; align-items: center; align-self: center; color: var(--sama-muted); gap: 5px; font-family: var(--sama-label); font-size: 11px; line-height: 1; text-transform: uppercase; letter-spacing: .05em; }
.sama-stock.is-limitedavailability .sama-stock-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d9922b; }
.sama-stock.is-soldout, .sama-stock.is-outofstock { color: var(--sama-muted); }
.sama-stock-price { color: var(--wp--preset--color--contrast); font-weight: 500; font-variant-numeric: tabular-nums; }
.sama-stock:last-of-type { margin-bottom: 16px; }

/* ---------- Contact ---------- */
.sama-contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 32px; padding-block: var(--sama-pad); }
.sama-contact-grid h3 { font-family: var(--sama-label); font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 4px; }
.sama-contact-grid p { margin: 0; }

/* ---------- Newsletter ---------- */
:root { --sama-foot-cols: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .87fr) minmax(0, .87fr); } /* Contact a little wider: the e-mail addresses fit on one line */
.sama-nl { display: grid; grid-template-columns: var(--sama-foot-cols); border-block: var(--sama-line); margin-block: 0 !important; align-items: center; }
.sama-nl > .sama-label { padding: 14px 0 8px; align-self: baseline; } /* on the line of the e-mail field */
.sama-nl > .sama-newsletter-form { align-self: baseline; }
.sama-newsletter-form { grid-column: 2 / -1; display: flex; align-items: center; margin: 0; border-left: var(--sama-line); padding: 14px 0 8px var(--sama-pad); }
.sama-newsletter-form input[type=email] { flex: 1; border: 0; font: inherit; background: transparent; outline: 0; min-width: 0; padding: 0; } /* no inner padding: the text starts on the same line as the note below */
.sama-newsletter-form button { border: 1px solid var(--wp--preset--color--contrast); border-radius: 0; transition: background-color .15s ease, color .15s ease; background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); font: inherit; font-size: 13px; padding: 6px 14px; cursor: pointer; }
.sama-nl-note { grid-column: 2 / -1; margin: 0; padding: 0 0 14px var(--sama-pad); line-height: 1.4; border-left: var(--sama-line); font-size: 12px; color: var(--sama-muted); }
.sama-nl-note a { color: inherit; }
.sama-nl, .sama-newsbar { cursor: text; } /* the whole row puts the cursor in the e-mail field (motion.js) */
.sama-nl a, .sama-nl button, .sama-newsbar a, .sama-newsbar button { cursor: pointer; }
.sama-newsletter-msg { grid-column: 2 / -1; border-left: var(--sama-line); padding: 8px 0 8px var(--sama-pad); }
.sama-newsletter-msg p { margin: 0; }
.sama-newsletter-form.is-sending { opacity: .5; transition: opacity .2s ease; }
.sama-newsletter-form button { transition: background-color .2s ease, color .2s ease; }
.sama-newsletter-form button:hover { background: var(--wp--preset--color--base) !important; color: var(--wp--preset--color--contrast) !important; opacity: 1 !important; } /* black button: inverts on hover */
.sama-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sama-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; } /* honeypot: people never see or reach it */

/* ---------- Footer ---------- */
.sama-footer { padding: 0 0 84px; /* room at the very end: the back-to-top button never covers the last line */ font-size: 14px; margin-block-start: 0 !important; } /* sits directly on the newsletter line */
.sama-footer a { text-decoration: none; }
.sama-footer a[href^="mailto:"] { white-space: nowrap; } /* never broken mid-word */
.sama-footer a:hover { text-decoration: underline; }
.sama-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.sama-footer li a { display: inline-block; min-height: 24px; line-height: 24px; } /* tap targets of at least 24 px (about the old spacing) */
.sama-footer p { margin: 0; }
/* Text pages (Imprint, Privacy & legal, …): in the footer's grid – the title as a label in the first column, the
   text from the second column on, with the line between (Benedikt, 2026-11-26: not so far left). */
.sama-page { display: grid !important; grid-template-columns: var(--sama-foot-cols); align-items: start; }
.sama-page > .wp-block-post-title { grid-column: 1; margin: 0 !important; padding: 2px var(--sama-pad) 0 0; font-size: 13px; font-weight: 500; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; }
.sama-page > .wp-block-post-content { grid-column: 2 / -1; margin: 0 !important; padding-left: var(--sama-pad); border-left: var(--sama-line); }
.sama-page > .wp-block-post-content > * { max-width: 41em; margin-left: 0 !important; margin-right: 0 !important; }
.sama-page > .wp-block-post-content > :first-child { margin-top: 0 !important; }
.sama-footer-grid { display: grid; grid-template-columns: var(--sama-foot-cols); /* the same split as the newsletter row: the lines match */ border-bottom: var(--sama-line); }
.sama-footer-grid > div { padding: 18px var(--sama-pad) 28px 0; display: grid; align-content: start; gap: 10px; }
.sama-footer-grid > div + div { border-left: var(--sama-line); padding-left: var(--sama-pad); }
.sama-footer .sama-ske img { height: 20px; width: auto; display: block; }
.sama-supporters { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.sama-footer .sama-ma7 img { height: 30px; width: auto; display: block; }
.sama-footer .sama-small { color: var(--sama-muted); }
/* Wordmark: SVG text stretched to exactly the content width at any size. */
.sama-wordmark { display: block; width: 100%; height: auto; margin: 28px 0 12px; overflow: visible; font-family: var(--wp--preset--font-family--text); font-weight: 500; }
.sama-wordmark text { font-size: 138px; fill: currentColor; font-family: inherit; font-weight: inherit; }
.sama-footer-base { display: flex; justify-content: flex-start; align-items: baseline; gap: 12px 24px; padding-top: 12px; border-top: var(--sama-line); font-family: var(--sama-label); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.sama-footer-base > span:first-child, .sama-footer-legal a, .sama-sound { white-space: nowrap; }
.sama-footer-legal { display: flex; flex: 1 1 auto; gap: 24px; } /* right after the copyright (Benedikt, 2026-11-26) */

/* ---------- Motion: calm. Hovers ease in and out; pages and lists change with a quick fade. ---------- */
:root { --sama-ease: cubic-bezier(.16, .84, .24, 1); }
.sama-strip { overflow: hidden; position: relative; }

/* Plain links fade down a little on hover. */
a:not(.sama-btn):not(.sama-rel):not(.sama-ev):not(.wp-block-button__link):hover { opacity: .55; text-decoration: none; }
.sama-header .current-menu-item > a:hover { opacity: 1; }
.sama-ev:hover { opacity: .6; }

/* Page changes without reload (assets/js/spa.js): the header stays, the content fades out and in. */
.wp-site-blocks > :not(header) { transition: opacity .18s var(--sama-ease); } /* a quick fade, no movement */
.sama-leaving .wp-site-blocks > :not(header) { opacity: 0; }
.sama-entering .wp-site-blocks > :not(header) { opacity: 0; transition: none; }

/* Smooth transitions between hover and not hover. */
a, button, .sama-btn, .sama-rel, .sama-ev, .sama-years a, .wp-block-navigation-item > a {
	transition: color .45s var(--sama-ease), background-color .45s var(--sama-ease), border-color .45s var(--sama-ease), opacity .45s var(--sama-ease), text-decoration-color .45s var(--sama-ease);
}
.sama-sound { all: unset; cursor: pointer; }
.sama-sound:hover { text-decoration: underline; }

/* Covers stay in the grid; on hover they only dim a little, softly. */
.sama-cover img { transition: opacity .6s var(--sama-ease); }
.sama-rel:hover .sama-cover img { opacity: .82; }

/* Grain (Local only for now: fabric.js adds .sama-grain). Near-white noise from an inline SVG. */
.sama-grain body::before,
.sama-grain body::after {
	content: "";
	position: fixed;
	inset: -50%;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sama-grain body::before { z-index: -1; opacity: 0; transition: opacity 1.1s ease; }
.sama-grain.sama-grain-in body::before { opacity: var(--sama-grain-back, 0); }
.sama-grain body::after { z-index: 100002; opacity: 0; mix-blend-mode: multiply; animation: sama-grain .9s steps(6) infinite; transition: opacity 1.1s ease;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.62' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='2.2' intercept='-.6'/%3E%3CfeFuncG type='linear' slope='2.2' intercept='-.6'/%3E%3CfeFuncB type='linear' slope='2.2' intercept='-.6'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); /* coarser, higher-contrast grain in front */
	background-size: var(--sama-grain-front-size, 135px); }
@keyframes sama-grain {
	0% { transform: translate3d(0, 0, 0); } 20% { transform: translate3d(-4%, 3%, 0); } 40% { transform: translate3d(3%, -5%, 0); }
	60% { transform: translate3d(-6%, -2%, 0); } 80% { transform: translate3d(5%, 4%, 0); } 100% { transform: translate3d(0, 0, 0); }
}

.sama-grain.sama-grain-in body::after { opacity: var(--sama-grain-front, .305); } /* grain fades in */

/* WebGL fabric layer (assets/js/fabric.js) draws the images; the originals stay in place, invisible. */
.sama-fabric { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 5; pointer-events: none; }
.sama-gl-hidden { opacity: 0 !important; }
.sama-flag-out { position: absolute; pointer-events: none; z-index: 3; }
.sama-gl .sama-strip { overflow: visible; }
.sama-gl-textflag { color: transparent !important; }
.sama-flag-text, .sama-wordmark { cursor: default; } /* waving lettering: the normal arrow, not the text cursor */
.sama-gl .sama-strip .wp-block-cover__image-background { animation: none; }

@media (prefers-reduced-motion: reduce) {
	.sama-wave { animation: none !important; }
}

/* ---------- Grid breakpoints (--cols) ----------
   Front page and "More releases" only ever show full rows. */
@media (max-width: 1399px) { .sama-grid { --cols: 5; } }
@media (max-width: 1149px) { .sama-grid { --cols: 4; } }
@media (max-width: 959px)  { .sama-grid { --cols: 3; } }
@media (max-width: 599px)  { :root body { --wp--style--root--padding-left: 1rem !important; --wp--style--root--padding-right: 1rem !important; } } /* phones: 1 rem page margin left and right (Tilman, 2026-11-25), more room for the content */
@media (max-width: 599px)  { .sama-grid { --cols: 1; } } /* phones: one tile per row */
@media (max-width: 599px)  { .sama-grid.sama-row { --cols: 2; } } /* phones: the "More releases" row shows two side by side */
@media (max-width: 599px)  { .sama-row .sama-pre { white-space: normal; } } /* two narrow tiles: the pre-order date wraps instead of being cut */
/* Phones: the footer in one column (the e-mail addresses need the width; they never break). */
@media (max-width: 599px) {
	.sama-footer-grid { grid-template-columns: 1fr !important; }
	.sama-page { grid-template-columns: 1fr; }
	.sama-page > .wp-block-post-title { grid-column: 1; padding: 0 0 16px; }
	.sama-page > .wp-block-post-content { grid-column: 1; padding-left: 0; border-left: 0; }
	.sama-footer-grid > div, .sama-footer-grid > div + div { border-left: 0 !important; padding-left: 0 !important; }
	.sama-footer-grid > div + div { border-top: var(--sama-line); }
}
/* Index, front page (12): at 5 columns show 10 */
@media (min-width: 1150px) and (max-width: 1399px) { body.home .sama-grid > .sama-rel:nth-child(n+11) { display: none; } }
/* Index, "More releases" (6): one full row */
@media (min-width: 1150px) and (max-width: 1399px) { body.single-release .sama-grid > .sama-rel:nth-child(n+6) { display: none; } }
@media (min-width: 960px) and (max-width: 1149px) { body.single-release .sama-grid > .sama-rel:nth-child(n+5) { display: none; } }

/* ---------- One row of releases with page arrows (release pages) ---------- */
:root body .sama-grid.sama-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(100% / var(--cols)); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
:root body .sama-grid.sama-row::-webkit-scrollbar { display: none; }
.sama-row > .sama-rel { display: flex !important; grid-row: auto; scroll-snap-align: start; } /* one row of equal tiles: no shared height needed */ /* never hidden like the grid's extra covers */
/* Index lines in the row: the row draws its own right edge (it can't scroll away), each tile its left one. */
.sama-grid.sama-row { border-left: 0; border-right: var(--sama-line); }
.sama-row > .sama-rel { border-right: 0; border-left: var(--sama-line); }
.sama-row-nav { display: flex; justify-content: space-between; padding: 14px 0 0; }
.sama-row-nav button { background: none; border: 0; padding: 6px 10px; font-size: 20px; line-height: 1; color: inherit; cursor: pointer; transition: opacity .2s ease; }
.sama-row-nav button:disabled { opacity: .2; cursor: default; }
.sama-more { text-align: center; padding: 32px 0 8px; }
.sama-js .sama-more a { visibility: hidden; } /* with JavaScript the next releases come by themselves while scrolling */

/* ---------- Phones ---------- */
@media (max-width: 860px) {
	.sama-intro > .wp-block-column + .wp-block-column { border-left: 0; border-top: var(--sama-line); padding-left: 0; }
	.sama-events, .sama-release-single, .sama-nl { grid-template-columns: 1fr; }
	.sama-years { border-right: 0; border-bottom: var(--sama-line); }
	.sama-years ul { display: flex; flex-wrap: wrap; gap: 4px 14px; }
	.sama-ev { grid-template-columns: 1fr auto; padding-inline: 0; }
	.sama-empty { padding-inline: 0; }
	.sama-ev-date { grid-column: 1 / -1; }
	.sama-release-single > .wp-block-group { border-left: 0; padding-left: 0; } /* the text starts on the page margin, like the rest */
	.sama-newsletter-form { grid-column: 1 / -1; border-left: 0; padding: 0 0 12px; }
	.sama-nl-note, .sama-newsletter-msg { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
	.sama-nl > .sama-label { padding: 14px 0 8px; }
	.sama-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sama-footer-grid > div:nth-child(3) { border-left: 0; padding-left: 0; border-top: var(--sama-line); }
	.sama-footer-grid > div:nth-child(4) { border-top: var(--sama-line); }
	.sama-footer-base { flex-direction: column; gap: 6px; }
}

/* External players waiting for a click (inc/consent.php) */
.sama-consent { border: var(--sama-line); padding: 14px 16px; display: grid; gap: 10px; font-size: 14px; max-width: 45em; }
.sama-consent p { margin: 0; }
.sama-bc { overflow: hidden; border: var(--sama-line); }
.sama-bc:has(> iframe[hidden]) { display: none; }
.wp-block-embed__wrapper:has(> .sama-consent)::before { display: none !important; padding-top: 0 !important; } /* no empty player-sized space above the card (WordPress reserves the aspect ratio) */
.sama-consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.sama-consent label, .sama-privacy-settings label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.sama-privacy-settings { list-style: none; padding: 0; display: grid; gap: 6px; }
.sama-privacy-note { color: var(--sama-muted); font-size: 13px; }
