/*
Theme Name: ZLeague
Theme URI: https://zleague.cl
Author: ZLeague
Description: Tema oficial ZLeague - Liga Nacional de eFootball Chile
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
Text Domain: zleague
*/

/* ============================================================
   VARIABLES GLOBALES
   ============================================================ */
:root {
  --zl-rojo:        #D52B1E;
  --zl-rojo-dark:   #A01F14;
  --zl-azul:        #0033A0;
  --zl-azul-dark:   #002070;
  --zl-blanco:      #F5F5F5;
  --zl-negro:       #0A0A0A;
  --zl-gris-dark:   #141414;
  --zl-gris-mid:    #1E1E1E;
  --zl-gris-light:  #2A2A2A;
  --zl-gris-text:   #9A9A9A;
  --zl-naranja:     #E8650A;

  --zl-grad-hero:   linear-gradient(135deg, #0A0A0A 0%, #0033A0 50%, #D52B1E 100%);
  --zl-grad-card:   linear-gradient(180deg, #1E1E1E 0%, #141414 100%);
  --zl-grad-rojo:   linear-gradient(135deg, #D52B1E, #A01F14);
  --zl-grad-azul:   linear-gradient(135deg, #0033A0, #002070);

  --zl-font-display: 'Barlow Condensed', sans-serif;
  --zl-font-body:    'Inter', sans-serif;

  --zl-radius:      8px;
  --zl-radius-lg:   16px;
  --zl-shadow:      0 4px 24px rgba(0,0,0,0.5);
  --zl-shadow-glow: 0 0 20px rgba(213,43,30,0.3);
  --zl-transition:  all 0.2s ease;
}

/* ============================================================
   RESET Y BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--zl-negro);
  color: var(--zl-blanco);
  font-family: var(--zl-font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: var(--zl-transition); }
a:hover { color: var(--zl-rojo); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--zl-font-body); }

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--zl-font-display);
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h1 { font-size: clamp(2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

.zl-label {
  font-family: var(--zl-font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--zl-gris-text);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.zl-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.zl-container--narrow { max-width: 960px; }
.zl-section { padding: 4rem 0; }

.zl-grid { display: grid; gap: 1.5rem; }
.zl-grid--2 { grid-template-columns: repeat(2, 1fr); }
.zl-grid--3 { grid-template-columns: repeat(3, 1fr); }
.zl-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   CARDS
   ============================================================ */
.zl-card {
  background: var(--zl-grad-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--zl-radius);
  overflow: hidden;
  transition: var(--zl-transition);
}

.zl-card:hover {
  border-color: var(--zl-rojo);
  transform: translateY(-2px);
  box-shadow: var(--zl-shadow-glow);
}

.zl-card__body { padding: 1.25rem; }
.zl-card__title {
  font-family: var(--zl-font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.zl-card__meta { font-size: 0.85rem; color: var(--zl-gris-text); }

/* ============================================================
   BOTONES
   ============================================================ */
.zl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--zl-radius);
  font-family: var(--zl-font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  transition: var(--zl-transition);
}

.zl-btn--primary { background: var(--zl-grad-rojo); color: #fff; }
.zl-btn--primary:hover { box-shadow: var(--zl-shadow-glow); transform: translateY(-1px); color: #fff; }

.zl-btn--secondary { background: var(--zl-grad-azul); color: #fff; }
.zl-btn--secondary:hover { transform: translateY(-1px); color: #fff; }

.zl-btn--outline { background: transparent; color: var(--zl-blanco); border: 1px solid rgba(255,255,255,0.2); }
.zl-btn--outline:hover { border-color: var(--zl-rojo); color: var(--zl-rojo); }

.zl-btn--sm { padding: 0.4rem 0.9rem; font-size: 0.75rem; }
.zl-btn--lg { padding: 1rem 2rem; font-size: 1.1rem; }
.zl-btn--danger { background: var(--zl-rojo); color: #fff; }

/* ============================================================
   BADGES
   ============================================================ */
.zl-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--zl-font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.zl-badge--rojo    { background: rgba(213,43,30,0.2);  color: var(--zl-rojo);    border: 1px solid rgba(213,43,30,0.4); }
.zl-badge--azul    { background: rgba(0,51,160,0.2);   color: #5b8ff9;           border: 1px solid rgba(0,51,160,0.4); }
.zl-badge--verde   { background: rgba(34,197,94,0.15); color: #4ade80;           border: 1px solid rgba(34,197,94,0.3); }
.zl-badge--gris    { background: rgba(255,255,255,0.1);color: var(--zl-gris-text);border: 1px solid rgba(255,255,255,0.1); }
.zl-badge--naranja { background: rgba(232,101,10,0.2); color: var(--zl-naranja); border: 1px solid rgba(232,101,10,0.4); }

/* ============================================================
   TABLAS
   ============================================================ */
.zl-table-wrap { overflow-x: auto; border-radius: var(--zl-radius); border: 1px solid rgba(255,255,255,0.06); }

.zl-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.zl-table th {
  background: var(--zl-gris-mid);
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--zl-font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--zl-gris-text);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}

.zl-table td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.zl-table tr:last-child td { border-bottom: none; }
.zl-table tr:hover td { background: rgba(255,255,255,0.03); }

.zl-table__pos { font-family: var(--zl-font-display); font-size: 1.1rem; font-weight: 700; color: var(--zl-gris-text); text-align: center; width: 40px; }
.zl-table__pos--1 { color: #FFD700; }
.zl-table__pos--2 { color: #C0C0C0; }
.zl-table__pos--3 { color: #CD7F32; }

.zl-table__ascenso  td { border-left: 3px solid #4ade80; }
.zl-table__descenso td { border-left: 3px solid var(--zl-rojo); }
.zl-table__playoff  td { border-left: 3px solid var(--zl-naranja); }

/* ============================================================
   FORMA RECIENTE
   ============================================================ */
.zl-forma { display: flex; gap: 3px; align-items: center; }
.zl-forma__item {
  width: 18px; height: 18px;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--zl-font-display); font-size: 0.6rem; font-weight: 700;
}
.zl-forma__item--v { background: #4ade80; color: #000; }
.zl-forma__item--e { background: var(--zl-gris-light); color: #fff; }
.zl-forma__item--d { background: var(--zl-rojo); color: #fff; }

/* ============================================================
   IMAGENES CON AUTODIMENSIONADO
   ============================================================ */
.zl-img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

.zl-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--zl-gris-light);
}

.zl-img-wrap--square  { aspect-ratio: 1 / 1; }
.zl-img-wrap--banner  { aspect-ratio: 3 / 1; }
.zl-img-wrap--card    { aspect-ratio: 16 / 9; }
.zl-img-wrap--avatar  { aspect-ratio: 1 / 1; border-radius: 50%; }
.zl-img-wrap--escudo  { aspect-ratio: 1 / 1; border-radius: var(--zl-radius); }

/* Placeholder sin imagen */
.zl-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zl-grad-card);
  color: var(--zl-gris-text);
  font-size: 2rem;
}

/* ============================================================
   STATS WIDGET
   ============================================================ */
.zl-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--zl-radius);
  overflow: hidden;
}

.zl-stat-item { background: var(--zl-gris-mid); padding: 1rem; text-align: center; }
.zl-stat-item__value { font-family: var(--zl-font-display); font-size: 1.75rem; font-weight: 900; line-height: 1; }
.zl-stat-item__value--rojo  { color: var(--zl-rojo); }
.zl-stat-item__value--azul  { color: #5b8ff9; }
.zl-stat-item__value--verde { color: #4ade80; }
.zl-stat-item__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--zl-gris-text); margin-top: 0.25rem; }

/* ============================================================
   TABS
   ============================================================ */
.zl-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.zl-tabs::-webkit-scrollbar { display: none; }

.zl-tab {
  padding: 0.75rem 1.25rem;
  font-family: var(--zl-font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--zl-gris-text);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border-top: none; border-left: none; border-right: none;
  transition: var(--zl-transition);
}
.zl-tab:hover { color: var(--zl-blanco); }
.zl-tab.active { color: var(--zl-rojo); border-bottom-color: var(--zl-rojo); }

/* ============================================================
   ALERTS
   ============================================================ */
.zl-alert { padding: 1rem 1.25rem; border-radius: var(--zl-radius); font-size: 0.9rem; margin-bottom: 1rem; border-left: 3px solid; }
.zl-alert--success { background: rgba(74,222,128,0.1);  border-color: #4ade80;         color: #4ade80; }
.zl-alert--error   { background: rgba(213,43,30,0.1);   border-color: var(--zl-rojo);  color: var(--zl-rojo); }
.zl-alert--info    { background: rgba(91,143,249,0.1);  border-color: #5b8ff9;         color: #5b8ff9; }
.zl-alert--warning { background: rgba(232,101,10,0.1);  border-color: var(--zl-naranja); color: var(--zl-naranja); }

/* ============================================================
   DIVISOR
   ============================================================ */
.zl-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 2rem 0; }
.zl-divider--rojo { background: linear-gradient(90deg, transparent, var(--zl-rojo), transparent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .zl-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .zl-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .zl-section { padding: 2.5rem 0; }
  .zl-grid--4, .zl-grid--3, .zl-grid--2 { grid-template-columns: 1fr; }
  .zl-container { padding: 0 1rem; }
  .zl-stat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .zl-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .zl-btn { padding: 0.65rem 1.25rem; font-size: 0.85rem; }
}
