/* Fixes on top of the imported design (dc/arvia.css), mostly for phones and tablets.
   Kept in its own file, loaded after arvia.css, so `bun scripts/site/import.mjs` (which rewrites
   public/site/dc/) does not undo them. */

/* Home hero: it was 64% of the screen's width tall (920 px on a 1440 px screen), taller than a
   laptop's browser window, so the slide bars and the pause button sat below the fold. It now fits
   the window's height (560–920 px) and the headline scales with the height too. On a window too short
   for its text, the hero grows instead of running the text up under the header. (The 1920×1080
   prototype sets its own --hero-h and keeps it.) */
#root { --hero-h: clamp(560px, min(64vw, 100vh), 920px); --hero-h: clamp(560px, min(64vw, 100svh), 920px); }
.hv__title { font-size: clamp(40px, min(5.6vw, 9.6svh), 84px); }
@media (min-width: 1101px) {
  .hv { height: auto; min-height: var(--hero-h); display: flex; flex-direction: column; justify-content: flex-end; }
  .hv__content { position: relative; padding-top: 150px; }
}

/* Home hero text over light photos (sky, pale paths, sunlit lawn): the text block sat where the
   shade was thinnest, so the lead line and the buttons' surroundings washed out. The shade now
   darkens the whole lower half, and the headline and lead carry a soft shadow, whatever the photo. */
.hv__shade { background: linear-gradient(180deg, rgba(12,17,8,.5) 0%, rgba(12,17,8,.08) 24%, rgba(12,17,8,.18) 42%, rgba(12,17,8,.62) 68%, rgba(12,17,8,.82) 100%); }
.hv__title, .hv__lead { text-shadow: 0 1px 2px rgba(12,17,8,.35), 0 4px 24px rgba(12,17,8,.45); }
.hv__lead { color: #F7F6EE; }
.hv .btn--ondark { background-color: rgba(12,17,8,.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hv__shop { text-shadow: 0 1px 2px rgba(12,17,8,.4), 0 2px 12px rgba(12,17,8,.4); }

/* Home hero: below ~1100px the text block is taller than the hero, so it ran up under the
   header (logo and menu over the headline). The hero now grows with its text, which starts
   below the header; on large screens nothing changes. */
@media (max-width: 1100px) {
  .hv { height: auto; min-height: var(--hero-h, clamp(600px, 64vw, 920px)); display: flex; flex-direction: column; justify-content: flex-end; }
  .hv__content { position: relative; padding-top: 140px; }
  /* The text now sits higher, over sky: a darker veil keeps it readable. */
  .hv__shade { background: linear-gradient(180deg, rgba(12,17,8,.62) 0%, rgba(12,17,8,.55) 45%, rgba(12,17,8,.78) 100%); }
}

/* Side columns that stay in view while their list scrolls only work side by side. Once the
   layout stacks they slid over the content below them (Acasă "Un proces clar", Servicii,
   Serviciu, Proiectează, the order summary). Lucrări's filter bar stays sticky on purpose. */
@media (max-width: 980px) {
  aside[style*="position: sticky"],
  div[style*="position: sticky"],
  .shop__side { position: static !important; }
}

/* Shop, phones: two plants per row instead of one full-width photo per screen. */
@media (max-width: 560px) {
  .lo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .lo-row { flex-direction: column; gap: 2px; }
  .lo-name { font-size: 14.5px; }
  .lo-quick { font-size: 13px; }
}

/* Shop info strip under the title: on phones its items stacked with a stray left border. */
@media (max-width: 700px) {
  .lo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lo-strip > div, .lo-strip > div + div { padding: 12px 12px 12px 0; border-left: 0; }
  .lo-strip > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--lo-line); }
  .lo-strip > div:nth-child(n + 3) { border-top: 1px solid var(--lo-line); }
}

/* Shop "Filtre" toggle on phones and tablets: it was a 14 px high text link. */
@media (max-width: 900px) {
  .lo-fbtn { min-height: 44px; padding: 0 18px !important; border: 1px solid var(--lo-line) !important; border-radius: 999px; align-items: center; gap: 6px; font-size: 15px !important; }
}

/* Tiled lists with 1px lines between the tiles (Serviciu "Ce primești", Magazin details, Lucrări
   numbers): the lines were the container's background showing through the gaps, so empty cells
   of an incomplete last row showed as a solid beige block. The lines are now drawn by the tiles. */
[style*="gap: 1px; background: var(--line)"] { background: var(--paper) !important; }
[style*="gap: 1px; background: var(--line)"] > * { box-shadow: 0 0 0 1px var(--line); }

/* Home service panels, stacked (phones and tablets): text over the light garden-plan drawing
   was hard to read; a darker veil under the text. */
@media (max-width: 900px) {
  .fp__shade { background: linear-gradient(180deg, rgba(12,17,8,.45) 0%, rgba(12,17,8,.35) 30%, rgba(12,17,8,.88) 100%); }
}

/* Phones and tablets: footer links and breadcrumbs big enough to tap (they were about 20 px high). */
@media (max-width: 900px) {
  footer .foot-link { display: inline-block; padding: 8px 0; }
  nav[aria-label="Breadcrumb"] a { display: inline-block; padding: 10px 0; }
}

/* The page scrolled behind the open phone menu, cart and photo viewer. */
html:has(#root header button[aria-controls="mobile-menu"][aria-expanded="true"]),
html:has(#root [role="dialog"][aria-modal="true"]) { overflow: hidden; }

/* Very narrow phones (old 320 px phones, Android with large text ≈ 280 px): grids whose columns are
   at least 240–280 px wide ran past the right edge (Acasă "Nu știi de unde să începi?", Serviciu
   previous/next, Audit). One column that fits. */
@media (max-width: 340px) {
  [style*="repeat(auto-fit, minmax(2"], .art-svc { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Phones and tablets: text links standing alone ("Toate lucrările", "Despre proiectăm", the phone
   number) were about 21 px high to tap. A larger tap area, the underline stays where it is. */
@media (max-width: 900px) {
  a.link { position: relative; }
  a.link::after { content: ""; position: absolute; inset: -10px 0; }
}

/* The header stays in view while scrolling. Its top line (address, phone) scrolls away and the
   menu row sticks to the top. On the home page the header lies over the hero photo: it stays
   transparent there and turns dark once the page scrolls (.is-scrolled, set in src/site/App.jsx,
   which also measures --hdr-bar and --hdr-h). Only the page's own header: not the headers drawn
   inside the 1920×1080 prototype. */
#root > div > header { position: sticky !important; top: calc(-1 * var(--hdr-bar, 36px)); z-index: 30 !important; }
#root > div > header.hdr--overlay { position: fixed !important; top: 0; transition: transform .3s var(--ease), background-color .3s, border-color .3s; }
html.is-scrolled #root > div > header.hdr--overlay { animation: none; transform: translateY(calc(-1 * var(--hdr-bar, 36px))); background: rgba(12,17,8,.88) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom-color: rgba(255,255,255,.08) !important; }
/* The phone menu scrolls inside itself if it is taller than the screen. */
#root > div > header #mobile-menu { max-height: calc(100vh - var(--hdr-h, 76px)); max-height: calc(100svh - var(--hdr-h, 76px)); overflow-y: auto; overscroll-behavior: contain; }
/* What sticks below the header (side summaries, Lucrări's filter bar) and what a link or a button
   scrolls to now lands below the header instead of under it. */
html { scroll-padding-top: calc(var(--hdr-h, 76px) + 12px); }
#root main [style*="position: sticky"], .shop__side, .lo-side, .sim2-side { top: calc(var(--hdr-h, 76px) + 16px) !important; }
#root main [style*="position: sticky; top: 0"] { top: var(--hdr-h, 76px) !important; }

/* Home hero slideshow. It has invisible strips over the photo that switch to a slide and stop the
   slideshow while the mouse is on them; the photo fills the screen, so on a computer the slideshow
   stood still and jumped whenever the mouse moved. The strips are off: the slides change on their
   own, and the bars below (and the pause button) still choose and stop them. The opening, the photo
   coming into focus from a blur, took 1.8 s and read as a slow page: shorter and lighter now. */
.hv__zones { display: none; }
.hv__stage { transform: scale(1.06); filter: blur(8px); transition-duration: .9s; }

/* Photos with square corners everywhere (ARVIA's choice, like the home page's photo sections):
   photo frames, cards that open with a photo, and photos rounded by an inline style. Tags, round
   buttons and the large text panels keep their shapes. */
#root :is(.media, .fg__media, .sp__media, .ga-photo, .ga-map, .lo-media, .ba, .pc, .card:has(img), button.hover-lift:has(img), .acc-photos__item, .lib-row__img),
#root [style*="border-radius"]:has(> img),
#root img[style*="border-radius"] { border-radius: 0 !important; }

/* Ghiduri heroes: sized by the screen's width only (up to 760 px for the list, 920 px for an
   article), so on a laptop the list's theme tabs and the article's start fell below the fold.
   Now they also fit the window's height, under the header; the list keeps room for its tabs. */
section.on-dark[style*="min-height: clamp(560px, 50vw, 760px)"] { min-height: clamp(420px, calc(100vh - var(--hdr-h, 76px) - var(--hdr-bar, 36px) - 112px), 760px) !important; min-height: clamp(420px, calc(100svh - var(--hdr-h, 76px) - var(--hdr-bar, 36px) - 112px), 760px) !important; }
section.on-dark[style*="min-height: clamp(560px, 50vw, 760px)"] h1 { font-size: clamp(44px, min(7vw, 11vh), 112px) !important; }
section.on-dark[style*="min-height: clamp(560px, 50vw, 760px)"] .wrap { padding-top: 72px !important; }
.ga-hero { height: clamp(560px, min(62vw, calc(100vh - var(--hdr-h, 76px) - var(--hdr-bar, 36px))), 920px); height: clamp(560px, min(62vw, calc(100svh - var(--hdr-h, 76px) - var(--hdr-bar, 36px))), 920px); }

/* After an in-app page change the new heading (or main) gets the focus, so screen readers announce
   the page (src/site/App.jsx). It isn't something to click: no focus ring on it (Safari drew one). */
#root [tabindex="-1"]:focus, #root [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }

/* The hero's photos follow a swipe or a drag (Home.dc.html swDown/swMove/swUp): vertical scrolling
   stays the browser's, sideways moves are the slider's; no image ghost or text selection while dragging. */
.hv { touch-action: pan-y; cursor: grab; }
.hv.is-drag { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.hv a, .hv button { cursor: pointer; }
.hv__img { -webkit-user-drag: none; user-select: none; }
.hv__stage { translate: calc(var(--sw, 0px) * .18) 0; transition: transform 1.8s cubic-bezier(.215,.61,.355,1), filter 1.8s cubic-bezier(.215,.61,.355,1), translate .35s cubic-bezier(.2,.7,.2,1), scale .35s cubic-bezier(.2,.7,.2,1); }
.hv.is-drag .hv__stage { scale: 1.06; transition: transform 1.8s cubic-bezier(.215,.61,.355,1), filter 1.8s cubic-bezier(.215,.61,.355,1), scale .35s cubic-bezier(.2,.7,.2,1); }

/* Sliders: the whole bar answers a press or a drag (src/site/base.js, dragAnywhereSliders), with a
   finger-sized hit area and thumb; the slider keeps horizontal moves for itself. */
input[type="range"] { touch-action: none; }
input.simt__range { height: 44px; }
input.simt__range::-webkit-slider-thumb { width: 30px; height: 30px; margin-top: -12px; }
input.simt__range::-moz-range-thumb { width: 26px; height: 26px; }
input.simt__range.is-dragging::-webkit-slider-thumb { transform: scale(1.15); }
#sv-area, #sv-zones { height: 44px !important; }
/* On touch screens a tapped chip kept its hover border and looked chosen: hover only where there is one. */
@media (hover: none) {
  .chip:hover { border-color: var(--line-strong); }
  .chip.is-on:hover, .chip[aria-pressed="true"]:hover { border-color: var(--forest); }
}

/* The language switch, next to the menu: a globe and RO / EN, outlined like a button. */
.iconbtn.hdr-lang { width: auto; gap: 6px; padding: 0 12px; border: 1px solid color-mix(in srgb, currentColor 32%, transparent); font: 600 13px/1 var(--font-sans); letter-spacing: .06em; text-decoration: none; }
.iconbtn.hdr-lang svg { flex: none; }

/* The official mark in the header keeps the brand's lime on the photo and on the dark header. */
.hdr-logo svg.hdr-mark, .hdr--overlay .hdr-logo svg.hdr-mark, #root > div > header .hdr-logo svg.hdr-mark { stroke: var(--lime, #C9DC3A); }
