/* ================================================================
   MANDATUM.MX — styles.css
   ----------------------------------------------------------------
   REBRAND CONFIG — edit this block only to re-skin the whole site.
   Option A (active):  Navy + Aged Gold
   Option B (swap in): Navy + Verdigris Teal → set --accent:#2E8B8B;
                       --accent-soft:#DDEDED;
   ================================================================ */
:root {
  /* -------- BRAND COLORS -------- */
  --ink:          #14213D;   /* deep navy — primary text & footer   */
  --ink-black:    #0C1226;   /* near-black navy for footer bg       */
  --accent:       #C6A15B;   /* aged gold — signature accent        */
  --accent-soft:  #F0E6D2;   /* pale gold — secondary pill bg       */
  --paper:        #F7F5F0;   /* warm cream page background          */
  --surface:      #FFFFFF;   /* cards                               */
  --grey:         #6B7080;   /* secondary text                      */
  --grey-idle:    #9A9FAE;   /* mega-menu idle links                */
  --hairline:     #DCD9D0;   /* borders                             */
  --on-dark:      #FFFFFF;

  /* -------- TYPOGRAPHY --------
     Offline-safe stacks. If you enable the Google Fonts link in
     index.html, these pick up Cormorant Garamond / Inter first. */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale (desktop tokens; fluid below) */
  --h1: clamp(40px, 6vw, 80px);
  --h2: clamp(32px, 4.5vw, 56px);
  --h3: clamp(22px, 2.2vw, 28px);
  --body-1: 18px;
  --body:   16px;
  --nav:    17px;
  --mega:   clamp(28px, 3.5vw, 40px);

  /* Layout */
  --gutter: 24px;
  --max-w: 1240px;
  --radius-media: 24px;
  --radius-pill: 48px;
  --header-h: 72px;
  --header-h-shrunk: 56px;
  --shadow: 0 0 18px 0 rgba(0,0,0,.20);
}

/* ================= RESET / BASE ================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; margin: 0; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent-soft); color: var(--ink);
  padding: 10px 24px; border-radius: var(--radius-pill); z-index: 200;
}
.skip-link:focus { left: 16px; top: 12px; }

/* ================= HEADER ================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper);
  transition: box-shadow .25s ease, background .25s ease;
}
.site-header.is-shrunk { box-shadow: var(--shadow); background: rgba(247,245,240,.97); }
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex; align-items: center; gap: 32px;
  transition: height .25s ease;
}
.site-header.is-shrunk .header-inner { height: var(--header-h-shrunk); }

.wordmark-text {
  font-family: var(--font-sans);
  font-weight: 700; font-size: 22px; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
}
.wordmark-accent { color: var(--accent); }

.primary-nav { display: flex; gap: 28px; margin-left: auto; }
.primary-nav a {
  font-size: var(--nav); font-weight: 450;
  position: relative; padding: 4px 0;
}
.primary-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--accent);
  transition: width .25s ease;
}
.primary-nav a:hover::after, .primary-nav a:focus-visible::after { width: 100%; }

.header-actions { display: flex; gap: 10px; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1.5px solid var(--ink);
  color: var(--ink);
  transition: background .2s ease, color .2s ease;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--ink); color: var(--paper); }

#menuBtn .ic-close { display: none; }
#menuBtn[aria-expanded="true"] .ic-burger { display: none; }
#menuBtn[aria-expanded="true"] .ic-close { display: block; }

/* ================= MEGA-MENU ================= */
.mega-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--paper);
  padding-top: var(--header-h);
  overflow-y: auto;
  opacity: 0; transition: opacity .25s ease;
}
.mega-menu.is-open { opacity: 1; }
.mega-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 48px var(--gutter) 64px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px;
}
.mega-nav ul { list-style: none; margin: 0; padding: 0; }
.mega-nav a {
  display: block; padding: 10px 0;
  font-family: var(--font-serif); font-size: var(--mega);
  color: var(--grey-idle); transition: color .2s ease;
}
.mega-nav a:hover, .mega-nav a:focus-visible { color: var(--ink); }
.mega-nav .chev { color: var(--accent); margin-left: 8px; }

.mega-aside-title { font-size: var(--h3); margin-bottom: 20px; }
.mega-search {
  display: flex; align-items: center;
  background: var(--surface); border: 1.5px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 4px 6px 4px 20px;
}
.mega-search input {
  flex: 1; border: 0; background: transparent; font: inherit;
  padding: 12px 0; outline: none; color: var(--ink);
}
.mega-search button {
  width: 44px; height: 44px; border-radius: 40px; border: 0;
  background: var(--ink); color: var(--on-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.mega-suggested { margin-top: 40px; }
.eyebrow {
  font-size: 13px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--grey); margin-bottom: 12px;
}
.suggested-card a { font-weight: 600; display: block; margin-top: 12px; }
.suggested-card a:hover { color: var(--accent); }

/* ================= SECTIONS / SHARED ================= */
.section {
  max-width: var(--max-w); margin: 0 auto;
  padding: 80px var(--gutter) 32px;
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 36px;
}
.section-head h2 { font-size: var(--h2); line-height: 1.2; }

/* Buttons */
.btn {
  display: inline-block; border: 0; border-radius: var(--radius-pill);
  padding: 15px 40px; font-size: var(--body-1); font-weight: 400;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-2px); opacity: .92; }
.btn-primary { background: var(--ink); color: var(--on-dark); }
.btn-secondary { background: var(--accent-soft); color: var(--ink); }

.text-cta { font-size: var(--nav); font-weight: 500; white-space: nowrap; }
.arrow { display: inline-block; transition: transform .2s ease; }
.text-cta:hover .arrow, .read-more:hover .arrow, .exp-card:hover .arrow { transform: translateX(6px); }

/* Placeholder blocks (swap for <img>) */
.ph { border-radius: 12px; width: 100%; }
.ph-suggested { height: 140px; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); }
.ph-split { height: 100%; min-height: 380px; border-radius: var(--radius-media);
  background: linear-gradient(160deg, var(--ink) 0%, #2A3B66 60%, var(--accent) 140%); }
.ph-1 { background: linear-gradient(135deg,#2A3B66,var(--accent)); }
.ph-2 { background: linear-gradient(135deg,var(--accent),#2A3B66); }
.ph-3 { background: linear-gradient(160deg,#14213D,#5A6B96); }
.ph-4 { background: linear-gradient(160deg,var(--accent-soft),var(--accent)); }
.ph-5 { background: linear-gradient(135deg,#3A4D7E,var(--accent-soft)); }
.ph-6 { background: linear-gradient(135deg,var(--accent),#14213D); }
.card .ph { height: 190px; }

/* ================= HERO ================= */
.hero { max-width: var(--max-w); margin: 0 auto; padding: 16px var(--gutter) 0; }
.hero-media {
  position: relative; height: min(56vh, 520px);
  border-radius: var(--radius-media) 0 0 0; overflow: hidden;
}
.hero-media video, .hero-gradient {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.hero-gradient {
  background: linear-gradient(115deg, var(--ink) 0%, #223257 45%, var(--accent) 130%);
  animation: heroShift 14s ease-in-out infinite alternate;
  background-size: 160% 160%;
}
@keyframes heroShift {
  from { background-position: 0% 40%; }
  to   { background-position: 100% 60%; }
}
.hero-copy { padding: 40px 0 24px; max-width: 900px; }
.hero-copy h1 { font-size: var(--h1); line-height: 1.15; margin-bottom: 20px; }
.hero-sub { font-size: var(--body-1); color: var(--grey); max-width: 640px; margin-bottom: 28px; }

/* ================= INSIGHTS CAROUSEL ================= */
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  border: 1.5px solid var(--hairline); background: transparent;
  border-radius: var(--radius-pill); padding: 8px 20px;
  color: var(--grey); transition: all .2s ease;
}
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab.is-active { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }

.carousel { position: relative; }
.carousel-track {
  display: flex; gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 8px;
}
.hide-scroll { scrollbar-width: none; }
.hide-scroll::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 clamp(260px, 30%, 380px);
  scroll-snap-align: start;
  background: var(--surface); border-radius: 12px; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-link { display: block; height: 100%; }
.card time { display: block; font-size: 13px; color: var(--grey); padding: 18px 20px 0; }
.card h3 { font-size: var(--h3); line-height: 1.25; padding: 8px 20px 0; }
.card p { font-size: 15px; color: var(--grey); padding: 10px 20px 0; }
.read-more { display: inline-block; font-weight: 600; font-size: 15px; padding: 12px 20px 20px; }

.carousel-controls { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.ctrl:disabled { opacity: .3; cursor: default; }
.ctrl:disabled:hover { background: transparent; color: var(--ink); }

/* ================= SPLIT BAND ================= */
.split-band { display: flex; gap: 48px; align-items: stretch; }
.split-copy { flex: 1 1 46%; display: flex; flex-direction: column; justify-content: center; }
.split-copy h2 { font-size: var(--h2); line-height: 1.2; margin-bottom: 24px; }
.split-copy p { font-size: var(--body-1); color: var(--grey); max-width: 520px; margin-bottom: 32px; }
.split-copy .btn { align-self: flex-start; }
.split-media { flex: 1 1 54%; }

/* ================= EXPERTISE ================= */
.expertise-grid { align-items: stretch; }
.exp-card {
  flex: 0 0 clamp(240px, 24%, 300px);
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 12px; overflow: hidden;
  padding-bottom: 20px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.exp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.exp-card .ph { height: 300px; border-radius: 0; }
.ph-e1 { background: linear-gradient(170deg,#14213D 20%,var(--accent)); }
.ph-e2 { background: linear-gradient(170deg,var(--accent) 0%,#14213D 90%); }
.ph-e3 { background: linear-gradient(170deg,#2A3B66,#0C1226); }
.ph-e4 { background: linear-gradient(170deg,var(--accent-soft),#2A3B66); }
.exp-card h3 { font-size: var(--h3); padding: 18px 20px 0; }
.exp-card p { font-size: 15px; color: var(--grey); padding: 8px 20px 0; flex: 1; }
.exp-card .arrow { margin: 12px 20px 0; font-size: 20px; color: var(--accent); }

/* ================= NEWS ================= */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { border-top: 1px solid var(--hairline); }
.news-list li:last-child { border-bottom: 1px solid var(--hairline); }
.news-list a {
  display: flex; gap: 32px; align-items: baseline;
  padding: 18px 4px; transition: background .15s ease;
}
.news-list a:hover { background: var(--surface); }
.news-list time { flex: 0 0 110px; font-size: 14px; color: var(--grey); }
.news-list span { font-size: var(--body-1); font-weight: 500; }

/* ================= FOOTER ================= */
.site-footer { background: var(--ink-black); color: var(--on-dark); margin-top: 96px; }
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 72px var(--gutter) 48px;
  display: flex; gap: 64px; flex-wrap: wrap;
}
.footer-brand { flex: 1 1 260px; }
.footer-mark { font-size: 26px; }
.footer-tag { color: var(--accent); margin-top: 12px; font-family: var(--font-serif); font-size: 20px; }
.footer-cols { display: flex; gap: 64px; flex: 2 1 560px; flex-wrap: wrap; }
.footer-col { flex: 1 1 160px; }
.footer-col h3 {
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--accent);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { font-weight: 600; opacity: .85; transition: opacity .15s ease; }
.footer-col a:hover { opacity: 1; }
.socials { display: flex; gap: 10px; margin-top: 20px; }
.icon-btn.soc { width: 40px; height: 40px; border-color: rgba(255,255,255,.4); color: var(--on-dark); }
.icon-btn.soc:hover { background: var(--on-dark); color: var(--ink-black); }
.lang-select { display: block; margin-top: 24px; font-size: 14px; }
.lang-select span { display: block; margin-bottom: 6px; opacity: .7; }
.lang-select select {
  background: transparent; color: var(--on-dark);
  border: 1.5px solid rgba(255,255,255,.4); border-radius: var(--radius-pill);
  padding: 8px 16px; font: inherit;
}
.lang-select option { color: var(--ink); }
.footer-base { border-top: 1px solid rgba(255,255,255,.15); }
.footer-base p {
  max-width: var(--max-w); margin: 0 auto;
  padding: 24px var(--gutter); font-size: 14px; opacity: .7;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .split-band { flex-direction: column; }
  .split-media { min-height: 320px; }
  .card { flex-basis: clamp(260px, 44%, 340px); }
  .exp-card { flex-basis: clamp(240px, 40%, 300px); }
}

@media (max-width: 768px) {
  .primary-nav { display: none; }           /* nav folds into mega-menu */
  .mega-inner { grid-template-columns: 1fr; gap: 40px; }
  .section { padding-top: 56px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hero-media { height: 44vh; }
  .news-list a { flex-direction: column; gap: 4px; }
  .news-list time { flex-basis: auto; }
  .footer-inner { padding: 48px var(--gutter) 32px; gap: 40px; }
  .footer-cols { gap: 40px; }
}

@media (max-width: 550px) {
  .card { flex-basis: 84%; }
  .exp-card { flex-basis: 78%; }
  .btn { padding: 13px 32px; }
  .icon-btn { width: 44px; height: 44px; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-gradient { animation: none; }
  * { transition-duration: .01ms !important; }
}
