/* ============================================================
   CATALOG — v5 Tailwind neutral + Inter
   Minimal custom CSS: animations, map pins, Leaflet overrides
   ============================================================ */

/* --- Prevent scrollbar layout shift --- */
html { scrollbar-gutter: stable; }

/* --- Paleta: teplý povrch + jantar = ruka redakce (decisions.md 2026-10-09) ---
   Neutrální zůstává páteří (text, UI, tlačítka, pozadí). Teplý povrch jen pro moduly,
   které redakce dělá nebo za ně ručí (slib, ilustrace Života v okolí); jantar jen drobné
   značky a odkazy v nich. Nikdy výplň CTA, nikdy signál stavu, nikdy pod fotkami developera. */
:root {
  --ul-warm: #f4f0e9;          /* teplý pískový povrch */
  --ul-amber: #fbbf24;         /* amber-400: kroužky, značky */
  --ul-amber-ink: #92400e;     /* amber-800: odkaz v teplém modulu (6,2 : 1 na --ul-warm) */
  --ul-amber-ink-hover: #78350f;
}

/* --- Inter variable font --- */
:root {
  font-family: Inter, sans-serif;
}
@supports (font-variation-settings: normal) {
  :root { font-family: InterVariable, sans-serif; }
}

/* --- Selection --- */
::selection {
  background-color: #262626;
  color: #fff;
}

/* --- Text wrap on headings --- */
h1, h2, h3, h4, h5, h6 {
  text-wrap: pretty;
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* --- Hero Ken Burns --- */
.hero-bg-slide {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center 35%;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  will-change: opacity, transform;
}
.hero-bg-slide.active {
  opacity: 1;
  animation: kenBurns 8s ease-in-out forwards;
}
@keyframes kenBurns {
  0%   { transform: scale(1); }
  100% { transform: scale(1.06) translate(-0.4%, -0.6%); }
}

/* --- Hero entry animations --- */
@keyframes heroUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.anim-hero-up   { animation: heroUp 1s cubic-bezier(0.16,1,0.3,1) 0.3s both; }
.anim-hero-up-2 { animation: heroUp 1s cubic-bezier(0.16,1,0.3,1) 0.45s both; }
.anim-hero-up-3 { animation: heroUp 1s cubic-bezier(0.16,1,0.3,1) 0.6s both; }
.anim-hero-fade { animation: heroFade 0.8s cubic-bezier(0.16,1,0.3,1) 0.8s both; }

/* --- Hero scroll pulse --- */
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50%      { opacity: 1; transform: scaleY(1); }
}
.hero-scroll-line {
  animation: scrollPulse 2.5s ease-in-out infinite;
}

/* --- Hero title fade --- */
.hero-title-fade {
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.hero-title-fade.fade-out {
  opacity: 0;
  transform: translateY(8px);
}
.hero-title-fade.fade-in {
  opacity: 0;
  transform: translateY(-8px);
}

/* --- Hero progress bar --- */
#hero-progress-bar {
  transform: scaleX(0);
  transform-origin: left;
}

/* Lišta menu při scrollu + hamburger: css/nav.css (načítá ho catalogue/views/parts/nav.php) */

/* --- Filter select arrow --- */
.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' fill='none'%3E%3Cpath d='M1 1l3.5 3L8 1' stroke='%23a3a3a3' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}

/* --- Map pin styles --- */
.map-pin-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #262626;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.map-pin-circle:hover,
.map-pin-circle.active {
  background: #000;
  transform: scale(1.15);
}

/* --- Map panel transition --- */
.map-panel {
  transform: translateX(calc(100% + 24px));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.map-panel.open { transform: translateX(0); pointer-events: auto; }

/* --- Leaflet desaturation --- */
.catalog-map {
  filter: saturate(0.12) brightness(1.06) contrast(0.9);
  transition: filter 0.6s ease;
}
.map-wrap:hover .catalog-map {
  filter: saturate(0.22) brightness(1.04) contrast(0.92);
}

/* --- Leaflet zoom control overrides --- */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  border: 1px solid #e5e5e5 !important;
  background: #fff !important;
  color: #262626 !important;
  font-size: 18px !important;
  font-weight: 300 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color 0.2s, background 0.2s;
}
.leaflet-control-zoom a:hover {
  background: #fafafa !important;
  border-color: #a3a3a3 !important;
  color: #262626 !important;
}

/* --- Hide Leaflet attribution --- */
.leaflet-control-attribution { display: none !important; }

/* --- No-results (JS toggled) --- */
.no-results { display: none; }

/* --- Focus ring --- */
:focus-visible {
  outline: 2px solid #262626;
  outline-offset: 3px;
}

/* --- Reduced motion: scroll reveal shows content immediately --- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   EDITORIAL SERIF: Literata names content, Inter runs the UI.
   Content = titles of articles, guides, Týden, projects, developers,
   suppliers (cards + detail H1). Section/UI headings stay Inter.
   Values are the homepage hero's (.hs-title / .hs-item-title).
   Literata is loaded once in catalogue/views/parts/head.php.
   One token replaces every type utility on the element (size, weight,
   tracking, leading, colour); layout utilities stay.
   ============================================================ */

/* Georgia scaled to Literata's metrics, so the font swap doesn't rewrap the
   title (CLS). Measured in Chromium on the real hero titles: Literata runs
   5.8 % wider at the 30px mobile title, 7.4 % at 18px strip titles; ascent
   1.18em, descent 0.31em (overrides are relative to the adjusted size). */
@font-face {
  font-family: 'Literata Fallback';
  src: local('Georgia');
  size-adjust: 106%;
  ascent-override: 111%;
  descent-override: 29%;
  line-gap-override: 0%;
}

.ed-display,
.ed-card {
  font-family: 'Literata', 'Literata Fallback', Georgia, serif;
  font-optical-sizing: auto;
  color: #171717;
}
.ed-display {                 /* content H1, listing lead, featured headline */
  font-size: clamp(1.875rem, 1.35rem + 1.2vw, 2.75rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.ed-card {                    /* every card / list / map-panel title */
  font-size: 1.125rem;
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
/* Linked title: the hero's underline, shown while the card (.group) is hovered/pressed */
.ed-link {
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
@media (hover: hover) {
  .group:hover .ed-link { text-decoration-color: #a3a3a3; }
}
@media (hover: none) {
  .group:active .ed-link { text-decoration-color: #a3a3a3; }
}
/* The press underline is the touch feedback, so no grey tap box on top of it.
   iOS needs a touchstart listener for :active (js/catalog.js, js/projekt.js). */
.group:has(.ed-link) { -webkit-tap-highlight-color: transparent; }

/* ============================================================
   HERO SHOWCASE "Cover" (index.php → catalogue/views/parts/hero-showcase.php)
   ≥1024: text 5fr · 40 · 1px · 40 · 16:9 image 7fr. The text column is
   padded by the image's margin-block, so it is exactly as tall as the
   image: kicker on the image's top edge, byline on its bottom edge.
   Titles use the EDITORIAL SERIF tokens above (lead .ed-display, strip
   .ed-card); everything else is Inter.
   ============================================================ */

.hs-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem 0 2.5rem;
}
/* Mobile: wrappers dissolve so the leaves can reorder around the image */
.hs-text,
.hs-head,
.hs-foot { display: contents; }
.hs-kicker { order: 1; margin-bottom: 0.75rem; }
.hs-title  { order: 2; margin-bottom: 1.5rem; }
.hs-media  { order: 3; margin-bottom: 1.5rem; }
.hs-dek    { order: 4; margin-bottom: 1rem; }
.hs-byline { order: 5; }
.hs-rule   { display: none; }

.hs-kicker,
.hs-item-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #737373;
}
.hs-type { font-weight: 500; color: #262626; }
.hs-new {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
  color: #262626;
}
.hs-new::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #262626;
}

/* .hs-title type = .ed-display (EDITORIAL SERIF) */
/* Same underline-on-hover as the strip titles; shows while the cover is hovered */
.hs-lead-link {
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
/* One link, one accessible name; the whole cover is the hit area */
.hs-lead-link::after {
  content: '';
  position: absolute;
  inset: 0.5rem -0.75rem;
  z-index: 1;
  border-radius: 24px;
}
.hs-lead-link:focus-visible { outline: none; }
.hs-lead-link:focus-visible::after { outline: 2px solid #262626; outline-offset: 0; }

.hs-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;   /* keeps the radius clipping the scaled image in Safari */
  background: #f5f5f5;
}
.hs-media::after {    /* image edge: hairline inset ring instead of a border */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.05);
  pointer-events: none;
}
.hs-settle { position: absolute; inset: 0; }
.hs-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hs-dek {
  max-width: 38rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: #525252;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hs-byline {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #a3a3a3;
}
.hs-author { color: #262626; }
.hs-avatar {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 999px;
  object-fit: cover;
  outline: 1px solid rgb(0 0 0 / 0.05);
  outline-offset: -1px;
}

/* --- Strip: stacked list with thumbnails (<768) --- */
.hs-strip { display: grid; grid-template-columns: minmax(0, 1fr); }
.hs-strip > li { position: relative; }
.hs-strip > li + li { border-top: 1px solid rgb(229 229 229 / 0.8); }
.hs-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0.5rem;
  margin-inline: -0.5rem;
  border-radius: 14px;
}
.hs-item:focus-visible { outline-offset: -2px; }
.hs-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e5e5;
}
.hs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hs-thumb-week {        /* Týden pod lupou: ISO week number instead of a photo */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #262626;
  color: #fff;
  font-family: 'Literata', 'Literata Fallback', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 450;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.hs-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.hs-item-label { order: -1; gap: 0.25rem 0.625rem; }
.hs-item-title {          /* type = .ed-card; the underline is hover-driven by .hs-item */
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.hs-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #737373;
  font-variant-numeric: tabular-nums;
}
.hs-dot { width: 8px; height: 8px; flex: none; border-radius: 999px; }

/* --- 2×2 (768–1279): dividers reconfigured for two columns --- */
@media (min-width: 768px) {
  .hs-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 81px;                          /* 40 · 1px · 40, like the grids below */
  }
  .hs-strip > li + li { border-top: 0; }
  .hs-strip > li:nth-child(n+3) { border-top: 1px solid #e5e5e5; }
  .hs-strip > li:nth-child(2n)::before {       /* vertical hairline in the middle gap */
    content: '';
    position: absolute;
    inset-block: 0;
    left: -41px;
    width: 1px;
    background: #e5e5e5;
  }
  .hs-strip > li:nth-child(3):not(:last-child)::after {   /* carry the row rule across the gap */
    content: '';
    position: absolute;
    top: -1px;
    left: 100%;
    width: 81px;
    height: 1px;
    background: #e5e5e5;
  }
  .hs-strip > li:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* 3 items: no empty cell */
  .hs-item {
    height: 100%;
    padding: 1.5rem 0.75rem 1.75rem;
    margin-inline: -0.75rem;
  }
  .hs-thumb { display: none; }
  .hs-item-body { gap: 0.625rem; }
}

/* --- Cover split (≥1024) --- */
@media (min-width: 1024px) {
  .hs-cover {
    display: grid;
    grid-template-columns: minmax(0, 5fr) 40px 1px 40px minmax(0, 7fr);
    padding: 0;
  }
  .hs-text {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding-block: 2.5rem;
  }
  .hs-head { display: flex; flex-direction: column; gap: 1.25rem; }
  .hs-foot { display: flex; flex-direction: column; gap: 1rem; }
  .hs-kicker, .hs-title, .hs-dek { margin: 0; }
  .hs-rule { display: block; grid-column: 3; grid-row: 1; background: #e5e5e5; }
  .hs-media {
    grid-column: 5;
    grid-row: 1;
    align-self: start;
    margin: 2.5rem 0;
  }
  .hs-dek { font-size: 1rem; }
}

/* --- One row of four (≥1280); columns follow the item count --- */
@media (min-width: 1280px) {
  .hs-strip {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  .hs-strip > li:nth-child(n+3) { border-top: 0; }
  .hs-strip > li:nth-child(3):not(:last-child)::after { content: none; }
  .hs-strip > li:last-child:nth-child(odd) { grid-column: auto; }
  .hs-strip > li + li::before {
    content: '';
    position: absolute;
    inset-block: 0;
    left: -41px;
    width: 1px;
    background: #e5e5e5;
  }
}

/* Hover: slow zoom on the lead image; strip title underline (no colour transition) */
@media (hover: hover) {
  .hs-cover:hover .hs-img { transform: scale(1.03); }
  .hs-cover:hover .hs-lead-link { text-decoration-color: #a3a3a3; }
  .hs-item:hover .hs-item-title { text-decoration-color: #a3a3a3; }
}

/* One-time entrance: the image settles, the text rises in 60 ms steps,
   then the strip fades in 40 ms steps right after the byline */
@keyframes hsSettle {
  from { transform: scale(1.04); }
  to   { transform: none; }
}
@keyframes hsUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes hsFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.hs-settle { animation: hsSettle 1.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hs-in     { animation: hsUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.hs-in-2   { animation-delay: 0.06s; }
.hs-in-3   { animation-delay: 0.12s; }
.hs-in-4   { animation-delay: 0.18s; }
/* The title fades without the rise: a transform on the h2, even mid-animation,
   makes it the containing block of the stretched link, so the cover's hit area +
   focus ring would jump from title- to cover-sized when it ends (~0.05 CLS) */
.hs-title.hs-in { animation-name: hsFade; }
/* Fade on the link, not the li: the li carries the hairlines (border, ::before,
   ::after), so the grid is drawn from the first frame and only the content arrives */
.hs-strip > li > .hs-item { animation: hsFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.24s backwards; }
.hs-strip > li:nth-child(2) > .hs-item { animation-delay: 0.28s; }
.hs-strip > li:nth-child(3) > .hs-item { animation-delay: 0.32s; }
.hs-strip > li:nth-child(4) > .hs-item { animation-delay: 0.36s; }

/* Touch press feedback: same underline as desktop hover, thumbnail gives a little.
   iOS needs a touchstart listener for :active (js/catalog.js). */
.hs-item,
.hs-lead-link { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .hs-cover:active .hs-lead-link { text-decoration-color: #a3a3a3; }
  .hs-item:active .hs-item-title { text-decoration-color: #a3a3a3; }
  .hs-thumb { transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
  .hs-item:active .hs-thumb { transform: scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
  .hs-settle, .hs-in, .hs-title.hs-in, .hs-strip > li > .hs-item { animation: none; }
  .hs-img, .hs-thumb { transition: none; }
  .hs-cover:hover .hs-img,
  .hs-item:active .hs-thumb { transform: none; }
}

/* ============================================================
   NEWSLETTER SIGNUP (catalogue/views/parts/newsletter-signup.php)
   White elevated panel on the neutral-50 page: ring + soft shadow.
   ============================================================ */
.nl-wrap { padding: 2.5rem 0; }
.nl-panel {
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.05),
    0 1px 2px rgb(0 0 0 / 0.03),
    0 16px 40px -24px rgb(0 0 0 / 0.14);
  overflow: hidden;
}
.nl-main {
  display: grid;
  gap: 1.5rem;
  padding: 1.75rem 1.5rem;
}
.nl-title {
  max-width: 36rem;
  font-size: clamp(1.375rem, 1rem + 1.2vw, 1.875rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: #262626;
  text-wrap: balance;
}

/* "Co najdete v e-mailu": three pillars, divider-separated */
.nl-pillars {
  border-top: 1px solid rgb(0 0 0 / 0.06);
  padding: 1.5rem;
}
.nl-pillars-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #737373;
  margin-bottom: 0.25rem;
}
.nl-pillar {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0;
}
.nl-pillar:last-child { padding-bottom: 0; }
.nl-pillar + .nl-pillar { border-top: 1px solid rgb(0 0 0 / 0.06); }
.nl-pillar-name {
  font-size: 1rem;
  font-weight: 500;
  color: #262626;
}
.nl-pillar-text {
  font-size: 1rem;
  line-height: 1.5;
  color: #525252;
  text-wrap: pretty;
}
@media (min-width: 640px) {
  .nl-wrap { padding: 3rem 0; }
  .nl-main { padding: 2.25rem 2.5rem; }
  .nl-pillars { padding: 1.5rem 2.5rem 1.75rem; }
  .nl-pillar-text { font-size: 0.875rem; }
}
@media (min-width: 768px) {
  .nl-pillar-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nl-pillar { padding: 0.5rem 1.5rem 0; }
  .nl-pillar + .nl-pillar { border-top: 0; border-left: 1px solid rgb(0 0 0 / 0.06); }
  .nl-pillar:first-child { padding-left: 0; }
  .nl-pillar:last-child { padding-right: 0; }
}
@media (min-width: 1024px) {
  .nl-main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    align-items: center;
    gap: 4rem;
    padding: 2.75rem 3rem;
  }
  .nl-pillars { padding: 1.5rem 3rem 2rem; }
}
