/*
Theme Name: NuffleZone
Theme URI: https://nufflezone.com/
Author: NuffleZone
Description: Tema ligero a medida para NuffleZone.com. Rojo, azul y blanco, sin constructores, trilingüe con Polylang.
Version: 1.0.2
Requires at least: 6.4
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: nufflezone
*/

/* ==========================================================================
   1. Variables
   ========================================================================== */
:root {
	--nz-red: #d0021b;
	--nz-red-dark: #a00115;
	--nz-blue: #0a2463;
	--nz-blue-dark: #061638;
	--nz-white: #ffffff;
	--nz-ink: #14171f;
	--nz-muted: #5b6475;
	--nz-bg: #ffffff;
	--nz-soft: #f2f4f8;
	--nz-line: #dfe3ec;

	--nz-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--nz-font-head: "bloodbowl", "Arial Black", "Segoe UI Black", Impact, sans-serif;

	--nz-wrap: 1200px;
	--nz-radius: 10px;
	--nz-shadow: 0 6px 20px rgba(10, 36, 99, .12);
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--nz-bg);
	color: var(--nz-ink);
	font-family: var(--nz-font);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; height: auto; }

a { color: var(--nz-red); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--nz-blue); }

h1, h2, h3, h4, h5, h6 {
	color: var(--nz-blue);
	font-weight: 900;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: .02em;
	margin: 1.6em 0 .6em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p, ul, ol, table, figure, blockquote { margin: 0 0 1.2em; }

hr { border: 0; border-top: 3px solid var(--nz-red); margin: 2em 0; }

blockquote {
	border-left: 6px solid var(--nz-red);
	background: var(--nz-soft);
	padding: 1em 1.2em;
	font-style: italic;
}

:focus-visible { outline: 3px solid var(--nz-red); outline-offset: 2px; }

.nz-wrap { width: 100%; max-width: var(--nz-wrap); margin: 0 auto; padding: 0 20px; }

.nz-skip {
	position: absolute; left: -9999px; top: 0; z-index: 1000;
	background: var(--nz-red); color: #fff; padding: .6em 1em; font-weight: 700;
}
.nz-skip:focus { left: 10px; top: 10px; color: #fff; }

/* ==========================================================================
   3. Cabecera y menú
   ========================================================================== */
.nz-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--nz-blue);
	color: #fff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.admin-bar .nz-header { top: 32px; }

.nz-header__inner {
	display: flex; align-items: center; gap: 20px;
	min-height: 72px;
}

/* Franja roja-blanca-roja tipo campo de juego */
.nz-stripe {
	height: 6px;
	background: linear-gradient(to bottom, var(--nz-red) 0 2px, #fff 2px 4px, var(--nz-red) 4px 6px);
}

.nz-brand {
	display: flex; align-items: center; gap: 10px;
	color: #fff; text-decoration: none; flex-shrink: 0;
}
.nz-brand:hover, .nz-brand:focus { color: #fff; }
.nz-brand__logo { width: auto; height: 56px; }
.nz-brand__name {
	font-family: var(--nz-font-head);
	font-size: 1.5rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em;
	line-height: 1;
}

.nz-nav { margin-left: auto; }

.nz-menu, .nz-menu ul { list-style: none; margin: 0; padding: 0; }

.nz-menu { display: flex; flex-wrap: nowrap; align-items: center; }
.nz-menu > li { position: relative; }
.nz-menu > li:hover, .nz-menu > li:focus-within { z-index: 20; }

.nz-menu a {
	display: block;
	color: #fff;
	text-decoration: none;
	font-weight: 800;
	font-size: .82rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	white-space: nowrap;
	padding: 26px 9px;
}
.nz-menu > li > a:hover,
.nz-menu > li > a:focus,
.nz-menu > .current-menu-item > a,
.nz-menu > .current-menu-ancestor > a {
	color: #fff;
	box-shadow: inset 0 -4px 0 var(--nz-red);
}

/* Selector de idioma de Polylang dentro del menú */
.nz-menu .lang-item img { vertical-align: middle; }

/* Submenús (escritorio) */
.nz-menu .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 240px;
	background: #fff;
	border-top: 4px solid var(--nz-red);
	border-radius: 0 0 var(--nz-radius) var(--nz-radius);
	box-shadow: var(--nz-shadow);
	padding: 8px 0;
	z-index: 200;
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .15s, transform .15s, visibility .15s;
}
.nz-menu li:hover > .sub-menu,
.nz-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }

.nz-menu .sub-menu a {
	color: var(--nz-blue);
	padding: 8px 18px;
	font-size: .85rem;
	white-space: normal;
}
.nz-menu .sub-menu a:hover,
.nz-menu .sub-menu a:focus { background: var(--nz-soft); color: var(--nz-red); }

.nz-menu .sub-menu .sub-menu { top: 0; left: 100%; border-radius: var(--nz-radius); }

/* Menú grande en columnas (Equipos) */
.nz-menu .nz-mega > .sub-menu {
	display: grid;
	grid-template-columns: repeat(4, minmax(170px, 1fr));
	width: min(860px, 90vw);
	left: 50%; transform: translate(-50%, 6px);
}
.nz-menu .nz-mega:hover > .sub-menu,
.nz-menu .nz-mega:focus-within > .sub-menu { transform: translate(-50%, 0); }

.nz-burger, .nz-sub-toggle { display: none; }

/* ==========================================================================
   4. Contenido
   ========================================================================== */
.nz-main { padding: 32px 0 56px; min-height: 60vh; }

.nz-entry__header { margin-bottom: 1.5em; }
.nz-entry__title { margin-top: 0; }
.nz-entry__title::after {
	content: ""; display: block; width: 80px; height: 6px; margin-top: 12px;
	background: var(--nz-red);
}

.nz-meta { color: var(--nz-muted); font-size: .9rem; font-weight: 600; text-transform: uppercase; }
.nz-meta a { color: var(--nz-muted); }

.entry-content > * { max-width: 1150px; margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: 1200px; }
.entry-content > .alignfull { max-width: none; width: 100vw; margin-left: calc(50% - 50vw); }

/* Tablas (rosters, habilidades…) */
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: .95rem;
	display: block;
	overflow-x: auto;
}
.entry-content table th,
.entry-content table thead td {
	background: var(--nz-blue); color: #fff;
	text-transform: uppercase; font-weight: 800; font-size: .85rem;
}
.entry-content table th,
.entry-content table td { padding: 8px 10px; border: 1px solid var(--nz-line); text-align: left; }
.entry-content table tbody tr:nth-child(even) td { background: var(--nz-soft); }
.wp-block-table { overflow-x: auto; }
.wp-block-table table { display: table; }

/* ==========================================================================
   Fichas de equipo (roster + estrellas) — v1.0.2
   ========================================================================== */
.nz-team-title {
	font-family: var(--nz-font-head);
	text-align: center;
	color: var(--nz-blue);
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	margin: .6em 0 .4em;
}
.nz-team-title::after {
	content: ""; display: block; width: 120px; height: 6px; margin: .35em auto 0;
	background: linear-gradient(to bottom, var(--nz-red) 0 2px, #fff 2px 4px, var(--nz-red) 4px 6px);
}
.nz-roster, .nz-stars {
	overflow-x: auto;
	margin: 1.5em 0;
	border-radius: var(--nz-radius);
	box-shadow: var(--nz-shadow);
	border-top: 4px solid var(--nz-red);
}
.entry-content .nz-roster table, .entry-content .nz-stars table {
	display: table; width: 100%; margin: 0; border: 0;
	border-collapse: separate; border-spacing: 0; font-size: .95rem;
}
.entry-content .nz-roster th, .entry-content .nz-stars th {
	background: var(--nz-blue) !important; color: #fff !important;
	border: 0 !important; border-bottom: 3px solid var(--nz-red) !important;
	padding: 12px 10px !important; font-size: .78rem !important;
	letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; text-align: center !important;
}
.entry-content .nz-roster td, .entry-content .nz-stars td {
	border: 0 !important; border-bottom: 1px solid var(--nz-line) !important;
	padding: 10px !important; vertical-align: middle; text-align: center !important;
	background: #fff !important; color: var(--nz-ink) !important; font-weight: 600;
}
.entry-content .nz-roster tbody tr:nth-child(even) td,
.entry-content .nz-stars tbody tr:nth-child(even) td { background: var(--nz-soft) !important; }
.entry-content .nz-roster tbody tr:hover td,
.entry-content .nz-stars tbody tr:hover td { background: #e6ebf5 !important; }
/* Columna Posición / Estrella y columna Habilidades a la izquierda */
.entry-content .nz-roster td:nth-child(2), .entry-content .nz-roster th:nth-child(2),
.entry-content .nz-roster td:nth-child(9), .entry-content .nz-roster th:nth-child(9),
.entry-content .nz-stars td:first-child, .entry-content .nz-stars th:first-child,
.entry-content .nz-stars td:last-child, .entry-content .nz-stars th:last-child { text-align: left !important; }
.entry-content .nz-roster td:nth-child(2),
.entry-content .nz-stars td:first-child { font-weight: 800; color: var(--nz-blue) !important; white-space: nowrap; }
.entry-content .nz-stars td:first-child a { color: var(--nz-blue); text-decoration: none; }
.entry-content .nz-stars td:first-child a:hover { color: var(--nz-red); }
.entry-content .nz-roster td:nth-child(3),
.entry-content .nz-stars td:nth-child(2) { color: var(--nz-red) !important; font-weight: 800; white-space: nowrap; }
.nz-roster .qty-badge {
	display: inline-block; min-width: 44px; padding: 2px 8px; border-radius: 4px;
	background: var(--nz-red) !important; color: #fff !important; font-weight: 800;
	white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.25) !important;
}
/* Habilidades como etiquetas */
.nz-roster td a, .nz-stars td:last-child a {
	display: inline-block; margin: 2px 3px 2px 0; padding: 1px 7px;
	border: 1px solid var(--nz-line); border-radius: 4px; background: #fff;
	color: var(--nz-blue) !important; font-size: .85rem; font-weight: 600;
	text-decoration: none; white-space: nowrap;
}
.nz-roster td a:hover, .nz-stars td:last-child a:hover {
	border-color: var(--nz-red); color: var(--nz-red) !important;
}
/* Caja de datos del equipo (relanzamientos, reglas, ligas) */
.nz-team-facts {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
	margin: 0 0 1.6em; padding: 0; list-style: none;
}
.nz-team-facts li {
	margin: 0; padding: 12px 14px; background: var(--nz-soft);
	border-left: 5px solid var(--nz-red); border-radius: 0 var(--nz-radius) var(--nz-radius) 0;
}
.nz-team-facts strong { display: block; color: var(--nz-blue); text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; }
.nz-team-note { color: var(--nz-muted); font-size: .92rem; }
.entry-content h3.nz-strengths, .entry-content h3.nz-weaknesses { padding-left: 12px; }
.entry-content h3.nz-strengths { border-left: 6px solid var(--nz-blue); }
.entry-content h3.nz-weaknesses { border-left: 6px solid var(--nz-red); }

/* Botones */
.nz-btn,
.wp-block-button__link,
.entry-content input[type="submit"],
.entry-content button {
	display: inline-block;
	background: var(--nz-blue); color: #fff;
	border: 0; border-radius: 999px;
	padding: .7em 1.4em;
	font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .9rem;
	text-decoration: none; cursor: pointer;
	transition: background .15s, transform .15s;
}
.nz-btn:hover, .nz-btn:focus,
.wp-block-button__link:hover, .wp-block-button__link:focus { background: var(--nz-red); color: #fff; transform: translateY(-1px); }
.nz-btn--red { background: var(--nz-red); }
.nz-btn--red:hover { background: var(--nz-blue); }

/* Formularios */
input[type="text"], input[type="email"], input[type="url"], input[type="search"],
input[type="number"], select, textarea {
	width: 100%; max-width: 100%;
	padding: .65em .8em;
	border: 2px solid var(--nz-line); border-radius: 8px;
	font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--nz-blue); outline: none; }

.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form label { flex: 1; }
.search-submit { background: var(--nz-red); color: #fff; border: 0; border-radius: 8px; padding: 0 1.2em; font-weight: 800; cursor: pointer; }

/* ==========================================================================
   5. Listados / tarjetas
   ========================================================================== */
.nz-archive__header { margin-bottom: 1.5em; }

.nz-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin: 0 0 2em;
}
.nz-card {
	background: #fff;
	border: 1px solid var(--nz-line);
	border-top: 5px solid var(--nz-red);
	border-radius: var(--nz-radius);
	overflow: hidden;
	transition: transform .15s, box-shadow .15s;
}
.nz-card:hover { transform: translateY(-3px); box-shadow: var(--nz-shadow); }
.nz-card__link { display: block; color: inherit; text-decoration: none; height: 100%; }
.nz-card__link:hover { color: inherit; }
.nz-card__img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.nz-card__body { padding: 16px 18px 20px; }
.nz-card__title { font-size: 1.1rem; margin: 0 0 .3em; }
.nz-card__date { color: var(--nz-muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; margin: 0 0 .6em; }
.nz-card__excerpt { font-size: .95rem; margin: 0 0 .8em; }
.nz-card__more { color: var(--nz-red); font-weight: 800; font-size: .85rem; text-transform: uppercase; }

.nz-pagination .nav-links,
.nz-postnav .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 2em 0; }
.nz-pagination .page-numbers {
	display: inline-block; min-width: 42px; padding: .4em .8em; text-align: center;
	border: 2px solid var(--nz-blue); border-radius: 8px; font-weight: 800; text-decoration: none; color: var(--nz-blue);
}
.nz-pagination .page-numbers.current,
.nz-pagination .page-numbers:hover { background: var(--nz-blue); color: #fff; }

.nz-postnav .nav-links { justify-content: space-between; }
.nz-postnav a { font-weight: 700; text-decoration: none; }

.nz-empty { text-align: center; padding: 40px 0; }
.nz-empty .search-form { margin: 1.5em auto; }
.nz-empty .nz-entry__title::after { margin-left: auto; margin-right: auto; }

/* Comentarios */
.nz-comments { max-width: 900px; margin: 3em auto 0; padding-top: 2em; border-top: 3px solid var(--nz-soft); }
.nz-comments__list { list-style: none; padding: 0; }
.nz-comments__list .comment-body { background: var(--nz-soft); border-radius: var(--nz-radius); padding: 14px 18px; margin-bottom: 14px; }
.nz-comments__list .children { list-style: none; padding-left: 24px; }

/* ==========================================================================
   6. Contenido antiguo de Divi (temporal, ver inc/divi-fallback.php)
   ========================================================================== */
.nz-dv-section { margin: 0 0 2em; }
.nz-dv-row { display: flex; flex-wrap: wrap; gap: 24px; margin: 0 0 1.5em; }
.nz-dv-col { flex: 1 1 100%; min-width: 0; }
.nz-dv-col-1_2 { flex-basis: calc(50% - 12px); }
.nz-dv-col-1_3 { flex-basis: calc(33.333% - 16px); }
.nz-dv-col-2_3 { flex-basis: calc(66.666% - 8px); }
.nz-dv-col-1_4 { flex-basis: calc(25% - 18px); }
.nz-dv-col-3_4 { flex-basis: calc(75% - 6px); }
.nz-dv-image { text-align: center; }
.nz-dv-image img { max-height: 300px; width: auto; }

/* ==========================================================================
   7. Pie
   ========================================================================== */
.nz-footer {
	background: var(--nz-blue-dark);
	color: #cfd6e6;
	border-top: 6px solid var(--nz-red);
	padding: 40px 0 24px;
	font-size: .9rem;
}
.nz-footer a { color: #fff; }
.nz-footer__support { text-align: center; margin-bottom: 28px; }
.nz-footer__title {
	font-family: var(--nz-font-head);
	color: #fff; font-size: 1.3rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em;
}
.nz-footer__buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.nz-footer .nz-btn { background: var(--nz-red); }
.nz-footer .nz-btn:hover { background: #fff; color: var(--nz-blue); }

.nz-footer__menu { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; margin: 0 0 24px; }
.nz-footer__menu a { text-decoration: none; font-weight: 700; text-transform: uppercase; font-size: .8rem; }
.nz-footer__menu a:hover { color: var(--nz-red); }

.nz-footer__legal { text-align: center; max-width: 900px; margin: 0 auto; font-size: .78rem; line-height: 1.5; }
.nz-footer__copy { margin-top: 1em; font-weight: 700; color: #fff; }

/* ==========================================================================
   8. Móvil
   ========================================================================== */
@media (max-width: 1024px) {
	.nz-header__inner { min-height: 64px; flex-wrap: wrap; }
	.nz-brand__logo { height: 46px; }
	.nz-brand__name { font-size: 1.2rem; }

	.nz-burger {
		display: inline-flex; align-items: center; gap: 8px;
		margin-left: auto;
		background: var(--nz-red); color: #fff; border: 0; border-radius: 8px;
		padding: 10px 14px; font-weight: 800; text-transform: uppercase; cursor: pointer;
	}
	.nz-burger__bars,
	.nz-burger__bars::before,
	.nz-burger__bars::after {
		display: block; width: 20px; height: 3px; background: #fff; border-radius: 2px; position: relative;
	}
	.nz-burger__bars::before, .nz-burger__bars::after { content: ""; position: absolute; left: 0; }
	.nz-burger__bars::before { top: -6px; }
	.nz-burger__bars::after { top: 6px; }

	.nz-nav {
		display: none;
		flex-basis: 100%;
		margin: 0 -20px;
		background: var(--nz-blue-dark);
		max-height: calc(100vh - 70px);
		overflow-y: auto;
	}
	.nz-nav.is-open { display: block; }

	.nz-menu { display: block; }
	.nz-menu > li { display: block; border-top: 1px solid rgba(255, 255, 255, .1); }
	.nz-menu li { position: relative; }
	.nz-menu a { padding: 14px 56px 14px 20px; }
	.nz-menu > li > a:hover, .nz-menu > li > a:focus { box-shadow: inset 4px 0 0 var(--nz-red); }

	.nz-sub-toggle {
		display: flex; align-items: center; justify-content: center;
		position: absolute; right: 0; top: 0; width: 52px; height: 50px;
		background: transparent; color: #fff; border: 0; font-size: 1.1rem; cursor: pointer;
	}
	.is-open > .nz-sub-toggle span { display: inline-block; transform: rotate(180deg); }

	.nz-menu .sub-menu,
	.nz-menu .nz-mega > .sub-menu {
		position: static; display: none; width: auto; min-width: 0;
		opacity: 1; visibility: visible; transform: none;
		box-shadow: none; border: 0; border-radius: 0;
		background: rgba(255, 255, 255, .05);
		padding: 0;
	}
	.nz-menu li:hover > .sub-menu,
	.nz-menu li:focus-within > .sub-menu { display: none; }
	.nz-menu li.is-open > .sub-menu { display: block; }
	.nz-menu .nz-mega.is-open > .sub-menu { display: grid; grid-template-columns: 1fr 1fr; }
	.nz-menu .sub-menu a { color: #fff; padding-left: 32px; }
	.nz-menu .sub-menu a:hover, .nz-menu .sub-menu a:focus { background: rgba(255, 255, 255, .08); color: #fff; }

	.nz-dv-col { flex-basis: 100% !important; }
}

@media (max-width: 782px) {
	.admin-bar .nz-header { top: 46px; }
}

@media (max-width: 600px) {
	body { font-size: 16px; }
	.nz-main { padding-top: 20px; }
	.nz-menu .nz-mega.is-open > .sub-menu { grid-template-columns: 1fr; }
	.admin-bar .nz-header { position: relative; top: 0; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
