/* Sociedad del Tenis: estilos comunes de sociedadeltenis.com */

@font-face { font-family: "Montserrat"; src: url(/fonts/montserrat.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(/fonts/dmsans.woff2) format("woff2"); font-weight: 100 1000; font-display: swap; }

:root {
  --verde: #00342B;
  --verde-2: #03664F;
  --crema: #FFFDEE;
  --lima: #D9EF00;
  --texto: #14362F;
  /* margen lateral: 64px como en el diseño, y en pantallas anchas el contenido no pasa de 1152px */
  --gx: max(64px, calc(50vw - 576px));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: "DM Sans", system-ui, sans-serif; background: var(--crema); color: var(--texto); }
a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }
img { max-width: 100%; }
button { font: inherit; }
[hidden] { display: none !important; }
.page { display: flex; flex-direction: column; min-height: 60vh; }
.page > * { flex-shrink: 0; }

/* ---------- menú ---------- */
.nav { position: sticky; top: 0; z-index: 50; height: 82px; background: var(--verde); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gx); }
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 30px; width: auto; display: block; }
.nav-menu { display: flex; align-items: center; gap: 22px; }
.nav-menu a { color: var(--crema); font-size: 15px; font-weight: 500; }
.nav-menu a.on { color: var(--lima); }
.nav-menu .nav-cta { background: var(--lima); color: var(--verde); font-family: Montserrat, sans-serif; font-weight: 700; font-size: 14px; padding: 13px 24px; border-radius: 999px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 10px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; height: 2px; background: var(--crema); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- pie ---------- */
.foot { background: var(--verde); padding: 54px var(--gx) 40px; color: #C6DBD3; }
.foot-top { display: flex; justify-content: space-between; gap: 60px; margin-bottom: 40px; }
.foot-about { width: 320px; }
.foot-about img { height: 32px; width: auto; display: block; margin-bottom: 18px; }
.foot-about p { margin: 0; font-size: 15px; line-height: 1.55; color: #A8C4BB; }
.foot-cols { display: flex; gap: 72px; }
.foot-cols > div { display: flex; flex-direction: column; gap: 11px; font-size: 15px; }
.foot-h { font-family: Montserrat, sans-serif; font-weight: 600; font-size: 13px; color: var(--lima); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 5px; }
.foot-bottom { border-top: 1px solid var(--verde-2); padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #7FA79C; }
.foot-legal { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- formularios ---------- */
input, textarea, select { max-width: 100%; }
.chip { cursor: pointer; display: inline-flex; align-items: center; user-select: none; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip:has(input:checked) { background: var(--verde) !important; color: var(--lima) !important; border-color: var(--verde) !important; }
.chip:has(input:focus-visible) { outline: 2px solid var(--verde-2); outline-offset: 2px; }
.form-error { margin: 0; padding: 12px 16px; border-radius: 10px; background: #FDE8E4; color: #8A2414; font-size: 14px; line-height: 1.45; }
button[disabled] { opacity: .6; cursor: progress; }

/* ---------- tablas anchas (ranking, comparativas) ---------- */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- páginas legales e índices ---------- */
.legal { max-width: 760px; padding: 56px var(--gx) 80px; }
.legal h1 { font-family: Montserrat, sans-serif; font-size: clamp(30px, 4vw, 44px); color: var(--verde); margin: 0 0 10px; line-height: 1.1; }
.legal h2 { font-family: Montserrat, sans-serif; font-size: 21px; color: var(--verde); margin: 36px 0 10px; }
.legal p, .legal li { font-size: 16.5px; line-height: 1.7; }
.legal .fecha { color: var(--verde-2); font-size: 14px; margin: 0 0 30px; }
.legal a { text-decoration: underline; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  :root { --gx: 40px; }
  .g4, .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .nav-menu { gap: 16px; }
  .nav-menu .nav-cta { padding: 11px 18px; }
}

@media (max-width: 980px) {
  .stack { flex-direction: column !important; align-items: stretch !important; }
  .stack > .wfix { width: 100% !important; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .foot-top { flex-direction: column; gap: 36px; }
  .foot-about { width: auto; }

  .nav-toggle { display: flex; }
  .nav-menu { display: none; position: absolute; top: 82px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--verde); padding: 8px var(--gx) 24px; border-top: 1px solid var(--verde-2); box-shadow: 0 18px 30px rgba(0,0,0,.25); }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 15px 0; font-size: 17px; border-bottom: 1px solid rgba(3,102,79,.6); }
  .nav-menu .nav-cta { margin-top: 18px; text-align: center; border: 0; padding: 15px; font-size: 16px; }
}

/* ---------- celular ---------- */
@media (max-width: 680px) {
  :root { --gx: 20px; }
  .nav { height: 68px; }
  .nav-menu { top: 68px; }
  .wfix { width: 100% !important; }
  .g2, .g3 { grid-template-columns: 1fr !important; }
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  .foot-cols { flex-wrap: wrap; gap: 32px 48px; }
  .foot { padding-top: 44px; }
}

/* ---------- índices (biblioteca, notas, jugadores) ---------- */
.idx-head { background: var(--verde); padding: 62px var(--gx) 56px; }
.idx-kicker { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--lima); font-weight: 500; margin-bottom: 18px; }
.idx-head h1 { margin: 0 0 16px; font-family: Montserrat, sans-serif; font-weight: 700; font-size: clamp(32px, 4.2vw, 54px); line-height: 1.06; color: var(--crema); max-width: 22ch; }
.idx-head p { margin: 0; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.55; color: #A8C4BB; max-width: 62ch; }
.idx-body { padding: 52px var(--gx) 80px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.card { display: block; background: #fff; border: 1px solid rgba(0,52,43,0.13); border-radius: 16px; overflow: hidden; }
.card-img { height: 186px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-contain { background: #fff; }
.card-img-contain img { object-fit: contain; }
.card-body { padding: 22px 24px 26px; }
.card-cat { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--verde-2); font-weight: 500; margin-bottom: 10px; }
.card-title { font-family: Montserrat, sans-serif; font-weight: 700; font-size: 21px; color: var(--verde); line-height: 1.22; margin-bottom: 12px; }
.card p { margin: 0 0 18px; font-size: 15px; line-height: 1.5; color: #1d4a41; }
.card-more { font-family: Montserrat, sans-serif; font-weight: 700; font-size: 14px; color: var(--verde); }
.notas { display: flex; flex-direction: column; }
.nota-row { display: flex; gap: 28px; align-items: center; padding: 24px 0; border-top: 1px solid rgba(0,52,43,0.14); }
.nota-row:last-child { border-bottom: 1px solid rgba(0,52,43,0.14); }
.nota-img { width: 200px; height: 124px; flex-shrink: 0; border-radius: 12px; overflow: hidden; }
.nota-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nota-title { font-family: Montserrat, sans-serif; font-weight: 700; font-size: clamp(18px, 1.9vw, 24px); color: var(--verde); line-height: 1.22; margin-bottom: 8px; }
.nota-meta { font-size: 14px; color: var(--verde-2); }
.jcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.jcard { display: block; background: var(--verde); border-radius: 16px; overflow: hidden; }
.jcard-img { height: 280px; }
.jcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jcard-body { padding: 22px 24px 26px; }
.jcard-name { font-family: Montserrat, sans-serif; font-weight: 700; font-size: 20px; color: var(--crema); line-height: 1.2; }
.jcard-meta { font-size: 14px; color: var(--lima); margin-top: 8px; font-weight: 500; }
.jcard-add { background: var(--crema); border: 1.5px dashed rgba(0,52,43,0.3); display: flex; align-items: center; justify-content: center; min-height: 200px; font-family: Montserrat, sans-serif; font-weight: 700; font-size: 17px; color: var(--verde); }
@media (max-width: 980px) {
  .cards, .jcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .cards, .jcards { grid-template-columns: 1fr; }
  .nota-row { gap: 16px; align-items: flex-start; }
  .nota-img { width: 112px; height: 76px; }
  .idx-body { padding-top: 36px; }
}

/* ---------- arreglos generales para pantallas chicas ---------- */
input, select, textarea { min-width: 0; }
@media (max-width: 680px) {
  /* campo de email + botón: el botón baja abajo y ocupa todo el ancho */
  div:has(> input[type="email"] + a), div:has(> input[type="email"] + button) { flex-wrap: wrap; }
  div:has(> input[type="email"] + a) > *, div:has(> input[type="email"] + button) > * { flex: 1 1 100% !important; justify-content: center; }
  /* encabezados de sección con botón "Ver todas" */
  div:has(> div > h2):has(> a) { flex-wrap: wrap; gap: 18px; }
}
.g2 > *, .g3 > *, .g4 > *, .g5 > * { min-width: 0; }
@media (max-width: 980px) {
  /* filas con una columna de ancho fijo: se apilan */
  main div[style*="display: flex"]:has(> .wfix) { flex-direction: column !important; align-items: stretch !important; }
  main div[style*="display: flex"]:has(> .wfix) > .wfix { width: 100% !important; }
}
@media (max-width: 680px) {
  main div[style*="justify-content: space-between"]:not([style*="column"]) { flex-wrap: wrap; row-gap: 12px; }
  main div[style*="display: flex"]:has(> a + a + a) { flex-wrap: wrap; }
  main div[style*="display: flex; gap: 18px;"]:has(> div + div) { flex-wrap: wrap; }
  main div[style*="display: flex; gap: 18px;"]:has(> div + div) > div { flex: 1 1 100%; }
}
@media (max-width: 680px) { main h1 br { display: none; } }
@media (max-width: 680px) {
  main div[style*="display: flex"]:has(> div > label + input[type="text"]) { flex-wrap: wrap; }
  main div[style*="display: flex"]:has(> div > label + input[type="text"]) > div { flex: 1 1 100%; }
}

/* encabezados de tablas (ranking y notas): el texto va claro sobre el verde */
.thead .nm, .thead .cr, .thead .cc, .thead .c, .thead .pos { color: inherit !important; opacity: 1; }
/* filas de números con separadores verticales: en pantallas chicas siguen en fila */
@media (max-width: 980px) {
  .stack:has(> div[style*="width: 1px"]) { flex-direction: row !important; align-items: flex-start !important; gap: 28px !important; flex-wrap: wrap; }
  .stack > div[style*="width: 1px"] { display: none; }
}

/* ---------- carruseles laterales de la home (celular) ---------- */
.hdots { display: none; }
@media (max-width: 680px) {
  [data-hscroll] { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  [data-hscroll]::-webkit-scrollbar { display: none; }
  [data-hscroll] > * { flex: 0 0 100%; scroll-snap-align: start; }
  .hdots { display: flex; justify-content: center; gap: 9px; margin-top: 18px; }
}
