/* ================================================================
   BRAGADO DIGITAL - PUBLIC PORTAL STYLESHEET
   Premium News Portal Design - Clean, Modern, Functional
   ================================================================ */

/* ---- CSS Variables ---- */
:root {
  --portal-primary: #004b93;
  --portal-primary-light: #e8f0fe;
  --portal-primary-dark: #003366;
  --portal-secondary: #6d6e71;
  --portal-accent: #ff9f1c;
  --portal-accent-hover: #e58f1a;
  --portal-text-main: #1a1a2e;
  --portal-text-muted: #64748b;
  --portal-text-light: #94a3b8;
  --portal-bg: #ffffff;
  --portal-bg-alt: #f7f8fc;
  --portal-border: #e5e7eb;
  --portal-card-bg: #ffffff;
  --portal-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --portal-shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --portal-shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --portal-radius: 10px;
  --portal-radius-sm: 6px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-title: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1480px;
  --content-padding-x: 28px;
  --section-padding-y: 32px;
  --grid-gap: 24px;
}

/* ---- Global Reset (especificidad baja: no pisa estilos de componentes) ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body#portal-body {
  width: 100%;
  margin: 0;
  padding: 0;
}

.portal-page {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

#portal-header-mount,
#portal-footer-mount {
  display: block;
  width: 100%;
  flex-shrink: 0;
}

.portal-site-header {
  width: 100%;
  display: block;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body#portal-body {
  font-family: var(--font-sans);
  background-color: var(--portal-bg-alt);
  color: var(--portal-text-main);
  overflow-y: auto;
  overflow-x: hidden;
  height: auto;
  min-height: 100vh;
  display: block;
  line-height: 1.6;
  font-size: 16px;
}

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

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

ul, ol {
  list-style: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--portal-bg-alt); }
::-webkit-scrollbar-thumb { background: #c1c7d0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a0a8b4; }

/* ================================================================
   TOP INFO BAR
   ================================================================ */
.portal-topbar {
  background-color: var(--portal-primary-dark);
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  width: 100%;
}

body#portal-body .portal-topbar-inner {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-left i {
  color: var(--portal-accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-weather {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-weather i {
  color: var(--portal-accent);
}

.topbar-divider {
  width: 1px;
  height: 16px;
  background-color: rgba(255,255,255,0.2);
}

.topbar-socials {
  display: flex;
  gap: 12px;
}

.topbar-socials a {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.topbar-socials a:hover {
  color: #ffffff;
}

/* ================================================================
   MAIN HEADER
   ================================================================ */
.portal-header {
  background-color: var(--portal-bg);
  border-bottom: 1px solid var(--portal-border);
  position: relative;
  z-index: 50;
}

.portal-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.portal-header-inner--search-only {
  justify-content: flex-end;
  padding: 12px 24px;
}

.header-side {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-left {
  justify-content: flex-start;
  gap: 10px;
}

.header-right {
  justify-content: flex-end;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--portal-border);
  background-color: var(--portal-bg);
  color: var(--portal-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--portal-primary);
  color: #fff;
  border-color: var(--portal-primary);
}

.theme-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portal-logo-link {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

.portal-logo-img {
  height: 90px;
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.portal-logo-link:hover .portal-logo-img {
  transform: scale(1.03);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--portal-bg-alt);
  border: 1px solid var(--portal-border);
  padding: 10px 16px;
  border-radius: 50px;
  width: 100%;
  max-width: 260px;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--portal-primary);
  box-shadow: 0 0 0 3px rgba(0, 75, 147, 0.1);
}

.search-box i {
  color: var(--portal-text-light);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
  color: var(--portal-text-main);
  font-family: var(--font-sans);
}

.search-box input::placeholder {
  color: var(--portal-text-light);
}

/* ================================================================
   NAVIGATION BAR
   ================================================================ */
.portal-navbar {
  background-color: var(--portal-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,75,147,0.15);
  width: 100%;
}

body#portal-body .portal-navbar-inner {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  height: 52px;
  flex-wrap: nowrap;
}

.portal-navbar-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  margin-right: 14px;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  line-height: 0;
}

.portal-navbar-brand-logo {
  height: 48px;
  width: auto;
  max-width: 110px;
  max-height: 48px;
  object-fit: contain;
  display: block;
  transition: opacity var(--transition-fast);
}

.portal-navbar-brand-logo--icon {
  height: 48px;
  width: auto;
  max-width: 110px;
  max-height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.portal-navbar-brand:hover .portal-navbar-brand-logo {
  opacity: 0.92;
}

.navbar-search-box {
  margin-left: auto;
  max-width: 210px;
  width: 210px;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 140px;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 5px 12px;
}

.portal-nav-shell {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  gap: 2px;
}

.portal-nav-overflow {
  position: relative;
  flex: 0 0 auto;
}

.portal-nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.portal-nav-more-btn:hover,
.portal-nav-overflow.is-open .portal-nav-more-btn,
.portal-nav-overflow.has-active .portal-nav-more-btn {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.portal-nav-overflow.has-active .portal-nav-more-btn {
  box-shadow: inset 0 -3px 0 var(--portal-accent);
}

.portal-nav-overflow.is-open .portal-nav-more-btn i {
  transform: rotate(180deg);
}

.portal-nav-more-btn i {
  font-size: 0.62rem;
  transition: transform var(--transition-fast);
}

.portal-nav-overflow-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  max-height: 60vh;
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--portal-primary-dark, #003d7a);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  z-index: 120;
}

.portal-nav-overflow.is-open .portal-nav-overflow-menu {
  display: block;
}

.portal-nav-overflow-menu li {
  display: block;
  width: 100%;
}

.portal-nav-overflow-menu .portal-nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.74rem;
  text-align: left;
}

.portal-nav-overflow-menu li.active-nav-item .portal-nav-link {
  background-color: rgba(255, 159, 28, 0.18);
  color: #fff;
  border-left: 3px solid var(--portal-accent);
  padding-left: 11px;
}

.navbar-search-box:focus-within {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

.navbar-search-box i {
  color: rgba(255, 255, 255, 0.85);
}

.navbar-search-box input {
  color: #fff;
}

.navbar-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.mobile-menu-btn,
.mobile-search-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background-color var(--transition-fast);
}

.mobile-menu-btn:hover,
.mobile-search-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.portal-mobile-overlay {
  display: none;
}

body#portal-body.portal-menu-open {
  overflow: hidden;
}

body#portal-body .portal-navbar-inner .portal-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  list-style: none;
  overflow: hidden;
}

body#portal-body .portal-nav li {
  position: relative;
  white-space: nowrap;
  flex: 0 0 auto;
}

body#portal-body .portal-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.2;
}

.portal-nav li:hover .portal-nav-link {
  color: #ffffff;
  background-color: rgba(255,255,255,0.1);
}

.portal-nav li.active-nav-item .portal-nav-link {
  color: #ffffff;
  background-color: rgba(255,255,255,0.15);
}

.portal-nav li.active-nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  background-color: var(--portal-accent);
  border-radius: 3px 3px 0 0;
}

/* ================================================================
   ÚLTIMAS NOTICIAS — TIRA BAJO EL MENÚ
   ================================================================ */
.portal-news-ticker {
  width: 100%;
  background-color: var(--portal-bg);
  border-bottom: 1px solid var(--portal-border);
  display: flex;
  align-items: stretch;
  min-height: 42px;
  overflow: hidden;
}

.portal-news-ticker-label {
  background-color: var(--portal-primary);
  color: #fff;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  flex-shrink: 0;
  white-space: nowrap;
}

.portal-news-ticker-label i {
  color: var(--portal-accent);
  font-size: 0.78rem;
}

.portal-news-ticker-track {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-width: 0;
  position: relative;
}

.portal-news-ticker-track::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  background: linear-gradient(to right, transparent, var(--portal-bg));
  pointer-events: none;
  z-index: 1;
}

.portal-news-ticker-scroll {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: portal-ticker-slide 110s linear infinite;
  padding: 10px 0;
  will-change: transform;
}

.portal-news-ticker-scroll:hover {
  animation-play-state: paused;
}

.portal-news-ticker-link {
  color: var(--portal-text-main);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0 18px;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.portal-news-ticker-link:hover {
  color: var(--portal-primary);
}

.portal-news-ticker-sep {
  color: var(--portal-accent);
  font-weight: 700;
  opacity: 0.85;
  user-select: none;
}

.portal-news-ticker-empty {
  padding: 0 18px;
  font-size: 0.82rem;
  color: var(--portal-text-muted);
}

@keyframes portal-ticker-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ================================================================
   VIDEOS RECIENTES — CARRUSEL EN PORTADA
   ================================================================ */
.portal-section--videos .portal-section-content {
  padding-top: 0;
}

.portal-section--videos .portal-section-title-wrapper {
  margin-bottom: 12px;
}

.videos-scroll-wrap {
  overflow: hidden;
  width: 100%;
  position: relative;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.videos-scroll-wrap::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 72px;
  background: linear-gradient(to right, transparent, #1e293b);
  pointer-events: none;
  z-index: 1;
}

.videos-scroll-track {
  display: flex;
  width: max-content;
  animation: videos-scroll-slide 65s linear infinite;
  will-change: transform;
}

.videos-scroll-track:hover {
  animation-play-state: paused;
}

.videos-scroll-row {
  display: flex;
  gap: 16px;
  padding: 16px 14px;
}

.videos-scroll-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: 250px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.videos-scroll-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.videos-scroll-thumb {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #0f172a;
}

.videos-scroll-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.videos-scroll-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 1.6rem;
  transition: background var(--transition-fast);
}

.videos-scroll-card:hover .videos-scroll-play {
  background: rgba(0, 75, 147, 0.55);
}

.videos-scroll-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.videos-scroll-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.videos-scroll-cat {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--portal-primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.videos-scroll-wrap--news .videos-scroll-cat {
  text-transform: none;
  letter-spacing: 0.2px;
  font-weight: 700;
}

.videos-scroll-title {
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--portal-text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.videos-scroll-date {
  font-size: 0.72rem;
  color: var(--portal-text-muted);
}

.videos-scroll-empty {
  padding: 20px;
  text-align: center;
  color: #cbd5e1;
  font-size: 0.9rem;
}

@keyframes videos-scroll-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  .videos-scroll-card {
    width: 220px;
  }

  .videos-scroll-thumb {
    height: 124px;
  }

  .videos-scroll-title {
    font-size: 0.8rem;
  }
}

/* ================================================================
   BREAKING NEWS TICKER (legacy)
   ================================================================ */
.breaking-ticker {
  background-color: var(--portal-bg);
  border-bottom: 1px solid var(--portal-border);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  font-size: 0.82rem;
}

.ticker-label {
  background-color: #dc2626;
  color: #fff;
  padding: 10px 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.72rem;
  flex-shrink: 0;
  animation: pulse-label 2s ease-in-out infinite;
}

@keyframes pulse-label {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.ticker-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.ticker-scroll {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: ticker-slide 30s linear infinite;
  color: var(--portal-text-main);
  font-weight: 500;
}

.ticker-scroll span {
  padding: 0 8px;
}

.ticker-sep {
  color: var(--portal-accent);
  font-weight: 800;
}

@keyframes ticker-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
body#portal-body .portal-main {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--content-padding-x);
  min-height: 60vh;
  flex: 1;
}

/* ---- Portal Section ---- */
.portal-section {
  margin-bottom: 8px;
  background-color: var(--portal-bg);
  border-radius: 0;
  overflow: visible;
  transition: background-color var(--transition-normal);
}

.portal-section:first-child {
  margin-top: 0;
}

body#portal-body .portal-section-content {
  padding: var(--section-padding-y) var(--content-padding-x);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.portal-section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--portal-primary);
}

.portal-section-header-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--portal-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.2;
}

/* Empty State */
.portal-canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  color: var(--portal-text-muted);
  background: var(--portal-bg);
  border: 2px dashed var(--portal-border);
  border-radius: var(--portal-radius);
  margin: 32px 0;
}

/* ================================================================
   NEWS GRID & CARDS
   ================================================================ */
.news-grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- News Card ---- */
.news-card {
  display: flex;
  flex-direction: column;
  background-color: var(--portal-card-bg);
  border-radius: var(--portal-radius);
  overflow: hidden;
  border: 1px solid var(--portal-border);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  height: 100%;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--portal-shadow-lg);
}

.news-card-img-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background-color: #eef2f7;
}

.news-card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.news-card:hover .news-card-img-wrapper img {
  transform: scale(1.06);
}

.news-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: var(--portal-primary);
  color: #fff;
  padding: 4px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  letter-spacing: 0.8px;
  z-index: 2;
}

.news-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card-title {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--portal-text-main);
  line-height: 1.35;
  margin-bottom: 8px;
  transition: color var(--transition-fast);
  display: block;
}

.news-card:hover .news-card-title {
  color: var(--portal-primary);
}

.news-card-desc {
  font-size: 0.85rem;
  color: var(--portal-text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
  flex: 1;
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--portal-text-light);
  border-top: 1px solid var(--portal-border);
  padding-top: 12px;
  margin-top: auto;
}

.news-card-author {
  font-weight: 600;
  color: var(--portal-text-main);
}

/* ================================================================
   HERO NEWS BLOCK
   ================================================================ */
.news-hero-wrapper {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 40px;
  align-items: stretch;
  cursor: pointer;
}

.news-hero-img-box {
  position: relative;
  aspect-ratio: 16/9;
  min-height: 320px;
  overflow: hidden;
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow-md);
}

.news-hero-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-hero-wrapper:hover .news-hero-img-box img {
  transform: scale(1.04);
}

.news-hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-hero-category {
  color: var(--portal-accent);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.news-hero-title {
  font-family: var(--font-title);
  font-size: clamp(1.65rem, 2.2vw, 2.35rem);
  font-weight: 800;
  color: var(--portal-text-main);
  line-height: 1.2;
  margin-bottom: 14px;
  transition: color var(--transition-fast);
}

.news-hero-wrapper:hover .news-hero-title {
  color: var(--portal-primary);
}

.news-hero-desc {
  font-size: 0.92rem;
  color: var(--portal-text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.news-hero-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--portal-text-light);
  border-top: 1px solid var(--portal-border);
  padding-top: 16px;
}

.news-hero-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ================================================================
   CATEGORY PAGE (hero + list)
   ================================================================ */
.portal-section--category .portal-section-content {
  max-width: 960px;
  margin: 0 auto;
}

.category-page-layout {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.category-hero-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  cursor: pointer;
}

.category-hero-img-box {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  max-height: 520px;
  overflow: hidden;
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow-md);
}

.category-hero-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-hero-wrapper:hover .category-hero-img-box img {
  transform: scale(1.03);
}

.category-hero-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.category-hero-title {
  font-family: var(--font-title);
  font-size: clamp(1.85rem, 3vw, 2.75rem);
  font-weight: 800;
  color: var(--portal-text-main);
  line-height: 1.15;
  margin-bottom: 14px;
  transition: color var(--transition-fast);
}

.category-hero-wrapper:hover .category-hero-title {
  color: var(--portal-primary);
}

.category-hero-desc {
  font-size: 1rem;
  color: var(--portal-text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.category-list-heading {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--portal-text-main);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--portal-accent);
}

.category-list-cat {
  color: var(--portal-primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.category-list-summary {
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.category-page-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--portal-text-muted);
}

.category-page-empty i {
  font-size: 2.5rem;
  color: var(--portal-primary);
  margin-bottom: 16px;
  display: block;
}

.news-hero-recent-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: var(--portal-bg-alt);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
}

.news-hero-recent-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: transform var(--transition-fast);
}

.news-hero-recent-item:hover {
  transform: translateY(-2px);
}

.news-hero-recent-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: #e8edf3;
  box-shadow: var(--portal-shadow-sm);
}

.news-hero-recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.news-hero-recent-item:hover .news-hero-recent-thumb img {
  transform: scale(1.05);
}

.news-hero-recent-cat {
  position: absolute;
  left: 6px;
  top: 6px;
  background: var(--portal-primary);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 6px;
  border-radius: 4px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-hero-recent-title {
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--portal-text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-hero-recent-item:hover .news-hero-recent-title {
  color: var(--portal-primary);
}

@media (max-width: 1100px) {
  .news-hero-recent-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .news-hero-recent-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .news-hero-recent-title {
    font-size: 0.68rem;
  }
}

/* ================================================================
   HIGHLIGHT GRID (1 Big + Side List)
   ================================================================ */
.highlight-grid-wrapper {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 36px;
  align-items: start;
}

.highlight-left {
  border-right: 1px solid var(--portal-border);
  padding-right: 28px;
}

.highlight-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ================================================================
   NEWS LIST STYLE
   ================================================================ */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-list-item {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--portal-border);
  padding: 16px 0;
  align-items: flex-start;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.news-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-list-item:hover {
  background-color: var(--portal-bg-alt);
}

.news-list-img {
  width: 130px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--portal-radius-sm);
  flex-shrink: 0;
  background-color: #eef2f7;
}

.news-list-body {
  flex: 1;
  min-width: 0;
}

.news-list-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--portal-text-main);
  line-height: 1.35;
  margin-bottom: 6px;
  display: block;
  transition: color var(--transition-fast);
}

.news-list-item:hover .news-list-title {
  color: var(--portal-primary);
}

.news-list-meta {
  display: flex;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--portal-text-light);
  flex-wrap: wrap;
}

/* ================================================================
   VIDEOS
   ================================================================ */
.video-card { position: relative; }

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 159, 28, 0.92);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  transition: transform var(--transition-fast), background var(--transition-fast);
  z-index: 2;
}

.video-card:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.12);
  background-color: var(--portal-accent);
}

.video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0,0,0,0.8);
  color: #fff;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  z-index: 2;
}

/* ================================================================
   OPINION
   ================================================================ */
.opinion-card {
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
  border: 1px solid var(--portal-border);
  border-left: 4px solid var(--portal-primary);
  border-radius: var(--portal-radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.opinion-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--portal-shadow-md);
}

.opinion-author-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.opinion-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: var(--portal-shadow-sm);
}

.opinion-author-text {
  display: flex;
  flex-direction: column;
}

.opinion-author-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--portal-text-main);
}

.opinion-author-role {
  font-size: 0.72rem;
  color: var(--portal-text-muted);
}

.opinion-quote {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: #334155;
  line-height: 1.6;
  position: relative;
  padding-left: 20px;
}

.opinion-quote::before {
  content: '\201C';
  font-family: Georgia, serif;
  font-size: 3.5rem;
  color: rgba(0, 75, 147, 0.12);
  position: absolute;
  top: -16px;
  left: -4px;
  line-height: 1;
}

/* ================================================================
   GALLERY
   ================================================================ */
.gallery-card .news-card-img-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
  z-index: 1;
}

.gallery-count-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background-color: rgba(0,0,0,0.7);
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

/* ================================================================
   BANNERS / PUBLICIDAD
   ================================================================ */
.banner-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--portal-bg-alt);
  border: 1px solid var(--portal-border);
  padding: 10px;
  border-radius: var(--portal-radius-sm);
}

.banner-label {
  font-size: 0.62rem;
  color: var(--portal-text-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.banner-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.banner-wrapper.banner-placement-superior,
.banner-wrapper.banner-placement-inferior {
  width: 100%;
  max-width: 970px;
  margin: 0 auto;
}

.banner-wrapper.banner-placement-superior .banner-img,
.banner-wrapper.banner-placement-inferior .banner-img {
  max-height: 90px;
  object-fit: contain;
}

.banner-wrapper.banner-placement-medio {
  max-width: 728px;
  margin: 0 auto;
}

.banner-wrapper.banner-placement-medio .banner-img {
  max-height: 90px;
  object-fit: contain;
}

.banner-wrapper.banner-placement-lateral {
  max-width: 300px;
  margin: 0 auto;
}

.banner-wrapper.banner-placement-lateral .banner-img {
  max-height: 250px;
  object-fit: contain;
}

.portal-section[data-id="sec-principal"] .news-hero-wrapper {
  margin-bottom: 4px;
}

@media (min-width: 1280px) {
  .banner-wrapper {
    padding: 12px 16px;
  }

  .banner-wrapper.banner-placement-lateral .banner-img {
    max-height: 250px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-news-ticker-scroll {
    animation: none;
    padding-left: 18px;
  }
}

/* ================================================================
   NEWSLETTER
   ================================================================ */
.newsletter-box {
  background: linear-gradient(135deg, #003366 0%, #004b93 50%, #0066cc 100%);
  color: #fff;
  padding: 48px 40px;
  border-radius: var(--portal-radius);
  text-align: center;
  box-shadow: var(--portal-shadow-lg);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.newsletter-box::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.newsletter-box h3 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
}

.newsletter-box p {
  opacity: 0.85;
  font-size: 0.88rem;
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
  position: relative;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background-color: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}

.newsletter-form input::placeholder { color: rgba(255,255,255,0.55); }
.newsletter-form input:focus {
  outline: none;
  background-color: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.newsletter-form button {
  background-color: var(--portal-accent);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}

.newsletter-form button:hover { background-color: var(--portal-accent-hover); }

/* ================================================================
   MARKETS / COTIZACIONES
   ================================================================ */
.markets-container {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
  background-color: var(--portal-bg-alt);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 24px;
}

.markets-column-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--portal-secondary);
  border-bottom: 2px solid var(--portal-border);
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.markets-column-title i { color: var(--portal-primary); }

.markets-table { width: 100%; border-collapse: collapse; }
.markets-table tr { border-bottom: 1px solid var(--portal-border); }
.markets-table tr:last-child { border-bottom: none; }
.markets-table td { padding: 9px 4px; font-size: 0.82rem; }
.market-label { font-weight: 600; color: var(--portal-text-main); }
.market-value { font-family: 'Courier New', monospace; font-weight: 700; color: #334155; text-align: right; }
.market-change { font-size: 0.75rem; font-weight: 700; text-align: right; }
.change-up { color: #10b981; }
.change-down { color: #ef4444; }
.change-neutral { color: var(--portal-text-muted); }

/* ================================================================
   TRENDING TAGS
   ================================================================ */
.trending-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background-color: var(--portal-bg-alt);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  padding: 12px 18px;
}

.trending-label {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--portal-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.trending-tag {
  background-color: #fff;
  border: 1px solid var(--portal-border);
  padding: 5px 14px;
  border-radius: 24px;
  font-size: 0.75rem;
  color: #475569;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.trending-tag:hover {
  background-color: var(--portal-primary);
  border-color: var(--portal-primary);
  color: #fff;
}

/* ================================================================
   MOST READ (NUMBERED LIST)
   ================================================================ */
.most-read-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.most-read-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid var(--portal-border);
  padding: 14px 0;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.most-read-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.most-read-item:hover {
  background-color: var(--portal-bg-alt);
}

.most-read-number {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  color: rgba(0, 75, 147, 0.15);
  line-height: 1;
  transition: color var(--transition-fast);
  min-width: 40px;
}

.most-read-item:hover .most-read-number {
  color: var(--portal-primary);
}

.most-read-body { flex: 1; }

.most-read-title {
  font-family: var(--font-title);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--portal-text-main);
  line-height: 1.35;
  margin-bottom: 4px;
  transition: color var(--transition-fast);
}

.most-read-item:hover .most-read-title {
  color: var(--portal-primary);
}

.most-read-meta {
  font-size: 0.7rem;
  color: var(--portal-text-light);
}

/* ================================================================
   ARTICLE VIDEO EMBED
   ================================================================ */
.article-video-container {
  margin-bottom: 24px;
}

.article-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background-color: #000;
  box-shadow: var(--portal-shadow-md);
}

.article-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ================================================================
   FOOTER
   ================================================================ */
.portal-footer {
  background-color: #0f172a;
  color: #94a3b8;
  margin-top: 0;
}

body#portal-body .footer-inner {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr;
  gap: 40px;
  padding: 48px 0 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand {}

.footer-logo {
  height: 64px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  margin-bottom: 16px;
}

.footer-logo[src$=".svg"] {
  filter: brightness(0) invert(1);
}

.footer-tagline {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 280px;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.footer-socials a:hover {
  background-color: var(--portal-primary);
  color: #fff;
}

.footer-links-group h4,
.footer-contact h4 {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links-group ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-sections-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px 16px !important;
}

.footer-links-group a {
  color: #94a3b8;
  font-size: 0.82rem;
  transition: color var(--transition-fast);
}

.footer-links-group a:hover {
  color: #fff;
}

.footer-contact p {
  font-size: 0.82rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-contact i {
  color: var(--portal-primary);
  width: 16px;
  text-align: center;
}

.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 0.72rem;
  color: #64748b;
}

/* Article breadcrumbs & related */
.article-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--portal-text-muted);
  margin-bottom: 14px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 14px;
}

.article-breadcrumbs a {
  color: var(--portal-primary);
  text-decoration: none;
  font-weight: 600;
}

.article-breadcrumbs a:hover {
  text-decoration: underline;
}

.article-breadcrumbs-sep {
  opacity: 0.5;
}

.article-breadcrumbs-current {
  color: var(--portal-text-main);
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-updated-label {
  font-size: 0.82rem;
  color: var(--portal-text-muted);
  margin: 0 0 14px;
  font-weight: 600;
}

.article-related-bottom {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--portal-border);
}

.article-related-bottom-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--portal-primary);
  margin: 0 0 14px;
}

.article-related-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.article-related-bottom-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--portal-bg-alt);
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.article-related-bottom-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.article-related-bottom-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-related-bottom-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  padding: 0 10px 10px;
  color: var(--portal-text-main);
}

@media (max-width: 768px) {
  .article-related-bottom-grid {
    grid-template-columns: 1fr;
  }

  .article-breadcrumbs {
    padding: 0 12px;
  }
}

/* Article page — loader */
.article-page-loader {
  padding: 18px 16px 22px;
  min-height: 200px;
}

.article-page-loader[hidden] {
  display: none !important;
}

body#portal-body.article-page #article-content-root {
  opacity: 0;
  transition: opacity 0.18s ease;
}

body#portal-body.article-page.article-ready #article-content-root {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .article-page-loader-shimmer,
  .article-page-loader-line {
    animation: none;
  }

  body#portal-body.article-page #article-content-root {
    transition: none;
  }
}

.article-page-loader-shimmer {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  border-radius: 10px;
  margin-bottom: 18px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
  background-size: 200% 100%;
  animation: article-loader-shimmer 1.2s ease-in-out infinite;
}

.article-page-loader-line {
  height: 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
  background-size: 200% 100%;
  animation: article-loader-shimmer 1.2s ease-in-out infinite;
}

.article-page-loader-line--lg {
  height: 22px;
  width: 88%;
  margin-bottom: 16px;
}

.article-page-loader-line--short {
  width: 62%;
}

@keyframes article-loader-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Home / portada — loader */
.portal-home-loader {
  padding: 16px 14px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.portal-home-loader-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 280px;
  border-radius: 10px;
  margin-bottom: 18px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
  background-size: 200% 100%;
  animation: article-loader-shimmer 1.2s ease-in-out infinite;
}

.portal-home-loader-row {
  margin-bottom: 20px;
}

.portal-home-loader-line {
  height: 14px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
  background-size: 200% 100%;
  animation: article-loader-shimmer 1.2s ease-in-out infinite;
}

.portal-home-loader-line--lg {
  height: 22px;
  width: 85%;
  margin-bottom: 14px;
}

.portal-home-loader-line--short {
  width: 55%;
}

.portal-home-loader-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.portal-home-loader-card {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
  background-size: 200% 100%;
  animation: article-loader-shimmer 1.2s ease-in-out infinite;
}

body#portal-body.is-portal-loading #portal-public-canvas > :not(#portal-home-loader) {
  opacity: 0;
}

body#portal-body.portal-ready #portal-public-canvas {
  opacity: 1;
  transition: opacity 0.2s ease;
}

#portal-public-canvas.is-switching-section {
  opacity: 0.72;
  transition: opacity 0.12s ease;
}

@media (max-width: 768px) {
  .portal-home-loader {
    padding: 12px 12px 20px;
  }

  .portal-home-loader-hero {
    max-height: 200px;
    border-radius: 8px;
  }

  .portal-home-loader-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .portal-home-loader-card {
    aspect-ratio: 16 / 9;
    max-height: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-home-loader-hero,
  .portal-home-loader-line,
  .portal-home-loader-card {
    animation: none;
  }

  body#portal-body.portal-ready #portal-public-canvas {
    transition: none;
  }
}

/* Article page layout */
.article-page-main {
  background-color: var(--portal-bg-alt);
}

body#portal-body .portal-main.article-page-main {
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.article-page-container {
  width: 100%;
  max-width: 1240px;
  margin: 30px auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.article-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.article-page-main-col {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.article-page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 88px;
}

.article-sidebar-widget {
  background-color: var(--portal-bg);
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  box-shadow: var(--portal-shadow-sm);
  overflow: hidden;
}

.article-sidebar-widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--portal-border);
  background: var(--portal-bg-alt);
}

.article-sidebar-widget-header i {
  color: var(--portal-accent);
  font-size: 0.9rem;
}

.article-sidebar-widget-title {
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--portal-text-main);
  margin: 0;
}

.article-sidebar-list {
  display: flex;
  flex-direction: column;
}

.article-sidebar-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--portal-border);
  text-decoration: none;
  color: inherit;
  align-items: center;
  min-height: 48px;
  transition: background-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.article-sidebar-item:last-child {
  border-bottom: none;
}

.article-sidebar-item:hover {
  background-color: var(--portal-bg-alt);
}

.article-sidebar-thumb {
  width: 72px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #eef2f7;
}

.article-sidebar-body {
  flex: 1;
  min-width: 0;
}

.article-sidebar-cat {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--portal-primary);
  margin-bottom: 4px;
}

.article-sidebar-item-title {
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--portal-text-main);
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

.article-sidebar-item:hover .article-sidebar-item-title {
  color: var(--portal-primary);
}

.article-sidebar-meta {
  font-size: 0.68rem;
  color: var(--portal-text-light);
}

.article-sidebar-empty {
  padding: 16px;
  font-size: 0.82rem;
  color: var(--portal-text-muted);
  text-align: center;
}

.article-sidebar-link-all {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--portal-primary);
  text-decoration: none;
  border-top: 1px solid var(--portal-border);
  transition: background-color var(--transition-fast);
}

.article-sidebar-link-all:hover {
  background-color: var(--portal-primary-light);
}

.article-sidebar-ad-widget {
  padding: 12px;
  background: var(--portal-bg-alt);
}

.article-sidebar-ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.article-sidebar-ad-link {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  text-decoration: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--portal-shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.article-sidebar-ad-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--portal-shadow-md);
}

.article-sidebar-ad-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background-color: #eef2f7;
}

.article-sidebar-ad--square .article-sidebar-ad-link {
  max-width: 300px;
}

.article-sidebar-ad--vertical .article-sidebar-ad-link {
  max-width: 300px;
}

.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--portal-primary);
  margin-bottom: 20px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background-color: var(--portal-primary-light);
  padding: 10px 18px;
  border-radius: 30px;
  transition: all var(--transition-fast);
}

.article-back-link:hover {
  transform: translateX(-3px);
  filter: brightness(0.95);
}

.article-container-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background-color: var(--portal-bg);
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--portal-shadow-md);
}

.reader-hero-img {
  width: 100%;
  max-width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.reader-body-padding {
  padding: 40px 44px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.reader-category {
  color: var(--portal-primary);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 14px;
  display: inline-block;
}

.reader-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: #1a1a2e;
  margin-bottom: 18px;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.reader-summary {
  font-size: 1.1rem;
  line-height: 1.55;
  color: #475569;
  font-weight: 500;
  margin-bottom: 28px;
  border-left: 4px solid var(--portal-accent);
  padding: 0 12px 0 18px;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.reader-author-row {
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--portal-border);
  border-bottom: 1px solid var(--portal-border);
  padding: 20px 0;
  margin-bottom: 32px;
  font-size: 0.8rem;
  color: var(--portal-text-muted);
}

.reader-author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--portal-primary-light);
  flex-shrink: 0;
}

.reader-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reader-author-name {
  font-weight: 700;
  color: var(--portal-text-main);
  font-size: 1rem;
}

.reader-author-role {
  font-size: 0.82rem;
  color: var(--portal-primary);
  font-weight: 600;
}

.reader-meta-row {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  font-size: 0.78rem;
}

.reader-article-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  line-height: 1.85;
  color: #2d3748;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

@media (max-width: 1024px) {
  .article-page-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .article-page-sidebar {
    position: static;
    order: 2;
  }

  .article-page-main-col {
    order: 1;
  }
}

@media (max-width: 768px) {
  .portal-main.article-page-main {
    padding-bottom: 96px;
    overflow-x: hidden;
  }

  .portal-main.article-page-main .article-page-container {
    width: 100%;
    max-width: 100%;
    margin: 12px 0 16px;
    padding: 0 14px;
    box-sizing: border-box;
    overflow-x: visible;
  }

  .portal-main.article-page-main .article-page-layout {
    gap: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .portal-main.article-page-main .article-page-main-col {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .portal-main.article-page-main .article-container-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 12px;
    border: 1px solid var(--portal-border);
    overflow: visible;
    box-shadow: var(--portal-shadow-sm);
  }

  .portal-main.article-page-main .reader-hero-img {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    max-height: 280px;
    border-radius: 0;
  }

  .portal-main.article-page-main .reader-body-padding {
    padding: 18px 16px 22px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: visible;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .portal-main.article-page-main .article-back-link {
    max-width: 100%;
    font-size: 0.74rem;
    padding: 10px 14px;
    margin-bottom: 14px;
    box-sizing: border-box;
  }

  .portal-main.article-page-main .reader-category {
    letter-spacing: 1.2px;
    max-width: 100%;
  }

  .article-sidebar-thumb {
    width: 68px;
    height: 51px;
  }

  .article-sidebar-item-title {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 0.84rem;
  }

  .article-sidebar-ad-widget {
    padding: 10px;
  }

  .article-sidebar-ad-link {
    max-width: 100%;
  }

  .portal-main.article-page-main .reader-title {
    font-size: 1.55rem;
    line-height: 1.25;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .portal-main.article-page-main .reader-summary {
    font-size: 1rem;
    padding: 0 12px 0 16px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .portal-main.article-page-main .reader-article-text {
    font-size: 1.05rem;
    line-height: 1.75;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }

  .portal-main.article-page-main .reader-article-text :is(p, div, li, blockquote, h1, h2, h3, h4, span, a, strong, em, u, s) {
    width: auto;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: normal;
    white-space: normal;
  }

  .portal-main.article-page-main .reader-article-text p {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .portal-main.article-page-main .reader-article-text ul,
  .portal-main.article-page-main .reader-article-text ol {
    margin: 0 0 20px 0;
    padding-left: 1.25rem;
    padding-right: 0;
  }

  .portal-main.article-page-main .reader-article-text blockquote {
    padding: 12px 14px 12px 16px;
    margin-right: 0;
    max-width: 100%;
  }

  .reader-author-row {
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 24px;
  }

  .reader-author-avatar {
    width: 52px;
    height: 52px;
  }

  .portal-main.article-page-main .reader-share-bar {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    padding-top: 18px;
  }

  .portal-main.article-page-main .whatsapp-float-btn {
    bottom: 18px;
    right: max(14px, env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 640px) {
  .article-page-sidebar {
    gap: 14px;
  }

  .article-sidebar-widget-header {
    padding: 12px 14px;
  }

  .article-sidebar-widget-title {
    font-size: 0.78rem;
  }

  .article-sidebar-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .article-sidebar-list::-webkit-scrollbar {
    display: none;
  }

  .article-sidebar-item {
    flex: 0 0 78%;
    max-width: 280px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border-bottom: none;
    border-right: 1px solid var(--portal-border);
    scroll-snap-align: start;
    min-height: 0;
  }

  .article-sidebar-item:last-child {
    border-right: none;
  }

  .article-sidebar-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .article-sidebar-item-title {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    font-size: 0.8rem;
  }

  .article-sidebar-link-all {
    padding: 14px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.reader-article-text p {
  margin: 0 0 1em;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.reader-article-text p:last-child {
  margin-bottom: 0;
}

.reader-article-text p:empty,
.reader-article-text p:has(> br:only-child) {
  display: none;
  margin: 0;
  padding: 0;
  height: 0;
}

.reader-article-text .ql-align-center {
  text-align: center;
}

.reader-article-text .ql-align-right {
  text-align: right;
}

.reader-article-text .ql-align-justify {
  text-align: justify;
}

.reader-article-text .ql-indent-1 { margin-left: 1.5em; padding-left: 0; }
.reader-article-text .ql-indent-2 { margin-left: 3em; padding-left: 0; }
.reader-article-text .ql-indent-3 { margin-left: 4.5em; padding-left: 0; }
.reader-article-text .ql-indent-4 { margin-left: 6em; padding-left: 0; }
.reader-article-text .ql-indent-5 { margin-left: 7.5em; padding-left: 0; }
.reader-article-text .ql-indent-6 { margin-left: 9em; padding-left: 0; }
.reader-article-text .ql-indent-7 { margin-left: 10.5em; padding-left: 0; }
.reader-article-text .ql-indent-8 { margin-left: 12em; padding-left: 0; }

.reader-article-text img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  border-radius: 8px;
  margin: 20px 0;
  display: block;
}

.reader-article-text iframe,
.reader-article-text .ql-video iframe,
.reader-article-text video,
.reader-article-text embed {
  max-width: 100% !important;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  margin: 20px 0;
  min-height: 0;
}

.reader-article-text table {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}

.reader-article-text pre,
.reader-article-text code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.reader-article-text .ql-video {
  max-width: 100%;
  width: 100%;
}

.reader-article-text :is(img, video, iframe, embed, table, pre, .ql-video) {
  max-width: 100%;
  box-sizing: border-box;
}

.reader-article-text h1,
.reader-article-text h2,
.reader-article-text h3 {
  font-family: var(--font-title);
  color: var(--portal-text-main);
  margin: 28px 0 14px;
  line-height: 1.3;
}

.reader-article-text blockquote {
  border-left: 4px solid var(--portal-primary);
  padding: 12px 18px;
  margin: 20px 0;
  background: var(--portal-bg-alt);
  font-style: italic;
}

.reader-article-text ul,
.reader-article-text ol {
  margin: 0 0 22px 24px;
}

.reader-article-text a {
  color: var(--portal-primary);
  text-decoration: underline;
}

.reader-share-bar {
  display: flex;
  gap: 10px;
  margin-top: 36px;
  border-top: 1px solid var(--portal-border);
  padding-top: 22px;
  align-items: center;
}

.share-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--portal-text-muted);
  text-transform: uppercase;
  margin-right: 4px;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.share-btn.fb { background-color: #3b5998; }
.share-btn.tw { background-color: #1da1f2; }
.share-btn.wa { background-color: #25d366; }
.share-btn.link-copy { background-color: #64748b; }

.share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* ================================================================
   FLOATING BUTTONS
   ================================================================ */
.whatsapp-float-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  border: none;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.whatsapp-float-btn:hover {
  color: #fff;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.45);
}

.whatsapp-float-btn i {
  font-size: 1.65rem;
  line-height: 1;
}

.back-to-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  background-color: var(--portal-primary);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--portal-shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--portal-primary-dark);
  transform: translateY(-2px);
}

/* ================================================================
   SEARCH UTILITIES
   ================================================================ */
.search-hidden-item { display: none !important; }
.search-dimmed-item {
  opacity: 0.12 !important;
  filter: blur(2px);
  pointer-events: none;
}

/* ================================================================
   THEME OVERRIDES
   ================================================================ */

/* Colors */
.theme-blue {
  --portal-primary: #004b93;
  --portal-primary-light: #e8f0fe;
  --portal-primary-dark: #003366;
  --portal-accent: #ff9f1c;
}

.theme-red {
  --portal-primary: #b91c1c;
  --portal-primary-light: #fef2f2;
  --portal-primary-dark: #7f1d1d;
  --portal-accent: #f97316;
}

.theme-green {
  --portal-primary: #047857;
  --portal-primary-light: #ecfdf5;
  --portal-primary-dark: #064e3b;
  --portal-accent: #eab308;
}

.theme-slate {
  --portal-primary: #334155;
  --portal-primary-light: #f1f5f9;
  --portal-primary-dark: #1e293b;
  --portal-accent: #06b6d4;
}

/* Font overrides */
.font-heading-outfit .portal-section-header-title,
.font-heading-outfit .news-card-title,
.font-heading-outfit .news-hero-title,
.font-heading-outfit .news-list-title,
.font-heading-outfit .opinion-author-name,
.font-heading-outfit .most-read-title,
.font-heading-outfit .newsletter-box h3,
.font-heading-outfit .reader-title {
  font-family: var(--font-title) !important;
}

.font-heading-playfair .portal-section-header-title,
.font-heading-playfair .news-card-title,
.font-heading-playfair .news-hero-title,
.font-heading-playfair .news-list-title,
.font-heading-playfair .opinion-author-name,
.font-heading-playfair .most-read-title,
.font-heading-playfair .newsletter-box h3,
.font-heading-playfair .reader-title {
  font-family: var(--font-serif) !important;
}

.font-heading-inter .portal-section-header-title,
.font-heading-inter .news-card-title,
.font-heading-inter .news-hero-title,
.font-heading-inter .news-list-title,
.font-heading-inter .opinion-author-name,
.font-heading-inter .most-read-title,
.font-heading-inter .newsletter-box h3,
.font-heading-inter .reader-title {
  font-family: var(--font-sans) !important;
}

/* ---- Dark Theme ---- */
.bg-theme-light {
  --portal-bg: #ffffff;
  --portal-bg-alt: #f7f8fc;
  --portal-text-main: #1a1a2e;
  --portal-text-muted: #64748b;
  --portal-text-light: #94a3b8;
  --portal-border: #e5e7eb;
  --portal-card-bg: #ffffff;
}

.bg-theme-dark {
  --portal-bg: #0f172a;
  --portal-bg-alt: #1e293b;
  --portal-text-main: #f1f5f9;
  --portal-text-muted: #94a3b8;
  --portal-text-light: #64748b;
  --portal-border: #334155;
  --portal-card-bg: #1e293b;
}

.bg-theme-dark .portal-topbar {
  background-color: #070b14;
}

.bg-theme-dark .portal-header {
  background-color: #0f172a;
  border-bottom-color: #1e293b;
}

.bg-theme-dark .portal-navbar {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.bg-theme-dark .breaking-ticker {
  background-color: #1e293b;
  border-bottom-color: #334155;
}

.bg-theme-dark .ticker-scroll {
  color: #e2e8f0;
}

.bg-theme-dark .search-box {
  background-color: #1e293b;
  border-color: #334155;
}

.bg-theme-dark .search-box input {
  color: #f1f5f9;
}

.bg-theme-dark .theme-toggle-btn {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.bg-theme-dark .theme-toggle-btn:hover {
  background-color: var(--portal-accent);
  border-color: var(--portal-accent);
}

.bg-theme-dark .theme-label {
  color: #94a3b8;
}

.bg-theme-dark .portal-section {
  background-color: #0f172a;
}

.bg-theme-dark .news-card {
  background-color: #1e293b;
  border-color: #334155;
}

.bg-theme-dark .news-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.bg-theme-dark .opinion-card {
  background: linear-gradient(135deg, #1e293b 0%, #1a2540 100%);
  border-color: #334155;
  border-left-color: var(--portal-primary);
}

.bg-theme-dark .opinion-quote {
  color: #cbd5e1;
}

.bg-theme-dark .opinion-quote::before {
  color: rgba(255,255,255,0.06);
}

.bg-theme-dark .markets-container {
  background-color: #1e293b;
  border-color: #334155;
}

.bg-theme-dark .market-value {
  color: #e2e8f0;
}

.bg-theme-dark .trending-bar {
  background-color: #1e293b;
  border-color: #334155;
}

.bg-theme-dark .trending-tag {
  background-color: rgba(255,255,255,0.05);
  border-color: #334155;
  color: #94a3b8;
}

.bg-theme-dark .trending-tag:hover {
  background-color: var(--portal-primary);
  color: #fff;
}

.bg-theme-dark .banner-wrapper {
  background-color: #1e293b;
  border-color: #334155;
}

.bg-theme-dark .reader-title { color: #f1f5f9; }
.bg-theme-dark .reader-summary { color: #94a3b8; }
.bg-theme-dark .reader-article-text { color: #cbd5e1; }

.bg-theme-sepia {
  --portal-bg: #faf5eb;
  --portal-bg-alt: #f4eed8;
  --portal-text-main: #433422;
  --portal-text-muted: #7c6853;
  --portal-text-light: #a8937c;
  --portal-border: #e4d7ba;
  --portal-card-bg: #faf5eb;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (min-width: 1280px) {
  :root {
    --max-width: 1560px;
    --content-padding-x: 32px;
    --grid-gap: 26px;
  }

  body#portal-body .portal-nav-link {
    padding: 10px 14px;
    font-size: 0.76rem;
    letter-spacing: 0.5px;
  }

  .news-card-img-wrapper {
    aspect-ratio: 16/10;
  }

  .news-card-title {
    font-size: 1.08rem;
  }

  .news-card-body {
    padding: 20px;
  }
}

@media (min-width: 1600px) {
  :root {
    --max-width: 1720px;
    --content-padding-x: 36px;
    --section-padding-y: 36px;
    --grid-gap: 28px;
  }

  .news-hero-img-box {
    min-height: 380px;
  }

  .highlight-left .news-card-title {
    font-size: 1.35rem;
  }
}

@media (min-width: 1920px) {
  :root {
    --max-width: 1840px;
    --content-padding-x: 40px;
  }
}

@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .news-hero-title {
    font-size: 1.4rem;
  }

  body#portal-body .portal-nav-link {
    padding: 9px 8px;
    font-size: 0.68rem;
    letter-spacing: 0.25px;
  }

  body#portal-body .navbar-search-box {
    max-width: 160px;
    width: 160px;
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  :root {
    --content-padding-x: 14px;
    --section-padding-y: 18px;
    --grid-gap: 14px;
  }

  body#portal-body .portal-topbar-inner {
    padding: 6px 12px;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    text-align: left;
  }

  .topbar-left,
  .topbar-right {
    font-size: 0.68rem;
    min-width: 0;
  }

  .topbar-left span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
    display: inline-block;
    vertical-align: bottom;
  }

  .topbar-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .topbar-weather span {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
  }

  .topbar-divider {
    display: none;
  }

  .topbar-socials {
    gap: 8px;
  }

  .topbar-socials a {
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
  }

  .portal-news-ticker {
    min-height: 36px;
  }

  .portal-news-ticker-label {
    padding: 0 10px;
    font-size: 0.62rem;
    letter-spacing: 0.4px;
  }

  .portal-news-ticker-link {
    font-size: 0.78rem;
    padding: 0 12px;
  }

  .portal-navbar {
    position: sticky;
  }

  .mobile-menu-btn,
  .mobile-search-btn {
    display: inline-flex;
  }

  body#portal-body .portal-navbar-inner {
    height: auto;
    min-height: 50px;
    padding: 4px 10px;
    flex-wrap: wrap;
    gap: 0 6px;
    align-items: center;
    position: relative;
    z-index: 101;
  }

  .portal-navbar-brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    border-right: none;
    flex: 0 0 auto;
    min-width: 0;
    justify-content: center;
    z-index: 1;
    max-width: 120px;
  }

  .portal-navbar-brand-logo,
  .portal-navbar-brand-logo--icon {
    height: 40px;
    max-height: 40px;
    max-width: 90px;
    width: auto;
  }

  .mobile-menu-btn,
  .mobile-search-btn {
    position: relative;
    z-index: 2;
  }

  .mobile-search-btn {
    margin-left: auto;
  }

  body#portal-body .portal-navbar-inner .navbar-search-box {
    display: none;
    order: 12;
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.14);
  }

  body#portal-body .portal-navbar-inner .navbar-search-box.mobile-search-open {
    display: flex;
  }

  body#portal-body .portal-navbar-inner .navbar-search-box input {
    font-size: 16px;
    width: 100%;
  }

  body#portal-body .portal-nav-shell {
    display: contents;
  }

  body#portal-body .portal-nav-overflow {
    display: none !important;
  }

  body#portal-body .portal-navbar-inner .portal-nav {
    display: none;
    order: 11;
    flex: 1 1 100%;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: min(58vh, 420px);
    background-color: var(--portal-primary-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 0 8px;
    position: relative;
    z-index: 101;
  }

  body#portal-body .portal-navbar-inner .portal-nav.mobile-open {
    display: flex;
  }

  body#portal-body .portal-nav li {
    display: block;
    width: 100%;
    white-space: normal;
    flex: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  body#portal-body .portal-nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    padding: 9px 14px;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    text-align: left;
  }

  .portal-nav li.active-nav-item::after {
    display: none;
  }

  .portal-nav li.active-nav-item .portal-nav-link {
    background-color: rgba(255, 159, 28, 0.18);
    color: #fff;
    border-left: 3px solid var(--portal-accent);
    padding-left: 11px;
  }

  .portal-mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    z-index: 100;
  }

  .portal-mobile-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body#portal-body .portal-main {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  body#portal-body .portal-section-content {
    padding: var(--section-padding-y) var(--content-padding-x);
    max-width: 100%;
  }

  .portal-section-title-wrapper {
    margin-bottom: 14px;
    padding-bottom: 8px;
  }

  .portal-section-header-title {
    font-size: 1rem;
    letter-spacing: 0.5px;
  }

  .news-hero-wrapper {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .category-hero-img-box {
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
  }

  .category-hero-title {
    font-size: 1.35rem;
  }

  .news-hero-img-box {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
  }

  .news-hero-content {
    justify-content: flex-start;
    padding: 0 2px;
  }

  .news-hero-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
  }

  .news-hero-desc {
    font-size: 0.86rem;
    margin-bottom: 12px;
  }

  .news-hero-meta {
    padding-top: 10px;
    font-size: 0.72rem;
  }

  .highlight-grid-wrapper {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .highlight-left {
    border-right: none;
    padding-right: 0;
  }

  .news-grid.grid-cols-2,
  .news-grid.grid-cols-3,
  .news-grid.grid-cols-4 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .news-card-img-wrapper {
    border-radius: 8px;
  }

  .markets-container {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .portal-main.article-page-main .article-page-container {
    margin: 10px 0 12px;
    padding: 0 12px;
  }

  .portal-main.article-page-main .reader-body-padding {
    padding: 16px 14px 20px;
  }

  .portal-main.article-page-main .reader-title {
    font-size: 1.32rem;
  }

  .portal-main.article-page-main .reader-article-text {
    font-size: 1rem;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .videos-scroll-wrap {
    border-radius: 8px;
    margin: 0 calc(var(--content-padding-x) * -0.15);
  }

  .whatsapp-float-btn {
    bottom: 18px;
    right: 14px;
    z-index: 90;
  }

  .back-to-top {
    bottom: 18px;
    left: 14px;
  }
}

@media (max-width: 480px) {
  :root {
    --content-padding-x: 12px;
    --section-padding-y: 16px;
    --grid-gap: 12px;
  }

  body#portal-body .portal-topbar-inner {
    padding: 5px 10px;
  }

  .topbar-left span {
    max-width: 38vw;
    font-size: 0.64rem;
  }

  .topbar-weather span {
    max-width: 34vw;
    font-size: 0.64rem;
  }

  .portal-news-ticker-label span {
    display: none;
  }

  body#portal-body .portal-nav-link {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.76rem;
  }

  .news-card-title,
  .news-hero-title {
    font-size: 1.08rem;
    line-height: 1.35;
  }

  .news-card-desc {
    font-size: 0.8rem;
  }

  .whatsapp-float-btn {
    width: 50px;
    height: 50px;
  }

  .whatsapp-float-btn i {
    font-size: 1.5rem;
  }
}

/* ================================================================
   SMOOTH TRANSITIONS FOR THEME SWITCHING
   ================================================================ */
body#portal-body,
.portal-topbar,
.portal-header,
.portal-section,
.news-card,
.opinion-card,
.markets-container,
.trending-bar,
.banner-wrapper,
.search-box,
.theme-toggle-btn,
.breaking-ticker,
.portal-footer {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/* Carrusel de Galería en Artículos */
.article-gallery-container {
  margin: 28px 0;
  border-radius: var(--portal-radius, 12px);
  overflow: hidden;
  border: 1px solid var(--portal-border, #e5e7eb);
  box-shadow: var(--portal-shadow-md);
  background: #0f172a;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slides {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.carousel-slides img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.carousel-slides img.active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 10;
  transition: background var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.carousel-btn:hover {
  background: var(--portal-primary, #004b93);
  transform: translateY(-50%) scale(1.08);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.carousel-btn.prev {
  left: 16px;
}

.carousel-btn.next {
  right: 16px;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.55);
  padding: 6px 12px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.carousel-dot.active {
  background: #ffffff;
  transform: scale(1.25);
  box-shadow: 0 0 8px #ffffff;
}

.carousel-dot:hover {
  background: #ffffff;
}

@media (max-width: 768px) {
  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
  .carousel-btn.prev { left: 8px; }
  .carousel-btn.next { right: 8px; }
  .carousel-dots { bottom: 10px; padding: 4px 8px; }
}

/* ================================================================
   FALLBACK BANNERS RESPONSIVE SYSTEM
   ================================================================ */
@media (max-width: 768px) {
  .banner-fallback-horizontal {
    padding: 0 10px !important;
  }
  .banner-fallback-horizontal .fallback-banner-desc,
  .banner-fallback-horizontal div[style*="text-align: right"] {
    display: none !important;
  }
}
@media (min-width: 768px) {
  .banner-fallback-horizontal .fallback-banner-desc {
    display: block !important;
  }
}

/* ================================================================
   ARTÍCULO MÓVIL — FIX DEFINITIVO (alta prioridad en cascada)
   ================================================================ */
@media (max-width: 768px) {
  body#portal-body.article-page {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }

  body#portal-body.article-page .portal-page {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }

  body#portal-body.article-page .portal-main.article-page-main {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
  }

  body#portal-body.article-page .article-page-container {
    width: 100%;
    max-width: 100%;
    margin: 12px 0 16px;
    padding-left: 14px;
    padding-right: 14px;
    box-sizing: border-box;
    overflow: visible;
  }

  body#portal-body.article-page .article-page-layout,
  body#portal-body.article-page .article-page-main-col {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body#portal-body.article-page .article-container-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: visible;
    border-radius: 12px;
  }

  body#portal-body.article-page .reader-body-padding {
    padding: 18px 16px 22px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  body#portal-body.article-page .reader-hero-img {
    width: 100%;
    max-width: 100%;
    display: block;
    border-radius: 12px 12px 0 0;
  }

  body#portal-body.article-page .reader-title {
    font-size: 1.5rem;
    line-height: 1.25;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  body#portal-body.article-page .reader-summary {
    font-size: 1rem;
    padding: 0 12px 0 14px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
  }

  body#portal-body.article-page .reader-article-text {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 1.05rem;
    line-height: 1.75;
    overflow: visible;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
  }

  body#portal-body.article-page .reader-article-text :is(p, div, li, blockquote, h1, h2, h3, h4, span, a, strong, em) {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
  }

  body#portal-body.article-page .reader-article-text p,
  body#portal-body.article-page .reader-article-text div {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  body#portal-body.article-page .reader-article-text [class*="ql-indent-"] {
    padding-left: 0;
  }

  body#portal-body.article-page .reader-article-text img,
  body#portal-body.article-page .reader-article-text video,
  body#portal-body.article-page .reader-article-text iframe {
    max-width: 100%;
    height: auto;
  }

  body#portal-body.article-page .article-page-sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  body#portal-body.article-page .reader-author-row {
    max-width: 100%;
    min-width: 0;
  }

  body#portal-body.article-page .reader-author-info {
    min-width: 0;
    flex: 1;
  }

  body#portal-body.article-page .reader-share-bar {
    max-width: 100%;
    flex-wrap: wrap;
  }

  body#portal-body.article-page .article-back-link {
    max-width: 100%;
    box-sizing: border-box;
  }

  body#portal-body.article-page .whatsapp-float-btn {
    right: 14px;
  }
}

@media (max-width: 480px) {
  body#portal-body.article-page .article-page-container {
    padding-left: 12px;
    padding-right: 12px;
  }

  body#portal-body.article-page .reader-body-padding {
    padding: 16px 14px 20px;
  }

  body#portal-body.article-page .reader-title {
    font-size: 1.32rem;
  }

  body#portal-body.article-page .reader-article-text {
    font-size: 1rem;
  }
}
