/*
Theme Name: Ladrillo Gaming
Theme URI: https://ladrillogaming.com
Author: Ladrillo Gaming
Description: Tema clásico, rápido y ligero para ladrillogaming.com. Guías, consejos y novedades de videojuegos. Sin page builders, sin jQuery, sin peticiones externas y con huecos de AdSense controlados.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ladrillo-gaming
Tags: blog, news, grid-layout, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments
*/

/* ---------- Variables (los colores se pueden cambiar en Personalizar) ---------- */
:root {
	--bg: #ffffff;
	--surface: #f4f5f7;
	--text: #14171f;
	--muted: #5b6270;
	--accent: #b83a26;
	--border: #e3e5ea;
	--radius: 12px;
	--measure: 35rem;
	--wide: 70rem;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	color-scheme: light;
}
@supports (color: color-mix(in srgb, red, blue)) {
	:root { --border: color-mix(in srgb, var(--text) 14%, var(--bg)); }
}

/* ---------- Base ---------- */
*, ::before, ::after { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 12px; }
@media (min-width: 768px) { html { font-size: 18px; } }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 1rem/1.65 var(--font);
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4, h5, h6 { font-weight: 800; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
p { margin: 0 0 1.2em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: 16px; }
.wrap--wide { max-width: 52rem; }
.wrap--text { max-width: calc(var(--measure) + 32px); }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus {
	position: fixed !important; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; margin: 0;
	clip: auto; clip-path: none; padding: 12px 16px; background: var(--bg); color: var(--text); font-weight: 700;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}

/* ---------- Formularios y botones ---------- */
input[type=text], input[type=email], input[type=url], input[type=search], input[type=tel],
input[type=number], input[type=password], textarea, select {
	width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
	background: var(--bg); border: 1px solid var(--muted); border-radius: 8px;
}
textarea { min-height: 8rem; }
.btn, button[type=submit], input[type=submit], .comment-reply-link {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
	font: inherit; font-weight: 700; color: #fff; background: var(--accent); border: 0; border-radius: 8px;
	text-decoration: none; cursor: pointer;
}
.btn:hover, button[type=submit]:hover, input[type=submit]:hover { filter: brightness(.92); }
.comment-reply-link { min-height: 0; padding: 4px 12px; font-size: .85rem; }

/* ---------- Cabecera ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; min-height: 60px; }
.brand {
	display: inline-flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--text);
	font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-decoration: none;
}
.brand__icon { flex: none; color: var(--accent); }
.custom-logo-link { display: inline-flex; padding: 8px 0; }
.custom-logo { display: block; width: auto; max-height: 44px; }
.nav-toggle {
	display: none; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; font: inherit; font-weight: 700;
	color: var(--text); background: var(--surface); border: 0; border-radius: 8px; cursor: pointer;
}
.js .nav-toggle { display: inline-flex; }
.nav { flex-basis: 100%; }
.js .nav { display: none; }
.menu { margin: 0; padding: 0; list-style: none; }
.menu a {
	display: block; padding: 12px 0; color: var(--text); font-weight: 700; text-decoration: none;
	border-top: 1px solid var(--border);
}
.menu a:hover, .menu .current-menu-item > a, .menu .current-menu-parent > a { color: var(--accent); }
.search { display: flex; gap: 8px; margin: 12px 0 16px; }
.search input { flex: 1; min-width: 0; }
.search button { flex: none; width: 44px; padding: 0; }
@media (max-width: 859.98px) {
	.js .nav.is-open { display: block; }
}
@media (min-width: 860px) {
	.bar { flex-wrap: nowrap; }
	.js .nav-toggle { display: none; }
	.nav, .js .nav { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 16px; }
	.menu { display: flex; flex-wrap: wrap; gap: 2px; }
	.menu a { padding: 8px 12px; border: 0; border-radius: 8px; }
	.menu a:hover { background: var(--surface); }
	.search { margin: 0; width: 13rem; }
}

/* ---------- Portada, archivos y rejilla ---------- */
.page-head { padding: 28px 0 4px; }
.page-head__title { margin: 0; font-size: 1.9rem; }
.page-head__text { margin: .4em 0 0; color: var(--muted); font-size: 1.05rem; }
.page-head__text p:last-child { margin-bottom: 0; }
@media (min-width: 768px) { .page-head__title { font-size: 2.3rem; } }

.grid { display: grid; grid-template-columns: 1fr; gap: 24px; padding-block: 24px 8px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.grid__ad { grid-column: 1 / -1; margin-block: 0; }

.card {
	position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
	border: 1px solid var(--border); border-radius: var(--radius); transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 6px 20px rgba(20, 23, 31, .1); transform: translateY(-2px); }
.card__media { aspect-ratio: 16 / 9; background: var(--surface); }
.card__media--empty { background: linear-gradient(135deg, var(--surface), var(--border)); }
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px; }
.card__title { margin: 0; font-size: 1.2rem; }
.card__title a { color: var(--text); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card:hover .card__title a { color: var(--accent); }
.card__excerpt { margin: 0 0 4px; color: var(--muted); font-size: .95rem; line-height: 1.5; }

.cat { display: block; margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.cat a { position: relative; z-index: 1; color: var(--accent); text-decoration: none; }
.cat a:hover { text-decoration: underline; }

.pagination { margin: 32px 0 40px; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.page-numbers {
	min-width: 44px; padding: 9px 14px; color: var(--text); text-align: center; text-decoration: none;
	border: 1px solid var(--border); border-radius: 8px;
}
a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.page-numbers.current { color: #fff; background: var(--accent); border-color: var(--accent); }
.page-numbers.dots { border: 0; }

.empty { padding: 40px 0 60px; }
.empty .search { max-width: 28rem; }

/* ---------- Entrada y página ---------- */
.entry { padding-block: 24px 8px; }
.entry__head .cat { margin-bottom: 8px; }
.entry__title { margin: 0 0 .4em; font-size: 1.9rem; }
@media (min-width: 768px) { .entry__title { font-size: 2.5rem; } }
.entry__meta { margin: 0; color: var(--muted); font-size: .9rem; }
.entry__media { margin: 20px auto 0; aspect-ratio: 16 / 9; }
.entry__media img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.entry__body { margin-top: 24px; }

.entry-content > * { margin-block: 0 1.2em; }
.entry-content h2 { margin: 1.8em 0 .6em; font-size: 1.6rem; }
.entry-content h3 { margin: 1.5em 0 .5em; font-size: 1.3rem; }
.entry-content h4 { margin: 1.4em 0 .4em; font-size: 1.1rem; }
.entry-content a { text-underline-offset: 2px; }
.entry-content img, .entry-content video { max-width: 100%; height: auto; border-radius: 8px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
	margin-inline: 0; padding: .2em 0 .2em 1em; color: var(--muted); font-size: 1.05em; border-left: 4px solid var(--accent);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content pre { padding: 1em; overflow-x: auto; font-size: .85rem; line-height: 1.5; background: var(--surface); border-radius: 8px; }
.entry-content code { padding: .1em .3em; font-size: .9em; background: var(--surface); border-radius: 4px; }
.entry-content pre code { padding: 0; background: none; }
.entry-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { padding: .5em .7em; text-align: left; border: 1px solid var(--border); }
.entry-content th { background: var(--surface); }
.entry-content iframe { max-width: 100%; border: 0; }
.entry-content iframe[src*="youtube"], .entry-content iframe[src*="youtu.be"], .entry-content iframe[src*="vimeo"] {
	display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
}
.alignleft { float: left; margin: .3em 1.2em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.2em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption, figcaption { margin-top: .4em; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 8px; }
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; }
@media (max-width: 599.98px) { .alignleft, .alignright { float: none; display: block; margin-inline: auto; } }

.entry__foot { margin-top: 24px; padding-top: 16px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }
.entry__foot p { margin: 0 0 .6em; }
.page-links { margin-top: 1em; font-weight: 700; }

.related { margin: 40px 0 -48px; padding-block: 32px 64px; background: var(--surface); }
.related__title { margin: 0; font-size: 1.4rem; }
.related .card { border-color: transparent; }

/* ---------- Comentarios ---------- */
.comments { margin-top: 40px; padding-bottom: 24px; }
.comments__title, .comment-reply-title { font-size: 1.3rem; }
.comment-list { margin: 0; padding: 0; list-style: none; }
.comment-list .children { padding-left: 16px; list-style: none; border-left: 2px solid var(--border); }
.comment-body { margin-bottom: 20px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius); }
.comment-meta { margin-bottom: .5em; color: var(--muted); font-size: .85rem; }
.comment-meta .fn { color: var(--text); font-weight: 800; font-style: normal; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-form p { margin-bottom: 1em; }
.comment-form label { display: block; margin-bottom: .3em; font-weight: 700; font-size: .9rem; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent input { margin-top: .4em; }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }

/* ---------- Publicidad (huecos con espacio reservado) ---------- */
.ad { position: relative; margin: 28px auto; min-height: 300px; max-width: 100%; overflow: hidden; text-align: center; }
.ad__label { display: block; margin-bottom: 4px; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.ad .adsbygoogle { display: block; min-height: 250px; }
.ad--footer { margin-top: 0; }

/* ---------- Pie ---------- */
.site-main { padding-bottom: 48px; }
.site-footer { margin: 0; padding: 28px 0 36px; color: var(--muted); font-size: .9rem; background: var(--surface); }
.footer-menu { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 16px; padding: 0; list-style: none; }
.footer-menu a { display: inline-block; padding: 6px 0; color: var(--text); text-decoration: none; }
.footer-menu a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 0; }

/* ---------- Aviso de cookies (posición fija: no genera CLS) ---------- */
.cookie-notice {
	position: fixed; inset: auto 0 0 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center;
	justify-content: center; gap: 12px 20px; padding: 14px 16px; font-size: .9rem; line-height: 1.45;
	color: var(--text); background: var(--bg); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(20, 23, 31, .14);
}
.cookie-notice p { max-width: 44rem; margin: 0; }
.cookies-set .cookie-notice { display: none; }

@media (prefers-reduced-motion: reduce) {
	.card { transition: none; }
	.card:hover { transform: none; }
}
