/*
Theme Name: Qué pasa en Granada
Theme URI: https://quepasaengranada.com
Author: Angular Comunicación
Description: Tema para el medio digital «Qué pasa en Granada». Preparado para recibir noticias automáticas desde n8n mediante la API REST de WordPress.
Version: 1.3.0
Requires at least: 6.2
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: qpg
*/

:root {
	--ink: #12222A;
	--ink-deep: #0B171D;
	--teal: #00B394;
	--teal-text: #007A66;
	--teal-soft: #E3F5F1;
	--teal-light: #7FE3CF;
	--grey-bg: #F3F5F5;
	--line: #DDE3E4;
	--line-strong: #C5CED0;
	--muted: #52616A;
	--body: #1E2E36;
	--lead: #3A4A52;
	--on-dark: #C9D4D7;
	--head: 'Montserrat', system-ui, sans-serif;
	--text: 'Inter', system-ui, sans-serif;
	--wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--text); color: var(--ink); background: #fff; font-size: 16px; line-height: 1.5; }
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--teal-text); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 1000; background: #fff; padding: 10px 16px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Barra superior ---------- */
.topbar { background: var(--grey-bg); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; }
.topbar nav { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar a { color: var(--muted); }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.topbar a.destacado { color: var(--teal-text); font-weight: 600; }

/* ---------- Cabecera ---------- */
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; padding-top: 28px; padding-bottom: 20px; }
.logo { display: inline-block; line-height: 0; }
.logo img { display: block; height: 72px; width: auto; }
.logo-footer img { height: 44px; }
.custom-logo { max-height: 80px; width: auto; }

.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input[type="search"] { height: 44px; width: 240px; max-width: 60vw; border: 1px solid var(--line-strong); border-radius: 22px; padding: 0 18px; font: inherit; font-size: 14px; color: var(--ink); }
.search-form button { height: 44px; width: 44px; border-radius: 22px; border: 0; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ---------- Navegación ---------- */
.main-nav { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 28px; }
.main-nav a { font-family: var(--head); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; padding: 14px 0; display: inline-flex; gap: 6px; align-items: center; }
.main-nav .current-menu-item > a, .main-nav .current-cat > a { color: var(--teal-text); }
.main-nav .menu-tv > a { color: var(--teal-text); font-weight: 800; }
.nav-toggle { display: none; }

/* ---------- Última hora ---------- */
.breaking { background: var(--ink); color: #fff; }
.breaking .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; padding-top: 12px; padding-bottom: 12px; font-size: 14px; }
.breaking a { color: #fff; display: inline-flex; gap: 8px; align-items: baseline; }
.breaking a:hover { color: var(--teal-light); }
.breaking .hora { color: var(--teal-light); font-weight: 600; }
.badge { background: var(--teal); color: var(--ink); font-family: var(--head); font-weight: 800; font-size: 12px; letter-spacing: 1px; padding: 5px 10px; border-radius: 3px; }

/* ---------- Publicidad ---------- */
.ad { margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.ad-header { max-width: 970px; margin-bottom: 32px; }
.ad-placeholder { border: 1px dashed var(--line-strong); border-radius: 6px; color: #6B7A82; font-size: 12px; letter-spacing: 1px; text-align: center; padding: 8px; width: 100%; }
.ad-header .ad-placeholder { height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-side .ad-placeholder { height: 250px; display: flex; align-items: center; justify-content: center; }

/* ---------- Estructura ---------- */
.site-main { padding-top: 32px; }
.cols { display: flex; flex-wrap: wrap; gap: 40px 56px; }
.col-main { flex: 999 1 640px; min-width: 0; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }

.kicker { font-family: var(--head); font-weight: 800; font-size: 12px; letter-spacing: 1px; color: var(--teal-text); text-transform: uppercase; }
a.kicker:hover { color: var(--ink); }
.meta { font-size: 13px; color: var(--muted); }
.thumb { display: block; background: var(--teal-soft); border-radius: 4px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-3-2 { aspect-ratio: 3 / 2; }
.ratio-9-16 { aspect-ratio: 9 / 16; }

/* Apertura */
.hero .thumb { border-radius: 6px; }
.hero .kicker { display: inline-block; margin-top: 18px; }
.hero h1 { margin: 8px 0 12px; font-weight: 800; font-size: 40px; line-height: 1.12; letter-spacing: -.5px; }
.hero .lead { margin: 0; font-size: 18px; line-height: 1.55; color: var(--lead); }
.hero .meta { margin-top: 12px; }

.grid-secondary { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; border-top: 1px solid var(--line); padding-top: 28px; margin-top: 32px; }
.card-h { display: flex; gap: 16px; }
.card-h .thumb { flex: 0 0 120px; height: 90px; }
.card-h h2, .card-h h3 { margin: 6px 0 0; font-weight: 700; font-size: 17px; line-height: 1.3; }

/* Bloques de sección */
.section-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px solid var(--ink); padding-bottom: 10px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-weight: 800; font-size: 24px; text-transform: uppercase; letter-spacing: .5px; }
.section-head .more { font-size: 14px; font-weight: 600; color: var(--teal-text); }
.block { margin-top: 56px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.card-v h3 { margin: 12px 0 6px; font-weight: 700; font-size: 17px; line-height: 1.3; }

/* QPasaTV */
.tv-block { background: var(--ink); color: #fff; margin-top: 56px; padding: 32px 28px; border-radius: 8px; }
.tv-block .section-head { border-color: var(--teal); }
.tv-block .section-head h2 { color: #fff; display: flex; gap: 10px; align-items: center; }
.tv-block .section-head .more { color: var(--teal-light); }
.grid-reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.card-reel { position: relative; }
.card-reel .thumb { border-radius: 8px; background: #1F343E; }
.card-reel .play { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 18px; background: var(--teal); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.card-reel h3 { margin: 10px 0 0; font-weight: 700; font-size: 15px; line-height: 1.3; }
.card-reel a { color: inherit; }
.tv-block .card-reel a:hover { color: var(--teal-light); }
.tv-archive { background: var(--ink); color: #fff; padding-bottom: 48px; }
.tv-archive .archive-head h1 { color: #fff; }
.tv-archive .archive-head { border-color: var(--teal); }
.tv-archive .archive-head p { color: var(--on-dark); }

/* Lo más leído / listas laterales */
.side-title { margin: 0 0 8px; font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 3px solid var(--ink); padding-bottom: 10px; }
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ranking .num { font-family: var(--head); font-weight: 900; font-size: 30px; line-height: 1; color: var(--teal); min-width: 28px; }
.ranking a { font-weight: 600; font-size: 15px; line-height: 1.4; }
.latest-list .item { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.latest-list .hora { font-weight: 600; font-size: 13px; color: var(--teal-text); min-width: 40px; }
.latest-list a { font-weight: 600; font-size: 15px; line-height: 1.4; }

/* Boletín */
.newsletter { background: var(--ink); color: #fff; margin-top: 72px; }
.newsletter .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; padding-top: 48px; padding-bottom: 48px; }
.newsletter h2 { margin: 0 0 8px; font-weight: 800; font-size: 28px; }
.newsletter p { margin: 0; color: var(--on-dark); }
.newsletter .text { flex: 1 1 360px; }
.newsletter .form { flex: 1 1 380px; }
.newsletter input[type="email"], .newsletter input[type="text"] { height: 48px; border-radius: 24px; border: 0; padding: 0 20px; font: inherit; font-size: 15px; }
.newsletter button, .newsletter input[type="submit"], .btn { height: 48px; padding: 0 28px; border-radius: 24px; border: 0; background: var(--teal); color: var(--ink); font-family: var(--head); font-weight: 800; font-size: 15px; cursor: pointer; }
.side-newsletter { background: var(--ink); color: #fff; border-radius: 6px; padding: 24px; }
.side-newsletter h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.side-newsletter p { margin: 0 0 16px; color: var(--on-dark); font-size: 14px; }
.side-newsletter .btn { width: 100%; height: 44px; display: flex; align-items: center; justify-content: center; }
.admin-hint { font-size: 13px; color: var(--teal-light); }

/* Pie */
.site-footer { background: var(--ink-deep); color: var(--on-dark); font-size: 14px; }
.newsletter + .site-footer, .tv-archive + .site-footer { margin-top: 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; padding-top: 40px; padding-bottom: 40px; }
.site-footer .about { flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; }
.site-footer .about p { margin: 0; line-height: 1.6; max-width: 380px; }
.site-footer nav { flex: 1 1 280px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: #fff; }
.site-footer .social { display: flex; gap: 16px; flex-wrap: wrap; }
.copyright { border-top: 1px solid #1F343E; }
.copyright .wrap { padding-top: 16px; padding-bottom: 16px; font-size: 13px; }

/* ---------- Noticia ---------- */
.single-article { max-width: 780px; }
.breadcrumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a.cat { color: var(--teal-text); font-weight: 600; }
.single-article h1 { margin: 16px 0; font-weight: 800; font-size: 44px; line-height: 1.12; letter-spacing: -.6px; }
.single-article .lead { margin: 0; font-size: 21px; line-height: 1.5; color: var(--lead); font-weight: 500; }
.byline { margin-top: 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.byline strong { color: var(--ink); }
.share { display: flex; gap: 8px; }
.share a, .share button { width: 44px; height: 44px; border-radius: 22px; background: var(--grey-bg); color: var(--ink); display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer; }
.share a:hover, .share button:hover { background: var(--teal-soft); color: var(--ink); }
.featured { margin: 28px 0 0; }
.featured .thumb { border-radius: 6px; }
.featured figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.entry-content { margin-top: 28px; font-size: 19px; line-height: 1.7; color: var(--body); }
.entry-content > * { margin-top: 0; margin-bottom: 22px; }
.entry-content a { color: var(--teal-text); text-decoration: underline; }
.entry-content a:hover { color: var(--ink); }
.entry-content h2 { font-size: 26px; margin-top: 36px; }
.entry-content h3 { font-size: 21px; margin-top: 28px; }
.entry-content blockquote { margin: 8px 0 22px; padding: 4px 0 4px 24px; border-left: 4px solid var(--teal); font-family: var(--head); font-weight: 700; font-size: 24px; line-height: 1.35; color: var(--ink); }
.entry-content blockquote p { margin: 0; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { font-size: 13px; color: var(--muted); }
.entry-content .wp-block-embed iframe { width: 100%; }
.tags { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { background: var(--grey-bg); border-radius: 16px; padding: 8px 14px; font-size: 14px; font-weight: 500; }
.ai-notice { margin-top: 32px; padding: 18px 20px; background: var(--teal-soft); border-radius: 6px; display: flex; gap: 14px; align-items: flex-start; font-size: 14px; line-height: 1.55; color: #1E3A34; }
.ai-notice p { margin: 0; }
.ai-notice a { color: var(--teal-text); text-decoration: underline; }
.related { margin-top: 48px; }
.related .grid-cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.related h3 { font-size: 16px; margin-top: 10px; }

/* ---------- Archivo / búsqueda ---------- */
.archive-head { border-bottom: 3px solid var(--ink); padding: 32px 0 14px; margin-bottom: 28px; }
.archive-head h1 { margin: 0; font-weight: 800; font-size: 36px; text-transform: uppercase; letter-spacing: .5px; }
.archive-head p { margin: 8px 0 0; color: var(--muted); }
.archive-list { display: flex; flex-direction: column; }
.archive-item { display: flex; flex-wrap: wrap; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.archive-item .thumb { flex: 0 0 280px; max-width: 100%; aspect-ratio: 3 / 2; }
.archive-item .body { flex: 1 1 300px; min-width: 0; }
.archive-item h2 { margin: 6px 0 8px; font-size: 22px; font-weight: 800; line-height: 1.25; }
.archive-item p { margin: 0 0 8px; color: var(--lead); }
.pagination { margin: 32px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { min-width: 44px; height: 44px; padding: 0 14px; border-radius: 22px; background: var(--grey-bg); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.pagination .current { background: var(--ink); color: #fff; }
.tv-archive .pagination .page-numbers { background: #1F343E; color: #fff; }
.tv-archive .pagination .current { background: var(--teal); color: var(--ink); }

.page-content { max-width: 780px; padding-bottom: 48px; }
.page-content h1 { font-size: 40px; font-weight: 800; margin: 16px 0 24px; }
.not-found { padding: 64px 0; max-width: 640px; }
.not-found h1 { font-size: 40px; margin: 0 0 12px; }

/* ---------- Móvil ---------- */
@media (max-width: 782px) {
	.site-header .wrap { padding-top: 16px; padding-bottom: 14px; flex-wrap: nowrap; }
	.logo img { height: 46px; }
	.site-header .search-form { display: none; }
	.site-header .search-form.is-open { display: flex; position: absolute; left: 16px; right: 16px; top: 120px; z-index: 20; background: #fff; padding: 12px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
	.site-header .search-form.is-open input { flex: 1; width: auto; max-width: none; }
	.mobile-actions { display: flex; gap: 4px; }
	.nav-toggle, .search-toggle { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--ink); cursor: pointer; }
	.main-nav ul { flex-wrap: nowrap; overflow-x: auto; gap: 20px; -webkit-overflow-scrolling: touch; }
	.main-nav li { flex: 0 0 auto; }
	.main-nav a { font-size: 13px; padding: 13px 0; }
	.breaking .wrap { flex-wrap: nowrap; overflow: hidden; }
	.breaking a { white-space: nowrap; }
	.breaking a + a { display: none; }
	.wrap { padding: 0 16px; }
	.hero h1 { font-size: 26px; line-height: 1.15; }
	.hero .lead { font-size: 16px; }
	.card-h { flex-direction: row-reverse; justify-content: space-between; }
	.card-h .thumb { flex: 0 0 96px; height: 72px; }
	.grid-secondary { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
	.grid-secondary .card-h { padding: 16px 0; border-bottom: 1px solid var(--line); }
	.grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.card-v h3 { font-size: 14px; margin-top: 8px; }
	.grid-reels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.tv-block { padding: 20px 16px; margin-left: -16px; margin-right: -16px; border-radius: 0; }
	.section-head h2 { font-size: 18px; }
	.block { margin-top: 36px; }
	.single-article h1 { font-size: 30px; }
	.single-article .lead { font-size: 18px; }
	.entry-content { font-size: 17px; }
	.archive-head h1 { font-size: 26px; }
	.archive-item .thumb { flex-basis: 100%; }
	.newsletter h2 { font-size: 21px; }
}
@media (min-width: 783px) {
	.mobile-actions { display: none; }
}
