/* ---------------------------------------------------------------------------
   site.css — Grupo TG landing page
   Layers on top of broadsheet.css (the design system). Everything here is one
   of three things, and each block says which:
     (a) layout the design file expressed as inline styles, lifted into classes
     (b) responsive behaviour the design file did not define at all
     (c) a marked accessibility correction to the design's defaults
   --------------------------------------------------------------------------- */


/* (a) Spacing steps the design file uses but broadsheet.css never defines.
   Home.dc.html references --space-5, --space-7 and --space-9; the system's
   scale only declares 1, 2, 3, 4, 6 and 8. An undefined custom property makes
   the whole declaration invalid at computed-value time, so the hero's top
   padding and several section gaps silently collapsed to 0. These continue
   the same 5px scale the defined steps sit on. */
:root {
  --space-5: 25px;
  --space-7: 35px;
  --space-9: 45px;

  /* Page frame, from the design's repeated max-width / padding pair. */
  --page-max: 1200px;
  --page-pad: clamp(20px, 5vw, 72px);
}


/* (c) Contrast corrections.
   --color-accent (#0088b0) measures 3.65:1 against the page ground — under the
   4.5:1 WCAG AA bar for the 14px text it is used on here (nav CTA, "Ver
   división" links). --color-accent-700 (#006786) measures 5.72:1 and is the
   next step down the same ramp, so the hue is unchanged. Delete this block to
   go back to the design's literal colours. */
.btn-primary { background: var(--color-accent-700); }
.btn-primary:hover { background: var(--color-accent-800); }
.btn-primary:active { background: var(--color-accent-900); }
.btn-ghost { color: var(--color-accent-700); }
.nav a:hover,
.nav a[aria-current='page'] { color: var(--color-accent-700); }

/* Specificity fix, not a restyle: broadsheet's `.nav a { color: inherit }`
   (0,1,1) outranks `.btn-primary { color: var(--color-bg) }` (0,1,0), so the
   header CTA drew dark ink on the dark accent fill — ~1.3:1, effectively
   unreadable. These selectors are 0,2,0 and restore the button's own colour. */
.nav .btn-primary,
.nav .btn-primary:hover,
.nav .btn-primary:focus-visible { color: var(--color-bg); }
.nav .btn-ghost:hover { color: var(--color-accent-800); }


/* --- Page shell ---------------------------------------------------------- */

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  text-wrap: pretty;
}

a { text-decoration: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 14px;
}
.skip-link:focus-visible {
  left: var(--space-2);
  top: var(--space-2);
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-inline: var(--page-pad);
}

.eyebrow {
  display: block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-neutral-700);
}

/* Extra wording for screen readers only — "Ver división" repeats three times
   on the page, so each link carries its division name for anyone tabbing
   through a list of links out of context. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}


/* --- Header / navigation -------------------------------------------------- */

.nav { gap: var(--space-4); flex-wrap: wrap; }

.nav-brand { display: flex; align-items: center; margin-right: auto; }
.nav-brand img { height: 30px; width: auto; display: block; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* (b) Hamburger — the design file has no small-screen navigation at all.
   Hidden on desktop, and hidden entirely when JS is unavailable (the menu
   stays visible in that case, see .no-js below). */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
}
.nav-toggle svg { display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded='true'] .icon-open { display: none; }
.nav-toggle[aria-expanded='true'] .icon-close { display: block; }


/* --- Hero ---------------------------------------------------------------- */

.hero {
  padding-top: var(--space-9);
  text-align: center;
}
.hero h1 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  max-width: 780px;
  margin: 0 auto var(--space-4);
}
.hero p {
  font-size: 16px;
  color: var(--color-neutral-700);
  max-width: 560px;
  margin: 0 auto;
}


/* --- Stat band ----------------------------------------------------------- */

.stats { margin-top: var(--space-8); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--color-neutral-300);
  border-bottom: 1px solid var(--color-neutral-300);
}

.stat {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  border-right: 1px solid var(--color-neutral-300);
}
.stat:last-child { border-right: 0; }

.stat-value {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-accent-700);
}
.stat-label {
  font-size: 12.5px;
  color: var(--color-neutral-700);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}


/* --- Business units ------------------------------------------------------ */

.units { padding-block: var(--space-8); }

.units h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(26px, 3.2vw, 34px);
  letter-spacing: -0.015em;
  margin: var(--space-2) 0 var(--space-6);
}

.unit-list { list-style: none; margin: 0; padding: 0; }

.unit {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-neutral-300);
}
/* The design sets a heavier rule above the first row — it opens the table. */
.unit:first-child { border-top: 1px solid var(--color-text); }
.unit:last-child { border-bottom: 1px solid var(--color-neutral-300); }

.unit-logo {
  width: 180px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
}
.unit-logo--drogueria { height: 46px; }
.unit-logo--estratg   { height: 32px; }
.unit-logo--terragate { height: 28px; }

/* Stopgap, remove once a proper TerraGate logo arrives: terragate-logo.png is
   a screenshot with no alpha channel, so it draws as a white box on the page
   ground. Its background is not quite flat (it runs #eff1f5 → #fefefe across
   the frame), so keying it out leaves edge artefacts — but it is dark ink on a
   light field, which `multiply` handles cleanly: the light background drops to
   the page colour and the ink is unaffected. The other three marks are real
   transparent PNGs and need none of this. */
.unit-logo--terragate { mix-blend-mode: multiply; }

.unit-desc {
  flex: 1;
  font-size: 14px;
  color: var(--color-neutral-700);
  margin: 0;
}


/* --- Pull quote ---------------------------------------------------------- */

.quote {
  padding-block: var(--space-7) var(--space-8);
  text-align: center;
}
.quote blockquote { margin: 0; }
.quote p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 20px;
  color: var(--color-neutral-800);
  max-width: 620px;
  margin: 0 auto;
}


/* --- Corporate structure -------------------------------------------------- */

.corporate { padding-bottom: var(--space-9); }

.corporate-grid {
  border-top: 1px solid var(--color-neutral-300);
  padding-top: var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.corporate-copy p {
  font-size: 15px;
  color: var(--color-neutral-700);
  max-width: 460px;
  margin: var(--space-3) 0 0;
}

.corporate-details {
  font-size: 14px;
  color: var(--color-neutral-700);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-style: normal;
}
.corporate-details dt {
  display: inline;
  font-weight: 600;
  color: var(--color-text);
}
.corporate-details dd { display: inline; margin: 0; }
.corporate-details div + div { margin: 0; }

/* (c) These links sit inside a paragraph of the same-value grey, so colour
   alone does not distinguish them (≈1:1 against the surrounding text, well
   under the 3:1 WCAG needs). They carry an underline instead. */
.corporate-details a {
  color: var(--color-accent-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* --- Footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-neutral-300);
  padding: var(--space-6) var(--page-pad);
}
.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 12.5px;
  color: var(--color-neutral-700);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav a { color: var(--color-neutral-700); }
.footer-nav a:hover { color: var(--color-accent-700); text-decoration: underline; }


/* --- (b) Responsive ------------------------------------------------------- */

/* Unit rows stack: the logo, the description and the link each get their own
   line rather than being squeezed into a three-column row. */
@media (max-width: 760px) {
  .unit {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo logo"
      "desc desc"
      "cta  cta";
    gap: var(--space-3);
    align-items: start;
  }
  .unit-logo { grid-area: logo; }
  .unit-desc { grid-area: desc; }
  .unit .btn { grid-area: cta; justify-self: start; }
}

/* Corporate structure drops to one column. */
@media (max-width: 820px) {
  .corporate-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .corporate-copy p { max-width: none; }
}

/* Navigation collapses behind a toggle. */
@media (max-width: 880px) {
  .nav { padding-inline: var(--page-pad); }
  .nav-toggle { display: inline-flex; }

  .nav-menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-neutral-300);
    margin-top: var(--space-2);
  }
  .nav-menu[data-open='true'] { display: flex; }
  .nav-menu a {
    padding: var(--space-2) 0;
    font-size: 16px;
  }
  .nav-menu .btn {
    margin-top: var(--space-2);
    align-self: flex-start;
  }
}

/* Stat band goes single column; the vertical rules become horizontal ones. */
@media (max-width: 620px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--color-neutral-300);
    padding-block: var(--space-4);
  }
  .stat:last-child { border-bottom: 0; }
}

/* Without JS the toggle is meaningless, so the menu stays open and inline. */
.no-js .nav-toggle { display: none; }
.no-js .nav-menu { display: flex; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .nav-toggle, .skip-link { display: none !important; }
  .nav-menu { display: flex !important; }
  body { background: #fff; }
}
