/*
Theme Name: Dinoticia
Theme URI: https://dinoticia.com
Author: Dinoticia
Description: Tema de noticias ligero y rápido para Dinoticia · Despertar informativo. Optimizado para SEO, Google Noticias y celulares.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dinoticia
Tags: news, blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* La tipografía Montserrat (títulos) se distribuye con licencia SIL Open Font License 1.1. */
@font-face {
	font-family: "Montserrat";
	font-style: normal;
	font-weight: 600 800;
	font-display: swap;
	src: url("assets/fonts/montserrat-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--navy: #04295a;
	--navy-2: #0b3a78;
	--blue: #0a5cad;
	--orange: #ff7a00;
	--orange-text: #b95300; /* naranja con contraste suficiente para texto pequeño */
	--ink: #101828;
	--text: #1f2937;
	--muted: #5b6472;
	--line: #e4e7ec;
	--soft: #f4f6f9;
	--bg: #ffffff;
	--radius: 10px;
	--wrap: 1240px;
	--font-head: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 70px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--font-body); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; font-weight: 700; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 3px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; padding: 10px 16px; background: var(--navy); color: #fff; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Barra superior ---------- */
.topbar { background: var(--navy); color: #dbe5f3; font-size: .8rem; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.topbar__date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.social { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.social a { display: grid; place-items: center; width: 30px; height: 30px; color: inherit; border-radius: 50%; }
.social a:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------- Cabecera ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: block; line-height: 0; }
.brand img { width: auto; height: 46px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--navy); cursor: pointer; }
.btn-icon:hover { border-color: var(--navy); }
.search-panel { border-bottom: 1px solid var(--line); background: var(--soft); }
.search-panel[hidden] { display: none; }
.search-panel .wrap { padding-top: 14px; padding-bottom: 14px; }
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid #cfd6e0; border-radius: 8px; background: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-2); color: #fff; }

/* ---------- Navegación (se desliza en celular) ---------- */
.main-nav { position: sticky; top: 0; z-index: 50; background: var(--navy); box-shadow: 0 2px 6px rgba(4, 41, 90, .18); }
.admin-bar .main-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .main-nav { top: 0; } }
.main-nav .wrap { display: flex; align-items: stretch; }
.main-nav ul { display: flex; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav li { flex: none; }
.main-nav a { display: block; padding: 13px 14px; color: #fff; font: 700 .86rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .03em; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-category-ancestor > a, .main-nav .current-post-ancestor > a { border-bottom-color: var(--orange); color: #fff; }
.main-nav .sub-menu { display: none; }

/* ---------- Última hora ---------- */
.ticker { background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.ticker .wrap { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.ticker__label { flex: none; background: var(--orange); color: var(--navy); font: 800 .72rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; padding: 7px 10px; border-radius: 4px; }
.ticker__track { position: relative; flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker__list { display: flex; gap: 40px; width: max-content; list-style: none; margin: 0; padding: 0; animation: ticker 45s linear infinite; }
.ticker__track:hover .ticker__list { animation-play-state: paused; }
.ticker__list a { color: var(--ink); font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ticker__list a:hover { color: var(--blue); }
.ticker__list li::before { content: "•"; color: var(--orange); margin-right: 10px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__list { animation: none; } .ticker__track { overflow-x: auto; } }

/* ---------- Estructura ---------- */
.site-main { padding: 24px 0 48px; }
.layout { display: grid; gap: 32px; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.sidebar { display: grid; gap: 24px; align-content: start; }
@media (min-width: 1000px) { .sidebar__sticky { position: sticky; top: 72px; display: grid; gap: 24px; } }

.section { margin-top: 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.section-head h2 { position: relative; margin: 0; padding-bottom: 10px; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .02em; }
.section-head h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 3px; background: var(--orange); }
.section-head h2 a { color: var(--ink); text-decoration: none; }
.section-head .more { font-size: .85rem; font-weight: 700; color: var(--orange-text); text-decoration: none; padding-bottom: 10px; }
.section-head .more:hover { text-decoration: underline; }

/* ---------- Tarjetas ---------- */
.card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card__media { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--soft); aspect-ratio: 16 / 9; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card__media img { transform: scale(1.03); }
.noimg { width: 100%; height: 100%; background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%); position: relative; }
.noimg::after { content: ""; position: absolute; inset: 30%; background: url("assets/img/icono-512.png") center / contain no-repeat; opacity: .9; }
.badge { display: inline-block; align-self: flex-start; background: var(--orange); color: var(--navy); font: 800 .68rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; padding: 5px 8px; border-radius: 4px; text-decoration: none; }
.badge:hover { background: var(--navy); color: #fff; }
.card__media + .card__body .badge, .card__body > .badge { margin-bottom: 2px; }
.card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card__title { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* toda la tarjeta es clicable */
.card__title a:hover { color: var(--blue); }
.card .badge { position: relative; z-index: 1; }
.card__excerpt { margin: 0; color: var(--muted); font-size: .95rem; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: .8rem; }
.meta a { color: inherit; position: relative; z-index: 1; }

.card--lead .card__title { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.15rem); line-height: 1.15; font-weight: 800; }
.card--lead .card__excerpt { font-size: 1.02rem; }
.card--row { flex-direction: row; gap: 12px; align-items: flex-start; }
.card--row .card__media { flex: none; width: 112px; border-radius: 8px; }
.card--row .card__title { font-size: .95rem; }
.card--mini .card__title { font-size: .95rem; }

.grid { display: grid; gap: 22px; }
@media (min-width: 600px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.list { display: grid; gap: 16px; }
.list > * + * { padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- Portada ---------- */
.home-h1 { margin: 0; }
.hero { display: grid; gap: 24px; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
.hero__side { display: grid; gap: 16px; align-content: start; }
.hero__side > * + * { padding-top: 16px; border-top: 1px solid var(--line); }
.cat-block { display: grid; gap: 22px; }
@media (min-width: 760px) { .cat-block { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.ad-slot { text-align: center; margin: 28px 0; }
.ad-slot .widget-title { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: 6px; font-family: var(--font-body); }

/* ---------- Widgets / barra lateral ---------- */
.widget { background: #fff; }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.box-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--orange); }
.popular { list-style: none; margin: 0; padding: 0; counter-reset: pop; display: grid; gap: 14px; }
.popular li { counter-increment: pop; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.popular li::before { content: counter(pop); font: 800 1.6rem/1 var(--font-head); color: var(--orange); }
.popular a { color: var(--ink); font-weight: 700; font-size: .95rem; line-height: 1.3; text-decoration: none; }
.popular a:hover { color: var(--blue); }
.widget ul { padding-left: 1.1em; }

/* ---------- Artículo ---------- */
.article { min-width: 0; }
.breadcrumbs { font-size: .8rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .separator { margin: 0 4px; }
.article__title { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.7rem); line-height: 1.12; font-weight: 800; margin: 12px 0 14px; }
.article__deck { font-size: 1.2rem; line-height: 1.5; color: #344054; margin: 0 0 18px; }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.byline { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }

.byline strong a { color: var(--ink); text-decoration: none; }
.byline time { white-space: nowrap; }
.article__figure { margin: 0 0 24px; }
.article__figure img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.article__figure figcaption, .entry-content figcaption { font-size: .82rem; color: var(--muted); margin-top: 8px; }

.share { display: flex; flex-wrap: wrap; gap: 8px; }
.share a, .share button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 0; color: #fff; font-size: .82rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.share .wa { background: #1fa855; }
.share .fb { background: #1877f2; }
.share .x { background: #111; }
.share .tg { background: #229ed9; }
.share .copy { background: var(--soft); color: var(--navy); border: 1px solid var(--line); }
.share a:hover, .share button:hover { filter: brightness(.92); color: #fff; }
.share .copy:hover { color: var(--navy); }
.share__label { display: none; }
@media (min-width: 600px) { .share__label { display: inline; } }

.entry-content { font-size: 1.12rem; line-height: 1.75; color: #1d2433; }
.entry-content > * { margin-top: 0; margin-bottom: 1.25em; }
.entry-content h2 { font-size: 1.5rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.4em; }
.entry-content a { color: var(--blue); }
.entry-content img { border-radius: 8px; height: auto; }
.entry-content blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--orange); font-size: 1.2rem; font-style: italic; color: var(--ink); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: .35em; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry-content iframe { width: 100%; border: 0; }
.entry-content .wp-block-embed__wrapper { position: relative; }
.entry-content .alignwide, .entry-content .alignfull { margin-left: 0; margin-right: 0; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }
@media (min-width: 700px) { .entry-content .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; } .entry-content .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; padding: 0; list-style: none; }
.tags a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--navy); font-size: .82rem; font-weight: 600; text-decoration: none; }
.tags a:hover { background: var(--navy); color: #fff; }
.author-box { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 20px; margin: 28px 0; background: var(--soft); border-radius: var(--radius); }

.author-box h2 { font-size: 1.05rem; margin: 0 0 4px; }
.author-box p { margin: 0; font-size: .92rem; color: var(--muted); }

/* ---------- Archivo / búsqueda ---------- */
.archive-head { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--line); }
.archive-head h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin: 0 0 6px; }
.archive-head h1 span { color: var(--orange-text); }
.archive-head p { margin: 0; color: var(--muted); }
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy); font-weight: 700; text-decoration: none; }
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }
.error-404 { text-align: center; padding: 30px 0 10px; }
.error-404 .big { font: 800 clamp(4rem, 3rem + 6vw, 7rem)/1 var(--font-head); color: var(--orange); margin: 0; }
.error-404 .search-form { max-width: 520px; margin: 20px auto 0; }

/* ---------- Pie de página ---------- */
.site-footer { background: var(--navy); color: #c9d6e8; font-size: .92rem; margin-top: 20px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.footer-grid { display: grid; gap: 32px; padding: 44px 0 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand img { height: 44px; width: auto; margin-bottom: 14px; }
.footer-title { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 16px 0; font-size: .8rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- Comentarios ---------- */
.comments { margin-top: 32px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-form input:not([type="submit"]):not([type="checkbox"]), .comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #cfd6e0; border-radius: 8px; }
.comment-form .submit { background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; font-weight: 700; cursor: pointer; }

/* ---------- Impresión ---------- */
@media print {
	.topbar, .main-nav, .ticker, .sidebar, .share, .site-footer, .header-actions, .ad-slot, .related { display: none !important; }
	.layout { display: block; }
	.entry-content { font-size: 12pt; }
}

/* Inicial del autor */
.avatar-initial { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--navy); color: #fff; font-family: var(--font-head); font-weight: 800; line-height: 1; }
.author-box .avatar-initial { box-shadow: 0 0 0 3px var(--orange); }

/* Fuente citada al final de las noticias del Redactor */
.entry-content .dn-fuente { margin-top: 2em; padding-top: 12px; border-top: 1px solid var(--line); font-size: .95rem; color: var(--muted); }
.entry-content .dn-fuente a { color: var(--blue); font-weight: 600; }
