/*
 * neuoft-sharing — the gated pages (login form and archive), neuoft.org Kadence look.
 * Printed only by templates/form.php and templates/archive.php, never enqueued site-wide.
 * ⚠ System font stack on purpose: a webfont would be a request to another host from a gated page.
 */

:root {
	--paper: #FFFFFF;
	--panel: #F7FAFC;
	--tint: #EDF2F7;
	--rule: #e0d7c9;
	--ink: #1A202C;
	--text: #2D3748;
	--muted: #4A5568;
	--action: #1f6285;
	--action-hover: #58724e;
	--screen: #1A202C;
	--field: #CBD5E0;
	--error-bg: #fdecea;
	--error-rule: #f0b4ae;
	--error-ink: #8a1c13;
	--head-h: 120px;
	--gutter: 1.5rem;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
	color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--text);
	font: 400 17px/1.6 var(--font);
	font-variant-numeric: tabular-nums;
}
a { color: var(--action); text-underline-offset: 2px; }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
.nf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Safe-area aware gutter (viewport-fit=cover on notched phones). */
.wrap {
	max-width: 1204px;
	margin: 0 auto;
	padding-left: max(var(--gutter), env(safe-area-inset-left));
	padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ── Header: logo left, eye right; sticky + shrinking eye on desktop only ── */
/* ⚠ overflow-x: clip, never hidden: hidden makes the header a scroll container and the eye image would
   be cut vertically; clip only stops the eye from widening the page (no horizontal scroll). */
.nf-head { position: relative; z-index: 20; background: var(--paper); overflow-x: clip; }
.nf-head__bar { position: relative; height: var(--head-h); display: flex; align-items: flex-start; }
.nf-logo { display: block; margin-top: 10px; position: relative; z-index: 1; }
.nf-logo img { display: block; height: 104px; max-height: none; width: auto; max-width: 60vw; }
.nf-logo--text { margin-top: 34px; font-weight: 700; font-size: 22px; line-height: 1.25; color: var(--ink); text-decoration: none; max-width: 60vw; }
.nf-eye { position: absolute; top: 0; right: max(var(--gutter), env(safe-area-inset-right)); pointer-events: none; }
.nf-eye img { display: block; height: 280px; max-height: none; width: auto; transform-origin: 100% 0%; will-change: transform; }
@media (min-width: 1025px) {
	.nf-head { position: sticky; top: 0; }
	.nf-head.is-stuck { box-shadow: 0 1px 0 rgba(26, 32, 44, .12); }
}
@media (max-width: 1024px) {
	:root { --head-h: 96px; }
	.nf-logo { margin-top: 18px; }
	.nf-logo img { height: 58px; }
	.nf-eye img { height: 120px; }
	.nf-logo--text { margin-top: 30px; font-size: 19px; }
}
@media (max-width: 560px) {
	:root { --head-h: 84px; --gutter: 1rem; }
	.nf-logo img { height: 48px; }
	.nf-eye img { height: 92px; }
	.nf-logo--text { font-size: 17px; max-width: 55vw; }
}

/* ── Title ── */
.nf-title { padding: 18px 0 34px; max-width: 40rem; }
@media (min-width: 1025px) { .nf-title { padding-top: 26px; min-height: 190px; } }
.nf-title h1 { margin: 0; color: var(--ink); font-size: 46px; line-height: 1.5; font-weight: 700; }
@media (max-width: 1024px) { .nf-title h1 { font-size: 36px; } }
@media (max-width: 767px) { .nf-title h1 { font-size: 28px; line-height: 1.35; } }
.nf-title p { margin: 4px 0 0; color: var(--muted); font-size: 18px; }
.nf-title .nf-note { font-size: 15px; margin-top: 12px; }

/* ── Archive grid: player left (sticky), programme right ── */
.nf-grid { display: grid; gap: 28px 40px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; padding-bottom: 56px; }
.nf-grid > * { min-width: 0; }
/* Left column: the stage (or the gallery), the abstract under it; right: the programme across both rows.
   ⚠ rows auto 1fr: the spanning programme then never stretches the stage's row (no gap above the abstract). */
@media (min-width: 1025px) {
	.nf-grid { grid-template-areas: "stage prog" "abstract prog"; grid-template-rows: auto 1fr; }
	.nf-stage, .nf-gallery { grid-area: stage; }
	.nf-abstract { grid-area: abstract; }
	.nf-prog { grid-area: prog; }
}
.nf-stage { scroll-margin-top: calc(var(--head-h) + 12px); }
/* ⚠ Desktop pins the stage at EVERY viewport height (no min-height guard): a short laptop viewport would
   otherwise scroll the player away with the list. The short-viewport rule below keeps it fitting. */
@media (min-width: 1025px) {
	.nf-stage { position: sticky; top: calc(var(--head-h) + 16px); }
}
/* ⚠ A sticky element stays pinned across its WHOLE containing block: a player pinned in the column that also
   holds the abstract would sit over the text for the entire read. With an abstract the stage scrolls away. */
@media (min-width: 1025px) {
	.nf-grid--abstract .nf-stage { position: static; }
}
/* Desktop: the programme is the pinned part — a scroll panel whose search and day tabs never scroll away. */
@media (min-width: 1025px) {
	.nf-prog {
		position: sticky; top: calc(var(--head-h) + 16px);
		max-height: calc(100vh - var(--head-h) - 32px);
		overflow-y: auto; overscroll-behavior: contain;
	}
	/* ⚠ Behind @supports, never a second declaration (see the short-viewport rule below). */
	@supports (height: 100dvh) {
		.nf-prog { max-height: calc(100dvh - var(--head-h) - 32px); }
	}
	/* The search, the count and the day tabs share one opaque sticky head, so they never scroll away or overlap. */
	.nf-prog .nf-prog__head { position: sticky; top: 0; z-index: 2; background: var(--paper); padding-bottom: 6px; }
}
/* ⚠ Short desktop viewport (≤ 800 px; the full 635 px stage pinned at 136 px needs ~771): the key hint,
   the reload tip under it and the place line are hidden, and the player is scaled by height, left-aligned
   like the title. Reserve 176px under it = 16 margin + the buttons (44 + 12) + a 2-line title (2 × 33.6)
   + speakers (33.2), so the buttons (above the title) stay visible; the 200px-high floor (356 px wide)
   still fits whole down to a ~340 px viewport, the rest then going below the fold. 100vh everywhere,
   100dvh where supported. */
@media (min-width: 1025px) and (max-height: 800px) {
	#nf-keys, .nf-reload-hint, .nf-now__where { display: none; }
	.nf-stage .nf-player { width: min(100%, max(calc((100vh - var(--head-h) - 16px - 176px) * 16 / 9), calc(200px * 16 / 9))); }
	/* ⚠ Behind @supports, never a second declaration: with var() inside, an unsupported dvh is only
	   rejected at computed-value time and falls to width: auto instead of the 100vh line above. */
	@supports (height: 100dvh) {
		.nf-stage .nf-player { width: min(100%, max(calc((100dvh - var(--head-h) - 16px - 176px) * 16 / 9), calc(200px * 16 / 9))); }
	}
}
@media (max-width: 1024px) {
	.nf-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.nf-stage {
		z-index: 10; background: var(--paper);
		margin: 0 calc(-1 * max(var(--gutter), env(safe-area-inset-left)));
		padding: 8px max(var(--gutter), env(safe-area-inset-left)) 12px;
		border-bottom: 1px solid var(--rule);
		scroll-margin-top: 0;
	}
	/* ⚠ The pinned player never takes more than ~45 % of the viewport height, so the list below stays
	   usable (tablet landscape 1024×768 would otherwise pin a 550 px player). */
	.nf-stage .nf-player { width: min(100%, calc(45vh * 16 / 9)); margin: 0 auto; }
}
/* Pinned above the list only when the screen is tall enough; a phone in landscape scrolls instead. */
@media (max-width: 1024px) and (min-height: 560px) {
	.nf-stage { position: sticky; top: 0; }
}

/* ── Gallery (the default view): 3 per row ≥ 1025 px, 2 at 561–1024 px, 1 below ── */
.nf-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1024px) { .nf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .nf-tiles { grid-template-columns: minmax(0, 1fr); } }
.nf-tile__link { display: block; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: var(--tint); color: var(--ink); text-decoration: none; border: 1px solid var(--rule); }
.nf-tile__link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nf-tile__text { display: flex; align-items: center; justify-content: center; height: 100%; padding: 12px; text-align: center; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.nf-tile__link:hover { border-color: var(--action); }
.nf-tile__link:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.nf-back { margin: 0 0 12px; }
.nf-back a { font-weight: 600; }
/* "Hledat v programu ↓": phones and tablets only. */
.nf-jump-wrap { margin: 0 0 12px; }
@media (min-width: 1025px) { .nf-jump-wrap { display: none; } }

/* ── Abstract (below the now-playing block) ── */
.nf-abstract { margin-top: 0; color: var(--text); max-width: 48rem; }
.nf-abstract h3 { margin: 18px 0 6px; font-size: 18px; font-weight: 700; color: var(--action); }
.nf-abstract p { margin: 0 0 10px; }
.nf-abstract .nf-abs-authors { font-size: inherit; }
.nf-abstract .nf-abs-authors sup, .nf-abstract .nf-abs-aff sup { font-size: .7em; }
.nf-abstract .nf-abs-aff { font-size: 14px; color: var(--muted); }
@media (min-width: 1025px) { .nf-abstract p, .nf-abstract li { text-align: justify; hyphens: auto; } }

.nf-player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--screen); border-radius: 4px; overflow: hidden; color: #E8F0F2; }
.nf-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nf-player__error, .nf-player__reload { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #E8F0F2; background: var(--screen); font-size: 16px; }
.nf-player__error a { color: #fff; }
.nf-player__reload button { font: 600 16px/1.2 var(--font); color: var(--ink); background: #fff; border: 0; border-radius: 6px; padding: 12px 18px; min-height: 44px; cursor: pointer; }

.nf-now { margin-top: 16px; }
.nf-now h2 { margin: 0; color: var(--ink); font-size: 24px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.nf-now__who { margin: 6px 0 0; overflow-wrap: anywhere; }
.nf-now__where { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.nf-now__nav { display: flex; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.nf-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
	font: 600 16px/1.1 var(--font); color: var(--action); background: #fff; text-decoration: none;
	border: 2px solid var(--action); border-radius: 6px; padding: 10px 18px; cursor: pointer;
}
.nf-btn:hover { background: var(--action-hover); border-color: var(--action-hover); color: #fff; }
.nf-btn[aria-disabled="true"], .nf-btn[aria-disabled="true"]:hover { opacity: .4; cursor: default; background: #fff; color: var(--action); border-color: var(--action); }
.nf-btn--small { min-height: 36px; padding: 6px 12px; font-size: 15px; }
.nf-help { color: var(--muted); font-size: 15px; margin: 14px 0 0; }
/* The reload tip, directly under the key hint: very small, muted. */
.nf-reload-hint { color: var(--muted); font-size: 12px; line-height: 1.4; margin: 4px 0 0; }
.nf-expiry { margin: 10px 0 0; padding: 10px 12px; background: var(--tint); border-left: 3px solid var(--action); font-size: 15px; }
@media (max-width: 1024px) {
	.nf-now { margin-top: 10px; }
	.nf-now h2 { font-size: 18px; }
	.nf-now__who { font-size: .9rem; margin-top: 2px; }
	.nf-now__where, .nf-now__nav, .nf-stage .nf-help, .nf-reload-hint { display: none; }
}

/* ── Programme ── */
.nf-search label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.nf-search input { width: 100%; font: 400 17px/1.4 var(--font); color: var(--text); background: #fff; border: 1px solid var(--field); border-radius: 3px; padding: 10px 12px; }
.nf-search input:focus-visible { outline-offset: 0; border-color: var(--action); }
.nf-count { margin: 8px 0 0; color: var(--muted); font-size: .9rem; min-height: 1.4em; }
.nf-days { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.nf-days a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 16px; text-decoration: none; padding: 7px 14px; border-radius: 6px; color: var(--ink); background: var(--tint); }
.nf-days a:hover { color: #fff; background: var(--action); }

.nf-day { margin-top: 26px; scroll-margin-top: calc(var(--head-h) + 12px); }
.nf-day > h3 { margin: 0 0 4px; font-size: 24px; line-height: 1.5; color: var(--ink); font-weight: 700; }
.nf-block { margin-top: 16px; border-top: 2px solid var(--action); }
.nf-block__head { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); gap: 10px; padding: 9px 0 7px; }
.nf-block__time { font-weight: 700; color: var(--action); white-space: nowrap; }
.nf-block__name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.nf-talks { list-style: none; margin: 0; padding: 0; }
.nf-talk { border-top: 1px solid var(--rule); }
.nf-block > .nf-talks > .nf-talk:first-child { border-top: 0; }
.nf-block__head + .nf-talks > .nf-talk:first-child { border-top: 1px solid var(--rule); }
.nf-talk__link {
	display: grid; grid-template-columns: 6.6em minmax(0, 1fr); gap: 10px; align-items: baseline;
	padding: 10px 8px 11px 0; border-left: 3px solid transparent; color: inherit; text-decoration: none;
}
.nf-talk__link:hover { background: var(--panel); color: inherit; }
.nf-talk__link:focus-visible { outline: 3px solid var(--action); outline-offset: -3px; border-radius: 3px; }
.nf-talk__link[aria-current="true"] { background: var(--tint); border-left-color: var(--action); }
.nf-talk__k { color: var(--action); font-weight: 600; font-size: 15px; padding-left: 8px; }
.nf-talk__main { min-width: 0; }
.nf-talk__title { display: block; font-weight: 600; color: var(--text); line-height: 1.35; overflow-wrap: anywhere; }
.nf-talk__who { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; line-height: 1.4; overflow-wrap: anywhere; }
.nf-talk__state { display: block; color: var(--action); font-size: .85rem; font-weight: 600; margin-top: 3px; }
.nf-talk__kin { display: none; }
.nf-empty { margin-top: 22px; padding: 16px 0; border-top: 2px solid var(--action); }
.nf-empty p { margin: 0 0 12px; }
@media (max-width: 1024px) {
	.nf-block__head { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.nf-talk__link { grid-template-columns: minmax(0, 1fr); padding-left: 10px; }
	.nf-talk__k { display: none; }
	.nf-talk__kin { display: inline; color: var(--muted); font-weight: 400; margin-right: .2em; }
}

/* ── PDFs and empty archive ── */
.nf-pdfs { padding: 8px 0 48px; border-top: 1px solid var(--rule); }
.nf-pdfs h2 { color: var(--ink); font-size: 24px; margin: 24px 0 4px; }
.neuoft-files { list-style: none; margin: 12px 0 0; padding: 0; }
.neuoft-files li { padding: 10px 0; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.neuoft-files a { font-weight: 600; }
.neuoft-files-meta { color: var(--muted); font-size: 14px; margin-left: 6px; }
.nf-empty-archive { padding-bottom: 56px; max-width: 40rem; }

/* ── Login form ── */
.nf-login { max-width: 32rem; padding-bottom: 64px; }
.nf-lead { margin: 0 0 4px; }
.nf-field { margin-top: 20px; }
.nf-field label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
/* 17px: iOS zooms into any input below 16px. */
.nf-field input { width: 100%; font: 400 17px/1.4 var(--font); background: #fff; border: 1px solid var(--field); border-radius: 3px; padding: 11px 12px; color: var(--text); }
.nf-field input:focus-visible { outline-offset: 0; border-color: var(--action); }
.nf-hint { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.nf-check { margin-top: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; }
.nf-check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--action); }
.nf-check label { font-weight: 600; color: var(--ink); }
.nf-check .nf-hint { grid-column: 2; margin: 0; }
.nf-submit { margin-top: 24px; min-height: 48px; font: 700 18px/1.2 var(--font); color: #fff; background: var(--action); border: 0; border-radius: 6px; padding: 16px 28px; cursor: pointer; box-shadow: 0 8px 18px rgba(0, 0, 0, .18), 0 2px 0 rgba(0, 0, 0, .25); }
.nf-submit:hover { background: var(--action-hover); }
@media (max-width: 560px) { .nf-submit { width: 100%; } }
.nf-error { margin: 16px 0 0; padding: 12px 14px; border-radius: 6px; background: var(--error-bg); border: 1px solid var(--error-rule); color: var(--error-ink); font-size: 16px; }
.nf-login details { margin-top: 30px; border-top: 1px solid var(--rule); padding-top: 14px; }
.nf-login summary { cursor: pointer; font-weight: 600; color: var(--action); min-height: 32px; }
.nf-login details p { color: var(--muted); font-size: 16px; }

/* ── Required boxes, privacy line, the notice for professionals (login form and interstitial) ── */
.nf-check--required label { font-weight: 400; color: var(--text); }
.nf-privacy-line { margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.nf-btn--primary { color: #fff; background: var(--action); }
.nf-pro { max-width: 40rem; margin: 0 0 56px; padding: 18px 20px; background: var(--panel); border-left: 3px solid var(--action); scroll-margin-top: calc(var(--head-h) + 12px); }
.nf-pro h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.35; color: var(--ink); }
.nf-pro p { margin: 0 0 10px; }
.nf-pro__actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }
/* With assets/archive.js the block is a modal dialog over a dimmed page. */
.nf-pro--modal { position: fixed; inset: 0; z-index: 100; max-width: none; margin: 0; padding: 16px; border: 0; background: rgba(26, 32, 44, .55); display: flex; align-items: center; justify-content: center; }
.nf-pro--modal .nf-pro__box { max-width: 40rem; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--paper); border-radius: 6px; padding: 22px 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.nf-pro--modal .nf-pro__box:focus { outline: none; }

/* ── Footer ── */
.nf-foot { background: var(--panel); border-top: 1px solid var(--rule); padding: 16px 0 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 15px; }
.nf-foot__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.nf-foot__links { margin: 0; }
.nf-foot__logout { margin: 0; }

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; }
	.nf-eye img { will-change: auto; }
}
@media print {
	.nf-head, .nf-stage, .nf-search, .nf-days, .nf-foot__logout { display: none !important; }
}
