/* Shared CSS for all site pages: design tokens, base reset, header/footer,
   and reusable page-layout helpers. Loaded before each page's own .css. */

/* ==========================================================================
   Design tokens
   Single source of truth for color, typography, spacing and layout.
   Change a brand value here and it updates everywhere it's referenced.
   ========================================================================== */

:root {
  /* ---- Brand / primary ---- */
  --color-primary: #478ac9;          /* main brand blue */
  --color-primary-dark: #3572a8;     /* hover / pressed */
  --color-primary-deep: #105885;     /* deep accent */
  --color-primary-light: #6fa5d6;
  --color-primary-pale: #b9cfe3;
  --color-primary-surface: #e0e8ef;  /* pale blue background */

  /* ---- Neutrals ---- */
  --color-ink: #1a1a1a;              /* near-black headings / footer bg */
  --color-text: #4a4a4a;            /* body text */
  --color-muted: #808080;           /* secondary text / inactive nav */
  --color-muted-dark: #333;
  --color-muted-light: #999;
  --color-border: #ddd;
  --color-surface: #f5f5f5;         /* light section background */
  --color-white: #fff;
  --color-black: #000;

  /* ---- Category accents (homepage flip-cards) ---- */
  --color-cat-green: #4f6b2f;
  --color-cat-green-tint: #cbd7c5;
  --color-cat-gold: #9f6912;
  --color-cat-gold-tint: #d7cbb6;
  --color-cat-wine: #8b2c4d;
  --color-cat-wine-tint: #debec9;

  /* ---- Feedback ---- */
  --color-success: #2f7a3d;
  --color-error: #b3261e;

  /* ---- Typography ---- */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --text-xs: .8125rem;   /* 13px */
  --text-sm: .9375rem;   /* 15px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.25rem;    /* 20px */
  --text-lead: 1.125rem; /* 18px — lead paragraphs / hero text / subtitles */

  /* Heading scale (fluid: min at mobile → max at ~desktop).
     clamp() resolves the responsive size itself, so headings need no
     per-breakpoint font-size overrides. */
  --fs-h1: clamp(2.25rem, 2.075rem + 0.75vw, 2.75rem);  /* 36 → 44px — every H1 below desktop; desktop hardcodes 52px */
  --fs-h2: clamp(1.875rem, 1.40rem + 1.5vw, 2.5rem);    /* 30 → 40px — section titles */
  --fs-h3: clamp(1.375rem, 1.15rem + 1.0vw, 1.625rem);  /* 22 → 26px — subsection (available) */
  --fs-h4: 1.3125rem;                                   /* 21px — hero subtitle */
  --fs-card-title: 1.0625rem;                           /* 17px — card titles */

  /* Line-heights */
  --lh-tight: 1.2;    /* H1 */
  --lh-heading: 1.3;  /* H2 / H3 */
  --lh-body: 1.6;     /* body copy */

  /* ---- Spacing (4px scale) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;

  /* ---- Layout ---- */
  --container-max: 1300px;
  --container-narrow: 1140px;

  /* ---- Effects ---- */
  --radius: 8px;
  --transition: .2s ease;

  /* Standard breakpoints (reference only — var() can't be used inside
     @media conditions): 576px · 768px · 992px · 1200px */
}

/* ==========================================================================
   Base reset
   Matches the resets Nicepage's bundle provided, so pages still loading the
   vendor bundle look identical while it's being removed page by page.
   ========================================================================== */

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* ==========================================================================
   Site header + primary navigation
   Injected from partials/header.html by components.js.
   ========================================================================== */

/* Reserve height so the injected header doesn't shift layout on load */
[data-include="header"] {
  display: block;
  min-height: 70px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: top var(--transition);
}

/* Uses `top` (not `transform`) to hide on scroll: a transform on this
   ancestor would become the containing block for the mobile off-canvas
   nav's fixed-position children, breaking their positioning while hidden. */
.site-header--hidden {
  top: -100px;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: rgba(255, 255, 255, .6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  min-height: 70px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-8);
  box-sizing: border-box;
}

@media (max-width: 1440px) and (min-width: 992px) {
  .site-header-inner {
    max-width: var(--container-narrow);
  }
}

@media (max-width: 575px) {
  .site-header-inner {
    padding: 0 var(--space-6);
  }
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-right: auto;
}

.site-logo-img {
  display: block;
  height: 48px;
  width: auto;
}

.site-logo-img-campana {
  height: 70px;
}

/* Desktop navigation */
.site-nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav-list a {
  display: block;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-ink);
  text-decoration: none;
  transition: color var(--transition);
}

.site-nav-list a:hover {
  color: var(--color-primary);
}

.site-nav-list a.is-active {
  color: var(--color-muted);
}

/* Mobile: the hamburger + off-canvas panel were removed. On the homepage the
   hero's own "Más info" dropdown replaces this navigation; other pages are
   pending a mobile-nav solution of their own (see project notes). */
@media (max-width: 991px) {
  .site-nav {
    display: none;
  }

  .site-header-inner {
    justify-content: center;
  }

  .site-logo {
    margin-right: 0;
  }
}

/* ==========================================================================
   Page layout helpers
   Replace the Nicepage u-section / u-sheet / u-text wrappers with reusable,
   token-based building blocks.
   ========================================================================== */

.page-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--space-8);
  padding-right: var(--space-8);
  box-sizing: border-box;
}

@media (max-width: 1440px) and (min-width: 992px) {
  .page-container {
    max-width: var(--container-narrow);
  }
}

@media (max-width: 575px) {
  .page-container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* Every page H1 shares one size (--fs-h1). `.hero-title` sits on hero
   sections, `.page-title` on plain index pages — same visual weight. */
.page-title,
.hero-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  color: var(--color-ink);
  text-align: left;
  margin: 0;
}

@media (min-width: 1441px) {
  .page-title,
  .hero-title {
    font-size: 52px;
  }
}

/* Card titles (H3 inside content/institution cards) */
.content-card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-card-title);
  color: var(--color-ink);
  margin: 0 0 var(--space-2);
}

/* Site footer */

.site-footer {
  background-color: var(--color-ink);
  color: var(--color-white);
  padding: 56px 32px 24px;
  box-sizing: border-box;
}

.site-footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  justify-content: space-between;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, .15);
}

.site-footer-brand {
  flex: 1 1 280px;
  max-width: 360px;
}

p.site-footer-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-white);
  margin: 0 0 12px;
}

p.site-footer-tagline {
  font-family: var(--font-body);
  font-size: .9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .7);
  margin: 0;
}

.site-footer-nav,
.site-footer-contact,
.site-footer-social {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer-social-contact {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

p.site-footer-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-primary);
  margin: 0 0 4px;
}

.site-footer-nav a,
.site-footer-contact a,
.site-footer-social a {
  font-family: var(--font-body);
  font-size: .9375rem;
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
  transition: color .2s ease;
}

.site-footer-nav a:hover,
.site-footer-contact a:hover,
.site-footer-social a:hover {
  color: var(--color-white);
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

.site-footer-bottom {
  max-width: 1300px;
  margin: 0 auto;
  padding-top: 20px;
}

p.site-footer-bottom-text {
  font-family: var(--font-body);
  font-size: .8125rem;
  color: rgba(255, 255, 255, .5);
  margin: 0;
  text-align: center;
}

@media (max-width: 575px) {
  .site-footer {
    padding: 40px 24px 24px;
  }

  .site-footer-inner {
    gap: 32px;
  }
}
