/* =========================================================================
   AltActivity — Gestión Deportiva
   Sistema de diseño. Responsive + Accesible (WCAG 2.1 AA).
   Contrastes de texto verificados >= 4.5:1 sobre su fondo.
   ========================================================================= */

/* ----------  Tokens  ---------- */
:root {
  /* Marca */
  --c-morado:      #6E4FA1;  /* color principal (dominante del logo) */
  --c-morado-osc:  #4A2E7A;  /* hover / énfasis */
  --c-morado-luz:  #F4F1FA;  /* fondo suave */
  --c-tinta:       #1E1B26;  /* texto principal  (~16:1 sobre blanco) */
  --c-tinta-2:     #514C60;  /* texto secundario (~7:1 sobre blanco) */
  --c-linea:       #E6E1F0;
  --c-blanco:      #FFFFFF;
  --c-nieve:       #F7F5FB;

  /* Acentos del molinillo (uso decorativo / categorías) */
  --c-coral:  #E14618;
  --c-coral-txt: #CC3D12;  /* coral oscurecido para texto sobre blanco (AA 4.95:1) */
  --c-ambar:  #EC9A12;
  --c-verde:  #4F9E2A;
  --c-azul:   #2487CE;
  --c-tierra: #96674B;
  --c-bosque: #00693A;

  /* Tipografía */
  --f-display: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --f-body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Escala */
  --wrap: 1180px;
  --gap: clamp(1.25rem, 3vw, 2.25rem);
  --radio: 18px;
  --radio-sm: 12px;
  --sombra: 0 12px 34px rgba(74, 46, 122, .12);
  --sombra-sm: 0 4px 14px rgba(74, 46, 122, .10);
  --trans: .22s ease;
}

/* ----------  Reset ligero  ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 1.0625rem;         /* 17px base */
  line-height: 1.7;
  color: var(--c-tinta);
  background: var(--c-blanco);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-morado-osc); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--c-morado); }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.12; color: var(--c-tinta); margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1.1rem; }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.3em; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--c-morado); outline-offset: 3px; border-radius: 4px; }

/* ----------  Utilidades  ---------- */
.am-wrap { width: min(var(--wrap), 92%); margin-inline: auto; }
.am-section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.am-eyebrow {
  font-family: var(--f-body);
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-morado);
  margin: 0 0 .9rem;
  display: inline-flex; align-items: center; gap: .55rem;
}
.am-eyebrow::before { content: ""; width: 26px; height: 3px; border-radius: 3px; background: var(--c-morado); }
.am-title { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 600; letter-spacing: -.01em; }
.am-lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--c-tinta-2); max-width: 60ch; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Salto al contenido (accesibilidad) */
.am-skip {
  position: absolute; left: 8px; top: -60px; z-index: 1000;
  background: var(--c-morado-osc); color: #fff; padding: .7rem 1.1rem;
  border-radius: 0 0 10px 10px; font-weight: 700; text-decoration: none;
  transition: top var(--trans);
}
.am-skip:focus { top: 0; color: #fff; }

/* ----------  Botones  ---------- */
.am-btn {
  --bg: var(--c-morado); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  background: var(--bg); color: var(--fg);
  font-family: var(--f-display); font-weight: 600; font-size: 1.02rem;
  padding: .85rem 1.6rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform var(--trans), background var(--trans), box-shadow var(--trans);
  box-shadow: var(--sombra-sm);
}
.am-btn:hover { background: var(--c-morado-osc); color: #fff; transform: translateY(-2px); box-shadow: var(--sombra); }
.am-btn--ghost {
  --bg: transparent; --fg: var(--c-morado-osc);
  border-color: currentColor; box-shadow: none;
}
.am-btn--ghost:hover { background: var(--c-morado); color: #fff; border-color: var(--c-morado); }
.am-btn--light { --bg: #fff; --fg: var(--c-morado-osc); }
.am-btn--light:hover { background: var(--c-morado-luz); color: var(--c-morado-osc); }
.am-btn--wa { --bg: var(--c-bosque); --fg: #fff; }
.am-btn--wa:hover { background: #00522e; color: #fff; }

/* =========================================================================
   Cabecera
   ========================================================================= */
.am-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--c-linea);
}
.am-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; }
.am-brand { display: inline-flex; align-items: center; }
.am-brand img { height: 46px; width: auto; }
.am-brand__txt { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; color: var(--c-morado-osc); }

.am-nav { display: flex; align-items: center; gap: 1.6rem; }
.am-menu { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.am-menu a {
  font-family: var(--f-display); font-weight: 500; font-size: 1.02rem;
  color: var(--c-tinta); text-decoration: none; padding: .4rem 0; position: relative;
}
.am-menu a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 3px; width: 0; border-radius: 3px;
  background: var(--c-morado); transition: width var(--trans);
}
.am-menu a:hover, .am-menu .current-menu-item > a { color: var(--c-morado-osc); }
.am-menu a:hover::after, .am-menu .current-menu-item > a::after { width: 100%; }

.am-burger {
  display: none; width: 46px; height: 46px; border: 2px solid var(--c-linea); border-radius: 12px;
  background: #fff; cursor: pointer; align-items: center; justify-content: center;
}
.am-burger span, .am-burger span::before, .am-burger span::after {
  content: ""; display: block; width: 22px; height: 2.5px; background: var(--c-tinta); border-radius: 3px;
  transition: transform var(--trans), opacity var(--trans);
}
.am-burger span::before { transform: translateY(-7px); }
.am-burger span::after { transform: translateY(4.5px); }
.am-burger[aria-expanded="true"] span { background: transparent; }
.am-burger[aria-expanded="true"] span::before { transform: rotate(45deg); }
.am-burger[aria-expanded="true"] span::after { transform: rotate(-45deg) translateY(-1.7px); }

/* =========================================================================
   Hero
   ========================================================================= */
.am-hero { position: relative; color: #fff; overflow: hidden; }
.am-hero__bg { position: absolute; inset: 0; z-index: 0; }
.am-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.am-hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(45,26,74,.92) 0%, rgba(74,46,122,.78) 42%, rgba(110,79,161,.34) 100%);
}
.am-hero__inner { position: relative; z-index: 1; padding-block: clamp(4rem, 11vw, 8.5rem); }
.am-hero__eyebrow { color: #EBD8FF; }
.am-hero__eyebrow::before { background: #EBD8FF; }
.am-hero h1 {
  color: #fff; font-size: clamp(2.4rem, 6vw, 4.3rem); font-weight: 600; letter-spacing: -.015em;
  max-width: 16ch; margin-bottom: .5rem;
}
.am-hero__sub { font-size: clamp(1.1rem, 2vw, 1.4rem); color: #F1E9FB; max-width: 46ch; margin-bottom: 2rem; }
.am-hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; }
.am-hero__facts { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 3.2rem; }
.am-fact strong { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); display: block; color: #fff; }
.am-fact span { font-size: .95rem; color: #E4D5F7; }

/* =========================================================================
   Molinillo (firma gráfica de marca)
   ========================================================================= */
.am-pinwheel { display: inline-block; transform-origin: 50% 50%; }
.am-pinwheel--spin { animation: am-spin 26s linear infinite; }
@keyframes am-spin { to { transform: rotate(360deg); } }
.am-hero__mark {
  position: absolute; right: -60px; top: 50%; transform: translateY(-50%);
  width: min(46vw, 520px); opacity: .16; z-index: 1; pointer-events: none;
}
.am-hero__mark .am-pinwheel { width: 100%; }

/* =========================================================================
   Servicios (3 líneas)
   ========================================================================= */
.am-services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.6rem; }
.am-card {
  background: #fff; border: 1px solid var(--c-linea); border-radius: var(--radio);
  padding: 2rem 1.7rem; position: relative; overflow: hidden;
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.am-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--accent, var(--c-morado)); }
.am-card:hover { transform: translateY(-6px); box-shadow: var(--sombra); border-color: transparent; }
.am-card__icon {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  background: var(--accent, var(--c-morado)); color: #fff; margin-bottom: 1.2rem;
}
.am-card__icon svg { width: 30px; height: 30px; }
.am-card h3 { font-size: 1.4rem; margin-bottom: .5rem; }
.am-card p { color: var(--c-tinta-2); margin-bottom: 1rem; font-size: 1rem; }
.am-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.am-card li {
  font-size: .86rem; font-weight: 700; color: var(--c-morado-osc);
  background: var(--c-morado-luz); padding: .3rem .7rem; border-radius: 999px;
}
.am-card--morado { --accent: var(--c-morado); }
.am-card--azul   { --accent: var(--c-azul); }
.am-card--coral  { --accent: var(--c-coral); }
.am-card--azul li   { color: #185a8a; background: #E4F1FB; }
.am-card--coral li  { color: #9c2f0f; background: #FBE7E0; }

/* =========================================================================
   Territorio (bloque diferencial)
   ========================================================================= */
.am-territory { background: var(--c-morado-osc); color: #fff; position: relative; overflow: hidden; }
.am-territory .am-eyebrow { color: #E9D8FF; }
.am-territory .am-eyebrow::before { background: #E9D8FF; }
.am-territory h2 { color: #fff; }
.am-territory__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.am-territory p { color: #EDE4F9; font-size: 1.12rem; }
.am-territory__mark { display: grid; place-items: center; }
.am-territory__mark .am-pinwheel { width: min(60%, 300px); }
.am-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.am-chips span {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25);
  padding: .45rem .95rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
}

/* =========================================================================
   Actividades (galería + lista)
   ========================================================================= */
.am-activities__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
.am-activities__media { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.am-activities__media img { border-radius: var(--radio-sm); box-shadow: var(--sombra-sm); aspect-ratio: 3/4; object-fit: cover; }
.am-activities__media img:nth-child(1) { margin-top: 2rem; }
.am-actlist { columns: 2; column-gap: 1.5rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.am-actlist li {
  break-inside: avoid; padding: .55rem 0 .55rem 1.9rem; position: relative;
  border-bottom: 1px solid var(--c-linea); font-weight: 600; color: var(--c-tinta);
}
.am-actlist li::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--c-verde);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/16px no-repeat;
}

/* =========================================================================
   Franja CTA
   ========================================================================= */
.am-cta { background: linear-gradient(120deg, var(--c-morado) 0%, var(--c-morado-osc) 100%); color: #fff; text-align: center; }
.am-cta h2 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.am-cta p { color: #EEE4FB; max-width: 52ch; margin-inline: auto; font-size: 1.15rem; }
.am-cta__btns { display: flex; flex-wrap: wrap; gap: .9rem; justify-content: center; margin-top: 1.8rem; }

/* =========================================================================
   Pie
   ========================================================================= */
.am-footer { background: #221838; color: #E7DEF3; padding-block: clamp(3rem, 6vw, 4.5rem) 0; }
.am-footer a { color: #E7DEF3; }
.am-footer a:hover { color: #fff; }
.am-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.am-footer__brand img { height: 66px; width: auto; margin-bottom: 1.1rem; }
.am-footer__brand p { color: #BCAFD3; max-width: 34ch; }
.am-footer h4 { color: #fff; font-size: 1.05rem; letter-spacing: .02em; margin-bottom: 1rem; }
.am-footer ul { list-style: none; padding: 0; margin: 0; }
.am-footer li { margin-bottom: .6rem; }
.am-footer__contact a { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.am-footer__contact svg { width: 18px; height: 18px; flex: none; color: var(--c-morado); }
.am-footer__bar {
  margin-top: 3rem; border-top: 1px solid rgba(255,255,255,.12);
  padding-block: 1.4rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  font-size: .9rem; color: #A99BC4;
}
.am-footer__legal { display: flex; flex-wrap: wrap; gap: 1.2rem; list-style: none; margin: 0; padding: 0; }
.am-footer__legal a { font-size: .9rem; text-decoration: none; }
.am-footer__legal a:hover { text-decoration: underline; }

/* =========================================================================
   Páginas internas (cabecera + prosa)
   ========================================================================= */
.am-page-hero { background: var(--c-morado-luz); border-bottom: 1px solid var(--c-linea); padding-block: clamp(2.5rem, 6vw, 4rem); }
.am-page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.am-page-hero p { color: var(--c-tinta-2); max-width: 60ch; margin: 0; font-size: 1.1rem; }
.am-breadcrumb { font-size: .9rem; color: var(--c-tinta-2); margin-bottom: .8rem; }
.am-breadcrumb a { color: var(--c-morado-osc); text-decoration: none; }
.am-breadcrumb a:hover { text-decoration: underline; }

.am-prose { max-width: 72ch; margin-inline: auto; }
.am-prose h2 { font-size: 1.6rem; margin-top: 2.2rem; color: var(--c-morado-osc); }
.am-prose h3 { font-size: 1.25rem; margin-top: 1.6rem; }
.am-prose ul, .am-prose ol { padding-left: 1.4em; }
.am-prose li { margin-bottom: .4rem; }
.am-prose a { color: var(--c-morado-osc); }
.am-prose table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; }
.am-prose th, .am-prose td { border: 1px solid var(--c-linea); padding: .7rem .9rem; text-align: left; vertical-align: top; }
.am-prose th { background: var(--c-morado-luz); font-family: var(--f-display); }
.am-note {
  background: #FFF7E6; border: 1px solid #F3D998; border-left: 5px solid var(--c-ambar);
  border-radius: 10px; padding: 1rem 1.2rem; margin: 1.5rem 0; color: #6b4e05;
}
.am-note strong { color: #5a4104; }

/* =========================================================================
   Quiénes somos — valores
   ========================================================================= */
.am-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.4rem; }
.am-value { background: var(--c-nieve); border-radius: var(--radio); padding: 1.8rem 1.5rem; border: 1px solid var(--c-linea); }
.am-value__icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent, var(--c-morado)); color: #fff; display: grid; place-items: center; margin-bottom: 1rem; }
.am-value__icon svg { width: 26px; height: 26px; }
.am-value h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.am-value p { color: var(--c-tinta-2); margin: 0; font-size: .98rem; }
.am-value:nth-child(1) { --accent: var(--c-morado); }
.am-value:nth-child(2) { --accent: var(--c-verde); }
.am-value:nth-child(3) { --accent: var(--c-coral); }

.am-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.am-split img { border-radius: var(--radio); box-shadow: var(--sombra); }

/* =========================================================================
   Contacto
   ========================================================================= */
.am-contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.am-contact__aside .am-eyebrow { margin-top: 0; }
.am-contact__list { list-style: none; padding: 0; margin: 1.6rem 0 0; }
.am-contact__list li { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 0; border-bottom: 1px solid var(--c-linea); }
.am-contact__list .ico { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--c-morado-luz); color: var(--c-morado-osc); display: grid; place-items: center; }
.am-contact__list .ico svg { width: 22px; height: 22px; }
.am-contact__list b { font-family: var(--f-display); display: block; }
.am-contact__list a { color: var(--c-morado-osc); text-decoration: none; font-weight: 700; }
.am-contact__list a:hover { text-decoration: underline; }
.am-contact__list span { color: var(--c-tinta-2); }

.am-form { background: #fff; border: 1px solid var(--c-linea); border-radius: var(--radio); padding: clamp(1.6rem, 3vw, 2.4rem); box-shadow: var(--sombra-sm); }
.am-field { margin-bottom: 1.2rem; }
.am-field label { display: block; font-family: var(--f-display); font-weight: 500; margin-bottom: .4rem; }
.am-field .req { color: var(--c-coral-txt); }
.am-field input, .am-field textarea, .am-field select {
  width: 100%; font-family: var(--f-body); font-size: 1rem; color: var(--c-tinta);
  padding: .8rem 1rem; border: 2px solid var(--c-linea); border-radius: 12px; background: #fff;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.am-field input:focus, .am-field textarea:focus, .am-field select:focus {
  outline: none; border-color: var(--c-morado); box-shadow: 0 0 0 4px rgba(110,79,161,.16);
}
.am-field textarea { min-height: 140px; resize: vertical; }
.am-field__hint { font-size: .86rem; color: var(--c-tinta-2); margin-top: .35rem; }
.am-check { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; color: var(--c-tinta-2); }
.am-check input { width: auto; margin-top: .25rem; accent-color: var(--c-morado); }
.am-honeypot { position: absolute; left: -9999px; top: -9999px; }
.am-alert { border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1.4rem; font-weight: 600; }
.am-alert--ok { background: #E7F6EA; border: 1px solid #A9DCB4; color: #1c5b2b; }
.am-alert--err { background: #FBE7E0; border: 1px solid #F0B49E; color: #8a2c0f; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .am-services__grid, .am-values { grid-template-columns: 1fr; }
  .am-territory__grid, .am-activities__grid, .am-split, .am-contact { grid-template-columns: 1fr; }
  .am-territory__mark { order: -1; }
  .am-activities__media img:nth-child(1) { margin-top: 0; }
  .am-hero__mark { display: none; }

  .am-burger { display: inline-flex; }
  .am-nav {
    position: fixed; inset: 74px 0 auto 0; background: #fff; flex-direction: column; align-items: stretch;
    gap: 0; padding: .5rem 6% 1.5rem; border-bottom: 1px solid var(--c-linea);
    box-shadow: var(--sombra); transform: translateY(-140%); transition: transform .3s ease; max-height: calc(100vh - 74px); overflow-y: auto;
  }
  .am-nav[data-open="true"] { transform: translateY(0); }
  .am-menu { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .am-menu li { border-bottom: 1px solid var(--c-linea); }
  .am-menu a { display: block; padding: .95rem .2rem; font-size: 1.1rem; }
  .am-menu a::after { display: none; }
  .am-nav .am-btn { margin-top: 1rem; justify-content: center; }
}
@media (max-width: 560px) {
  .am-actlist { columns: 1; }
  .am-activities__media, .am-footer__grid { grid-template-columns: 1fr; }
  .am-hero__facts { gap: 1.4rem; }
  .am-footer__grid { gap: 1.8rem; }
}

/* ----------  Movimiento reducido  ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .am-pinwheel--spin { animation: none; }
}
