/*
Theme Name: D.Craft Galdniecība
Theme URI: https://dcraft.parnet.uk
Author: SIA "D.Craft"
Description: Vienas lapas tēma D.Craft galdniecībai. Teksti un attēli — Lapas saturs → Teksti un attēli; darbu foto — Galerija; pakalpojumi un soļi — Lapas saturs; klientu pieteikumi — Pieteikumi; rokasgrāmata — Palīdzība.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: dcraft-galdnieciba
*/

/* =========================================================
   Fonts — self-hosted (latin + latin-ext covers Latvian)
   ========================================================= */
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/marcellus-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/marcellus-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 300 600; font-display: swap; src: url(assets/fonts/work-sans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 300 600; font-display: swap; src: url(assets/fonts/work-sans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* =========================================================
   Base
   ========================================================= */
html { scroll-behavior: smooth; }
body { margin: 0; background-color: #F4EFE7; color: #241D14; font-family: 'Work Sans', sans-serif; }
/* Zero-specificity so every component colour wins. */
:where(a) { color: #9A6B39; text-decoration: none; }
:where(a:hover) { color: #241D14; }
::selection { background: #9A6B39; color: #fff; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: #241D14; color: #FBF7F0; font-size: 14px; }
.skip-link:focus { top: 12px; color: #FBF7F0; }

/* =========================================================
   Layout + side rail
   ========================================================= */
.page-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
main { min-width: 0; }

.rail { position: sticky; top: 0; height: 100vh; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; border-right: 1px solid transparent; border-image: linear-gradient(180deg, transparent 0%, rgba(36,29,20,0.28) 18%, rgba(36,29,20,0.28) 72%, transparent 100%) 1; padding: 36px 28px; display: flex; flex-direction: column; gap: 28px; background: linear-gradient(180deg, rgba(244,239,231,0.94) 0%, rgba(244,239,231,0.6) 62%, rgba(237,229,216,0.34) 100%); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 40; }
.rail-head, .rail-head:hover { display: flex; align-items: center; gap: 14px; color: inherit; }
.rail-stamp { width: 58px; height: 58px; border: 1.5px solid rgba(154,107,57,0.65); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #8A5E30; flex: none; }
.rail-stamp-main { font-family: 'Marcellus', serif; font-size: 20px; line-height: 1; }
.rail-brand { margin: 0; font-family: 'Marcellus', serif; font-size: 26px; letter-spacing: 2px; }
/* Logo in place of the stamp + wordmark: logo above, tagline below. */
.rail-head--logo, .rail-head--logo:hover { flex-direction: column; align-items: flex-start; gap: 12px; }
.rail-logo { display: block; width: 184px; height: auto; }
.rail-head--logo .rail-tagline { margin: 0; }
.rail-tagline { margin: 4px 0 0; font-size: 11px; letter-spacing: 1.5px; color: #6E6253; text-transform: uppercase; }

.rail-nav { position: relative; display: flex; flex-direction: column; border-top: 1px solid rgba(36,29,20,0.2); padding-top: 20px; }
.spy-marker { position: absolute; left: -28px; top: 22px; width: 3px; height: 30px; background: linear-gradient(180deg, transparent 0%, #9A6B39 30%, #9A6B39 70%, transparent 100%); transition: top 0.3s, opacity 0.3s; opacity: 0; }
.nav-lnk { display: flex; align-items: center; gap: 12px; font-size: 14px; height: 34px; color: #5C5245; font-weight: 400; white-space: nowrap; }
.nav-lnk.is-active { color: #241D14; font-weight: 600; }
.nav-lnk:hover { color: #8A5E30; }
.lang-switch { display: flex; gap: 2px; margin: -12px 0 0 -6px; font-size: 13px; letter-spacing: 1px; }
.lang-switch a { padding: 4px 6px; color: #8A5E30; }
.lang-switch a:hover { color: #241D14; }
.lang-switch a[aria-current] { color: #241D14; font-weight: 600; }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 18px; }
.rail-cta-group { display: flex; flex-direction: column; gap: 8px; }
.rail-cta-full { display: block; text-align: center; padding: 13px 16px; background: #9A6B39; color: #fff; font-weight: 600; font-size: 14px; letter-spacing: 0.5px; border-radius: 2px; }
.rail-cta-full:hover { background: #B07E45; color: #fff; }
.rail-rating { display: block; text-align: center; font-size: 13px; color: #5C5245; }
.rail-rating:hover { color: #8A5E30; }
.rail-avail { display: flex; gap: 10px; align-items: flex-start; }
.rail-avail .dot { width: 8px; height: 8px; border-radius: 50%; background: #6FA876; margin-top: 5px; flex: none; }
.rail-avail p { margin: 0; font-size: 13px; line-height: 1.5; color: #5C5245; }
.rail-contacts { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.rail-contacts a { color: #8A5E30; }
.rail-contacts .rail-phone { color: #241D14; font-weight: 600; }
.rail-address { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: #6E6253; }

/* =========================================================
   Shared sheet parts
   ========================================================= */
.sheet-title { margin: 0; font-family: 'Marcellus', serif; font-size: 40px; font-weight: 400; color: #FBF7F0; }

/* =========================================================
   Titullapa (hero)
   ========================================================= */
.sheet-hero { --bg: none; padding: 72px 64px 88px; position: relative; background-image: linear-gradient(105deg, rgba(26,20,13,0.95) 0%, rgba(36,29,20,0.87) 44%, rgba(84,58,32,0.62) 100%), var(--bg); background-size: cover; background-position: center 40%; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr); gap: 64px; align-items: center; }
.hero-title { margin: 0 0 24px; font-family: 'Marcellus', serif; font-size: clamp(44px, 5.5vw, 84px); line-height: 1.02; font-weight: 400; color: #FBF7F0; }
.hero-title span { color: #E8C79A; }
.hero-lead { margin: 0 0 36px; max-width: 520px; font-size: 18px; line-height: 1.65; color: rgba(251,247,240,0.82); font-weight: 300; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn { padding: 14px 28px; font-weight: 500; letter-spacing: 0.5px; border-radius: 2px; }
.btn-primary { background: #9A6B39; color: #fff; }
.btn-primary:hover { background: #B07E45; color: #fff; }
.btn-ghost { border: 1px solid rgba(251,247,240,0.5); color: #FBF7F0; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.1); color: #fff; }
.hero-rating { align-self: center; font-size: 13px; letter-spacing: 1px; color: #E8C79A; }
.hero-rating:hover { color: #fff; }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; object-position: center 60%; display: block; box-shadow: 0 14px 34px rgba(36,29,20,0.22); border: 8px solid #FBF7F0; }
.hero-caption { margin-top: 14px; font-size: 13px; letter-spacing: 0.3px; color: #C8A87C; }

/* =========================================================
   Pakalpojumi
   ========================================================= */
.sheet-services { --bg: none; padding: 72px 64px; background-image: linear-gradient(105deg, rgba(26,20,13,0.96) 0%, rgba(36,29,20,0.93) 46%, rgba(74,52,29,0.82) 100%), var(--bg); background-size: cover; background-position: center; }
.svc-head { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.svc-list { display: flex; flex-direction: column; border-top: 1px solid rgba(251,247,240,0.22); overflow-x: clip; }
.svc-row { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; padding: 32px 12px 32px 0; border-bottom: 1px solid rgba(251,247,240,0.16); transition: background 0.25s; }
/* Hover nudges the text right; transform, so nothing re-lays out. The price column stays put. */
.svc-main { transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.svc-row:hover { background: rgba(251,247,240,0.07); }
.svc-row:hover .svc-main { transform: translateX(16px); }
.svc-main { display: flex; gap: 18px; align-items: flex-start; }
.svc-thumb { width: 62px; height: 62px; object-fit: cover; border: 4px solid #FBF7F0; box-shadow: 0 5px 14px rgba(0,0,0,0.35); flex: none; }
/* When no service carries materials/price, drop the empty third column. */
.svc-list--nospec .svc-row { grid-template-columns: minmax(0, 1fr); }
.svc-list--nospec .svc-spec { display: none; }
.svc-main h3 { margin: 0 0 8px; font-family: 'Marcellus', serif; font-size: 25px; font-weight: 400; color: #FBF7F0; }
.svc-main p { margin: 0; font-size: 15px; line-height: 1.7; color: rgba(251,247,240,0.75); max-width: 560px; }
.svc-spec { display: flex; flex-direction: column; gap: 7px; align-items: flex-end; text-align: right; }
.svc-mat { font-size: 11px; letter-spacing: 2px; color: #C8A87C; text-transform: uppercase; }
.svc-price { font-family: 'Marcellus', serif; font-size: 19px; color: #E8C79A; }

/* =========================================================
   Darbi (gallery wall)
   ========================================================= */
.sheet-works { padding: 72px 64px; background: #241D14; }
.sheet-title.works-title { margin: 0 0 6px; }
.works-hint { margin: 0 0 34px; font-size: 13px; color: #9A8D7A; }
.wall { display: flex; align-items: flex-start; gap: 52px; overflow-x: auto; padding: 10px 8px 26px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(154,107,57,0.7) rgba(251,247,240,0.08); }
.wall:focus-visible { outline: 1px dashed rgba(200,168,124,0.6); outline-offset: 4px; }
.work { margin: 0; scroll-snap-align: start; }
.work-frame { background: #FBF7F0; padding: 12px; border: 1px solid rgba(200,168,124,0.45); box-shadow: 0 30px 50px -18px rgba(0,0,0,0.6); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s; }
.work-frame:hover { transform: translateY(-8px); box-shadow: 0 42px 64px -18px rgba(0,0,0,0.7); }
.work-crop { height: 40vh; width: 40vh; overflow: hidden; border: 1px solid rgba(36,29,20,0.18); }
.work-crop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work figcaption { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(200,168,124,0.3); max-width: 100%; }
.work-title { margin: 0; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 600; color: #FBF7F0; }
.work-meta { margin: 5px 0 0; font-size: 12.5px; color: #9A8D7A; }

/* =========================================================
   Meistars
   ========================================================= */
.sheet-about { --bg: none; padding: 72px 64px; background-image: linear-gradient(105deg, rgba(26,20,13,0.96) 0%, rgba(36,29,20,0.9) 44%, rgba(74,52,29,0.72) 100%), var(--bg); background-size: cover; background-position: center 30%; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 56px; align-items: center; }
.sheet-title.about-title { margin: 0 0 24px; }
.about-body { margin-bottom: 28px; }
.about-body p { margin: 0 0 18px; font-size: 17px; line-height: 1.7; color: rgba(251,247,240,0.82); }
.about-body p:last-child { margin-bottom: 0; }
.about-quote { margin: 0 0 28px; font-family: 'Marcellus', serif; font-size: 22px; line-height: 1.5; color: #FBF7F0; border-left: 1px solid #C8A87C; padding-left: 16px; }
.about-fig { max-width: 460px; justify-self: center; }
.about-fig img { width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; object-position: 62% 40%; display: block; border: 8px solid #FBF7F0; box-shadow: 0 12px 28px rgba(0,0,0,0.4); }

/* =========================================================
   Kā strādāju
   ========================================================= */
.sheet-process { padding: 72px 64px; }
.sheet-title.process-title { margin: 0 0 48px; color: inherit; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.step-num { margin: 0 0 10px; font-family: 'Marcellus', serif; font-size: 40px; line-height: 1; color: #9A6B39; }
.step h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.step-text { margin: 0; font-size: 15px; line-height: 1.6; color: #5C5245; }

/* =========================================================
   Pieteikums
   ========================================================= */
.sheet-apply { padding: 72px 64px 88px; background: #241D14; }
.sheet-title.apply-title { margin: 0 0 12px; }
.apply-lead { margin: 0 0 40px; max-width: 560px; font-size: 16px; line-height: 1.6; color: rgba(251,247,240,0.78); }
.apply-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 48px; align-items: start; }
.apply-card { border: 1px solid rgba(200,168,124,0.35); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.maker { display: flex; gap: 16px; align-items: center; }
.maker-photo { width: 84px; height: 84px; flex: none; border-radius: 50%; object-fit: cover; }
.maker-photo--empty { display: flex; align-items: center; justify-content: center; box-sizing: border-box; background: rgba(251,247,240,0.06); border: 1px solid rgba(200,168,124,0.35); font-family: 'Marcellus', serif; font-size: 28px; letter-spacing: 1px; color: #C8A87C; text-transform: uppercase; }
.maker-name { margin: 0; font-family: 'Marcellus', serif; font-size: 22px; color: #FBF7F0; }
.maker-role { margin: 4px 0 0; font-size: 13px; color: rgba(251,247,240,0.6); }
.apply-avail { display: flex; gap: 10px; align-items: flex-start; }
.apply-avail .dot { width: 8px; height: 8px; border-radius: 50%; background: #86C28B; margin-top: 6px; flex: none; }
.apply-avail p { margin: 0; font-size: 14px; line-height: 1.6; color: rgba(251,247,240,0.85); }
.apply-contacts { border-top: 1px solid rgba(200,168,124,0.25); padding-top: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.apply-contacts span { font-size: 13px; color: rgba(251,247,240,0.6); }
.apply-contacts a { color: #E8C79A; }
.apply-contacts .apply-phone { font-weight: 600; }
.apply-guarantee { margin: 0; font-size: 13px; color: rgba(251,247,240,0.6); border-top: 1px solid rgba(200,168,124,0.25); padding-top: 16px; }

.apply-thanks { background: rgba(200,168,124,0.12); border: 1px solid #9A6B39; padding: 32px; text-align: center; outline: none; }
.apply-thanks p { margin: 0; color: rgba(251,247,240,0.8); font-size: 16px; }
.apply-thanks p:first-child { margin: 0 0 8px; font-family: 'Marcellus', serif; font-size: 24px; color: #FBF7F0; }

.apply-form { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
/* min-width: 0 — a <select> otherwise refuses to shrink below its longest option and pushes the grid out of the sheet. */
.apply-form > * { min-width: 0; }
.apply-form input, .apply-form select, .apply-form textarea { width: 100%; box-sizing: border-box; padding: 14px 16px; background: rgba(251,247,240,0.06); border: 1px solid rgba(251,247,240,0.25); color: #FBF7F0; font-family: 'Work Sans', sans-serif; font-size: 15px; border-radius: 2px; }
.apply-form option { color: #241D14; }
.apply-form ::placeholder { color: rgba(251,247,240,0.6); opacity: 1; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field--wide { grid-column: span 2; }
.field-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #C8A87C; }
.apply-form :is(input, select, textarea):focus-visible { outline: 2px solid #C8A87C; outline-offset: 1px; }
.apply-form textarea { resize: vertical; }
.apply-form button { grid-column: span 2; padding: 16px; background: #9A6B39; color: #fff; border: none; font-family: 'Work Sans', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: 0.5px; cursor: pointer; border-radius: 2px; }
.apply-form button:hover { background: #B07E45; }
.apply-form button:disabled { opacity: 0.7; cursor: progress; }
.apply-note { grid-column: span 2; margin: 0; font-size: 13px; color: rgba(251,247,240,0.55); text-align: center; }
.apply-privacy { grid-column: span 2; margin: -10px 0 0; font-size: 12px; line-height: 1.5; color: rgba(251,247,240,0.55); text-align: center; }
.apply-privacy a { color: #C8A87C; text-decoration: underline; text-underline-offset: 2px; }
.apply-error { grid-column: span 2; margin: 0; padding: 12px 16px; border: 1px solid #C0705A; background: rgba(192,112,90,0.14); color: #F2C9BC; font-size: 14px; line-height: 1.5; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* =========================================================
   Footer, mobile bar, plain pages
   ========================================================= */
.site-footer { background: #1A140D; padding: 28px 64px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; align-items: center; }
.footer-brand { margin: 0; font-family: 'Marcellus', serif; font-size: 20px; letter-spacing: 2px; color: #FBF7F0; }
.footer-logo { display: block; width: auto; height: 30px; }
.footer-copy { margin: 0; color: #9A8D7A; font-size: 13px; }
.footer-copy a { color: #C8A87C; }
.footer-legal { flex-basis: 100%; margin: 0; color: #9A8D7A; font-size: 12px; line-height: 1.5; }
.footer-legal a { color: #C8A87C; text-decoration: underline; text-underline-offset: 2px; }
/* On the front page the footer closes the last sheet: full-bleed band below the form. */
.sheet-apply .site-footer { margin: 72px -64px -88px; }

.mob-cta { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: #241D14; border-top: 1px solid rgba(200,168,124,0.35); padding: 12px 16px; gap: 12px; align-items: center; justify-content: space-between; }
.mob-cta-text { color: #FBF7F0; font-size: 14px; }
.mob-cta-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.mob-cta-btn { padding: 10px 18px; background: #9A6B39; color: #fff; border-radius: 2px; font-weight: 600; font-size: 14px; }
.mob-cta-btn:hover { background: #B07E45; color: #fff; }
.mob-cta-call { display: none; padding: 9px 16px; border: 1px solid rgba(232,199,154,0.5); color: #E8C79A; border-radius: 2px; font-weight: 600; font-size: 14px; }
.mob-cta-call:hover { border-color: #E8C79A; color: #fff; }
/* With JS the bar slides in only once the hero buttons are off-screen, and steps aside at the form. */
.js .mob-cta { transform: translateY(100%); visibility: hidden; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.3s; }
.js .mob-cta.is-shown { transform: none; visibility: visible; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s; }

.sheet-page { padding: 72px 64px 88px; min-height: 60vh; }
.sheet-title.page-title { margin: 0 0 32px; color: inherit; }
.page-content { max-width: 720px; font-size: 17px; line-height: 1.7; color: #5C5245; }
.page-content a { color: #8A5E30; text-decoration: underline; }
.page-content h2 { margin: 40px 0 12px; font-family: 'Marcellus', serif; font-size: 25px; font-weight: 400; line-height: 1.3; color: #241D14; }
.page-content h3 { margin: 28px 0 8px; font-size: 17px; font-weight: 600; color: #241D14; }
.page-content p, .page-content li { margin: 0 0 12px; }
.page-content ul, .page-content ol { margin: 0 0 16px; padding-left: 22px; }
.page-content table { width: 100%; margin: 8px 0 20px; border-collapse: collapse; font-size: 15px; }
.page-content th, .page-content td { padding: 9px 10px; border-bottom: 1px solid rgba(36,29,20,0.15); text-align: left; vertical-align: top; }
.page-content th { font-weight: 600; color: #241D14; }
.page-content .dcg-controller { list-style: none; padding: 16px 20px; border: 1px solid rgba(36,29,20,0.2); background: rgba(251,247,240,0.6); }
.page-content .dcg-controller li { margin: 0 0 4px; }
.page-content .dcg-missing { color: #A33A2A; }

/* =========================================================
   Desktop fade mode + responsive overrides.
   ========================================================= */
.wall::-webkit-scrollbar { height: 8px; }
.wall::-webkit-scrollbar-thumb { background: rgba(154,107,57,0.6); border-radius: 4px; }
.wall::-webkit-scrollbar-track { background: rgba(251,247,240,0.08); }
@media (max-height: 720px) { .wall { gap: 24px 32px !important; } }

.fx-driver { display: none; }
body.fx-on .fx-driver { display: block; height: 525vh; }
body.fx-on .page-grid { position: fixed; top: 0; left: 0; right: 0; height: 100vh; overflow: hidden; z-index: 5; }
body.fx-on main { position: relative; height: 100vh; overflow: hidden; }
body.fx-on main > div, body.fx-on main > footer { display: none !important; }
body.fx-on main > .sheet { display: flex; flex-direction: column; justify-content: flex-start; position: absolute !important; inset: 0; box-sizing: border-box; padding: 40px 64px !important; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(20px); transition: opacity 0.75s cubic-bezier(0.33, 0, 0.2, 1), transform 0.75s cubic-bezier(0.33, 0, 0.2, 1); z-index: 1; }
/* Centre the sheet's content with auto margins instead of justify-content: center,
   so a sheet taller than the screen starts at its top and scrolls instead of being clipped at both ends. */
body.fx-on main > .sheet::before, body.fx-on main > .sheet::after { content: ''; display: block; flex: 0 0 auto; margin: auto 0; }
body.fx-on main > .sheet.fx-passed { transform: translateY(-20px); }
body.fx-on main > .sheet.fx-active { opacity: 1; pointer-events: auto; transform: none; z-index: 2; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(154,107,57,0.7) transparent; }
body.fx-on main > .sheet.fx-active::-webkit-scrollbar { width: 8px; }
body.fx-on main > .sheet.fx-active::-webkit-scrollbar-thumb { background: rgba(154,107,57,0.6); border-radius: 4px; }
body.fx-on .sheet h2 { font-size: 34px !important; margin-bottom: 24px !important; }
body.fx-on .svc-head { margin-bottom: 24px; }
body.fx-on #pakalpojumi .svc-row { padding: 15px 12px 15px 0 !important; }
body.fx-on #pakalpojumi h3 { font-size: 21px !important; margin-bottom: 5px !important; }
body.fx-on #sakums img { max-height: 36vh; }
body.fx-on .about-fig { max-width: calc(46vh * 0.8) !important; }
body.fx-on #process .step-num { font-size: 34px !important; margin-bottom: 8px !important; }
body.fx-on #pieteikums h2 { margin-bottom: 10px !important; }
body.fx-on .apply-lead { margin: 0 0 22px; }
body.fx-on #pieteikums textarea { min-height: 60px; }
body.fx-on .sheet-apply .site-footer { margin: 36px 0 0; padding: 16px 0 0; background: none; border-top: 1px solid rgba(200,168,124,0.25); }
body.fx-on .sheet-apply .footer-brand { font-size: 16px; }
body.fx-on .sheet-apply .footer-logo { height: 24px; }
/* Logged-in admin bar: keep the fixed stage below it. */
body.admin-bar.fx-on .page-grid { top: 32px; height: calc(100vh - 32px); }
body.admin-bar.fx-on main, body.admin-bar.fx-on .rail { height: calc(100vh - 32px); }
/* Compact sizing for laptop screens up to 800px tall. */
@media (max-height: 800px) {
  body.fx-on .sheet h2 { font-size: 28px !important; margin-bottom: 16px !important; }
  body.fx-on .svc-head { margin-bottom: 14px; }
  body.fx-on main > .sheet { padding: 28px 64px !important; }
  body.fx-on #pakalpojumi .svc-row { padding: 10px 12px 10px 0 !important; }
  body.fx-on #pakalpojumi h3 { font-size: 18px !important; }
  body.fx-on #pakalpojumi .svc-row div p { font-size: 13.5px !important; line-height: 1.5 !important; }
  body.fx-on .svc-spec span { font-size: 10px !important; }
  body.fx-on .svc-spec span:last-child { font-size: 16px !important; }
  body.fx-on #process .step-num { font-size: 28px !important; }
  body.fx-on #process h3 { font-size: 15px !important; }
  body.fx-on #process p { font-size: 13.5px !important; }
  body.fx-on #pieteikums textarea { min-height: 44px; }
  body.fx-on .apply-form { gap: 14px; }
  body.fx-on .field { gap: 6px; }
  body.fx-on .sheet-apply .site-footer { margin-top: 22px; padding-top: 12px; }
  body.fx-on #sakums h1 { font-size: clamp(36px, 4.2vw, 60px) !important; margin-bottom: 14px !important; }
  body.fx-on #sakums img { max-height: 30vh; }
  body.fx-on .hero-lead { font-size: 16px; margin-bottom: 24px; }
}
@media (max-width: 1150px) {
  .mob-cta { display: flex; } body { padding-bottom: 64px; }
  /* On the front page the bar steps aside at the form, so the page end needs no room for it. */
  .js body.dcg-onepage { padding-bottom: 0; }
}
@media (min-width: 561px) and (max-width: 1150px) { .mob-cta-call { display: inline-block; } }
@media (max-width: 1150px) {
  .rail { position: sticky !important; top: 0 !important; width: 100% !important; height: auto !important; border-right: none !important; border-image: none !important; border-bottom: 1px solid rgba(36,29,20,0.2); flex-direction: row !important; align-items: center !important; gap: 14px !important; padding: 10px 20px !important; background: rgba(244,239,231,0.95) !important; }
  .rail-head { flex: none; gap: 10px !important; }
  .rail-stamp { transform: scale(0.8); margin: -7px; }
  .rail-head .rail-txt p:first-child { font-size: 20px !important; }
  .rail-head .rail-txt p:last-child { display: none; }
  .rail-head--logo .rail-txt { display: none; }
  .rail-head--logo .rail-logo { width: auto; height: 30px; }
  .rail-nav { flex-direction: row !important; border-top: none !important; padding-top: 0 !important; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-nav { padding-right: 28px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  .sheet { scroll-margin-top: 68px; }
  .nav-lnk { height: auto !important; padding: 6px 10px; flex: none; }
  .lang-switch { flex: none; margin: 0; }
  .lang-switch a { padding: 6px; }
  .spy-marker { display: none; }
  .rail-foot { display: none !important; }
  .page-grid { grid-template-columns: 1fr !important; }
  .hero-grid, .apply-grid { grid-template-columns: 1fr !important; }
  .svc-row { grid-template-columns: minmax(0, 1fr) !important; }
  .svc-spec { align-items: flex-start !important; text-align: left !important; flex-direction: row !important; flex-wrap: wrap; gap: 14px !important; }
  body.admin-bar .rail { top: 32px !important; }
}
@media (max-width: 782px) { body.admin-bar .rail { top: 46px !important; } }
@media (max-width: 600px) { body.admin-bar .rail { top: 0 !important; } }
@media (max-width: 720px) {
  .sheet { padding: 56px 24px !important; }
  .sheet h2 { font-size: 31px !important; }
  .sheet .page-content h2 { font-size: 22px !important; }
  /* Policy tables: each row becomes a small card, the column name before each value. */
  .page-content thead { display: none; }
  .page-content tr { display: block; padding: 10px 0; border-bottom: 1px solid rgba(36,29,20,0.15); }
  .page-content td { display: block; padding: 2px 0; border: 0; }
  .page-content td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: #241D14; }
  .page-content td:first-child { font-weight: 600; color: #241D14; }
  .page-content td:first-child::before { content: none; }
  #sakums h1 { font-size: clamp(36px, 10vw, 58px) !important; }
  .hero-grid { gap: 36px !important; }
  .page-grid footer { padding: 24px !important; }
  .apply-form { grid-template-columns: 1fr; }
  .apply-form > * { grid-column: auto !important; }
  .sheet-apply .site-footer { margin: 56px -24px -56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.fx-on main > .sheet, body.fx-on main > .sheet.fx-passed { transition: opacity 0.2s linear; transform: none; }
  .svc-row, .svc-main, .work-frame, .spy-marker, .mob-cta { transition: none !important; }
}
