/* ============================================================
   Directorio de Asociaciones de España — sistema de diseño
   Editorial moderno: serif display + sans humanista, blanco cálido,
   acento terracota. Pensado para SEO y lectura.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Color */
  --bg: #FAF7F1;
  --bg-2: #F3EFE6;
  --surface: #FFFFFF;
  --ink: #161412;
  --ink-2: #3C3833;
  --ink-3: #6F695F;
  --ink-4: #9A9388;
  --line: #E6DFD2;
  --line-2: #D6CCB9;
  --accent: #B83A1A;        /* terracota */
  --accent-ink: #FFFFFF;
  --accent-soft: #F5E6DD;
  --olive: #2E3A22;
  --gold: #B58A2C;

  /* Type scale (editorial, generosa) */
  --serif: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'JetBrains Mono', Consolas, monospace;

  --fs-display: clamp(56px, 9vw, 132px);
  --fs-h1: clamp(40px, 5.6vw, 76px);
  --fs-h2: clamp(28px, 3.4vw, 48px);
  --fs-h3: 24px;
  --fs-h4: 18px;
  --fs-body: 16px;
  --fs-sm: 14px;
  --fs-xs: 12px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-pill: 999px;

  --maxw: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding: clamp(56px, 8vw, 120px) 0;
  border-top: 1px solid var(--line);
}
.section--tight { padding: clamp(40px, 5vw, 72px) 0; }
.section--bare { border-top: none; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.section-head .eyebrow { color: var(--ink-3); }
.section-head h2 { margin: 4px 0 0; max-width: 14ch; }
.section-head .section-link {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.section-head .section-link:hover { color: var(--accent); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
}

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
h4 { font-size: var(--fs-h4); font-family: var(--sans); font-weight: 600; letter-spacing: 0; }

.display {
  font-family: var(--serif);
  font-size: var(--fs-display);
  line-height: 0.94;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.display em { font-style: italic; color: var(--accent); }

p { text-wrap: pretty; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 241, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  white-space: nowrap;
}
.brand > span { white-space: nowrap; }
.brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #E2552A, #8B2510);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}
.brand .mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.55);
}
.brand small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-top: -4px;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  font-size: 14px;
  color: var(--ink-2);
  transition: color .15s;
  position: relative;
}
.nav a:hover { color: var(--accent); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--accent);
}

@media (max-width: 760px) {
  .nav { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  transition: transform .15s, background .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); background: var(--accent); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13px; }

/* ---------- Tags / chips ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--surface);
}
.tag--solid {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.tag--accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.tag .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Cards (asociaciones) ---------- */
.card-assoc {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card-assoc:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(22,20,18,0.25);
}
.card-assoc .cover {
  aspect-ratio: 4 / 3;
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
}
.card-assoc .cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(22,20,18,0.04) 0 1px, transparent 1px 16px);
}
.card-assoc .cover .logo-circle {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
}
.card-assoc .cover .sector-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(22,20,18,0.85);
  color: #fff;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.card-assoc .body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.card-assoc .body h3 {
  font-size: 26px;
}
.card-assoc .meta {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.card-assoc .meta::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-4);
}
.card-assoc .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #DCD6CB;
  padding: 80px 0 32px;
  margin-top: 80px;
}
.site-footer h4 {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--sans);
  font-weight: 500;
  margin-bottom: 18px;
}
.site-footer a { color: #BAB2A4; font-size: 14px; }
.site-footer a:hover { color: #fff; }
.site-footer .grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 60px;
  border-bottom: 1px solid #2A2723;
}
.site-footer .grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.site-footer .legal {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #6B655B;
  flex-wrap: wrap;
  gap: 16px;
}
@media (max-width: 800px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Forms / search ---------- */
.search-input {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  padding: 6px 6px 6px 22px;
  box-shadow: 0 10px 40px -20px rgba(22,20,18,0.25);
  transition: border-color .15s;
}
.search-input:focus-within { border-color: var(--ink); }
.search-input svg { flex-shrink: 0; color: var(--ink-3); }
.search-input input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font-family: var(--sans);
  font-size: 17px;
  padding: 14px 12px;
  color: var(--ink);
  min-width: 0;
}
.search-input input::placeholder { color: var(--ink-4); }
.search-input .btn { height: 48px; }

select, input[type="text"], input[type="search"] {
  font-family: var(--sans);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--ink);
  width: 100%;
}
select:focus, input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

/* ---------- Utility ---------- */
.divider { height: 1px; background: var(--line); margin: 0; border: 0; }
.text-muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }

/* ---------- Skeleton stripe placeholder pattern ---------- */
.stripe {
  background-image: repeating-linear-gradient(135deg,
    rgba(22,20,18,0.06) 0 1px,
    transparent 1px 12px);
  background-color: var(--bg-2);
}
