/* Stránky: úvod, kolekce, řemeslo, příběh, kontakt, právní stránky, 404. */

@layer pages {

  /* =========================================================
     ÚVOD
     ========================================================= */

  .hero {
    position: relative;
    display: grid;
    align-items: end;
    min-height: clamp(560px, 86svh, 1000px);
    overflow: hidden;
    isolation: isolate;
    background: var(--coal);
  }
  .hero__media, .hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; }
  .hero__media { z-index: -2; }
  .hero__media img { object-fit: cover; object-position: 50% 50%; }
  @media (prefers-reduced-motion: no-preference) {
    .hero__media img { animation: hero-settle 2.8s var(--ease) both; }
    @keyframes hero-settle { from { transform: scale(1.04); opacity: 0.6; } to { transform: none; opacity: 1; } }
  }
  /* kraje vystínované do černé, zdobný střed zámku zůstává vidět */
  .hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
      linear-gradient(to bottom, rgb(15 13 11 / 0.9) 0%, rgb(15 13 11 / 0.5) 12%, rgb(15 13 11 / 0) 26%),
      linear-gradient(to top, rgb(15 13 11 / 0.96) 0%, rgb(15 13 11 / 0.9) 20%, rgb(15 13 11 / 0.6) 36%, rgb(15 13 11 / 0.18) 50%, rgb(15 13 11 / 0) 62%);
  }
  .hero__content { padding-block: 200px clamp(40px, 5vw, 64px); }
  .hero__kicker { display: flex; align-items: center; gap: 16px; }
  .hero__kicker .rule { width: 64px; }
  .hero__title {
    margin-top: 14px;
    font-family: var(--f-display);
    font-size: clamp(2.7rem, 1.2rem + 5vw, 5.1rem);
    font-weight: 500;
    line-height: 1.02;
    max-width: 12ch;
    color: var(--cream);
    text-shadow: 0 2px 26px rgb(0 0 0 / 0.5);
  }

  /* PC: text vlevo ve vystínovaném kraji, zdobný střed zámku vpravo vedle něj */
  @media (min-width: 900px) {
    .hero { align-items: center; }
    .hero::after {
      background:
        linear-gradient(to right, rgb(15 13 11 / 0.94) 0%, rgb(15 13 11 / 0.86) 26%, rgb(15 13 11 / 0.4) 46%, rgb(15 13 11 / 0) 62%),
        linear-gradient(to bottom, rgb(15 13 11 / 0.7) 0%, rgb(15 13 11 / 0) 22%),
        linear-gradient(to top, rgb(15 13 11 / 0.55) 0%, rgb(15 13 11 / 0) 24%);
    }
    .hero__content { padding-block: clamp(150px, 18vh, 220px) clamp(60px, 10vh, 120px); }
    .hero__title { max-width: 11ch; }
  }

  @media (max-width: 899px) {
    .hero { min-height: clamp(560px, 84svh, 980px); }
    .hero__content { padding-bottom: 44px; }
    .hero__kicker .rule { display: none; }
    .hero__kicker .kicker { letter-spacing: 0.2em; }
  }

  /* dlaždice = rozcestník */
  .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; background: var(--coal); }
  .tile {
    position: relative; display: block; aspect-ratio: 4 / 5; max-height: 88svh;
    overflow: hidden; isolation: isolate; color: var(--cream); text-decoration: none;
  }
  .tile picture, .tile img { position: absolute; inset: 0; width: 100%; height: 100%; }
  .tile picture { z-index: -2; }
  .tile img { object-fit: cover; transition: transform 1.4s var(--ease), filter 0.8s; filter: saturate(0.92) brightness(0.92); }
  .tile::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(to top, rgb(15 13 11 / 0.9) 0%, rgb(15 13 11 / 0.4) 34%, rgb(15 13 11 / 0) 60%);
  }
  .tile:hover img, .tile:focus-visible img { transform: scale(1.05); filter: none; }
  .tile:focus-visible { outline-offset: -6px; }

  .tile__label { position: absolute; left: clamp(22px, 3vw, 46px); right: 70px; bottom: clamp(26px, 3.4vw, 50px); display: grid; gap: 10px; }
  .tile__cz {
    font-family: var(--f-display); font-weight: 500; line-height: 1;
    font-size: clamp(1.9rem, 1.1rem + 1.7vw, 3rem); letter-spacing: 0.08em; text-transform: uppercase;
  }
  .tile__en { font-style: italic; font-size: 1.1rem; color: var(--brass-hi); letter-spacing: 0.02em; }
  .tile__label::after {
    content: ""; display: block; width: 48px; height: 1px; margin-top: 6px; background: var(--brass);
    transition: width 0.6s var(--ease);
  }
  .tile:hover .tile__label::after, .tile:focus-visible .tile__label::after { width: 104px; }
  .tile__arrow {
    position: absolute; right: clamp(20px, 2.6vw, 40px); bottom: clamp(26px, 3.4vw, 50px);
    display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
    border: 1px solid rgb(194 155 95 / 0.6); color: var(--cream);
    opacity: 0; transform: translateX(-8px); transition: opacity 0.4s, transform 0.5s var(--ease), background-color 0.3s;
  }
  .tile__arrow .icon { width: 20px; height: 20px; }
  .tile:hover .tile__arrow, .tile:focus-visible .tile__arrow { opacity: 1; transform: none; background: rgb(15 13 11 / 0.4); }
  @media (hover: none) { .tile__arrow { opacity: 1; transform: none; } }

  .tile--kolekce img { object-position: 50% 44%; }
  .tile--remeslo img { object-position: 50% 50%; }
  .tile--pribeh img { object-position: 50% 45%; }

  @media (max-width: 760px) {
    .tiles { grid-template-columns: 1fr; }
    .tile { aspect-ratio: 5 / 4; max-height: none; }
    .tile--kolekce img { object-position: 50% 40%; }
    .tile--remeslo img { object-position: 50% 42%; }
    .tile--pribeh img { object-position: 50% 44%; }
  }

  /* pozvánka „Kování pro váš dům“ */
  .invite { position: relative; overflow: hidden; text-align: center; padding-block: var(--section); }
  .invite__inner { position: relative; z-index: 1; }
  .invite__mark { height: 84px; width: auto; aspect-ratio: 813 / 1078; margin: 0 auto 30px; fill: var(--steel-ink); }
  .invite__title { font-family: var(--f-display); font-size: var(--fs-h2); font-weight: 500; line-height: 1.04; }
  .invite__text { max-width: 30em; margin: 20px auto 0; font-size: var(--fs-l); color: var(--ink-soft); }
  .invite .rule { margin: 30px auto 34px; }
  .invite__door, .invite__hinge { position: absolute; bottom: 0; color: var(--ink); pointer-events: none; }
  .invite__door { right: max(-40px, (100vw - 1500px) / 2); height: 94%; width: auto; opacity: 0.13; }
  .invite__hinge { left: max(-30px, (100vw - 1560px) / 2); top: 50%; bottom: auto; transform: translateY(-50%); width: min(26vw, 340px); height: auto; opacity: 0.11; }
  @media (max-width: 980px) { .invite__door, .invite__hinge { display: none; } }

  /* =========================================================
     KOLEKCE
     ========================================================= */

  .range { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 30px; }
  .range li {
    padding: 7px 14px; border: 1px solid var(--iron-line);
    font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream-soft);
  }

  .collection-intro {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(22px, 4vw, 56px); max-width: 1020px; margin: 0 auto clamp(60px, 8vw, 104px);
    font-size: var(--fs-l); line-height: 1.6;
  }

  .section-head { max-width: 44em; margin-bottom: clamp(30px, 4vw, 48px); }
  .section-head .h2 { margin-top: 12px; }
  .section-head p { margin-top: 14px; color: var(--ink-soft); }
  .on-iron .section-head p, .on-coal .section-head p { color: var(--cream-soft); }

  .group-title {
    display: flex; align-items: center; gap: 18px;
    margin: clamp(44px, 5vw, 66px) 0 clamp(18px, 2vw, 26px);
    font-family: var(--f-text); font-size: 0.82rem; font-weight: 500;
    letter-spacing: 0.26em; text-transform: uppercase; color: var(--brass-ink);
  }
  .group-title:first-of-type { margin-top: 0; }
  .group-title::after { content: ""; flex: 1; height: 1px; background: var(--paper-line); }

  .catalog { display: grid; gap: clamp(18px, 2.2vw, 32px); align-items: start; }
  .catalog--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog--tall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card { margin: 0; }
  .card .zoom { aspect-ratio: auto; }       /* kusy se ukazují celé, bez ořezu */
  .card .zoom img { height: auto; }
  .card--wide { grid-column: span 2; }
  .card__name {
    margin-top: 14px; font-family: var(--f-display); font-weight: 500; line-height: 1.15;
    font-size: clamp(1.15rem, 1rem + 0.5vw, 1.5rem);
  }
  .card__name::after { content: ""; display: block; width: 30px; height: 1px; margin-top: 10px; background: var(--brass-ink); opacity: 0.55; }
  @media (max-width: 860px) { .catalog--wide { grid-template-columns: 1fr; } }
  @media (max-width: 620px) { .catalog--tall { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card--wide { grid-column: span 2; } }
  @media (max-width: 360px) { .catalog--tall { grid-template-columns: 1fr; } }

  /* galerie realizací — zděné sloupce, fotky v původním poměru */
  .shots { columns: 3; column-gap: clamp(12px, 1.6vw, 20px); }
  .shots .zoom { display: block; break-inside: avoid; margin-bottom: clamp(12px, 1.6vw, 20px); aspect-ratio: auto; }
  .shots .zoom img { height: auto; }
  @media (max-width: 1000px) { .shots { columns: 2; } }
  @media (max-width: 560px) { .shots { columns: 1; } }

  /* =========================================================
     ŘEMESLO
     ========================================================= */

  .craft-intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 7vw, 120px); align-items: center; }
  .craft-intro .prose { font-size: var(--fs-l); line-height: 1.6; color: var(--ink); }
  .pull {
    position: relative; padding-left: clamp(24px, 3vw, 40px); border-left: 1px solid var(--brass-ink);
    font-family: var(--f-display); font-style: italic; font-weight: 500;
    font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.8rem); line-height: 1.16; color: var(--ink);
  }
  .pull::before {
    content: ""; position: absolute; left: -6px; top: 0.35em; width: 11px; height: 11px; border-radius: 50%; background: var(--brass-ink);
  }
  @media (max-width: 860px) { .craft-intro { grid-template-columns: 1fr; } }

  .steps-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 40px; margin-bottom: clamp(40px, 5vw, 64px); }
  .steps-head p { max-width: 30em; color: var(--cream-soft); }
  .steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(16px, 2vw, 28px); counter-reset: step; }
  .step { grid-column: span 2; margin: 0; }
  .step--wide { grid-column: span 3; }
  .step .zoom { aspect-ratio: 3 / 4; }
  .step--wide .zoom { aspect-ratio: 16 / 9; }
  .step figcaption { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: baseline; margin-top: 16px; }
  .step__no { font-family: var(--f-display); font-size: 2.1rem; line-height: 1; color: var(--brass); }
  .step__text { font-size: 1.12rem; line-height: 1.35; color: var(--cream); }
  .step__text::after { content: ""; display: block; width: 36px; height: 1px; margin-top: 12px; background: var(--brass); opacity: 0.8; }
  @media (max-width: 1000px) {
    .steps { grid-template-columns: 1fr; max-width: 720px; margin-inline: auto; }
    .step, .step--wide { grid-column: auto; }
    .step .zoom { aspect-ratio: auto; max-height: 78svh; }
    .step .zoom img { max-height: 78svh; }
    .step--wide .zoom { aspect-ratio: 16 / 9; }
  }

  /* =========================================================
     PŘÍBĚH
     ========================================================= */

  .chapters { position: relative; display: grid; gap: clamp(56px, 7vw, 96px); }
  .chapters::before {
    content: ""; position: absolute; top: 12px; bottom: 12px; left: calc(var(--marker-w) + 26px);
    width: 1px; background: linear-gradient(to bottom, transparent, var(--brass-ink) 6%, var(--brass-ink) 94%, transparent);
    opacity: 0.55;
  }
  .chapters { --marker-w: clamp(150px, 16vw, 220px); }
  .chapter { position: relative; display: grid; grid-template-columns: var(--marker-w) minmax(0, 1fr); gap: 52px; }
  .chapter::before {
    content: ""; position: absolute; left: calc(var(--marker-w) + 26px - 6px); top: 0.62em;
    width: 13px; height: 13px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 3px var(--brass-ink);
  }
  .chapter__marker { text-align: right; font-family: var(--f-display); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem); line-height: 1.05; color: var(--brass-ink); }
  .chapter__marker small { display: block; margin-top: 6px; font-family: var(--f-text); font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft); }
  .chapter .prose { font-size: var(--fs-l); line-height: 1.62; color: var(--ink); max-width: 34em; }
  .chapter__coda { margin-top: 26px; font-family: var(--f-display); font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.9rem); line-height: 1.05; color: var(--ink); }
  @media (max-width: 760px) {
    .chapters { --marker-w: 0px; padding-left: 28px; }
    .chapters::before { left: 6px; }
    .chapter { grid-template-columns: 1fr; gap: 10px; }
    .chapter::before { left: -28px; top: 0.3em; }
    .chapter__marker { text-align: left; }
  }

  .castle { position: relative; margin: 0; background: var(--coal); }
  .castle picture, .castle img { width: 100%; }
  .castle img { aspect-ratio: 16 / 9; max-height: 86svh; object-fit: cover; }
  .castle figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 0 clamp(22px, 3vw, 38px);
    background: linear-gradient(to top, rgb(15 13 11 / 0.82), rgb(15 13 11 / 0));
    color: var(--cream);
  }
  .castle__title { font-family: var(--f-display); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem); line-height: 1.1; }
  .castle__sub { margin-top: 4px; font-style: italic; color: rgb(238 230 216 / 0.85); }
  @media (max-width: 600px) {
    .castle img { aspect-ratio: 4 / 3; }
    .castle figcaption { position: static; padding: 16px var(--gutter) 22px; background: var(--coal); }
    .castle figcaption .wrap { width: auto; }
  }

  .maker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: clamp(560px, 86svh, 900px); }
  .maker__photo { position: relative; margin: 0; background: var(--coal); }
  .maker__photo picture, .maker__photo img { position: absolute; inset: 0; width: 100%; height: 100%; }
  .maker__photo img { object-fit: cover; object-position: 50% 30%; }
  .maker__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, var(--coal) 0%, rgb(15 13 11 / 0) 30%); }
  .maker__text {
    align-self: center; display: grid; justify-items: center; text-align: center; gap: 0;
    padding: clamp(56px, 8vw, 110px) var(--gutter);
  }
  .maker__brand { font-family: var(--f-brand); font-size: clamp(3rem, 2rem + 3vw, 5rem); line-height: 1; color: var(--logo-word); }
  .maker__person { margin-top: 18px; font-size: 0.86rem; letter-spacing: 0.4em; text-transform: uppercase; color: var(--cream); }
  .maker .rule { margin: 30px auto; }
  .maker__motto { max-width: 19em; font-family: var(--f-display); font-size: clamp(1.45rem, 1.2rem + 0.9vw, 2rem); line-height: 1.3; color: var(--cream); }
  .maker__links { margin-top: 40px; }
  .maker__sign { margin-top: 34px; font-family: var(--f-sign); font-size: clamp(3.4rem, 2.6rem + 2.4vw, 5rem); line-height: 1; color: var(--brass-hi); transform: rotate(-4deg); }
  @media (max-width: 860px) {
    .maker { grid-template-columns: 1fr; min-height: 0; }
    .maker__photo { aspect-ratio: 4 / 5; }
    .maker__photo::after { background: linear-gradient(to top, var(--coal) 0%, rgb(15 13 11 / 0) 30%); }
  }

  /* =========================================================
     KONTAKT
     ========================================================= */

  .contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(44px, 6vw, 96px); align-items: start; }
  @media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; } }

  .contact-card h2, .form-card h2 { font-family: var(--f-display); font-size: clamp(2rem, 1.6rem + 1.4vw, 2.8rem); line-height: 1.05; }
  .contact-card__intro { margin-top: 16px; color: var(--ink-soft); }
  .contact-list { display: grid; gap: 20px; margin-top: 34px; }
  .contact-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 16px; align-items: start; }
  .contact-list .icon { width: 22px; height: 22px; margin-top: 3px; color: var(--brass-ink); }
  .contact-list li:first-child .icon { width: 26px; height: 32px; margin-top: 0; color: var(--steel-ink); }
  .contact-list strong { display: block; font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
  .contact-list a { color: var(--ink); text-decoration: none; font-size: 1.15rem; }
  .contact-list a:hover { text-decoration: underline; text-decoration-color: var(--brass-ink); }
  .contact-list span, .contact-list .muted { color: var(--ink-soft); }
  .contact-list a.contact-map { display: inline-block; margin-top: 6px; font-size: 0.95rem; color: var(--brass-ink); text-decoration: underline; text-decoration-color: rgb(122 92 48 / 0.4); }
  .contact-card .social { margin-top: 32px; }
  .contact-card .social a { border-color: var(--paper-line); color: var(--ink); }
  .contact-card .social a:hover { border-color: var(--brass-ink); color: var(--brass-ink); background: rgb(122 92 48 / 0.06); }
  .contact-sign { margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--paper-line); }
  .contact-sign > p:first-child { font-style: italic; font-size: 1.15rem; color: var(--ink-soft); }
  .contact-sign .contact-sign__name { margin-top: 10px; font-family: var(--f-sign); font-size: 3.6rem; line-height: 1; color: var(--ink); transform: rotate(-3deg); transform-origin: left; }

  .form-card { padding: clamp(24px, 4vw, 48px); background: rgb(255 255 255 / 0.42); border: 1px solid var(--paper-line); }
  .form-card > p { margin-top: 10px; margin-bottom: 30px; color: var(--ink-soft); }

  /* informace k poptávce */
  .guide-head { max-width: 46em; margin: 0 auto clamp(40px, 5vw, 64px); text-align: center; }
  .guide-head .h2 { margin-top: 14px; }
  .guide-head p { margin-top: 18px; color: var(--ink-soft); font-size: var(--fs-l); }
  .guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; background: var(--paper-line); border: 1px solid var(--paper-line); }
  .guide__item { display: grid; grid-template-rows: auto auto 1fr; gap: 12px; padding: clamp(24px, 3.4vw, 44px); background: var(--paper); background-image: var(--grain-paper); }
  .guide__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
  .guide__no {
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
    background: var(--paper-3); color: var(--ink); font-family: var(--f-display); font-size: 1.9rem; line-height: 1; font-weight: 600;
  }
  .guide__title { font-family: var(--f-display); font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.9rem); line-height: 1.05; text-transform: uppercase; letter-spacing: 0.04em; }
  .guide__title small { display: block; margin-top: 4px; font-family: var(--f-text); font-size: 0.78rem; letter-spacing: 0.2em; color: var(--ink-soft); }
  .guide__item > p { color: var(--ink-soft); }
  .guide__art { align-self: end; margin-top: 12px; color: var(--ink); }
  .guide__art svg { width: 100%; height: auto; max-height: 330px; }
  .guide__legend { margin-top: 10px; font-size: var(--fs-s); color: var(--ink-soft); text-align: center; }
  .guide__legend b { color: var(--ink); font-weight: 600; }
  .guide-note { max-width: 860px; margin: clamp(32px, 4vw, 48px) auto 0; }
  @media (max-width: 860px) { .guide { grid-template-columns: 1fr; } }

  /* =========================================================
     PRÁVNÍ STRÁNKY A 404
     ========================================================= */

  .legal { max-width: 46em; }
  .legal h2 { margin-top: 2.2em; font-family: var(--f-display); font-size: 1.8rem; line-height: 1.1; }
  .legal p, .legal ul { margin-top: 0.9em; color: var(--ink-soft); }
  .legal ul { padding-left: 1.2em; }
  .legal li + li { margin-top: 0.35em; }
  .legal a { color: var(--brass-ink); }
  .legal .placeholder { background: #f6e3a8; color: var(--ink); padding: 0 4px; }
  .legal__meta { margin-top: 3em !important; padding-top: 1.2em; border-top: 1px solid var(--paper-line); font-size: var(--fs-s); }
  .crumbs--paper, .crumbs--paper a { color: var(--ink-soft); }
  .crumbs--paper a:hover { color: var(--ink); }
  .crumbs--paper [aria-current] { color: var(--brass-ink); }
  .site-footer__legal--solo { margin-top: 0; padding-top: 0; border-top: 0; }

  .lost { min-height: 70svh; display: grid; align-content: center; justify-items: center; text-align: center; padding-block: 100px; }
  .lost__mark { height: 120px; width: auto; aspect-ratio: 813 / 1078; fill: var(--steel); opacity: 0.9; transform: rotate(-8deg); }
  .lost__code { margin-top: 26px; font-size: 0.8rem; letter-spacing: 0.4em; color: var(--brass); }
  .lost h1 { margin-top: 12px; }
  .lost p { margin-top: 18px; max-width: 30em; color: var(--cream-soft); }
  .lost__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 16px; margin-top: 36px; }
}
