/* AVL veeb — projektide loend (projektid.html) ja projektileht (projekt.html). Ühine osa ja kaardisüsteem on failis leht.css. */

  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
  img { height: auto; }
  .ph { margin: 0; overflow: hidden; background: var(--stone); }
  .ph img { height: 100%; object-fit: cover; }
  h2 { max-width: 20ch; }
  .skip { position: absolute; left: 12px; top: -80px; z-index: 50; background: var(--ink); color: var(--white); padding: 14px 18px; font-weight: 600; font-size: var(--fs-ui); text-decoration: none; }
  .skip:focus { top: 12px; }
  footer :focus-visible, .lb :focus-visible { outline-color: var(--yellow); }
  .foot h2 { color: var(--white); font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em; line-height: 1.6; text-transform: uppercase; margin: 0 0 10px; max-width: none; }
  .foot a, .foot address span { display: block; padding: 4px 0; }
  .foot address { font-style: normal; }
  .legal a { display: inline-block; padding: 4px 0; }
  @media (pointer: coarse) { .foot a, .foot address span, .legal a { padding: 9px 0; } } /* puuteekraanil jääb sõrmele ruumi */
  @media (max-width: 599px) { header.site .tools > .btn { display: none; } }
  .arr-btn { width: 48px; height: 48px; border: 1px solid var(--ink); background: transparent; font-size: var(--fs-body); font-weight: 600; cursor: pointer; display: inline-grid; place-items: center; transition: background .2s, color .2s; }
  .arr-btn:hover:not(:disabled) { background: var(--ink); color: var(--white); }
  .arr-btn:disabled { border-color: var(--line); color: var(--line); cursor: default; }
  .poster .btn.dark { background: var(--ink); border-color: var(--ink); color: var(--white); }
  .poster .btn.dark:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
  .poster h2 { max-width: 16ch; }
  .poster .act { margin-top: 0; }
  .poster .tlink { border-bottom-color: var(--ink); }

  /* ---------- loend ---------- */
  .pl { padding-top: 0; }
  .pl-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px 32px; flex-wrap: wrap; }
  .pl-filters { display: grid; gap: 14px; }
  .pl-filters .grp { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
  .pl-filters .k { min-width: 62px; }
  .chip .n { font-weight: 500; opacity: .6; }
  .chip:disabled { color: var(--muted); opacity: .5; cursor: default; }
  .chip:disabled:hover { border-color: var(--line); }
  .pl-status { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; min-height: 44px; margin-top: 14px; }
  .pl-status .fine { margin-top: 0; }
  .pl-status .tlink { padding: 12px 0 6px; font-size: var(--fs-small); }

  /* ruudud: foto 4:3, all tüüp · koht, nimi, üks lause */
  .pgrid { display: grid; grid-template-columns: 1fr; gap: clamp(40px, 5vw, 72px) clamp(16px, 2vw, 32px); margin-top: clamp(28px, 4vw, 48px); }
  @media (min-width: 600px) { .pgrid { grid-template-columns: 1fr 1fr; } }
  @media (min-width: 1100px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
  .pcard { display: block; text-decoration: none; }
  .pcard .ph { aspect-ratio: 4 / 3; position: relative; }
  .pcard .ph img { transition: transform .6s ease; }
  .pcard:hover .ph img { transform: scale(1.03); }
  .pcard .badge { position: absolute; left: 12px; top: 12px; }
  .pcard .meta { display: flex; justify-content: space-between; gap: 16px; font-size: var(--fs-fine); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 16px; }
  .pcard h3 { font-size: clamp(22px, 2vw, 28px); font-weight: 600; line-height: 1.2; margin-top: 8px; letter-spacing: -.01em; }
  .pcard:hover h3 { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 5px; }
  .pcard p { font-size: var(--fs-ui); color: var(--muted); margin-top: 8px; max-width: 44ch; }
  .tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
  .tagrow span { font-size: var(--fs-label); font-weight: 600; padding: 6px 10px; background: var(--card); line-height: 1.2; }

  /* nimekiri: read kaartidena, paremal valitud rea foto */
  .plist-wrap { display: grid; gap: clamp(20px, 3vw, 40px); margin-top: clamp(28px, 4vw, 48px); align-items: start; }
  .plist { display: grid; gap: 8px; list-style: none; padding: 0; }
  .prow { display: grid; grid-template-columns: 72px 1fr auto; gap: 4px 18px; align-items: center; background: var(--card); padding: 14px 18px 14px 14px; text-decoration: none; transition: background .2s, color .2s; }
  .prow .ph { grid-row: span 2; width: 72px; aspect-ratio: 4 / 3; }
  .prow h3 { font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; align-self: end; }
  .prow .m { grid-column: 2; font-size: var(--fs-fine); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); align-self: start; }
  .prow .go { grid-column: 3; grid-row: 1 / span 2; font-weight: 600; transition: transform .2s; }
  .prow .badge { margin-left: 10px; vertical-align: 3px; }
  .prow:hover, .prow:focus-visible { background: var(--ink); color: var(--white); }
  .prow:hover .m, .prow:focus-visible .m { color: rgba(255,255,255,.72); }
  .prow:hover .go { transform: translateX(4px); }
  .pprev { display: none; }
  @media (min-width: 1100px) {
    .plist-wrap { grid-template-columns: 7fr 5fr; }
    .prow { grid-template-columns: 1fr auto; padding: 22px 24px; }
    .prow .ph { display: none; }
    .prow .m { grid-column: 1; }
    .prow .go { grid-column: 2; }
    .pprev { display: block; position: sticky; top: 100px; margin: 0; }
    .pprev .ph { aspect-ratio: 4 / 3; }
    .pprev figcaption { font-size: var(--fs-ui); color: var(--muted); margin-top: 14px; min-height: 3.2em; }
  }
  .pl-empty { background: var(--card); padding: clamp(28px, 4vw, 56px); margin-top: clamp(28px, 4vw, 48px); }
  .pl-empty h3 { font-size: var(--fs-h3); font-weight: 600; }

  /* ---------- projektileht ---------- */
  /* galerii: suur pilt, all pisipildid, loendur ja nooled; klõps avab täisvaate */
  .g { margin-top: 0; }
  .g-main { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--stone); aspect-ratio: 16 / 9; max-height: 78vh; overflow: hidden; cursor: zoom-in; }
  .g-main img { height: 100%; object-fit: cover; }
  .g-main .zoom { position: absolute; right: 16px; bottom: 16px; background: var(--paper); color: var(--ink); font-size: var(--fs-fine); font-weight: 600; padding: 10px 14px; }
  .g-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 12px; }
  .thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; min-width: 0; }
  .thumbs::-webkit-scrollbar { display: none; }
  .thumbs button { flex: none; width: 104px; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--stone); cursor: pointer; opacity: .55; position: relative; transition: opacity .2s; }
  .thumbs button img { height: 100%; object-fit: cover; }
  .thumbs button:hover { opacity: .85; }
  .thumbs button[aria-current="true"] { opacity: 1; }
  .thumbs button[aria-current="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--yellow); }
  .g-nav { display: flex; align-items: center; gap: 10px; flex: none; }
  .g-count { font-size: var(--fs-small); font-weight: 600; letter-spacing: .08em; margin-right: 8px; white-space: nowrap; }
  .g-note { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; margin-top: 8px; }
  .g-note .fine { margin-top: 0; }
  @media (max-width: 599px) {
    .g-main { aspect-ratio: 4 / 3; }
    .g-bar { flex-direction: column-reverse; align-items: stretch; }
    .g-nav { justify-content: space-between; }
    .thumbs button { width: 84px; }
  }
  .page-head .label { flex-wrap: wrap; row-gap: 4px; }
  .pstats { padding-top: clamp(40px, 6vw, 80px); }
  .pstats .istat b { font-size: clamp(34px, 4.4vw, 64px); white-space: nowrap; }
  .pstats .istat span { max-width: 24ch; }
  .pstats + .icon-row { margin-top: clamp(32px, 4vw, 52px); }
  .p-top { padding-bottom: clamp(64px, 9vw, 128px); }

  /* faktid: kaardid teemade kaupa, read ilma joonteta */
  .fcards { display: grid; grid-template-columns: 1fr; gap: var(--gap); margin-top: clamp(36px, 5vw, 64px); }
  @media (min-width: 600px) { .fcards { grid-template-columns: 1fr 1fr; } }
  @media (min-width: 1100px) { .fcards.n3 { grid-template-columns: repeat(3, 1fr); } .fcards.n4 { grid-template-columns: repeat(4, 1fr); } }
  .fcards .card h3 { margin-top: 0; }
  .frows { display: grid; gap: 18px; margin: 26px 0 0; }
  .frows dt { font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .frows dd { margin: 4px 0 0; font-weight: 600; font-size: var(--fs-input); line-height: 1.4; }

  /* tagasiside */
  .pquote { background: var(--card); padding: clamp(28px, 5vw, 72px); margin-top: clamp(36px, 5vw, 64px); }
  .pquote blockquote { font-size: clamp(20px, 2.3vw, 32px); line-height: 1.36; letter-spacing: -.01em; max-width: 44ch; }
  .pquote cite { display: block; margin-top: 28px; font-style: normal; font-size: var(--fs-small); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

  /* lugu: akordioni sisu — vasakul tekst, paremal tehtud tööd */
  .acc .body p + p { margin-top: 14px; }
  .acc .body .k { display: block; margin-bottom: 12px; }

  /* mööbel ja põrand samalt objektilt */
  .split { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
  .split .ph { aspect-ratio: 4 / 3; }
  @media (min-width: 900px) { .split.has-ph { grid-template-columns: 5fr 6fr; } }
  .split:not(.has-ph) .lead { max-width: 52ch; }

  /* eelmine ja järgmine projekt */
  .pn { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
  @media (min-width: 600px) { .pn { grid-template-columns: 1fr 1fr; } }
  .pn a { display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: center; background: var(--card); padding: 16px; text-decoration: none; transition: background .2s, color .2s; }
  .pn a .ph { aspect-ratio: 4 / 3; }
  .pn a h3 { font-size: clamp(20px, 2vw, 26px); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin-top: 6px; }
  .pn a:hover { background: var(--ink); color: var(--white); }
  .pn a:hover .k { color: rgba(255,255,255,.72); }
  .pn a.next { grid-template-columns: 1fr 112px; text-align: right; }
  .pn a.next .ph { order: 2; }
  .pn-all { margin-top: 28px; }

  /* täisvaade */
  .lb { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; background: rgba(20,22,24,.97); color: var(--white); }
  .lb::backdrop { background: rgba(20,22,24,.97); }
  .lb[open] { display: grid; grid-template-rows: auto 1fr auto; }
  .lb-top, .lb-bot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(12px, 3vw, 32px); }
  .lb-top .g-count { margin: 0; }
  .lb button { min-width: 48px; min-height: 48px; padding: 0 16px; background: transparent; border: 1px solid rgba(255,255,255,.4); color: var(--white); font-weight: 600; font-size: var(--fs-ui); cursor: pointer; }
  .lb button:hover { background: var(--white); color: var(--ink); }
  .lb-stage { min-height: 0; display: grid; place-items: center; padding: 0 clamp(0px, 3vw, 32px); }
  .lb-stage img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 168px); max-height: calc(100dvh - 168px); object-fit: contain; }
  .lb-cap { font-size: var(--fs-small); color: rgba(255,255,255,.78); }
  .lb-bot .g-nav { gap: 8px; }
  body:has(.lb[open]) { overflow: hidden; }

  /* objektilugu lühidalt: mure → otsus → tulemus */
  .l3 { list-style: none; padding: 0; margin: clamp(28px, 4vw, 48px) 0 0; display: grid; gap: var(--gap); }
  @media (min-width: 900px) { .l3 { grid-template-columns: repeat(3, 1fr); } }
  .l3 .card p { font-size: var(--fs-body); color: var(--ink); line-height: 1.55; margin-top: 14px; }

  /* ---------- loend v2 (11.10.2026): üleval vaatur, all kaks veergu suurte fotodega ---------- */
  .pl-top { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
  .pl-top .g-nav { display: flex; align-items: center; gap: 10px; }
  .pv { margin-top: clamp(20px, 2.4vw, 32px); }
  .pv .work-info h3 { font-size: clamp(30px, 3.4vw, 48px); }
  .pv-one { margin-top: 20px; color: var(--muted); max-width: 44ch; }
  .pv .view-rail figure { aspect-ratio: 3 / 2; max-width: 92%; } .pv .view-rail img { width: 100%; height: 100%; object-fit: cover; }
  .pgrid.pgrid-2 { margin-top: clamp(56px, 7vw, 104px); }
  @media (min-width: 600px) { .pgrid.pgrid-2 { grid-template-columns: 1fr 1fr; } }
  .pgrid-2 .pcard .ph { aspect-ratio: 3 / 2; }
  .pl-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
  .pl-status { margin-top: 20px; }

  /* ---------- loend v4 (12.10.2026): ikoonidega filter, üleval ühe projekti vaade fotoreaga, all kõik projektid uute kaartidena. Kaart, filter ja nooled: leht.css ---------- */
  .pl .ico { width: 22px; height: 22px; }
  .pc-grid { display: grid; gap: 16px; margin-top: clamp(56px, 7vw, 104px); }
  @media (min-width: 600px) { .pc-grid { grid-template-columns: 1fr 1fr; } }
  @media (min-width: 1100px) { .pc-grid { grid-template-columns: repeat(3, 1fr); } }

  /* ---------- „Selles kodus kasutasime” (valik C) ja „Võta see lahendus” (valik B), 16.10.2026 ---------- */
  .btn.s { min-height: 44px; padding: 9px 16px; font-size: var(--fs-small); gap: 8px; }
  .kp-tabs { display: flex; gap: 6px; margin: 28px 0 16px; overflow-x: auto; }
  .kp-tabs button { flex: none; min-height: 48px; padding: 10px 18px; border: 0; background: var(--card); font: inherit; font-weight: 600; font-size: var(--fs-ui); cursor: pointer; }
  .kp-tabs button .n { font-weight: 500; color: var(--muted); margin-left: 4px; }
  .kp-tabs button[aria-selected="true"] { background: var(--ink); color: var(--white); } /* valitud olek eristub vähemalt 3:1 */
  .kp-tabs button[aria-selected="true"] .n { color: rgba(255,255,255,.75); }
  .kp-tabs + .kp-room, h2 + .kp-room { margin-top: 0; }
  #kasutasime h2 + .kp-room { margin-top: 28px; }
  .kp-room { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .kp-room.no-ph { grid-template-columns: minmax(0, 1fr); }
  .kp-room.no-ph .kp-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .kp-room[hidden] { display: none; }
  @media (max-width: 900px) { .kp-room { grid-template-columns: minmax(0, 1fr); } }
  .kp-ph { position: relative; margin: 0; overflow: hidden; background: var(--stone); }
  .kp-ph img { width: 100%; height: auto; display: block; }
  .kp-num { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 0; border-radius: 50%; background: var(--ink); color: var(--white); font: inherit; font-size: var(--fs-small); font-weight: 700; box-shadow: 0 0 0 4px rgba(255,255,255,.65); cursor: pointer; transition: background .2s, color .2s; }
  .kp-num.on, .kp-num:hover { background: var(--yellow); color: var(--ink); }
  .kp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
  .kp-li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; background: var(--card); padding: 18px; outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .2s; }
  .kp-li.on { outline-color: var(--ink); }
  .kp-li:focus { outline-color: var(--ink); }
  .kp-n { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--white); font-size: var(--fs-fine); font-weight: 700; display: grid; place-items: center; }
  .kp-li.on .kp-n { background: var(--yellow); color: var(--ink); }
  .kp-li .k { display: block; margin-bottom: 4px; }
  .kp-li h3 { font-size: var(--fs-body); font-weight: 600; line-height: 1.3; }
  .kp-li p { font-size: var(--fs-small); color: var(--muted); margin-top: 4px; }
  .kp-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
  .kp-act:empty { display: none; }
  .kp-price { font-weight: 800; font-size: var(--fs-body); }
  .kp-sum { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; background: var(--ink); color: var(--white); padding: 14px 18px; }
  .kp-sum-a { display: flex; gap: 10px; flex-wrap: wrap; }
  .kp-sum .btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
  .kp-sum .btn.primary:hover { background: var(--white); border-color: var(--white); }
  .kp-sum .btn.ghost { color: var(--white); border-color: var(--white); }
  .kp-sum .btn.ghost:hover { background: var(--white); color: var(--ink); }
  .kp-sum :focus-visible { outline-color: var(--yellow); }
  .kp-msg { margin-top: 12px; font-size: var(--fs-small); font-weight: 600; min-height: 1.5em; }
  .lah { background: var(--yellow); padding: 20px; display: grid; gap: 10px; margin-top: 22px; }
  .lah h4 { font-size: var(--fs-body); font-weight: 700; }
  .lah-r { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; background: rgba(255,255,255,.6); padding: 10px 12px; }
  .lah-r:not(:has(.lah-ph)) { grid-template-columns: minmax(0, 1fr); }
  .lah-ph img { width: 56px; height: 56px; object-fit: contain; background: var(--white); display: block; }
  .lah-r b { display: block; font-size: var(--fs-ui); }
  .lah-r span { display: block; font-size: var(--fs-fine); color: var(--ink-soft); }
  .lah-a { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .lah-a:empty { display: none; }
  .lah .btn.ghost { background: var(--white); border-color: var(--ink); }
  .lah .btn.ghost:hover { background: var(--ink); color: var(--white); }
  .lah .kp-price { font-size: var(--fs-ui); }
  .lah .btn.primary { background: var(--ink); border-color: var(--ink); color: var(--white); }
  .lah .btn.primary:hover { background: var(--white); color: var(--ink); }
