/* ============================================================
   URISTST — DESIGN SYSTEM  (DESIGN LOCK v1)
   Scope: global tokens, Header desktop/sticky, Mobile Header,
   Footer desktop/mobile, Button system.
   Only child theme. Astra parent untouched.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root{
  /* colors */
  --color-bg-main:#F4F1EB;
  --color-surface:#FFFFFF;
  --color-text-primary:#172231;
  --color-text-secondary:#5E6470;
  --color-accent:#9A503F;
  --color-accent-dark:#7f4333;
  --color-border:#D8D3CA;
  --color-dark-surface:#172231;
  --color-text-on-dark:#F4F1EB;

  /* typography */
  --font-sans:"Segoe UI",Arial,Helvetica,sans-serif;

  --fs-display:64px; --lh-display:68px;
  --fs-h1:52px;      --lh-h1:58px;
  --fs-h2:40px;      --lh-h2:48px;
  --fs-h3:24px;      --lh-h3:32px;
  --fs-lead:21px;    --lh-lead:32px;
  --fs-body-large:18px; --lh-body-large:30px;
  --fs-body:16px;    --lh-body:27px;
  --fs-small:14px;   --lh-small:21px;
  --fs-meta:13px;    --lh-meta:18px;
  --fs-button:15px;  --lh-button:20px;

  /* container */
  --container-max:1180px;
  --container-pad-mobile:20px;

  /* spacing scale */
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-6:24px;
  --sp-8:32px;
  --sp-10:40px;
  --sp-12:48px;
  --sp-16:64px;
  --sp-20:80px;
  --sp-24:96px;
  --sp-30:120px;

  /* radius */
  --radius-btn:5px;
  --radius-input:4px;
  --radius-surface:6px;
  --radius-max:8px;

  /* shadow (default none; sticky only) */
  --shadow-none:none;
  --shadow-sticky:0 8px 24px rgba(23,34,49,.07);

  /* motion */
  --dur:200ms;
  --ease:ease;

  /* header heights */
  --header-h-top:88px;
  --header-h-sticky:70px;
  --header-h-mobile-top:72px;
  --header-h-mobile-sticky:64px;
}

/* ---------- 2. Base ---------- */
html{
  scroll-padding-top:calc(var(--header-h-sticky) + 12px);
}
body{
  background:var(--color-bg-main);
  color:var(--color-text-primary);
  font-family:var(--font-sans);
  font-size:var(--fs-body);
  line-height:var(--lh-body);
  -webkit-font-smoothing:antialiased;
}
.site-content{ background:var(--color-bg-main); }

/* Typography scale (applied to editorial headings) */
.entry-content h1,.entry-content h2,.entry-content h3,
.entry-content .wp-block-heading{
  font-family:var(--font-sans);
  color:var(--color-text-primary);
}
.entry-content h1{ font-size:var(--fs-h1); line-height:var(--lh-h1); font-weight:700; }
.entry-content h2{ font-size:var(--fs-h2); line-height:var(--lh-h2); font-weight:700; }
.entry-content h3{ font-size:var(--fs-h3); line-height:var(--lh-h3); font-weight:700; }

/* Legacy pages: neutralise Astra's default top spacing on the content wrapper
   so the first section sits flush under the sticky header (sections keep
   their own DESIGN LOCK padding). */
.entry-content > .uristst-legacy{
  padding-top:0;
}

/* Global focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible{
  outline:2px solid var(--color-accent);
  outline-offset:2px;
}

/* ---------- 3. Button system (used by header/footer) ---------- */
.uristst-btn{
  display:inline-block;
  box-sizing:border-box;
  padding:var(--sp-3) 22px;
  border:1px solid transparent;
  border-radius:var(--radius-btn);
  font-family:var(--font-sans);
  font-size:var(--fs-button);
  font-weight:600;
  line-height:var(--lh-button);
  text-align:center;
  text-decoration:none;
  cursor:pointer;
  transition:background-color var(--dur) var(--ease),
             border-color var(--dur) var(--ease),
             color var(--dur) var(--ease),
             box-shadow var(--dur) var(--ease);
}
/* Primary */
.uristst-btn--primary{
  background:var(--color-accent);
  border-color:var(--color-accent);
  color:var(--color-surface);
}
.uristst-btn--primary:hover{
  background:var(--color-accent-dark);
  border-color:var(--color-accent-dark);
  color:var(--color-surface);
}
.uristst-btn--primary:focus-visible{
  outline:2px solid var(--color-text-primary);
  outline-offset:3px;
}
.uristst-btn--primary:active{
  background:var(--color-accent-dark);
  box-shadow:inset 0 2px 4px rgba(0,0,0,.18);
}
/* Secondary */
.uristst-btn--secondary{
  background:transparent;
  border-color:var(--color-accent);
  color:var(--color-text-primary);
}
.uristst-btn--secondary:hover{
  border-color:var(--color-accent-dark);
  color:var(--color-accent-dark);
}
.uristst-btn--secondary:focus-visible{
  outline:2px solid var(--color-accent);
  outline-offset:3px;
}
.uristst-btn--secondary:active{
  box-shadow:inset 0 2px 4px rgba(0,0,0,.08);
}

/* ---------- 4. Header shell (desktop + mobile) ---------- */
#masthead{
  position:sticky;
  top:0;
  left:auto;
  right:auto;
  z-index:40;
  background:var(--color-surface);
  border-bottom:1px solid var(--color-border);
  box-shadow:var(--shadow-none);
  transition:box-shadow var(--dur) var(--ease);
}
/* Neutralize Astra transparent-header overlay behaviour for this stage */
body.ast-theme-transparent-header #masthead{
  position:sticky;
  top:0;
  left:auto;
  right:auto;
  z-index:40;
}
body.ast-theme-transparent-header .main-header-bar{
  background:var(--color-surface);
}
body.ast-theme-transparent-header .ast-builder-menu .main-header-menu,
body.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-link,
body.ast-theme-transparent-header [class*="ast-builder-menu-"] .main-header-menu .menu-item > .menu-link,
body.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item > .ast-menu-toggle{
  color:var(--color-text-primary);
}
body.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link,
body.ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .ast-menu-toggle,
body.ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link,
body.ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link,
body.ast-theme-transparent-header [class*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link{
  color:var(--color-accent);
}

/* ---------- 5. Header — desktop TOP ---------- */
#ast-desktop-header .ast-primary-header-bar{
  min-height:var(--header-h-top);
  background:var(--color-surface);
}
#ast-desktop-header .site-primary-header-wrap{
  max-width:var(--container-max);
  width:100%;
}
#ast-desktop-header .ast-builder-grid-row{
  align-items:center;
}
/* Branding */
#ast-desktop-header .site-branding{
  display:flex;
  align-items:center;
  min-height:0;
  gap:var(--sp-3);
}
/* Hide Astra's own site title/tagline — we inject our identity via astra_logo filter */
#ast-desktop-header .ast-site-title-wrap{ display:none; }
#ast-desktop-header .site-logo-img .custom-logo{
  width:auto;
  height:54px;
  max-width:none;
}
#ast-desktop-header .site-logo-img{
  flex-shrink:0;
}

/* Header identity (injected via astra_logo filter) */
.uristst-header-identity{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
}
.uristst-header-identity__name{
  font-size:16px;
  font-weight:600;
  line-height:1.25;
  color:var(--color-text-primary);
  white-space:nowrap;
}
.uristst-header-identity__subtitle{
  font-size:12px;
  font-weight:400;
  line-height:1.3;
  color:var(--color-text-secondary);
  letter-spacing:.02em;
  white-space:nowrap;
}

/* Menu */
#ast-desktop-header .ast-builder-menu-1 .main-header-menu{
  flex-wrap:nowrap;
  gap:var(--sp-1);
}
#ast-desktop-header .ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link,
#ast-desktop-header .ast-builder-menu-1 .menu-item > .menu-link{
  padding:var(--sp-3) var(--sp-4);
  font-size:var(--fs-body);
  font-weight:600;
  line-height:var(--lh-button);
  letter-spacing:0;
  text-transform:none;
  color:var(--color-text-primary);
  white-space:nowrap;
}
#ast-desktop-header .ast-builder-menu-1 .menu-item > .menu-link:hover{
  color:var(--color-accent);
}
#ast-desktop-header .ast-builder-menu-1 .main-header-menu > .current-menu-item > .menu-link,
#ast-desktop-header .ast-builder-menu-1 .main-header-menu > .current-menu-ancestor > .menu-link{
  color:var(--color-accent);
}
/* Submenus */
#ast-desktop-header .ast-builder-menu-1 .main-header-menu .sub-menu{
  background:var(--color-surface);
  border:1px solid var(--color-border);
  border-radius:var(--radius-surface);
  box-shadow:var(--shadow-sticky);
  padding:var(--sp-2) 0;
}
#ast-desktop-header .ast-builder-menu-1 .main-header-menu .sub-menu .menu-item > .menu-link{
  color:var(--color-text-primary);
  font-weight:400;
}
/* Header dropdown fix: long labels wrap inside the dropdown box instead of
   stretching past it (white-space:nowrap is set on the generic menu-link rule) */
#ast-desktop-header .ast-builder-menu-1 .main-header-menu .sub-menu .menu-item > .menu-link{
  white-space:normal;
  overflow-wrap:break-word;
  word-wrap:break-word;
}
#ast-desktop-header .ast-builder-menu-1 .main-header-menu .sub-menu .menu-item.menu-item-has-children > .menu-link{
  padding-right:2.5em;
}
#ast-desktop-header .ast-builder-menu-1 .main-header-menu .sub-menu{
  max-width:calc(100vw - 32px);
}
#ast-desktop-header .ast-builder-menu-1 .main-header-menu .sub-menu .menu-item > .menu-link:hover{
  color:var(--color-accent);
}
#ast-desktop-header .ast-builder-menu-1 .main-header-menu .sub-menu .current-menu-item > .menu-link{
  color:var(--color-accent);
  font-weight:600;
}
/* Right column: menu + phone + CTA */
#ast-desktop-header .site-header-primary-section-right{
  gap:var(--sp-4);
  align-items:center;
}
.uristst-header-extra{
  display:flex;
  align-items:center;
  gap:var(--sp-6);
  margin-left:var(--sp-3);
}
.uristst-header-phone{
  font-size:var(--fs-small);
  font-weight:600;
  line-height:var(--lh-button);
  color:var(--color-text-primary);
  text-decoration:none;
  white-space:nowrap;
}
.uristst-header-phone:hover{
  color:var(--color-accent);
}
.uristst-header-cta{
  white-space:nowrap;
}

/* ---------- 6. Header — STICKY ---------- */
#masthead.uristst-is-sticky{
  box-shadow:var(--shadow-sticky);
}
#masthead.uristst-is-sticky #ast-desktop-header .ast-primary-header-bar,
#masthead.uristst-is-sticky #ast-desktop-header .ast-primary-header-bar .site-primary-header-wrap{
  min-height:var(--header-h-sticky);
}
#masthead.uristst-is-sticky #ast-desktop-header .ast-primary-header-bar{
  padding:0;
}
#masthead.uristst-is-sticky #ast-desktop-header .ast-primary-header-bar,
#masthead.uristst-is-sticky #ast-desktop-header .ast-primary-header-bar .site-primary-header-wrap,
#masthead.uristst-is-sticky #ast-desktop-header .ast-primary-header-bar .ast-builder-grid-row,
#masthead.uristst-is-sticky #ast-desktop-header .site-header-primary-section-left,
#masthead.uristst-is-sticky #ast-desktop-header .site-header-primary-section-right{
  padding-top:0;
  padding-bottom:0;
  border-top-width:0;
  border-bottom-width:0;
  box-shadow:none;
}
#masthead.uristst-is-sticky #ast-desktop-header .site-logo-img .custom-logo{
  height:46px;
}
#masthead.uristst-is-sticky #ast-desktop-header .site-branding{
  padding:0;
}
/* Sticky: hide subtitle to maintain 70px height */
#masthead.uristst-is-sticky .uristst-header-identity__subtitle{
  display:none;
}

/* ---------- 7. Header — MOBILE ---------- */
#ast-mobile-header .ast-primary-header-bar{
  min-height:var(--header-h-mobile-top);
  background:var(--color-surface);
  transition:min-height var(--dur) var(--ease);
}
#ast-mobile-header .site-primary-header-wrap{
  max-width:var(--container-max);
  width:100%;
  padding:0 var(--container-pad-mobile);
  box-sizing:border-box;
}
#ast-mobile-header .ast-builder-grid-row{
  align-items:center;
  max-width:100%;
}
#ast-mobile-header .site-header-primary-section-left,
#ast-mobile-header .site-header-primary-section-right{
  min-width:0;
  max-width:100%;
}
#ast-mobile-header .ast-builder-layout-element{
  min-width:0;
  max-width:100%;
  overflow:hidden;
}
#ast-mobile-header .site-branding{
  overflow:hidden;
}
#ast-mobile-header .site-branding{
  display:flex;
  align-items:center;
  min-height:0;
  min-width:0;
  gap:var(--sp-2);
  max-width:100%;
  flex:1 1 auto;
}
/* Hide Astra's site title — inject identity via astra_logo filter */
#ast-mobile-header .ast-site-title-wrap{ display:none; }
#ast-mobile-header .site-logo-img .custom-logo{
  width:auto;
  height:36px;
  max-width:none;
  max-height:36px;
}
#ast-mobile-header .site-logo-img{
  flex-shrink:0;
  flex:0 0 auto;
}
/* Mobile identity */
#ast-mobile-header .uristst-header-identity{
  flex-direction:row;
  align-items:baseline;
  gap:var(--sp-2);
  min-width:0;
  flex:1 1 auto;
  overflow:hidden;
}
#ast-mobile-header .uristst-header-identity__name{
  font-size:14px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  min-width:0;
}
#ast-mobile-header .uristst-header-identity__subtitle{
  font-size:11px;
  font-weight:400;
  color:var(--color-text-secondary);
  white-space:nowrap;
}
/* Right column */
#ast-mobile-header .site-header-primary-section-right{
  gap:var(--sp-2);
  align-items:center;
}
/* Call icon */
.uristst-mobile-call{
  order:-1;
  display:flex;
  align-items:center;
}
.uristst-mobile-call a{
  display:flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border-radius:var(--radius-surface);
  color:var(--color-text-primary);
  transition:color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.uristst-mobile-call a:hover{
  color:var(--color-accent);
  background:rgba(154,80,63,.08);
}

/* Burger trigger — 3 horizontal lines via CSS */
#ast-mobile-header .ast-button-wrap .menu-toggle{
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  border:1px solid var(--color-border);
  border-radius:var(--radius-surface);
  background:transparent;
  color:var(--color-text-primary);
  cursor:pointer;
  padding:0;
  transition:color var(--dur) var(--ease), border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
#ast-mobile-header .ast-button-wrap .menu-toggle:hover{
  color:var(--color-accent);
  border-color:var(--color-accent);
  background:rgba(154,80,63,.06);
}
/* Hide Astra's default hamburger icon spans */
#ast-mobile-header .ast-button-wrap .menu-toggle .ast-icon,
#ast-mobile-header .ast-button-wrap .menu-toggle .toggle-box,
#ast-mobile-header .ast-button-wrap .menu-toggle .toggle-text{
  display:none !important;
}
/* 3-line burger via pseudo-elements */
#ast-mobile-header .ast-button-wrap .menu-toggle::before,
#ast-mobile-header .ast-button-wrap .menu-toggle::after{
  content:'';
  display:block;
  width:22px;
  height:2px;
  background:currentColor;
  border-radius:1px;
  transition:transform .2s ease, opacity .2s ease;
}

/* Mobile menu dropdown */
#ast-mobile-header .ast-mobile-header-content{
  background:var(--color-surface);
  border-top:1px solid var(--color-border);
  box-shadow:var(--shadow-sticky);
  overflow-y:auto;
}
#ast-mobile-header .ast-mobile-header-content .menu-link{
  padding:var(--sp-4) var(--container-pad-mobile);
  font-size:var(--fs-body);
  font-weight:500;
  line-height:var(--lh-body);
  color:var(--color-text-primary);
}
#ast-mobile-header .ast-mobile-header-content .menu-link:hover{
  color:var(--color-accent);
}
#ast-mobile-header .ast-mobile-header-content .current-menu-item > .menu-link{
  color:var(--color-accent);
  font-weight:600;
}
/* Mobile sticky */
#masthead.uristst-is-sticky #ast-mobile-header .ast-primary-header-bar{
  min-height:var(--header-h-mobile-sticky);
  padding-top:0;
  padding-bottom:0;
}
#masthead.uristst-is-sticky #ast-mobile-header .ast-primary-header-bar,
#masthead.uristst-is-sticky #ast-mobile-header .ast-primary-header-bar .site-primary-header-wrap,
#masthead.uristst-is-sticky #ast-mobile-header .ast-primary-header-bar .ast-builder-grid-row,
#masthead.uristst-is-sticky #ast-mobile-header .site-header-primary-section-left,
#masthead.uristst-is-sticky #ast-mobile-header .site-header-primary-section-right{
  padding-top:0;
  padding-bottom:0;
  border-top-width:0;
  border-bottom-width:0;
}
#masthead.uristst-is-sticky #ast-mobile-header .site-logo-img .custom-logo{
  height:30px;
  max-height:30px;
}
#masthead.uristst-is-sticky #ast-mobile-header .site-branding{
  padding-top:0;
  padding-bottom:0;
}
#masthead.uristst-is-sticky #ast-mobile-header .uristst-header-identity__subtitle{
  display:none;
}

/* Very narrow screens: guarantee zero horizontal overflow in header */
@media (max-width:430px){
  #ast-mobile-header .site-primary-header-wrap{
    padding:0 12px;
  }
  #ast-mobile-header .site-logo-img .custom-logo{
    height:30px;
    max-height:30px;
  }
  #ast-mobile-header .uristst-header-identity__name{
    font-size:13px;
  }
  #ast-mobile-header .uristst-header-identity__subtitle{
    font-size:10px;
  }
  #ast-mobile-header .site-header-primary-section-right{
    gap:2px;
  }
}

/* ---------- 8. Native footer disabled; modern footer is in footer-modern.css ---------- */
#colophon,
footer.site-footer,
.elementor-location-footer,
[data-elementor-type="footer"]{
  display:none !important;
}
/* ---------- 9. Motion ---------- */
@media (prefers-reduced-motion: reduce){
  #masthead,
  #ast-desktop-header .ast-primary-header-bar,
  #ast-mobile-header .ast-primary-header-bar,
  .uristst-btn,
  .uristst-header-phone,
  .uristst-mobile-call a,
  #ast-mobile-header .ast-button-wrap .menu-toggle{
    transition:none;
  }
}

/* ---------- 10. Responsive ---------- */
/* Compact header menu below 1280 so phone + CTA still fit side by side */
@media (max-width:1280px){
  #ast-desktop-header .ast-builder-menu-1 .main-header-menu{ gap:0; }
  #ast-desktop-header .ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link{
    padding:var(--sp-3) var(--sp-3);
    font-size:14px !important;
  }
  #ast-desktop-header .site-header-primary-section-right{ gap:var(--sp-2); }
  #ast-desktop-header .uristst-header-extra{ margin-left:0; gap:var(--sp-2); }
  #ast-desktop-header .uristst-header-cta{ padding:var(--sp-3) var(--sp-3); }
}
@media (max-width:1100px){
  #ast-desktop-header .uristst-header-phone{ display:none; }
  #ast-desktop-header .uristst-header-cta{ padding:var(--sp-3) var(--sp-4); }
}
/* Extra squeeze near the 921 mobile switch */
@media (max-width:980px){
  #ast-desktop-header .ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link{
    padding:var(--sp-2) 9px;
    font-size:13px !important;
  }
  #ast-desktop-header .site-header-primary-section-right{ gap:var(--sp-1); }
  #ast-desktop-header .uristst-header-cta{ padding:var(--sp-2) 9px; }
}
@media (max-width:921px){
  #ast-desktop-header{ display:none; }
  #ast-mobile-header{ display:block; }
  html{ scroll-padding-top:calc(var(--header-h-mobile-sticky) + 12px); }
  .entry-content h1{ font-size:clamp(38px,8vw,40px); line-height:clamp(42px,8vw,44px); }
  .entry-content h2{ font-size:var(--fs-h2-mob,30px); line-height:var(--lh-h2-mob,36px); }
  .entry-content h3{ font-size:21px; line-height:28px; }
}
@media (max-width:640px){
}
