/*
Theme Name: ElectroConsumo
Theme URI: https://electroconsumo.com
Description: Tema hijo de Kadence para el portal de noticias B2B ElectroConsumo del sector energético.
Author: ElectroConsumo
Author URI: https://electroconsumo.com
Template: kadence
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: electroconsumo-child
Requires at least: 6.3
Requires PHP: 7.4
*/

:root {
	--ec-color-primary: #24388c;
	--ec-color-accent: #fbba19;
}

/* --- MENÚ PRINCIPAL --- */
.header-navigation .primary-menu > li > a {
	color: var(--ec-color-primary);
	font-weight: bold;
	transition: color 0.3s ease;
}

.header-navigation .primary-menu > li > a:hover {
	color: var(--ec-color-accent);
}

.ec-nav-highlight a {
	background-color: var(--ec-color-accent) !important;
	color: #000000 !important;
	font-weight: 600 !important;
	padding: 6px 18px !important;
	border-radius: 4px;
	margin-left: 15px;
	display: inline-block;
	transition: all 0.3s ease !important;
}

.ec-nav-highlight a:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	filter: brightness(0.95);
	color: #000000 !important;
}

/* --- FOOTER PERSONALIZADO --- */
.ec-custom-footer {
	background-color: var(--ec-color-primary);
	color: #ffffff;
	padding: 60px 0 0;
}

.ec-footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

.ec-footer-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 48px;
	padding-bottom: 48px;
}

.ec-footer-col h3 {
	color: var(--ec-color-accent);
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0 0 20px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.ec-footer-brand .ec-footer-logo-text {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 16px;
	color: #ffffff;
}

.ec-footer-brand .ec-footer-logo img {
	max-width: 180px;
	height: auto;
	display: block;
	margin-bottom: 16px;
}

.ec-footer-description {
	margin: 0;
	line-height: 1.7;
	font-size: 0.95rem;
	opacity: 0.92;
}

.ec-footer-menu,
.ec-footer-social-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-footer-menu li + li,
.ec-footer-social-list li + li {
	margin-top: 12px;
}

.ec-footer-menu a,
.ec-footer-social-list a {
	color: #ffffff;
	text-decoration: none;
	transition: color 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.ec-footer-menu a:hover,
.ec-footer-social-list a:hover {
	color: var(--ec-color-accent);
}

.ec-footer-social-list svg {
	flex-shrink: 0;
}

.ec-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	padding: 24px 0 60px;
	text-align: center;
}

.ec-footer-bottom p {
	margin: 0;
	font-size: 0.875rem;
	opacity: 0.85;
}

/* --- PROMOCIÓN ELECTROMINERÍA --- */
.ec-sister-site-card {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	padding: 24px;
}

.ec-sister-brand {
	font-size: 1.5rem;
	font-weight: 900;
	color: #ffffff;
	letter-spacing: -0.5px;
	margin-bottom: 12px;
	display: block;
	font-family: sans-serif;
}

.ec-sister-description {
	margin: 0 0 16px;
	font-size: 0.9rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.88);
}

.ec-sister-action {
	display: inline-block;
	color: var(--ec-color-accent);
	font-weight: 700;
	text-decoration: none;
	transition: color 0.3s ease, opacity 0.3s ease;
}

.ec-sister-action:hover {
	color: #ffffff;
	opacity: 0.9;
}

@media (max-width: 768px) {
	.ec-custom-footer {
		padding-top: 48px;
	}

	.ec-footer-grid {
		grid-template-columns: 1fr;
		gap: 36px;
		padding-bottom: 36px;
	}

	.ec-footer-bottom {
		padding-bottom: 48px;
	}
}

/* --- HERO REVISTA --- */
.ec-hero-magazine-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	grid-template-rows: 1fr 1fr;
	gap: 20px;
	margin-bottom: 40px;
}

.ec-main-story,
.ec-side-story {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
}

.ec-main-story {
	grid-column: 1;
	grid-row: 1 / -1;
	min-height: 500px;
}

.ec-side-story {
	grid-column: 2;
	min-height: 250px;
}

.ec-hero-card-link {
	display: block;
	position: relative;
	text-decoration: none;
	color: inherit;
	height: 100%;
	min-height: inherit;
	background-color: var(--ec-color-primary);
}

.ec-main-story .ec-hero-card-link {
	min-height: 500px;
}

.ec-side-story .ec-hero-card-link {
	min-height: 250px;
}

.ec-main-story img,
.ec-side-story img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 1;
	transition: transform 0.5s ease;
}

.ec-story-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 24px;
	background: linear-gradient(to bottom, transparent 0%, var(--ec-color-primary) 100%);
}

.ec-story-overlay .ec-hero-category,
.ec-story-overlay .ec-hero-title,
.ec-story-overlay .ec-hero-date {
	position: relative;
	z-index: 3;
	color: #ffffff;
	margin: 0;
}

.ec-hero-category {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 8px;
}

.ec-hero-title {
	line-height: 1.25;
	font-weight: 700;
	margin-bottom: 8px;
	transition: color 0.3s ease;
}

.ec-main-story .ec-hero-title {
	font-size: 1.75rem;
}

.ec-side-story .ec-hero-title {
	font-size: 1rem;
}

.ec-hero-date {
	font-size: 0.8125rem;
	opacity: 0.9;
}

.ec-main-story:hover img,
.ec-side-story:hover img {
	transform: scale(1.05);
}

.ec-main-story:hover .ec-hero-title,
.ec-side-story:hover .ec-hero-title {
	color: var(--ec-color-accent);
}

@media (max-width: 768px) {
	.ec-hero-magazine-grid {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
	}

	.ec-main-story,
	.ec-side-story {
		grid-column: 1;
		grid-row: auto;
	}

	.ec-main-story,
	.ec-main-story .ec-hero-card-link {
		min-height: 400px;
	}

	.ec-main-story .ec-hero-title {
		font-size: 1.375rem;
	}
}

/* --- ÚLTIMAS NOTICIAS --- */
.ec-latest-section {
	padding: 60px 0;
}

.ec-latest-section h2 {
	color: var(--ec-color-primary);
	font-size: 2rem;
	font-weight: 700;
	margin: 0 0 40px;
	padding-bottom: 16px;
	position: relative;
}

.ec-latest-section h2::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 50px;
	height: 3px;
	background-color: var(--ec-color-accent);
}

.ec-latest-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
	gap: 30px;
}

.ec-news-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #eaeaea;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ec-news-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.ec-news-card-media {
	display: block;
	position: relative;
	overflow: hidden;
}

.ec-badge-exclusivo {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 10;
	background-color: var(--ec-color-accent);
	color: #ffffff;
	padding: 6px 12px;
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
	border-radius: 4px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	letter-spacing: 0.5px;
}

.ec-single-exclusive-banner {
	background-color: var(--ec-color-primary);
	color: #ffffff;
	padding: 16px 24px;
	margin: 0 0 30px 0;
	border-radius: 8px;
	border-left: 6px solid var(--ec-color-accent);
	font-size: 1.05rem;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ec-news-card-media img,
.ec-news-card-placeholder {
	display: block;
	width: 100%;
	height: 200px;
	object-fit: cover;
}

.ec-news-card-placeholder {
	background-color: var(--ec-color-primary);
}

.ec-news-card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	height: 100%;
	padding: 24px;
}

.ec-news-category {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ec-color-primary);
	margin-bottom: 10px;
}

.ec-news-title {
	margin: 0 0 10px;
	font-size: 1.125rem;
	line-height: 1.35;
}

.ec-news-title a {
	color: var(--ec-color-primary);
	text-decoration: none;
	transition: color 0.3s ease;
}

.ec-news-title a:hover {
	color: var(--ec-color-accent);
}

.ec-news-date {
	display: block;
	font-size: 0.8125rem;
	color: #666666;
	margin-bottom: 0;
}

.ec-news-excerpt {
	font-size: 0.95rem;
	line-height: 1.6;
	color: #555555;
	margin: 12px 0 20px 0;
}

.ec-news-read-more {
	margin-top: auto;
	color: var(--ec-color-accent);
	font-weight: bold;
	text-decoration: none;
	transition: opacity 0.3s ease;
}

.ec-news-read-more:hover {
	opacity: 0.8;
}

/* --- BLOQUES POR CATEGORÍA --- */
.ec-category-blocks {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px;
	margin: 60px 0;
}

.ec-cat-column h3 {
	color: var(--ec-color-primary);
	border-bottom: 4px solid var(--ec-color-accent);
	padding-bottom: 10px;
	margin: 0 0 20px;
	font-size: 1.125rem;
	font-weight: 700;
}

.ec-horizontal-card {
	display: flex;
	gap: 15px;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #eaeaea;
}

.ec-horizontal-card:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.ec-horizontal-card img,
.ec-horizontal-card-placeholder {
	width: 90px;
	height: 70px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
	display: block;
}

.ec-horizontal-card-placeholder {
	background-color: var(--ec-color-primary);
}

.ec-horizontal-card h4 {
	font-size: 0.95rem;
	line-height: 1.4;
	margin: 0;
	flex: 1;
}

.ec-horizontal-card h4 a {
	color: var(--ec-color-primary);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.3s ease;
}

.ec-horizontal-card h4 a:hover {
	color: var(--ec-color-accent);
}

/* --- SINGLE POST — CABECERA INMERSIVA --- */
.ec-cinematic-header {
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	min-height: 55vh;
	display: flex;
	align-items: flex-end;
	padding-bottom: 30px;
	overflow: hidden;
	background-color: var(--ec-color-primary);
}

.ec-cinematic-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 1;
}

.ec-cinematic-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	background: linear-gradient(
		to bottom,
		rgba(36, 56, 140, 0) 0%,
		rgba(36, 56, 140, 0.7) 40%,
		var(--ec-color-primary) 100%
	);
}

.ec-cinematic-inner {
	max-width: 1140px;
	margin: 0 auto;
	width: 100%;
	padding: 0 20px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
}

.ec-cinematic-inner > * {
	max-width: 760px;
}

.ec-cinematic-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-size: 0.875rem;
}

.ec-cinematic-category,
.ec-cinematic-category a {
	color: var(--ec-color-accent);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ec-cinematic-category a {
	text-decoration: none;
}

.ec-cinematic-meta-separator {
	color: rgba(255, 255, 255, 0.65);
	font-weight: 700;
}

.ec-cinematic-date {
	color: rgba(255, 255, 255, 0.9);
	font-weight: 500;
}

.ec-cinematic-title,
.ec-cinematic-excerpt {
	color: #ffffff;
}

.ec-cinematic-title {
	margin: 0;
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	line-height: 1.2;
	font-weight: 700;
}

.ec-cinematic-excerpt {
	font-size: 1.25rem;
	line-height: 1.6;
	margin: 20px 0 0;
}

.single-post .entry-hero,
.single-post .entry-content-wrap > header.entry-header {
	display: none;
}

/* --- SINGLE POST — ZONA DE LECTURA --- */
.single-post #inner-wrap {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

.single-post .content-container {
	display: flex;
	gap: 50px;
	justify-content: space-between;
	max-width: 1140px;
	margin: 0 auto;
	padding-top: 0 !important;
}

.single-post #main.site-main {
	flex: 1;
	max-width: 760px;
	width: 100%;
	min-width: 0;
}

.single-post .entry-content {
	max-width: 760px;
	width: 100%;
	padding-top: 0 !important;
	margin: 30px 0 0 0;
	font-size: 1.1rem;
	line-height: 1.8;
}

/* --- SINGLE POST — STICKY SIDEBAR --- */
.single-post #secondary,
.single-post .sidebar,
.single-post aside.primary-sidebar {
	position: sticky;
	top: 120px;
	align-self: flex-start;
	margin-top: 30px;
	width: 300px;
	max-width: 100%;
	flex-shrink: 0;
}

.single-post #secondary .widget,
.single-post aside.primary-sidebar .widget {
	background: #f8f9fa;
	border: 1px solid #eaeaea;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 30px;
	text-align: center;
}

.single-post .advanced-ads-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	color: #888888;
	letter-spacing: 1px;
	display: block;
	margin-bottom: 12px;
}

.single-post #comments,
.single-post .comments-area,
.single-post .entry-related,
.single-post .kadence-related-posts {
	display: none !important;
}

.single-post .entry-content > p:first-of-type {
	font-weight: 400;
}

.single-post .entry-content a {
	color: var(--ec-color-primary);
	font-weight: 600;
	text-decoration: none;
	border-bottom: 2px solid var(--ec-color-accent);
	transition: background-color 0.3s ease, color 0.3s ease;
}

.single-post .entry-content a:hover {
	background-color: var(--ec-color-accent);
	color: #000000;
}

/* --- SINGLE POST — CITAS PERIODÍSTICAS --- */
.single-post .entry-content blockquote.wp-block-quote {
	border: none !important;
	background: transparent;
	padding: 30px 40px;
	margin: 50px auto;
	position: relative;
	max-width: 800px;
}

.single-post .entry-content blockquote.wp-block-quote::before,
.single-post .entry-content blockquote.wp-block-quote::after {
	content: '';
	position: absolute;
	width: 45px;
	height: 45px;
	border-color: var(--ec-color-primary);
	border-style: solid;
}

.single-post .entry-content blockquote.wp-block-quote::before {
	top: 0;
	left: 0;
	border-width: 8px 0 0 8px;
}

.single-post .entry-content blockquote.wp-block-quote::after {
	bottom: 0;
	right: 0;
	border-width: 0 8px 8px 0;
}

.single-post .entry-content blockquote.wp-block-quote p {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--ec-color-primary);
	line-height: 1.5;
	margin: 0;
}

.single-post .entry-content blockquote.wp-block-quote cite {
	display: block;
	margin-top: 20px;
	font-size: 1.05rem;
	font-style: italic;
	color: #666666;
	font-weight: 400;
	border-left: 3px solid var(--ec-color-accent);
	padding-left: 10px;
}

/* --- SINGLE OPINIÓN — PLANTILLA DE BLOQUES --- */
.ec-drop-cap::first-letter {
	font-family: 'Roboto Slab', serif;
	font-size: 4.8rem;
	font-weight: bold;
	float: left;
	color: #24388c;
	line-height: 0.8;
	margin-right: 12px;
	margin-top: 6px;
}

.ec-pull-quote {
	font-family: inherit;
	font-size: 1.15rem;
	line-height: 1.6;
	color: #24388c;
	border-top: 2px solid #24388c;
	border-bottom: 2px solid #24388c;
	padding: 15px 0;
	margin: 0 0 30px 0;
	font-weight: 600;
	text-align: left;
	border-left: none;
}

/* --- SINGLE POST — VITRINA RELACIONADAS --- */
.ec-modern-related {
	margin-top: 60px;
	padding-top: 40px;
	border-top: 2px solid #eaeaea;
	max-width: 760px;
	margin-left: 0;
	margin-right: 0;
}

.ec-modern-related h3 {
	color: var(--ec-color-primary);
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 0;
	padding-bottom: 12px;
	border-bottom: 3px solid var(--ec-color-accent);
	display: inline-block;
}

.ec-related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
	margin-top: 30px;
}

.ec-modern-related .ec-news-card {
	background-color: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #eaeaea;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ec-modern-related .ec-news-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.ec-modern-related .ec-news-title {
	font-size: 1rem;
}

.ec-modern-related a {
	border-bottom: none !important;
	background: transparent !important;
}

.ec-modern-related .ec-news-category,
.ec-modern-related .ec-news-date {
	border-bottom: none !important;
	background: transparent !important;
	color: var(--ec-color-primary);
	text-decoration: none;
}

.ec-modern-related h4 a {
	display: inline;
	border-bottom: 2px solid transparent !important;
	transition: all 0.3s ease;
	color: var(--ec-color-primary);
	font-weight: 600;
}

.ec-modern-related h4 a:hover {
	color: var(--ec-color-accent) !important;
	border-bottom-color: var(--ec-color-accent) !important;
	background: transparent !important;
}

/* --- OCULTAR CATEGORÍAS ESTRUCTURALES EN KADENCE --- */
.single-post header.entry-header .category-links a[href*="destacado"] {
    display: none !important;
}

.post-navigation,
.kadence-post-navigation {
	display: none !important;
}

/* --- PÁGINA DE CONTACTO --- */
.ec-contact-grid {
	display: grid;
	grid-template-columns: 1.2fr 0.8fr;
	gap: 60px;
	max-width: 1400px;
	margin: 60px auto;
	align-items: start;
	padding: 0 20px;
}

.ec-contact-title {
	color: var(--ec-color-primary);
	font-weight: 800;
	margin-bottom: 15px;
	font-size: 2.2rem;
	line-height: 1.2;
}

.ec-contact-lead {
	font-size: 1.1rem;
	color: #555555;
	margin-bottom: 30px;
	line-height: 1.6;
}

.ec-contact-details {
	background: #f8f9fa;
	padding: 25px;
	border-left: 4px solid var(--ec-color-accent);
	border-radius: 0 6px 6px 0;
	margin-bottom: 40px;
}

.ec-contact-details p {
	margin: 0 0 10px 0;
	font-size: 1.05rem;
}

.ec-contact-details p:last-child {
	margin-bottom: 0;
}

.ec-contact-video-wrapper {
	margin-top: 20px;
}

.ec-video-container {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ec-video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.ec-contact-form-box {
	background-color: #ffffff;
	padding: 40px;
	border-radius: 12px;
	border: 1px solid #eaeaea;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.04);
	position: sticky;
	top: 120px;
}

/* --- RESPONSIVE GLOBAL --- */
@media (max-width: 768px) {
	.ec-hero-magazine-grid {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
	}

	.ec-main-story,
	.ec-side-story {
		grid-column: 1;
		grid-row: auto;
	}

	.ec-main-story,
	.ec-main-story .ec-hero-card-link,
	.ec-side-story,
	.ec-side-story .ec-hero-card-link {
		min-height: 300px;
	}

	.ec-category-blocks {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.ec-cinematic-header {
		min-height: 40vh;
		padding-bottom: 30px;
	}

	.ec-cinematic-inner {
		padding: 0 20px;
	}

	.ec-cinematic-inner h1,
	.ec-cinematic-title {
		font-size: 1.8rem !important;
		line-height: 1.2;
	}

	.single-post .content-container {
		flex-direction: column;
		gap: 30px;
	}

	.single-post #secondary,
	.single-post aside.primary-sidebar {
		position: static;
		width: 100%;
		margin-top: 0;
	}

	.ec-contact-grid {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.ec-contact-form-box {
		position: static;
		padding: 25px;
	}
}