/* ==========================================================================
   PROJECT OVERRIDES (Bootstrap 5 friendly)
   Uses CSS variables set in base.html (:root from SiteSettings)
   ========================================================================== */

/* -------------------------
   0) Safety / baseline
   ------------------------- */
:root{
  /* warm accent from hero photo (sun / cranes) */
  --accent-warm: #E9B752;
  --accent-warm-2: #F6D27A;

  /* safe “surfaces” */
  --surface: rgba(255,255,255,.92);
  --surface-strong: rgba(255,255,255,.98);

  --shadow: 0 14px 45px rgba(14,24,18,.12);
  --shadow-strong: 0 28px 70px rgba(14,24,18,.18);

  /* section tint fallbacks (will be overridden by color-mix when supported) */
  --section-tint: rgba(30,64,175,.06);
  --section-tint-2: rgba(233,183,82,.10);
}

/* Prefer color-mix if available */
@supports (color: color-mix(in srgb, white 50%, black)) {
  :root{
    --surface: color-mix(in srgb, var(--bg-body) 92%, white);
    --surface-strong: color-mix(in srgb, var(--bg-body) 84%, white);
    --section-tint: color-mix(in srgb, var(--project) 6%, white);
    --section-tint-2: color-mix(in srgb, var(--accent-warm) 10%, white);
  }
}

html, body{
  background: var(--bg-body);
  color: var(--text-body);
}

a{ color: inherit; }
a:hover{ color: var(--project); }

.text-muted{ color: var(--text-muted) !important; }

hr, .border-base{ border-color: var(--border-base) !important; }


/* -------------------------
   1) Header / Footer
   ------------------------- */
#site-header{
  background: var(--bg-header);
  color: var(--text-header);
  border-bottom: 1px solid var(--border-base);
}

#site-footer{
  background: var(--bg-footer);
  color: var(--text-footer);
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 28px 0;
}

@supports (border-top-color: color-mix(in srgb, white 50%, transparent)) {
  #site-footer{
    border-top-color: color-mix(in srgb, var(--border-base) 65%, transparent);
  }
}

#site-footer a{ color: inherit; }

/* Nav */
.brand{
  font-weight: 850;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text-header);
}

.nav-link{
  text-decoration: none;
  color: var(--text-header);
  opacity: .9;
}
.nav-link:hover{
  opacity: 1;
  text-decoration: underline;
}


/* -------------------------
   2) Project palette utilities
   ------------------------- */
.bg-project   { background-color: var(--project) !important;   color: var(--on-project) !important; }
.bg-project-1 { background-color: var(--project-1) !important; color: var(--on-project) !important; }
.bg-project-2 { background-color: var(--project-2) !important; color: var(--on-project) !important; }
.bg-project-3 { background-color: var(--project-3) !important; color: var(--on-project) !important; }
.bg-project-4 { background-color: var(--project-4) !important; color: var(--on-project) !important; }

.border-project   { border-color: var(--project) !important; }
.border-project-1 { border-color: var(--project-1) !important; }
.border-project-2 { border-color: var(--project-2) !important; }
.border-project-3 { border-color: var(--project-3) !important; }
.border-project-4 { border-color: var(--project-4) !important; }

.text-project   { color: var(--project) !important; }
.text-project-1 { color: var(--project-1) !important; }
.text-project-2 { color: var(--project-2) !important; }
.text-project-3 { color: var(--project-3) !important; }
.text-project-4 { color: var(--project-4) !important; }

/* Bootstrap button harmony */
.btn.bg-project{ background-color: var(--project) !important;
  color: var(--on-project) !important; border-color: var(--project) !important; }
.btn.bg-project:hover{
  background-color: #264F36 !important;
  border-color: #264F36 !important;
  filter: brightness(.95);
  color: var(--on-project) !important;
}
/* make outline-secondary a bit “softer” */
.btn-outline-secondary{
  border-color: rgba(0,0,0,0.14) !important;
}
@supports (border-color: color-mix(in srgb, white 50%, transparent)) {
  .btn-outline-secondary{
    border-color: color-mix(in srgb, var(--border-base) 70%, transparent) !important;
  }
}
.btn-outline-light{
  border-color: rgba(255,255,255,.55);
  color: #fff;
}

.btn-outline-light:hover{
  background: rgba(255,255,255,.12);
  color: #fff;
}
/* Minimal custom button (works even without BS) */
.btn-project{
  display: inline-block;
  background: var(--project);
  color: var(--on-project);
  border: 1px solid var(--project);
  padding: .55rem .9rem;
  border-radius: .75rem;
  text-decoration: none;
}
.btn-project:hover{ filter: brightness(.95); color: var(--on-project); }


/* -------------------------
   3) Typography polish (corporate)
   ------------------------- */
h1, h2, h3{ letter-spacing: -0.02em; }
h2.h3{ font-weight: 950 !important; }


/* -------------------------
   4) Section “mood”
   - supports both .section and .home-section naming
   ------------------------- */
.section,
.home-section{
  position: relative;
  padding: 5rem 0;
}

.section.border-top,
.home-section.border-top{
  border-top: 1px solid rgba(0,0,0,0.08) !important;
}
@supports (border-top-color: color-mix(in srgb, white 50%, transparent)) {
  .section.border-top,
  .home-section.border-top{
    border-top-color: color-mix(in srgb, var(--border-base) 65%, transparent) !important;
  }
}

/* light tint background */
.section--light,
.home-section--light{
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(30,64,175,.10), transparent 60%),
    radial-gradient(800px 360px at 85% 20%, rgba(16,185,129,.10), transparent 60%),
    transparent;
}

/* stronger tint background */
.section--tint,
.home-section--tint{
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(30,64,175,.10), transparent 62%),
    radial-gradient(700px 380px at 85% 15%, rgba(233,183,82,.14), transparent 60%),
    linear-gradient(180deg, var(--section-tint), #fff 60%);
  border-top: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* accent bar under section titles (optional) */
.section-accent{
  width: 86px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--project), var(--project-2));
  margin-top: 10px;
}

/* underline style for titles */
.h2-underline{
  position: relative;
  display: inline-block;
}
.h2-underline::after{
  content:"";
  display:block;
  width: 84px;
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--project), var(--accent-warm));
}


/* -------------------------
   5) Hero (homepage header)
   ------------------------- */
.hero-stage{
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
@supports (border-bottom-color: color-mix(in srgb, white 50%, transparent)) {
  .hero-stage{
    border-bottom-color: color-mix(in srgb, var(--border-base) 65%, transparent);
  }
}

.hero-media{
  width: 100%;
  height: clamp(360px, 46vw, 640px);
  object-fit: cover;
  display: block;
}

.hero-overlay{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10,18,14,.72), rgba(10,18,14,.20)),
    radial-gradient(900px 520px at 20% 20%, rgba(255,255,255,.10), transparent 60%);
  pointer-events: none;
}

/* NOTE: don't target ".hero-content .rounded-3" globally, use a dedicated class if possible */
.hero-panel{
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  backdrop-filter: blur(6px);
}

.hero-badge{
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.88);
}

.hero-content .badge{
  background: rgba(0,0,0,.45) !important;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}

.hero-contact.card{
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  font-size: 1.4rem;
}


/* -------------------------
   6) Cards (general life)
   IMPORTANT: Don't override ALL .card too aggressively,
   Bootstrap uses cards everywhere. Keep it gentle.
   ------------------------- */
.card{
  border-radius: 16px;
}

.card.shadow-sm{
  box-shadow: var(--shadow) !important;
}

/* Add a nice “brand stripe” only to selected cards (opt-in) */
.card.card-stripe{
  position: relative;
  overflow: hidden;
}
.card.card-stripe::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--project), var(--project-2));
  opacity: .9;
}

/* Placeholder block inside ratio */
.ratio > .bg-light{
  background: rgba(30,64,175,.06) !important;
}


/* -------------------------
   7) Services – service-card component (your new HTML)
   ------------------------- */
.service-card{
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(0,0,0,.12);
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform .18s ease, box-shadow .18s ease;
  background: var(--surface-strong);
}
.service-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 28px 70px rgba(0,0,0,.16);
}

.service-card__cover{
  height: 140px;
  position: relative;
  background:
    radial-gradient(500px 220px at 20% 20%, rgba(233,183,82,.30), transparent 60%),
    radial-gradient(520px 240px at 80% 35%, rgba(30,64,175,.22), transparent 60%),
    linear-gradient(135deg, rgba(8,12,10,.20), rgba(255,255,255,.65));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.service-card__cover::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.65));
}

.service-card__cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.service-card__icon{
  position: absolute;
  left: 18px;
  bottom: -20px;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 14px 40px rgba(0,0,0,.12);
  color: rgba(20,20,20,.85);
  z-index: 1000;
}

.service-card__body{
  padding: 2.25rem 1.25rem 1.25rem;
}
.service-card__title{
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 .35rem;
}
.service-card__text{
  color: var(--text-muted);
  margin: 0;
}


/* -------------------------
   8) Why-us tiles (feature tiles)
   ------------------------- */
.feature-tile{
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(180deg, #fff, rgba(233,183,82,.10));
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
  padding: 1.1rem 1.1rem;
}
.feature-tile .title{
  font-weight: 850;
  letter-spacing: -0.01em;
}
.feature-tile .title::before{
  content:"";
  display:inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-warm);
  margin-right: 10px;
  box-shadow: 0 0 0 5px rgba(233,183,82,.20);
}


/* -------------------------
   9) CTA band (stats / contact panel)
   ------------------------- */
.cta-band{
  border-radius: 20px;
  padding: 26px;
  background:
    radial-gradient(600px 260px at 20% 10%, rgba(233,183,82,.24), transparent 60%),
    linear-gradient(135deg, rgba(30,64,175,.10), #fff);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 18px 55px rgba(0,0,0,.10);
}

.badge.bg-project{
  border-radius: 999px;
  padding: .42rem .6rem;
}


/* -------------------------
   10) Accordion (FAQ preview)
   ------------------------- */
.accordion-item{
  border: 1px solid rgba(0,0,0,0.08) !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* FIX: invalid CSS "margin-top break;" */
.accordion-item + .accordion-item{
  margin-top: 12px;
}

.accordion-button{
  font-weight: 700;
  letter-spacing: -0.01em;
}

.accordion-button:not(.collapsed){
  background: rgba(30,64,175,.08) !important;
  color: var(--text-body) !important;
  box-shadow: none !important;
}

.accordion-button:focus{
  box-shadow: 0 0 0 .2rem rgba(30,64,175,.22) !important;
}


/* -------------------------
   11) Breadcrumbs (if used)
   ------------------------- */
.breadcrumbs{
  font-size: .92rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.breadcrumbs ol{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 0;
  margin: 0;
}

.breadcrumbs li::after{
  content: "›";
  margin: 0 .4rem;
  color: rgba(0,0,0,0.35);
}
.breadcrumbs li:last-child::after{ content:""; }

.breadcrumbs a{
  text-decoration: none;
  color: color-mix(in srgb, var(--project) 70%, black);
}
.breadcrumbs a:hover{ text-decoration: underline; }


/* -------------------------
   12) CMS content baseline
   ------------------------- */
.cms-content{
  max-width: 760px;
  line-height: 1.65;
  font-size: 1rem;
}

.cms-content > * + *{ margin-top: 1.2em; }

.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4,
.cms-content h5{
  line-height: 1.25;
  margin-top: 1.8em;
  margin-bottom: .6em;
  font-weight: 750;
}

.cms-content h1{ font-size: 2rem; }
.cms-content h2{ font-size: 1.6rem; }
.cms-content h3{ font-size: 1.3rem; }
.cms-content h4{ font-size: 1.1rem; }

.cms-content p{ margin: 0; }

.cms-content ul,
.cms-content ol{ padding-left: 1.4em; }

.cms-content li + li{ margin-top: .4em; }

.cms-content a{ text-decoration: underline; }

.cms-content img{
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
}

.cms-content table{
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

.cms-content th,
.cms-content td{
  padding: .5em .6em;
  border-bottom: 1px solid rgba(0,0,0,0.10);
  text-align: left;
}

.cms-content blockquote{
  border-left: 4px solid rgba(30,64,175,.35);
  background: rgba(30,64,175,.05);
  border-radius: 10px;
  padding: 10px 12px 10px 14px;
  margin: 0;
  color: rgba(0,0,0,.72);
  font-style: italic;
}

.cms-content hr{
  border: none;
  border-top: 1px solid rgba(0,0,0,0.10);
  margin: 2em 0;
}


/* -------------------------
   13) Articles / Gallery grids (if still used)
   ------------------------- */
.articles-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.article-card{
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.article-card img{
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
}

.article-card h3{
  font-size: 1.1rem;
  line-height: 1.3;
  margin: .5rem 0 0;
}

.article-card .muted{
  color: var(--text-muted);
  font-size: .95rem;
}

.article-card a{
  text-decoration: none;
  color: inherit;
}
.article-card a:hover h3{ text-decoration: underline; }

.gallery-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-card{
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.gallery-card img{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.gallery-card h3{
  font-size: 1rem;
  margin: .4rem 0 0;
}

.gallery-card .muted{
  font-size: .85rem;
  color: var(--text-muted);
}

.gallery-card a{
  text-decoration: none;
  color: inherit;
}
.gallery-card a:hover h3{ text-decoration: underline; }

.gallery-cats{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.5rem 0 1rem;
}

.gallery-cats .tag{
  font-size: .85rem;
  padding: .25rem .6rem;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 999px;
  background: rgba(30,64,175,.06);
  color: rgba(0,0,0,.78);
}


/* -------------------------
   14) Responsive tweaks
   ------------------------- */
@media (max-width: 991.98px){
  .section, .home-section{ padding: 3.2rem 0; }
  .hero-media{ height: clamp(320px, 62vw, 520px); }
}

@media (prefers-reduced-motion: reduce){
  .service-card{ transition: none; }
  .service-card:hover{ transform: none; }
}

.home-section.why-us {
  background-image: url("../images/section-why-us.webp");
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: cover;
}


/* ==========================================================================
   HERO vs NAVBAR (mobile fix)
   - burger must stay clickable
   ========================================================================== */

/* 1) Navbar always on top */
#site-header,
#site-header .navbar{
  position: relative;
  z-index: 1100; /* above hero layers & cards */
}

/* 2) Hero layers: keep them below header */
.hero-stage{
  position: relative;
  z-index: 0;
}

/* overlay already has pointer-events:none; keep it that way */
.hero-overlay{ z-index: 0; }

/* make sure content + contact are above overlay, but still below navbar */
.hero-stage .hero-media{ position: relative; z-index: 0; }
.hero-stage .hero-content{ z-index: 1; }
.hero-stage .hero-contact{ position: relative; z-index: 1; }

/* 3) Mobile: remove absolute centering so it doesn't overlap the header */
@media (max-width: 991.98px){
  .hero-stage{
    /* approximate header height; tweak if needed */
    padding-top: 74px;
  }

  .hero-stage .hero-content{
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin-top: 0.75rem;
  }

  /* contact bar should flow under panel on mobile */
  .hero-stage > .position-absolute.bottom-0{
    position: relative !important;
  }

  .hero-stage .hero-contact{
    margin-top: 0.75rem;
  }
}
