/* ADAGUR — tema de ajedrez.
   Se carga DESPUÉS de tailwind.css. Todo va bajo `body.ajedrez` para ganarle en
   especificidad a las utilidades de Tailwind sin usar !important.
   Es CSS escrito a mano (no lo genera Tailwind): editarlo directamente. */

:root {
  --verde: #0b6b28;          /* verde del club */
  --verde-osc: #074d1c;
  --verde-casilla: #769656;  /* casilla oscura del tablero */
  --crema: #eeeed2;          /* casilla clara del tablero */
  --papel: #f6f4ea;
  --tinta: #1f2a24;
  --oro: #c9a227;
  --oro-claro: #fbf1c7;
  --serif: Georgia, "Times New Roman", Times, serif;
  /* Patrón de tablero: usar con tamaño 2s × 2s para casillas de lado s. */
  --tablero: conic-gradient(var(--verde-casilla) 25%, var(--crema) 0 50%, var(--verde-casilla) 0 75%, var(--crema) 0);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
body.ajedrez {
  background-color: var(--papel);
  background-image: conic-gradient(rgba(118,150,86,.08) 25%, transparent 0 50%, rgba(118,150,86,.08) 0 75%, transparent 0);
  background-size: 112px 112px;
  color: var(--tinta);
}
body.ajedrez a:focus-visible,
body.ajedrez button:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }

/* ── Encabezado: verde del club con franja de tablero ────────────────── */
body.ajedrez header.banner-bg {
  background: linear-gradient(135deg, var(--verde-osc) 0%, var(--verde) 60%, #12822f 100%);
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
}
body.ajedrez header.banner-bg::before {          /* caballo de marca de agua */
  content: "\265E\FE0E";
  position: absolute; right: 7%; top: -14px;
  font-size: 118px; line-height: 1;
  color: rgba(255,255,255,.07);
  pointer-events: none;
}
body.ajedrez header.banner-bg::after {           /* franja de tablero */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background: var(--tablero) 0 0 / 16px 16px;
}
body.ajedrez header.banner-bg > * { position: relative; z-index: 1; }
body.ajedrez header.banner-bg h1,
body.ajedrez header.banner-bg .text-white > div:first-child {
  font-family: var(--serif);
  letter-spacing: .01em;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
body.ajedrez header.banner-bg > span {           /* "Sitio Oficial" */
  background: rgba(201,162,39,.2);
  border-color: var(--oro);
  color: #f8e9a8;
}

/* ── Menú ─────────────────────────────────────────────────────────────── */
body.ajedrez nav { background: var(--tinta); border-bottom: 3px solid var(--oro); box-shadow: none; }
body.ajedrez nav a { color: #dfe8da; letter-spacing: .02em; }
body.ajedrez nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
body.ajedrez nav a::before { color: var(--oro); margin-right: .4em; }
body.ajedrez nav a:nth-child(1)::before { content: "\265C\FE0E"; }   /* torre */
body.ajedrez nav a:nth-child(2)::before { content: "\2709\FE0E"; }   /* sobre */
body.ajedrez nav a:nth-child(3)::before { content: "\265B\FE0E"; }   /* dama: Rey Blanco */
body.ajedrez nav a.nav-externo::after { content: " \2197\FE0E"; font-size: .85em; opacity: .75; }

/* ── Páginas de torneo: tarjeta de contenido ─────────────────────────── */
body.ajedrez main.bg-white {
  border-top: 6px solid var(--verde);
  border-radius: .6rem;
  box-shadow: 0 10px 30px rgba(7,77,28,.12);
}
body.ajedrez main h1 {
  font-family: var(--serif);
  color: var(--verde-osc);
  font-weight: 700;
  letter-spacing: -.01em;
  border-bottom: 0;
  padding-bottom: 0;
}
body.ajedrez main h1::after {                    /* línea de tablero bajo el título */
  content: "";
  display: block; height: 8px; margin-top: .6rem;
  background: var(--tablero) 0 0 / 16px 16px;
  border-radius: 2px; opacity: .85;
}
body.ajedrez main h2.mb-4 {                      /* títulos de sección */
  font-family: var(--serif);
  color: var(--verde-osc);
  border-bottom: 2px dotted var(--verde-casilla);
}
body.ajedrez main h2.mb-4::before { content: "\265E\FE0E"; color: var(--verde-casilla); margin-right: .45rem; }
body.ajedrez main h2.mb-1 { font-family: var(--serif); color: var(--verde-osc); }
body.ajedrez main h3.mb-1 { color: #3b4a40; }
body.ajedrez main h3.text-blue-700 {
  font-family: var(--serif);
  color: var(--verde);
  border-color: var(--verde-casilla);
  border-bottom-style: dashed;
}

/* Campeones: panel dorado */
body.ajedrez main .from-yellow-50 {
  background: linear-gradient(135deg, #fff8dc, #f6e7a6);
  border-color: var(--oro);
  position: relative; overflow: hidden;
}
body.ajedrez main .from-yellow-50::before {
  content: "\2654\FE0E";
  position: absolute; right: 14px; top: -22px;
  font-size: 130px; line-height: 1;
  color: rgba(201,162,39,.18);
  pointer-events: none;
}
body.ajedrez main .from-yellow-50 > * { position: relative; }
body.ajedrez main .from-yellow-50 h2 { font-family: var(--serif); }

/* ── Tablas de resultados ─────────────────────────────────────────────── */
body.ajedrez table {
  border-collapse: separate; border-spacing: 0;
  border: 1px solid #d6dcc8;
  border-radius: .5rem; overflow: hidden;
}
body.ajedrez table thead,
body.ajedrez table thead th { background: var(--verde); color: #fff; letter-spacing: .06em; }
/* Filas "lisas": zebra como casillas del tablero. Las filas con clase propia
   (.fila-adagur, .fila-premio, .bg-yellow-50) conservan su resaltado. */
body.ajedrez tbody tr:not([class]):nth-child(odd),
body.ajedrez tbody tr.static-row:nth-child(odd)  { background: #fff; }
body.ajedrez tbody tr:not([class]):nth-child(even),
body.ajedrez tbody tr.static-row:nth-child(even) { background: #eef2e1; }
body.ajedrez tbody tr:not([class]):hover,
body.ajedrez tbody tr.static-row:hover { background: #e1ebcb; }
/* Podio (sólo tablas de posiciones que empiezan en el 1.º) */
body.ajedrez table.tabla-posiciones tbody tr:nth-child(1) td:first-child { box-shadow: inset 4px 0 0 var(--oro); }
body.ajedrez table.tabla-posiciones tbody tr:nth-child(2) td:first-child { box-shadow: inset 4px 0 0 #aeb4ba; }
body.ajedrez table.tabla-posiciones tbody tr:nth-child(3) td:first-child { box-shadow: inset 4px 0 0 #b87333; }
body.ajedrez table.tabla-posiciones tbody tr:nth-child(1) td:first-child::before {
  content: "\2654\FE0E"; color: var(--oro); margin-right: .15rem;
}

/* ── Pie ──────────────────────────────────────────────────────────────── */
body.ajedrez footer { background: var(--tinta); color: #cfd9c8; position: relative; padding-top: 1.7rem; }
body.ajedrez footer::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 8px;
  background: var(--tablero) 0 0 / 16px 16px;
}
body.ajedrez footer p:first-child::before {
  content: "\2654\FE0E \265B\FE0E \2656\FE0E \2657\FE0E \2658\FE0E \2659\FE0E";
  display: block; margin-bottom: .35rem;
  letter-spacing: .3em; font-size: 1.1rem; color: var(--oro);
}

/* ── Portada: hero con tablero ilustrado ──────────────────────────────── */
.hero { max-width: 80rem; margin: 0 auto; padding: 1.4rem 1rem .25rem; display: grid; gap: 1.5rem; align-items: center; }
.hero h2 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.08; font-weight: 700; color: var(--verde-osc);
}
.hero h2 span { color: var(--verde-casilla); }
.hero p { max-width: 34rem; margin-top: .7rem; color: #44554a; font-size: 1.02rem; line-height: 1.5; }
.tablero { display: none; }
@media (min-width: 768px) {
  .hero { grid-template-columns: 1fr auto; padding: 2rem 1.5rem .5rem; }
}
@media (min-width: 1024px) {
  .hero { padding-left: 2rem; padding-right: 2rem; }   /* alinea con el contenido (px-8) */
}
@media (min-width: 768px) {
  .tablero {
    display: grid;
    grid-template: repeat(8, 1fr) / repeat(8, 1fr);
    width: 15rem; height: 15rem;
    background: var(--tablero) 0 0 / 25% 25%;
    border: 6px solid var(--tinta); border-radius: 4px;
    box-shadow: 0 14px 28px rgba(0,0,0,.28);
    transform: rotate(3deg);
  }
}
.tablero span { display: grid; place-items: center; font-size: 1.6rem; line-height: 1; }
.tablero .b { color: #fff; text-shadow: 0 0 1px #000, 0 0 1px #000, 0 1px 3px rgba(0,0,0,.6); }
.tablero .n { color: #14181a; }

.titulo-seccion {
  font-family: var(--serif);
  font-size: 1.7rem; font-weight: 700; color: var(--tinta);
  margin: .6rem 0 1rem;
}
.titulo-seccion::after {
  content: "\265C\FE0E \265E\FE0E \265D\FE0E \265B\FE0E \265A\FE0E \265D\FE0E \265E\FE0E \265C\FE0E";
  display: block; margin-top: .2rem;
  font-size: 1rem; letter-spacing: .5em; color: var(--verde-casilla);
}

/* ── Portada: tarjetas de torneo ──────────────────────────────────────── */
.cartas { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px)  { .cartas { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cartas { grid-template-columns: repeat(3, 1fr); } }
.carta {
  display: flex; align-items: center; gap: .8rem;
  width: auto;
  background: #fff; border: 1px solid #dfe3d2; border-radius: .6rem;
  padding: .7rem .85rem;
  box-shadow: 0 1px 3px rgba(31,42,36,.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.carta:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(7,77,28,.15); border-color: var(--verde-casilla); }
.carta-pieza {
  flex: 0 0 2.7rem; height: 2.7rem;
  display: grid; place-items: center;
  font-size: 1.65rem; line-height: 1;
  border-radius: .35rem;
  background: var(--crema); color: var(--tinta);
}
/* Casillas alternadas: las tarjetas forman un tablero. */
.cartas .carta:nth-child(even) .carta-pieza { background: var(--verde-casilla); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.carta h3 { font-family: var(--serif); font-size: .98rem; font-weight: 700; line-height: 1.25; color: var(--verde-osc); }
.carta p  { font-size: .78rem; margin-top: .15rem; color: #56645b; }

@media (prefers-reduced-motion: reduce) {
  .carta { transition: none; }
  .carta:hover { transform: none; }
}

/* ── Enlace a Proyecto Rey Blanco ─────────────────────────────────────── */
body.ajedrez footer .pie-amigo { margin-top: .25rem; }
body.ajedrez footer .pie-amigo a { color: #f0d675; text-decoration: underline; text-underline-offset: 3px; }
body.ajedrez footer .pie-amigo a:hover { color: #fff; }

.rey-blanco {
  display: grid; gap: .9rem; align-items: center;
  margin-top: 1.75rem; padding: 1.1rem 1.2rem;
  background: var(--tinta); color: #e8efe4;
  border-radius: .7rem; border-left: 6px solid var(--oro);
  box-shadow: 0 8px 20px rgba(31,42,36,.22);
}
.rey-blanco-pieza {
  display: grid; place-items: center;
  width: 3.4rem; height: 3.4rem; font-size: 2.2rem; line-height: 1;
  background: var(--crema); color: var(--tinta); border-radius: .4rem;
}
.rey-blanco h2 { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: #fff; }
.rey-blanco p  { margin-top: .3rem; font-size: .92rem; line-height: 1.5; color: #cfd9c8; max-width: 44rem; }
.rey-blanco-boton, .boton-oro {
  display: inline-block; width: auto; justify-self: start;
  padding: .55rem 1.05rem; border-radius: .45rem;
  background: var(--oro); color: #1a1500; font-weight: 700; font-size: .95rem;
  transition: background .15s ease, transform .15s ease;
}
.rey-blanco-boton:hover, .boton-oro:hover { background: #ddb63a; transform: translateY(-1px); }
@media (min-width: 768px) {
  .rey-blanco { grid-template-columns: auto 1fr auto; gap: 1.2rem; padding: 1.2rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .rey-blanco-boton { transition: none; } .rey-blanco-boton:hover, .boton-oro:hover { transform: none; } }

/* ── Página de contacto ───────────────────────────────────────────────── */
.contacto-intro { color: #44554a; margin-bottom: .4rem; }
.contacto-grid { display: grid; gap: .8rem; margin-top: 1.2rem; }
@media (min-width: 768px) { .contacto-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.dato {
  display: flex; gap: .85rem; align-items: flex-start;
  background: var(--papel); border: 1px solid #dfe3d2; border-radius: .6rem; padding: .95rem 1rem;
}
.dato-pieza {
  flex: 0 0 2.7rem; height: 2.7rem; display: grid; place-items: center;
  font-size: 1.65rem; line-height: 1; border-radius: .35rem;
  background: var(--crema); color: var(--tinta);
}
.dato:nth-child(even) .dato-pieza { background: var(--verde-casilla); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
body.ajedrez main .dato h2 {
  font-family: var(--serif); font-size: .78rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--verde);
}
.dato p, .dato address { margin-top: .2rem; font-size: 1.02rem; font-style: normal; line-height: 1.45; color: var(--tinta); }
.dato a { color: var(--verde-osc); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.dato a:hover { color: var(--verde); }
.contacto-acciones { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.boton-secundario {
  display: inline-block; width: auto; padding: .5rem 1.05rem; border-radius: .45rem;
  border: 2px solid var(--verde); color: var(--verde-osc); font-weight: 700; font-size: .95rem;
  transition: background .15s ease, color .15s ease;
}
.boton-secundario:hover { background: var(--verde); color: #fff; }
@media (prefers-reduced-motion: reduce) { .boton-secundario { transition: none; } }

/* ── Torneos agrupados por año ────────────────────────────────────────── */
.anios-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1.1rem; }
.anios-nav span { font-size: .85rem; color: #56645b; margin-right: .2rem; }
.anios-nav a {
  display: inline-block; width: auto; min-width: 3.4rem; text-align: center;
  padding: .3rem .8rem; border-radius: .4rem;
  background: var(--crema); color: var(--tinta);
  font-family: var(--serif); font-weight: 700; font-size: .95rem;
  border: 1px solid #d6dcc0;
  transition: background .15s ease, color .15s ease;
}
.anios-nav a:nth-of-type(even) { background: var(--verde-casilla); color: #fff; border-color: var(--verde-casilla); }
.anios-nav a:hover { background: var(--verde); color: #fff; border-color: var(--verde); }

.anio { margin-bottom: 1.3rem; scroll-margin-top: 100px; }   /* deja lugar para el encabezado fijo */
.anio > summary {
  display: flex; align-items: center; gap: .9rem;
  list-style: none; cursor: pointer; padding: .35rem .1rem .5rem;
}
.anio > summary::-webkit-details-marker { display: none; }
.anio-num { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--verde-osc); }
.anio-linea {
  flex: 1; height: 8px; border-radius: 2px;
  background: var(--tablero) 0 0 / 16px 16px; opacity: .85;
}
.anio-flecha {
  flex: 0 0 auto; width: .7rem; height: .7rem;
  border-right: 3px solid var(--verde-osc); border-bottom: 3px solid var(--verde-osc);
  transform: rotate(45deg); transition: transform .15s ease; margin: 0 .3rem .2rem 0;
}
.anio[open] > summary .anio-flecha { transform: rotate(225deg); margin-bottom: 0; margin-top: .3rem; }
.anio > summary:hover .anio-num { color: var(--verde); }
@media (prefers-reduced-motion: reduce) { .anio-flecha, .anios-nav a { transition: none; } }
