/* Club Deportivo Juan Ramsay Master — estilos públicos
   Diseñado para adultos mayores: letra grande, alto contraste, áreas de clic amplias. */

:root {
  --azul: #0b4db0;
  --azul-osc: #083a87;
  --rojo: #e2233b;
  --rojo-osc: #b81a2f;
  --azul-claro: #1360cc;
  --texto: #1b1f24;
  --texto-suave: #4a525c;
  --fondo: #ffffff;
  --fondo-suave: #f1f5fc;
  --borde: #d3dcec;
  --radio: 14px;
  --sombra: 0 2px 10px rgba(11, 77, 176, .10);
  --escala: 1;
}

html { font-size: calc(19px * var(--escala)); scroll-behavior: smooth; }
html.letra-1 { --escala: 1.15; }
html.letra-2 { --escala: 1.3; }
html.letra--1 { --escala: .9; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.65;
  color: var(--texto);
  background: var(--fondo);
}

img { max-width: 100%; height: auto; }
a { color: var(--azul); text-underline-offset: 3px; }
a:hover { color: var(--rojo-osc); }
:focus-visible { outline: 4px solid var(--rojo); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.25; color: var(--azul-osc); }
h1 { font-size: 2.1rem; margin: 0 0 .6em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; margin: .2em 0 .4em; }

.contenedor { width: min(1140px, 100% - 32px); margin-inline: auto; }
.seccion { padding: 48px 0; }
.intro { font-size: 1.1rem; color: var(--texto-suave); max-width: 60ch; }
.meta { color: var(--texto-suave); font-size: .92rem; display: block; }

.saltar { position: absolute; left: -999px; top: 0; background: var(--azul); color: #fff; padding: 10px 16px; z-index: 100; }
.saltar:focus { left: 8px; top: 8px; }

/* Barra accesibilidad */
.barra-accesibilidad { background: var(--azul-osc); color: #fff; font-size: .85rem; }
.barra-accesibilidad .contenedor { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 6px 0; flex-wrap: wrap; }
.barra-accesibilidad button {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6);
  border-radius: 8px; padding: 4px 12px; font: inherit; cursor: pointer; min-height: 36px;
}
.barra-accesibilidad button:hover, .barra-accesibilidad button[aria-pressed="true"] { background: #fff; color: var(--azul-osc); }

/* Cabecera */
.cabecera { background: #fff; border-bottom: 4px solid var(--rojo); position: sticky; top: 0; z-index: 50; box-shadow: var(--sombra); }
.cabecera-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.marca { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--azul-osc); }
.marca strong { display: block; font-size: 1.1rem; line-height: 1.2; }
.marca small { color: var(--texto-suave); font-size: .82rem; }
.menu { display: flex; gap: 4px; flex-wrap: wrap; }
.menu a {
  text-decoration: none; color: var(--texto); font-weight: 600; padding: 10px 14px; border-radius: 10px;
}
.menu a:hover { background: var(--fondo-suave); color: var(--azul); }
.menu a[aria-current="page"] { background: var(--azul); color: #fff; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex; font: inherit; font-weight: 700; background: var(--azul); color: #fff;
    border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; min-height: 48px;
  }
  .menu { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; padding: 8px 16px 16px; border-bottom: 4px solid var(--rojo); }
  .menu.abierto { display: flex; }
  .menu a { padding: 14px; font-size: 1.1rem; border-bottom: 1px solid var(--borde); border-radius: 0; }
  .cabecera-inner { position: relative; }
  .marca small { display: none; }
}

/* Botones */
.btn {
  display: inline-block; background: var(--rojo); color: #fff; text-decoration: none; font-weight: 700;
  padding: 12px 22px; border-radius: 12px; border: 0; font: inherit; font-weight: 700; cursor: pointer;
  min-height: 48px; line-height: 1.5;
}
.btn:hover { background: var(--rojo-osc); color: #fff; }
.btn-grande { font-size: 1.1rem; padding: 14px 26px; }
.btn-secundario { background: #fff; color: var(--azul); border: 2px solid var(--azul); }
.btn-secundario:hover { background: var(--azul); color: #fff; }

/* Hero */
.hero { background: radial-gradient(circle at 30% 20%, var(--azul-claro) 0%, var(--azul) 45%, var(--azul-osc) 100%); color: #fff; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 56px 0; }
.hero h1 { color: #fff; font-size: 2.4rem; }
.hero-lema { font-size: 1.25rem; color: #ffe3e7; font-weight: 600; }
.hero-botones { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero .btn-secundario { background: transparent; color: #fff; border-color: #fff; }
.hero .btn-secundario:hover { background: #fff; color: var(--azul); }
@media (max-width: 800px) { .hero-inner { grid-template-columns: 1fr; padding: 36px 0; } .hero-img { max-width: 320px; margin: auto; } .hero h1 { font-size: 1.9rem; } }

.titulo-seccion { position: relative; padding-bottom: 10px; margin-bottom: 24px; }
.titulo-seccion::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 5px; border-radius: 3px; background: var(--rojo); }
.fondo-suave { background: var(--fondo-suave); }

/* Grids y tarjetas */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin-bottom: 24px; }
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.tarjeta-icono { padding: 24px; }
.tarjeta-icono span { font-size: 2.4rem; }
.tarjeta-noticia a { display: block; text-decoration: none; color: inherit; height: 100%; }
.tarjeta-noticia img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--fondo-suave); }
.tarjeta-noticia:hover { border-color: var(--azul); }
.tarjeta-cuerpo { padding: 18px 20px 22px; }
.tarjeta-cuerpo p { color: var(--texto-suave); margin: .3em 0 .8em; }
.leer-mas { color: var(--azul); font-weight: 700; }

/* Eventos */
.lista-eventos { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.evento-item {
  display: flex; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 14px 18px; text-decoration: none; color: inherit; box-shadow: var(--sombra);
}
.evento-item:hover { border-color: var(--rojo); }
.evento-titulo { font-size: 1.15rem; color: var(--azul-osc); display: block; }
.evento-resumen { display: block; color: var(--texto-suave); margin-top: 4px; }
.fecha-caja {
  flex: 0 0 78px; text-align: center; background: var(--rojo); color: #fff; border-radius: 12px;
  padding: 8px 4px; font-weight: 700; font-size: .85rem; line-height: 1.2;
}
.fecha-caja strong { display: block; font-size: 1.8rem; }
.fecha-caja small { display: block; font-weight: 400; opacity: .9; }

.pestanas { display: flex; gap: 8px; margin-bottom: 24px; }
.pestanas a { padding: 10px 20px; border-radius: 999px; border: 2px solid var(--azul); text-decoration: none; font-weight: 700; }
.pestanas a[aria-current="page"] { background: var(--azul); color: #fff; }

.datos-evento { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; background: var(--fondo-suave); padding: 16px 20px; border-radius: var(--radio); }
.datos-evento dt { font-weight: 700; }
.datos-evento dd { margin: 0; }

/* Directorio */
.grid-directorio { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.miembro { text-align: center; padding: 24px 20px; }
.miembro img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 5px solid var(--fondo-suave); }
.miembro h2 { font-size: 1.2rem; margin: 12px 0 4px; }
.miembro .cargo { color: var(--rojo-osc); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .9rem; margin: 0 0 8px; }

/* Textos */
.contenido-texto { max-width: 820px; }
.texto-enriquecido { font-size: 1.05rem; }
.texto-enriquecido blockquote { border-left: 5px solid var(--rojo); margin: 1em 0; padding: .4em 1em; background: var(--fondo-suave); }
.img-destacada { width: 100%; border-radius: var(--radio); margin: 12px 0 20px; }
.bajada { font-size: 1.2rem; font-weight: 600; color: var(--texto-suave); }

/* Formulario */
.grid-contacto { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .grid-contacto { grid-template-columns: 1fr; } }
.formulario label { display: block; font-weight: 700; margin: 16px 0 6px; }
.formulario input, .formulario textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--borde); border-radius: 10px; background: #fff; min-height: 50px;
}
.formulario input:focus, .formulario textarea:focus { border-color: var(--azul); outline: 3px solid rgba(11,77,176,.2); }
.formulario button { margin-top: 20px; }
.campo-trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.datos-contacto { padding: 24px; }
.datos-contacto h2 { margin-top: 0; }
.mapa { width: 100%; height: 280px; border: 0; border-radius: 10px; }

.alerta { padding: 14px 18px; border-radius: 10px; margin: 16px 0; font-weight: 600; }
.alerta ul { margin: 0; padding-left: 20px; }
.alerta-ok { background: #e3f6ea; color: #0f5132; border: 2px solid #8fd1a8; }
.alerta-error { background: #fdecea; color: #842029; border: 2px solid #f1aeb5; }

.paginacion { display: flex; gap: 6px; flex-wrap: wrap; margin: 24px 0; }
.paginacion a, .paginacion span { padding: 8px 14px; border: 2px solid var(--borde); border-radius: 10px; text-decoration: none; min-width: 44px; text-align: center; }
.paginacion span { background: var(--azul); color: #fff; border-color: var(--azul); }

/* Pie */
.pie { background: var(--azul-osc); color: #e6ecf7; margin-top: 40px; }
.pie a { color: #fff; }
.pie h2 { color: #fff; font-size: 1.15rem; }
.pie-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; padding: 40px 0; }
.lista-simple { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pie-final { background: rgba(0,0,0,.25); padding: 14px 0; font-size: .85rem; text-align: center; }

/* Modo alto contraste */
html.alto-contraste body { background: #000; color: #fff; }
html.alto-contraste .cabecera, html.alto-contraste .tarjeta, html.alto-contraste .evento-item,
html.alto-contraste .fondo-suave, html.alto-contraste .menu, html.alto-contraste .datos-evento,
html.alto-contraste .formulario input, html.alto-contraste .formulario textarea { background: #000; color: #fff; border-color: #fff; }
html.alto-contraste h1, html.alto-contraste h2, html.alto-contraste h3, html.alto-contraste .evento-titulo,
html.alto-contraste .marca, html.alto-contraste .menu a, html.alto-contraste .meta,
html.alto-contraste .tarjeta-cuerpo p, html.alto-contraste .intro, html.alto-contraste .evento-resumen { color: #fff; }
html.alto-contraste a, html.alto-contraste .leer-mas { color: #ffeb3b; }
html.alto-contraste .menu a[aria-current="page"] { background: #ffeb3b; color: #000; }
html.alto-contraste .btn { background: #ffeb3b; color: #000; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .barra-accesibilidad, .cabecera, .pie, .menu-toggle { display: none; } }

/* Identidad del logo: franja blanca y roja como los anillos del escudo */
.cabecera { border-bottom: 0; box-shadow: 0 3px 0 #fff, 0 7px 0 var(--rojo), var(--sombra); }
.marca img { width: 64px; height: 64px; }
.hero-img { width: 100%; max-width: 420px; justify-self: center; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.pie { border-top: 6px solid var(--rojo); }
