/*
 * Shared portal theme (pkg/cmsportal/theme): design tokens, base reset and
 * the page shell (header, nav, footer, cookie-consent trigger). Bricks style
 * themselves in portal-cards.css/portal-news.css/portal-events.css/
 * portal-calendar.css/portal-detail.css/portal-account.css, all served
 * alongside this file under one asset hash (theme.go StylesheetURLs). A
 * portal's look comes only from its design tokens (--portal-*, store data:
 * stores.config_json portal.tokens); the defaults below are a neutral light
 * design. Bricks carry semantic markup; CSS styles them by class and
 * data-portal-variant.
 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-bold.woff2") format("woff2"); }

:root {
  --portal-bg: #fbfaf8;
  --portal-surface: #ffffff;
  --portal-surface-alt: #f4f2ee;
  --portal-card-bg: var(--portal-surface);
  --portal-text: #111418;
  --portal-muted: #545659;
  --portal-subtle: #85868a;
  --portal-border: #e0dfdd;
  --portal-accent: #1b60b3;
  --portal-accent-ink: #ffffff;
  --portal-header-bg: var(--portal-bg);
  --portal-footer-bg: var(--portal-surface);
  /* nav_link: idle colour of a primary nav link. Evidence (fix round 1,
     2026-09-19): prod resolves ".news-shell-nav-link"/".news-shell-mobile-link"
     with NO colour rule on the dark host (inherits full text colour) but an
     explicit ".news-theme-light .news-shell-nav-link{color:var(--text-med)}"
     override on the light host — two real per-store values neither "text" nor
     a fixed "muted" alone can express for every store, so a store opts into
     the dimmer look by setting this token; unset stores keep full text. */
  --portal-nav-link: var(--portal-text);
  --portal-radius: 14px;
  --portal-font: Inter, ui-sans-serif, system-ui, sans-serif;
  --portal-font-heading: var(--portal-font);
  --portal-max-width: 80rem;
  /* Gutter: prod's px-6 utility is a flat 24px at every width (mob main
     column 342 = 390-48; desk container 1232 = 1280-48). A clamp() that
     bottoms out at 1rem (16px) below ~48rem was shrinking every mobile pair
     below prod (fix round 2, W1 evidence). */
  --portal-gutter: 1.5rem;
  --portal-gap: clamp(1rem, 2vw, 1.5rem);
  --portal-shadow: 0 18px 40px -24px color-mix(in srgb, var(--portal-text) 45%, transparent);
}

/* Base reset. border-style/border-width match the legacy Tailwind preflight
   (every element pre-declares a solid, zero-width border), so a component
   only needs to set border-*-width to draw a line; this keeps border-style
   from ever showing as a page-frame diff against prod. */
/* border-color defaults to the token too, matching the legacy Tailwind
   preflight ("*,::after,::before{border-color:var(--border, currentColor)}")
   so a component that only sets border-*-width never falls back to
   currentColor (fix round 2, W1 evidence: prod's border colour on a
   zero-width edge is always the border token, never inherited text colour). */
*, *::before, *::after { box-sizing: border-box; border-style: solid; border-width: 0; border-color: var(--portal-border); }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--portal-bg); color: var(--portal-text);
  font-family: var(--portal-font); font-size: 1rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* Scrollbars: prod's global ::-webkit-scrollbar rules (index.css, fix round 4)
 * with the token mapping --bg-level-0 -> --portal-bg, --bg-level-3 ->
 * --portal-surface-alt, --text-low -> --portal-subtle, radius var(--phi) =
 * 1.618px; scrollbar-color is the same look for engines without the
 * ::-webkit- pseudo-elements. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--portal-bg); }
::-webkit-scrollbar-thumb { background: var(--portal-surface-alt); border-radius: 1.618px; border: 2px solid var(--portal-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--portal-subtle); }
* { scrollbar-color: var(--portal-surface-alt) var(--portal-bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--portal-accent); }
:focus-visible { outline: 2px solid var(--portal-accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--portal-font-heading); line-height: 1.15; }
/* Block margins: prod ships the Tailwind preflight, which zeroes the user-agent
   margin of every heading, paragraph, quote and figure, so each ported rule
   states its own spacing. Resetting only h1-h3 left the UA margin on every
   h4/h5/h6 and <p> the port does not name: the inline promo measured 291px
   against prod's 217px (h4 1.33em twice plus the body <p>'s 1em = 74.3px),
   article paragraphs carried 16px prod has not, and the legal card ran 48px
   long (style-diff zo-p2-inlinepromo/zo-p3-body/zo-p4-privacy-card, 2026-09-20). */
h1, h2, h3, h4, h5, h6, p, blockquote, figure, figcaption, dl, dd, pre { margin: 0; }

.portal-skip-link { position: absolute; left: -999px; top: 0; z-index: 60; padding: .5rem 1rem; background: var(--portal-accent); color: var(--portal-accent-ink); }
.portal-skip-link:focus { left: 1rem; top: 1rem; }

/* Header: fixed (not sticky) and blurred, matching prod exactly; border-color
   and box-shadow are set on every side like the legacy "border-border"
   utility even though only the bottom edge carries width. */
.portal-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  /* Use the token as-is: prod renders header_bg literally (hs #0d0e10, zo
     #fbfaf9), it never darkens it (fix round 2, W1 evidence). */
  background: var(--portal-header-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-color: var(--portal-border); border-bottom-width: 1px;
  box-shadow: 0 12px 30px rgba(12, 16, 24, .08);
}
.portal-header-inner {
  max-width: var(--portal-max-width); margin: 0 auto; padding: 0 var(--portal-gutter); min-height: 4rem;
  display: flex; align-items: center; justify-content: space-between; gap: clamp(1rem, 3vw, 2.5rem);
}
.portal-brand { display: inline-flex; align-items: center; font-weight: 700; font-size: 1.25rem; line-height: calc(1.75 / 1.25); letter-spacing: -.05em; white-space: normal; color: var(--portal-text); }
.portal-brand:hover { color: var(--portal-text); }
@media (width>=48rem) {
  .portal-brand { font-size: 1.5rem; line-height: calc(2 / 1.5); }
}
.portal-brand-accent { color: var(--portal-accent); white-space: pre; }
.portal-brand-logo { height: 2rem; width: auto; }
.portal-header-brand-group { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); flex-shrink: 0; }
/* Stacked wordmark (two-line brand, e.g. "HASIČSKÝ" / "ŠPORT"): Wordmark.Stacked
   (pkg/cmsportal/site.go) reuses Text as line 1 and Accent as line 2. Line 1's
   colour is the one literal prod keeps on both a dark and a light host
   (verbatim white in the legacy markup), so it stays a literal, not a token. */
.portal-brand-stack { display: inline-flex; flex-direction: column; align-items: flex-start; text-transform: uppercase; line-height: .82; }
.portal-brand-stack-line1 { font-size: .72em; font-weight: 700; letter-spacing: .22em; color: #fff; }
.portal-brand-stack-line2 { margin-top: .125rem; font-size: .58em; font-weight: 700; letter-spacing: .32em; color: var(--portal-accent); }

/* Desktop nav (hidden below lg; the always-visible bottom tab row below is
   .portal-nav-mobile, a separate element like prod's, not a reflow of this
   one). An external link (no href match, opens elsewhere) carries no
   padding/underline on prod; an internal link always reserves the 2px
   underline track, coloured only when active. */
.portal-nav { display: none; align-items: center; gap: 1.5rem; font-size: .875rem; font-weight: 700; }
/* line-height: an absolute 1.25rem (20px), not the 1.4286 em-ratio prod's
   own utility resolves to (14px * 1.4286 = 20.0004px, a sub-pixel rounding
   diff against prod's exact 20px; fix round 2, W1 evidence). */
.portal-nav-link { color: var(--portal-nav-link); line-height: 1.25rem; border-color: var(--portal-border); border-bottom-width: 2px; padding: .25rem 0; transition: color .15s; }
.portal-nav-link[data-portal-nav-external] { padding: 0; border-bottom-width: 0; }
/* Only :hover brightens to full text colour; the active (aria-current) link
   keeps the idle nav-link colour like prod (the active item still carries
   the base nav-link class the light host dims — only its underline differs,
   via border-bottom-color below). */
.portal-nav-link:hover { color: var(--portal-text); }
/* border-color shorthand (all four sides), matching prod's active link, which
   sets border-color on every side even though only bottom carries width. */
.portal-nav-link[aria-current="page"] { border-color: var(--portal-accent); }

/* Mobile nav: an always-visible bottom tab row below the header bar, not a
   hamburger/drawer (prod has neither a toggle button nor an open/close
   state for it — it is simply hidden at >=lg via the responsive rule below,
   which must stay after this base rule to win the cascade). */
.portal-nav-mobile { display: flex; align-items: center; justify-content: space-around; border-color: var(--portal-border); border-top-width: 1px; padding: .5rem 0; font-size: .6875rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.portal-nav-mobile-link { color: var(--portal-nav-link); transition: color .15s; }
.portal-nav-mobile-link:hover, .portal-nav-mobile-link[aria-current="page"] { color: var(--portal-accent); }

/* Page frame (every layout, not one brick's concern) */
main[data-portal-layout] { max-width: var(--portal-max-width); margin: 0 auto; padding: 6rem var(--portal-gutter) 4rem; }
/* Prod's archive wraps its grid as div.px-6 > div.max-w-7xl: the 80rem cap is
   the CONTENT box and the gutter sits outside it (1280px content vs the home
   page's 1232px), so the archive card measures 296px, not 290px. */
main[data-portal-layout="portal_event_archive"] { max-width: none; }
main[data-portal-layout="portal_event_archive"] > * { max-width: var(--portal-max-width); margin-inline: auto; }
main [data-portal-node="page_shell"], main [data-portal-node="stack"] { display: flex; flex-direction: column; gap: clamp(1.5rem, 3vw, 2.5rem); min-width: 0; }
/* Mobile-first: base is one column (matches prod at every viewport below its
   own breakpoint); each variant only ever ADDS its multi-column mode at
   min-width, so there is no higher-specificity rule left to out-rank a later
   "collapse" override (fix round 1 evidence: the 2.7:1 weighted variant kept
   its two columns below 64rem because a same-specificity collapse rule at
   max-width:1023px could never beat this selector's own extra attribute
   selector — main column measured 238px instead of prod's full-width 342px). */
[data-portal-variant="portal_columns"] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4rem; align-items: start; }
[data-portal-variant="portal_columns"][data-portal-weights="2.7,1"] { gap: 2rem; }
[data-portal-variant="portal_aside"] { display: flex; flex-direction: column; gap: 1.5rem; }
@media (width>=64rem) {
  [data-portal-variant="portal_columns"] { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  [data-portal-variant="portal_aside"] { position: sticky; top: 5.5rem; }
}
/* The event detail page is prod's twelve-column grid ("grid grid-cols-1
   lg:grid-cols-12 gap-16", main "lg:col-span-8", aside "lg:col-span-4"):
   twelve real tracks, because the eleven 4rem gaps inside them are what make
   the columns measure 800px and 368px in the 1232px page - an 8fr:4fr split
   of the same row would give 779px and 389px. compose.go emits the 8,4
   weights for PortalPublicRouteKindEventDetail only. */
@media (width>=64rem) {
  [data-portal-variant="portal_columns"][data-portal-weights="8,4"] { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  [data-portal-variant="portal_columns"][data-portal-weights="8,4"] > :first-child { grid-column: span 8; }
  [data-portal-variant="portal_columns"][data-portal-weights="8,4"] > :last-child { grid-column: span 4; }
}
/* Same page, its side rail: prod spaces the event detail boxes "space-y-12"
   (3rem) and leaves the column in flow, while every other page keeps the
   1.5rem sticky rail above. The page kind is already on the root stack
   (compose.go RootVariant "portal_" + page kind), so no new attribute and no
   tenant name is needed to tell the two apart. */
[data-portal-variant="portal_event_detail"] [data-portal-variant="portal_aside"] { gap: 3rem; }
@media (width>=64rem) {
  [data-portal-variant="portal_event_detail"] [data-portal-variant="portal_aside"] { position: static; top: auto; }
}
/* The 2.7:1 home/article split (news-layout-home-grid/news-layout-article-grid)
   switches at prod's own 990px breakpoint, narrower than the generic 64rem
   split above. */
@media (width>=61.875rem) {
  [data-portal-variant="portal_columns"][data-portal-weights="2.7,1"] { grid-template-columns: minmax(0, 2.7fr) minmax(0, 1fr); }
}
/* The same split's two columns are prod's own boxes: both stacks space their
   blocks "space-y-8" (2rem, not the generic stack clamp's 2.5rem), and the rail
   column carries "border-l border-white/10 pl-6" at every width - the hairline
   plus 1.5rem that make the rail's content 299px inside the 324px track
   (style-diff zo-p2-railbanner: 324x123 against prod's 299x115, 2026-09-20).
   The hairline is a token: the light host repaints exactly this column
   (`.news-theme-light .news-rail-column{border-color:var(--border)}`). */
[data-portal-variant="portal_columns"][data-portal-weights="2.7,1"] > [data-portal-variant="portal_main"],
[data-portal-variant="portal_columns"][data-portal-weights="2.7,1"] > [data-portal-variant="portal_aside"] { gap: 2rem; }
[data-portal-variant="portal_columns"][data-portal-weights="2.7,1"] > [data-portal-variant="portal_aside"] {
  border-color: var(--portal-border); border-left-width: 1px; padding-left: 1.5rem;
}

/* Header/inline search (brick markup, styled here because the header uses
   it directly; portal-cards.css also applies to any other .portal-search) */
.portal-search { display: flex; gap: .5rem; align-items: stretch; max-width: 36rem; }
/* The label stays a non-flex (block) box so the input inside it is never a
   flex item itself: a flex item's "inline-block" display computes as
   blockified "block" (CSS Display §2.7), which was making the input's
   display compute as "block" instead of prod's "inline-block". */
.portal-search-label { position: relative; display: block; flex: 1; }
.portal-search-label-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.portal-search-input {
  width: 100%; font: inherit; font-size: .875rem; line-height: calc(1.25 / .875); min-height: 0; color: var(--portal-text); background: var(--portal-surface);
  border-color: var(--portal-border); border-width: 1px; border-radius: var(--portal-radius); padding: .375rem 1rem .375rem 2.25rem;
  transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s;
}
.portal-search-input::placeholder { color: var(--portal-subtle); }
.portal-search-input:focus { outline: none; border-color: var(--portal-accent); box-shadow: 0 0 0 1px var(--portal-accent); }
.portal-search-submit {
  font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
  border-width: 0; border-radius: calc(var(--portal-radius) - 2px); padding: 0 1.1rem; background: var(--portal-accent); color: var(--portal-accent-ink);
}
/* Header search (Site.HeaderSearch): the same brick markup, grown to fill
   the header between the brand/nav group and the header's end, with a
   leading icon the plain body search form does not carry. */
.portal-header-search { flex: 1; max-width: 28rem; margin: 0; }
.portal-header-search-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--portal-subtle); display: flex; }
/* Header actions + account icon link: legacy header.templ "flex items-center
   gap-2 md:gap-4" and "p-2 hover:bg-white/5 rounded-xl transition-all
   text-text-low hover:text-highlight" with a "w-5 h-5 md:w-6 md:h-6" user
   icon, resolved from prod CSS. text-text-low is a no-op on prod (unknown
   class), so the idle colour inherits; the 5% white hover wash is the one
   literal prod renders on both the dark and the light host. */
.portal-header-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.portal-header-account { display: inline-flex; padding: .5rem; border-radius: calc(var(--portal-radius) + 4px); color: inherit; transition: all .15s cubic-bezier(.4, 0, .2, 1); }
.portal-header-account svg { width: 1.25rem; height: 1.25rem; }
@media (hover:hover) {
  .portal-header-account:hover { background-color: rgba(255, 255, 255, .05); color: var(--portal-accent); }
}
@media (width>=48rem) {
  .portal-header-actions { gap: 1rem; }
  .portal-header-account svg { width: 1.5rem; height: 1.5rem; }
}

/* Footer: 3-column (brand / legal / mission), then centered copyright rule */
.portal-footer { background: var(--portal-footer-bg); border-color: var(--portal-border); border-top-width: 1px; padding: 3rem 1.5rem; }
@media (width>=48rem) {
  .portal-footer { padding-block: 6rem; }
}
.portal-footer-inner { max-width: var(--portal-max-width); margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.portal-footer-heading { font-size: .75rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--portal-accent); margin-bottom: 1rem; }
.portal-footer-tagline { font-size: .625rem; letter-spacing: .2em; text-transform: uppercase; color: var(--portal-subtle); margin: 1rem 0 0; max-width: 18rem; line-height: 1.625; }
.portal-footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; font-size: .875rem; font-weight: 500; }
.portal-footer-links a, .portal-footer-link-button { display: flex; align-items: center; gap: .75rem; color: var(--portal-muted); }
.portal-footer-link-button { font: inherit; border-width: 0; padding: 0; background: none; cursor: pointer; }
.portal-footer-links a:hover, .portal-footer-link-button:hover { color: var(--portal-text); }
.portal-footer-mission p { margin: 0; color: var(--portal-muted); font-size: .875rem; line-height: 1.625; }
/* Footer credit row (legacy footer.templ, after the mission paragraph):
   "flex items-center gap-2 text-[10px] font-medium uppercase tracking-widest
   text-text-low" inside the mission column's space-y-6, with a 12px red
   heart (h-3 w-3, fill/stroke red literal on both hosts). text-text-low is
   a no-op on prod, so the words inherit the footer colour. */
.portal-footer-credit { display: flex; align-items: center; gap: .5rem; margin-top: 1.5rem; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; }
.portal-footer-credit svg { width: .75rem; height: .75rem; flex-shrink: 0; }
.portal-footer-copyright { max-width: var(--portal-max-width); margin: 3rem auto 0; padding-top: 3rem; border-color: var(--portal-border); border-top-width: 1px; text-align: center; font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; color: var(--portal-subtle); }

/* The cookie-consent dialog the footer trigger above opens lives in
   portal-consent.css (shell component, A13); only the trigger button itself
   is part of the page frame. */

/* Responsive */
@media (min-width: 1024px) {
  .portal-nav { display: flex; }
  .portal-nav-mobile { display: none; }
}
@media (max-width: 767px) {
  .portal-footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .portal-search { max-width: none; }
  /* Must come after ".portal-search { max-width: none }" above (equal
     specificity, later source wins) so the header search keeps its own,
     narrower mobile width instead of growing to fill the header row. */
  .portal-header-search { max-width: 11.5rem; }
  .portal-search-input { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
