/*
Theme Name: ADTheme by AD
Theme URI: https://aldenoticias.com/
Author: AD
Author URI: https://aldenoticias.com/
Description: Tema ligero para noticias, optimizado para WordPress, Gutenberg, Yoast SEO, AdSense Auto Ads y navegadores móviles integrados como Facebook e Instagram.
Version: 2.1
Requires at least: 6.4
Tested up to: 7.0
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: adtheme-by-ad
Tags: news, blog, custom-logo, custom-menu, featured-images, footer-widgets, right-sidebar, left-sidebar, translation-ready, accessibility-ready
*/

:root {
	--ad-accent: #d71920;
	--ad-link: #1565c0;
	--ad-page-bg: #ffffff;
	--ad-text: #252525;
	--ad-muted: #68707b;
	--ad-border: #e5e7eb;
	--ad-card-bg: #ffffff;
	--ad-menu-bg: #ffffff;
	--ad-menu-text: #111111;
	--ad-footer-bg: #111827;
	--ad-footer-text: #f9fafb;
	--ad-container: 1180px;
	--ad-content: 820px;
	--ad-sidebar: 30%;
	--ad-card-radius: 14px;
	--ad-image-radius: 14px;
	--ad-body-font: "Roboto", Arial, Helvetica, sans-serif;
	--ad-heading-font: "Roboto", Arial, Helvetica, sans-serif;
	--ad-logo-font: "Roboto", Arial, Helvetica, sans-serif;
	--ad-body-weight: 400;
	--ad-heading-weight: 700;
	--ad-logo-weight: 700;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	/* Evita que los ajustes automáticos del viewport (como los anuncios ancla) se animen como un mini desplazamiento. */
	scroll-behavior: auto;
}

body {
	margin: 0;
	background: var(--ad-page-bg);
	color: var(--ad-text);
	font-family: var(--ad-body-font);
	font-size: 18px;
	font-weight: var(--ad-body-weight);
	line-height: 1.65;
	overflow-wrap: break-word;
}

body,
button,
input,
select,
textarea {
	font-family: var(--ad-body-font);
}

a {
	color: var(--ad-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.16em;
}

a:hover,
a:focus {
	text-decoration-thickness: 2px;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

iframe,
embed,
object,
video {
	max-width: 100%;
}

/*
 * Estabilidad para AdSense Auto Ads. No cambia tamaños, posiciones ni visibilidad
 * de los anuncios; solo evita que los nodos inyectados se conviertan en anclas
 * de desplazamiento del navegador.
 */
ins.adsbygoogle,
.google-auto-placed,
[data-google-query-id],
[id^="google_ads_iframe_"],
[id^="aswift_"] {
	overflow-anchor: none !important;
}

button,
input,
select,
textarea {
	font-size: 100%;
}

button {
	cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-title {
	font-family: var(--ad-heading-font);
	font-weight: var(--ad-heading-weight);
	line-height: 1.2;
	overflow-wrap: normal;
}

.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;
}

.screen-reader-text:focus {
	top: 8px;
	left: 8px;
	z-index: 100000;
	display: block;
	width: auto;
	height: auto;
	padding: 12px 16px;
	margin: 0;
	clip: auto;
	background: #ffffff;
	color: #111111;
	border-radius: 8px;
	box-shadow: 0 3px 18px rgba(0, 0, 0, 0.2);
}

.ad-container {
	width: min(calc(100% - 32px), var(--ad-container));
	margin-inline: auto;
}

.site-header {
	position: relative;
	z-index: 100;
	background: var(--ad-menu-bg);
	color: var(--ad-menu-text);
	border-bottom: 1px solid var(--ad-border);
}

.site-header.is-sticky {
	position: sticky;
	top: 0;
}

.admin-bar .site-header.is-sticky {
	top: 32px;
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	min-height: 68px;
	padding-block: 10px;
}

.site-branding {
	display: flex;
	align-items: center;
	min-width: 0;
}

.custom-logo-link {
	display: inline-flex;
	align-items: center;
}

.custom-logo {
	width: auto;
	max-height: 48px;
}

.site-title {
	margin: 0;
	font-family: var(--ad-logo-font);
	font-size: clamp(1.25rem, 3vw, 1.75rem);
	font-weight: var(--ad-logo-weight);
	line-height: 1.1;
}

.site-title a,
.site-title a:hover,
.site-title a:focus {
	color: var(--ad-menu-text);
	text-decoration: none;
}

.site-description {
	margin: 4px 0 0;
	color: var(--ad-menu-text);
	opacity: 0.72;
	font-size: 0.78rem;
	line-height: 1.25;
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 8px;
}

.menu-toggle,
.search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--ad-menu-text);
	background: transparent;
	border: 1px solid rgba(127, 127, 127, 0.32);
	border-color: color-mix(in srgb, var(--ad-menu-text) 18%, transparent);
	border-radius: 10px;
}

.menu-toggle svg,
.search-toggle svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.primary-navigation {
	margin-left: auto;
}

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

.primary-menu {
	display: flex;
	align-items: center;
	gap: 4px;
}

.primary-menu > li {
	position: relative;
}

.primary-menu a {
	display: block;
	padding: 10px 12px;
	color: var(--ad-menu-text);
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
	border-radius: 9px;
}

.primary-menu a:hover,
.primary-menu a:focus,
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a {
	background: rgba(127, 127, 127, 0.12);
	background: color-mix(in srgb, var(--ad-menu-text) 9%, transparent);
}

.primary-menu .sub-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 110;
	display: none;
	min-width: 220px;
	padding: 8px;
	background: var(--ad-menu-bg);
	border: 1px solid var(--ad-border);
	border-radius: 12px;
	box-shadow: 0 14px 38px rgba(0, 0, 0, 0.14);
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
	display: block;
}

.primary-menu .sub-menu .sub-menu {
	top: 0;
	left: calc(100% + 8px);
}

.menu-toggle {
	display: none;
}

.search-panel {
	display: none;
	padding: 0 0 14px;
}

.search-panel.is-open {
	display: block;
}

.search-form {
	display: flex;
	align-items: stretch;
	gap: 8px;
	max-width: 720px;
	margin-inline: auto;
}

.search-field {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	padding: 0 14px;
	color: var(--ad-text);
	background: #ffffff;
	border: 1px solid var(--ad-border);
	border-radius: 10px;
}

.search-submit {
	flex: 0 0 auto;
	min-width: 110px;
	padding: 0 18px;
	color: #ffffff;
	background: var(--ad-accent);
	border: 0;
	border-radius: 10px;
	font-weight: 700;
}

.site-main {
	padding-block: 24px 42px;
}

.adtheme-breadcrumbs {
	margin: 0 0 14px;
	color: var(--ad-muted);
	font-size: 0.82rem;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.adtheme-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.adtheme-breadcrumbs a:hover,
.adtheme-breadcrumbs a:focus {
	color: var(--ad-link);
	text-decoration: underline;
}

.page-header {
	margin: 0 0 20px;
}

.page-title,
.entry-title {
	margin: 0;
	letter-spacing: -0.025em;
}

.page-title {
	font-size: clamp(1.75rem, 4vw, 2.35rem);
}

.archive-description {
	max-width: 780px;
	margin-top: 10px;
	color: var(--ad-muted);
	font-size: 0.96rem;
}

.content-layout {
	display: flex;
	align-items: flex-start;
	gap: 32px;
}

.content-layout.sidebar-left {
	flex-direction: row-reverse;
}

.main-column {
	flex: 1 1 auto;
	min-width: 0;
}

.widget-area {
	flex: 0 0 var(--ad-sidebar);
	min-width: 250px;
}

.widget-area.is-sticky {
	position: sticky;
	top: 22px;
}

.admin-bar .widget-area.is-sticky {
	top: 54px;
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(var(--ad-loop-columns, 3), minmax(0, 1fr));
	gap: 16px;
}

.post-grid > :not(.news-card) {
	grid-column: 1 / -1;
	min-width: 0;
}

.news-card {
	min-width: 0;
	overflow: hidden;
	background: var(--ad-card-bg);
	border: 1px solid var(--ad-border);
	border-radius: var(--ad-card-radius);
	transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.news-card:hover {
	transform: translateY(-2px);
	border-color: #c7cbd1;
	border-color: color-mix(in srgb, var(--ad-border) 45%, var(--ad-text));
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.news-card > a.card-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.card-media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f1f3f5;
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card-placeholder {
	width: 100%;
	height: 100%;
	background:
		linear-gradient(135deg, rgba(255,255,255,.55), transparent 60%),
		#eceff3;
}

.card-body {
	padding: 12px 13px 15px;
}

.card-category {
	display: inline-flex;
	align-items: center;
	margin: 0 0 8px;
	padding: 4px 8px;
	color: #ffffff;
	background: var(--ad-accent);
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.card-title {
	margin: 0;
	color: var(--ad-text);
	font-size: 1.02rem;
	line-height: 1.28;
}

.card-meta,
.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: 9px;
	color: var(--ad-muted);
	font-size: 0.78rem;
	line-height: 1.4;
}

.card-excerpt {
	margin: 10px 0 0;
	color: var(--ad-muted);
	font-size: 0.88rem;
	line-height: 1.5;
}

.card-read-more {
	display: inline-block;
	margin-top: 10px;
	color: var(--ad-link);
	font-size: 0.84rem;
	font-weight: 700;
}

.pagination {
	margin-top: 24px;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	padding: 8px 12px;
	color: var(--ad-text);
	background: var(--ad-card-bg);
	border: 1px solid var(--ad-border);
	border-radius: 10px;
	text-decoration: none;
}

.page-numbers.current {
	color: #ffffff;
	background: var(--ad-accent);
	border-color: var(--ad-accent);
}

.single-layout .main-column {
	width: 100%;
}

.single-article {
	max-width: var(--ad-content);
	margin-inline: auto;
}

.single-article.with-sidebar {
	max-width: none;
	margin-inline: 0;
}

.entry-header {
	margin-bottom: 18px;
}

.entry-category {
	display: inline-flex;
	margin-bottom: 12px;
	padding: 6px 10px;
	color: #ffffff;
	background: var(--ad-accent);
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.035em;
}

.entry-category:hover,
.entry-category:focus {
	color: #ffffff;
}

.entry-title {
	font-size: clamp(2rem, 5.4vw, 3.15rem);
}

.entry-subtitle {
	margin: 12px 0 0;
	color: var(--ad-muted);
	font-size: clamp(1.05rem, 2.3vw, 1.28rem);
	line-height: 1.5;
}

.entry-meta {
	margin-top: 13px;
	font-size: 0.86rem;
}

.featured-image {
	margin: 0 0 22px;
	overflow: hidden;
	border-radius: var(--ad-image-radius);
}

.entry-content {
	min-width: 0;
	font-size: 1.08rem;
}

.entry-content > * {
	max-width: 100%;
}

.entry-content p {
	margin: 0 0 1.08em;
}

.entry-content h2 {
	margin: 1.55em 0 0.52em;
	font-size: clamp(1.55rem, 3.3vw, 2rem);
}

.entry-content h3 {
	margin: 1.4em 0 0.5em;
	font-size: clamp(1.32rem, 2.8vw, 1.7rem);
}

.entry-content h4 {
	margin: 1.3em 0 0.45em;
	font-size: 1.22rem;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.35em;
	margin: 0 0 1.1em;
}

.entry-content blockquote {
	margin: 1.35em 0;
	padding: 1em 1.1em;
	background: #f8f8f8;
	background: color-mix(in srgb, var(--ad-accent) 6%, var(--ad-card-bg));
	border-left: 4px solid var(--ad-accent);
	border-radius: 0 10px 10px 0;
}

.entry-content table {
	width: 100%;
	margin-bottom: 1.2em;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.entry-content th,
.entry-content td {
	padding: 9px 10px;
	border: 1px solid var(--ad-border);
	text-align: left;
}

.entry-content pre {
	overflow-x: auto;
	padding: 14px;
	background: #111827;
	color: #f9fafb;
	border-radius: 10px;
}

.entry-content img.adtheme-local-image,
.entry-content img[class*="wp-image-"] {
	border-radius: var(--ad-image-radius);
}

.entry-content figure {
	max-width: 100%;
	margin: 0 0 1.2em;
}

.entry-content figcaption {
	margin-top: 7px;
	color: var(--ad-muted);
	font-size: 0.78rem;
	line-height: 1.4;
	text-align: center;
}

.entry-content .wp-block-embed,
.entry-content .wp-block-embed__wrapper {
	max-width: 100%;
}

.entry-content .wp-block-embed__wrapper iframe {
	max-width: 100%;
}

.entry-content .wp-block-embed.is-type-video .wp-block-embed__wrapper {
	position: relative;
	aspect-ratio: 16 / 9;
}

.entry-content .wp-block-embed.is-type-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.alignwide {
	width: min(100%, var(--ad-container));
	max-width: var(--ad-container);
	margin-left: 50%;
	transform: translateX(-50%);
}

.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: 50%;
	transform: translateX(-50%);
}


.related-posts {
	width: min(calc(100% - 24px), var(--ad-container));
	margin: 38px auto 0;
}

.related-title {
	margin: 0 0 15px;
	font-size: clamp(1.45rem, 3vw, 1.85rem);
}

.comments-area {
	width: min(calc(100% - 24px), var(--ad-content));
	max-width: var(--ad-content);
	margin: 36px auto 0;
}

.comment-list {
	padding: 0;
	list-style: none;
}

.comment-body {
	margin-bottom: 16px;
	padding: 16px;
	background: var(--ad-card-bg);
	border: 1px solid var(--ad-border);
	border-radius: 12px;
}

.comment-metadata {
	font-size: 0.78rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--ad-border);
	border-radius: 9px;
}

.comment-form .submit {
	padding: 11px 18px;
	color: #ffffff;
	background: var(--ad-accent);
	border: 0;
	border-radius: 9px;
	font-weight: 700;
}

.widget {
	margin-bottom: 18px;
	padding: 16px;
	background: var(--ad-card-bg);
	border: 1px solid var(--ad-border);
	border-radius: 12px;
	font-size: 0.9rem;
}

.widget-title {
	margin: 0 0 12px;
	font-size: 1.05rem;
}

.widget ul {
	padding: 0;
	margin: 0;
	list-style: none;
}

.widget li + li {
	margin-top: 8px;
}

.site-footer {
	padding: 34px 0 20px;
	background: var(--ad-footer-bg);
	color: var(--ad-footer-text);
}

.site-footer a {
	color: inherit;
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
}

.site-footer .widget {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.18);
	border-color: color-mix(in srgb, var(--ad-footer-text) 18%, transparent);
}

.footer-credits {
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	border-top-color: color-mix(in srgb, var(--ad-footer-text) 20%, transparent);
	font-size: 0.82rem;
	text-align: center;
	opacity: 0.88;
}

.no-results {
	padding: 28px;
	background: var(--ad-card-bg);
	border: 1px solid var(--ad-border);
	border-radius: 12px;
	text-align: center;
}

@media (max-width: 1080px) {
	.post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.footer-widgets {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 980px) {
	.admin-bar .site-header.is-sticky {
		top: 46px;
	}

	.primary-navigation {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		padding: 8px 16px 16px;
		background: var(--ad-menu-bg);
		border-bottom: 1px solid var(--ad-border);
	}

	.primary-navigation.is-open {
		display: block;
	}

	.primary-menu {
		display: block;
	}

	.primary-menu a {
		padding: 12px 10px;
	}

	.primary-menu .sub-menu,
	.primary-menu .sub-menu .sub-menu {
		position: static;
		display: block;
		min-width: 0;
		padding: 0 0 0 16px;
		background: transparent;
		border: 0;
		box-shadow: none;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.content-layout,
	.content-layout.sidebar-left {
		display: block;
	}

	.widget-area {
		min-width: 0;
		margin-top: 30px;
	}

	.widget-area.is-sticky {
		position: static;
	}
}

@media (max-width: 680px) {
	body {
		font-size: 17px;
	}

	.ad-container {
		width: min(calc(100% - 24px), var(--ad-container));
	}

	.site-description {
		display: none;
	}

	.post-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.footer-widgets {
		grid-template-columns: 1fr;
	}

	.search-form {
		display: grid;
		grid-template-columns: 1fr;
	}

	.search-submit {
		min-height: 46px;
	}

	.entry-title {
		font-size: clamp(1.9rem, 9vw, 2.55rem);
	}

	.entry-content {
		font-size: 1.03rem;
	}
}

@media (max-width: 360px) {
	.header-inner {
		gap: 8px;
	}

	.menu-toggle,
	.search-toggle {
		width: 40px;
		height: 40px;
	}
}

@media print {
	.site-header,
	.site-footer,
	.widget-area,
	.related-posts,
	.comments-area {
		display: none !important;
	}

	.site-main {
		padding: 0;
	}

	a {
		color: inherit;
		text-decoration: none;
	}
}
