:root {
  --brand: #4200ff;
  --brand-soft: #eef0ff;
  --bg: #f5f6fb;
  --panel: #ffffff;
  --border: #d7d9e8;
  --text: #22253a;
  --muted: #6b6f82;
  --radius: 14px;
  --shadow-soft: 0 10px 30px rgba(15, 32, 86, 0.08);
}

/* Color de selección global (texto marcado con el ratón) */
::selection {
  background: #c7b0ff; /* Lila suave acorde al estilo DCM */
  color: #000000;      /* Texto en negro para buen contraste */
}

::-moz-selection {
  background: #c7b0ff;
  color: #000000;
}


/* -------------------------------------------------
   RESET BÁSICO
-------------------------------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Imágenes genéricas: nunca romper layout */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Enlaces base (luego se ajustan en nav y tarjetas) */
a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Utilidad */
.text-muted {
  color: var(--muted);
}

/* -------------------------------------------------
   HEADER / TOPBAR (según header.html / login / nova)
-------------------------------------------------- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 246, 251, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(215, 217, 232, 0.8);
}

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Marca */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: conic-gradient(
    from 210deg,
    #4200ff,
    #7b5bff,
    #f27cfc,
    #ffcf74,
    #ffa24b,
    #ff5c88,
    #4200ff
  );
  box-shadow: 0 6px 18px rgba(66, 0, 255, 0.35);
}

.brand span {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* NAV principal */
.topbar nav {
  margin-left: 32px;
  display: flex;
  gap: 8px;
  flex: 1;
}

.topbar nav a {
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
}

.topbar nav a:hover {
  background: rgba(66, 0, 255, 0.06);
  color: #322c86;
}

.topbar nav a.active {
  background: #ffffff;
  color: #22129a;
  border-color: rgba(66, 0, 255, 0.16);
  font-weight: 600;
}

/* Acciones de usuario (header.html y nova.html) */
.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.user-auth-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

#user-logged-in {
  display: none;
}

.user-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f5f6ff;
  border: 1px solid var(--border);
  color: var(--text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-actions a.user-link {
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(66, 0, 255, 0.3);
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 500;
}

.user-actions a.user-link:hover {
  filter: brightness(1.03);
}

.user-actions button.user-logout {
  border: none;
  background: none;
  padding: 0 4px;
  color: #c0392b;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Botón menú móvil */
.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 6px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #333;
  border-radius: 999px;
  margin: 2px 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Responsive header */
@media (max-width: 768px) {
  .topbar {
    align-items: center;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar nav {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    margin-top: 6px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 8px;
    flex-direction: column;
    display: none;
    z-index: 20;
  }

  .topbar nav.nav-open {
    display: flex;
  }

  .topbar nav a {
    padding: 6px 8px;
    border-radius: 8px;
  }

  .topbar nav a.active {
    background: #eef0ff;
  }

  .user-actions {
    margin-left: auto;
  }
}

/* -------------------------------------------------
   MAIN + FOOTER
-------------------------------------------------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.hero-note,
.hero-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 1180px;
  margin: 10px auto 18px;
  padding: 0 16px;
}

footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px 24px;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-sub {
  font-size: 0.85rem;
  margin-top: 4px;
}

/* -------------------------------------------------
   PORTADA – GRID
-------------------------------------------------- */

/* Contenedor de noticias en index.html */
#articles {
  margin-top: 4px;
}

/* Neutralizamos el grid heredado en el SECTION para evitar la "columna fantasma"
   y dejamos que herede el ancho/padding de <main> */
#articles.articles-grid {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Grid real para la portada (wrapper que inyecta app.js) */
.articles-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: flex-start;
}

.articles-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.articles-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.articles-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.articles-side-title {
  margin: 0 0 6px;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* Estado vacío */
.empty-note {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 10px 0;
}

/* -------------------------------------------------
   TARJETAS DE NOTICIA
-------------------------------------------------- */

/* Raíz de la tarjeta (a.article-card o article.article-card) */
.article-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid rgba(215, 217, 232, 0.96);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    border-color 0.12s ease;
  overflow: hidden; /* asegura que la imagen respeta el border-radius */
  position: relative;
}

/* Muy importante: el enlace raíz NO es azul ni subrayado */
a.article-card {
  color: inherit;
  text-decoration: none;
}

a.article-card:hover {
  text-decoration: none;
}

/* Hover general */
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(15, 32, 86, 0.16);
  border-color: rgba(66, 0, 255, 0.35);
}

/* Imagen en portada (article-card-image + img)
   - sangrado completo hasta el borde horizontal
   - algo más alta
   - recorte desde la parte superior */
.article-card-image {
  position: relative;
  margin: 0 0 10px;
  width: calc(100% + 32px);      /* 16px + 16px de padding horizontal */
  left: -16px;
  top: -14px;
  height: 230px;
  background-color: #dde0ea;
  overflow: hidden;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;   /* recorte desde arriba */
  display: block;
}

/* Variantes */
.article-card--featured .article-card-image {
  height: 280px;
}

.article-card--small .article-card-image {
  height: 130px;
}

/* Contenido de la card */
.article-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Kicker / ubicación */
.article-card-kicker,
.article-location {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* Títulos y resúmenes – limpios, sin azul ni subrayado */
.article-title,
.article-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  color: #181a29;
}

.article-summary,
.article-card-summary {
  font-size: 0.88rem;
  color: #3c3f53;
  margin: 0;
}

/* Meta + puntuación */
.article-meta,
.article-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.article-meta .author-link {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.article-meta .author-link:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.article-score,
.article-card-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Iconos Font Awesome integrados en tarjetas y detalle */
.article-card-kicker i,
.article-card-score i,
.article-card-meta i,
.article-detail-meta i,
.like-button i {
  margin-right: 4px;
  font-size: 0.9em;
}

.like-button i {
  font-size: 1rem;
}

.like-button.liked i {
  color: var(--brand);
}


/* Tarjeta destacada en portada */
.article-card--featured {
  padding: 18px 20px 20px;
}

.article-card--featured .article-card-body {
  gap: 8px;
}

.article-card--featured .article-card-title {
  font-size: 1.2rem;
}

.article-card--featured .article-card-summary {
  font-size: 0.92rem;
}

/* Tarjetas pequeñas (columna lateral) */
.article-card--small {
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 32, 86, 0.06);
  padding: 12px 13px 13px;
}

/* Miniaturas en el perfil (auth.js → .thumb) */
.article-card .thumb {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 8px;
}

/* Cuerpo interno en el perfil (auth.js utiliza .body, .summary, etc.) */
.article-card .body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.article-card .summary {
  font-size: 0.88rem;
  color: #3c3f53;
  margin: 0;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Pills de estado en perfil */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f7f8ff;
  color: var(--muted);
  font-size: 0.75rem;
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #27ae60;
}

/* Controles de portada en perfil (.feature-controls, .btn-feature) */
.feature-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.btn-feature {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-feature.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

/* -------------------------------------------------
   DETALLE DE NOTICIA
-------------------------------------------------- */

.article-detail {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px 24px;
}

.article-detail-head,
.article-detail-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.article-detail-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.article-detail-title {
  font-size: 1.6rem;
  margin: 0;
  color: #161727;
}

.article-detail-summary {
  font-size: 0.98rem;
  margin: 10px 0 14px;
  color: #3c3f53;
}

/* Imagen principal (se pinta como background en noticia.js) */
.article-detail-image {
  margin: 8px 0 20px;
  border-radius: 18px;
  overflow: hidden;
  background: #e2e4f1;
  height: clamp(220px, 45vh, 420px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Cuerpo */
.article-detail-body {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #22253a;
  white-space: pre-wrap;
}

/* Botones sociales */
.article-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  font-size: 0.82rem;
}

.like-button,
.share-buttons button,
.btn-like,
.btn-share {
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.like-button:hover,
.share-buttons button:hover {
  border-color: #322c86;
  color: #322c86;
}

/* Botones compactos para vistas / comentarios en las tarjetas */
.article-meta-button {
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}

.article-meta-button i {
  font-size: 0.9em;
}

.like-button.liked {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

/* -------------------------------------------------
   COMENTARIOS EN DETALLE
-------------------------------------------------- */

.comments-section {
  margin-top: 20px;
  padding: 18px 20px 22px;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.comments-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.comments-login-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.comments-login-hint a {
  color: var(--brand);
  font-weight: 500;
  text-decoration: none;
}

.comments-login-hint a:hover {
  text-decoration: underline;
}

.comment-form {
  margin-bottom: 12px;
}

.comment-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.comment-form textarea:focus {
  outline: none;
  border-color: rgba(66, 0, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(66, 0, 255, 0.25);
}

.comment-form-actions {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-form-actions button[type="submit"] {
  border-radius: 999px;
  padding: 7px 14px;
  border: none;
  background: #322c86;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.comment-form-actions button[type="submit"]:hover {
  filter: brightness(1.05);
}

.comment-form-message {
  font-size: 0.8rem;
  color: var(--muted);
}

.comment-form-message.error {
  color: #c0392b;
}

.comments-empty {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}

.comments-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(215, 217, 232, 0.7);
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.comment-author {
  font-weight: 600;
}

.comment-body {
  font-size: 0.9rem;
  color: #22253a;
}

.comment-status {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #8e44ad;
}

.comment-body--deleted {
  color: var(--muted);
  font-style: italic;
}

.comment-actions {
  margin-top: 4px;
}

.comment-actions .comment-delete {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f5f6fb;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: #c0392b;
}

.comment-actions .comment-delete:hover {
  border-color: #c0392b;
  background: #fff5f5;
}

/* -------------------------------------------------
   NOVA NOTÍCIA – parte común
   (el resto se complementa con el <style> de nova.html)
-------------------------------------------------- */

.form-card {
  max-width: 760px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  padding: 18px 20px 24px;
}

.form-card h1 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.form-card p.subtitle {
  margin: 0 0 16px;
  font-size: 0.87rem;
  color: var(--muted);
}

.form-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Botones suaves reutilizables */
.btn-soft {
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: #f5f6fb;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-soft:hover {
  border-color: #322c86;
}

/* -------------------------------------------------
   PERFIL
-------------------------------------------------- */

.profile-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.profile-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.profile-meta,
.profile-header .meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.profile-articles {
  margin-top: 10px;
}

/* La grid del perfil reutiliza .articles-grid sin columna fantasma */
.profile-articles .articles-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.7fr);
  gap: 24px;                 /* más separación entre cards */
  padding: 8px 6px 24px;     /* aire alrededor de la grid */
}

/* Tarjetas del perfil: más padding interior para que respiren */
.profile-articles .article-card {
  padding: 20px 22px 22px;
}

/* Fila de controles de portada dentro del perfil */
.profile-article-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.profile-article-footer-label {
  font-weight: 500;
}

.featured-toggle-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.featured-toggle-button {
  border: 1px solid var(--border);
  background: #f5f6ff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text);
}

.featured-toggle-button.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.featured-toggle-button:disabled {
  opacity: 0.6;
  cursor: default;
}


/* -------------------------------------------------
   LOGIN / REGISTER
-------------------------------------------------- */

.auth-layout {
  max-width: 880px;
  margin: 24px auto 32px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.auth-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px 22px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.auth-card p.subtitle {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-card label {
  font-size: 0.82rem;
  color: var(--muted);
}

.auth-card input {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 0.9rem;
  background: #fbfbff;
}

.auth-card input:focus {
  outline: none;
  border-color: rgba(66, 0, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(66, 0, 255, 0.25);
}

.auth-card button[type="submit"] {
  margin-top: 4px;
  border-radius: 999px;
  padding: 9px 16px;
  border: none;
  background: #322c86;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(50, 44, 134, 0.35);
}

.auth-card button[type="submit"]:hover {
  filter: brightness(1.06);
}

.auth-message {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.1em;
}

.auth-message.error {
  color: #c0392b;
}

.auth-message.success {
  color: #1e8449;
}

/* -------------------------------------------------
   RESPONSIVE GENERAL
-------------------------------------------------- */

@media (max-width: 960px) {
  /* Portada: 1 columna */
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .profile-articles .articles-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  main {
    padding: 12px 16px 24px;
  }
}

/* Widget meteo a la columna lateral */
.article-card--meteo {
  background: linear-gradient(135deg, var(--brand-soft), #ffffff);
}

.meteo-card-body {
  padding: 12px 14px;
}

.meteo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.meteo-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
}

.meteo-title i {
  font-size: 0.9rem;
}

.meteo-updated {
  white-space: nowrap;
}

.meteo-main {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 6px 0;
}

.meteo-temp-now {
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
}

.meteo-details {
  font-size: 0.85rem;
  color: var(--muted);
}

.meteo-footer {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.meteo-footer i {
  margin-right: 4px;
}

/* -------------------------------------------------
   PÀGINA METEO COMPLETA
-------------------------------------------------- */

.page-wrapper {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px 28px;
}

.page-wrapper--meteo {
  padding-top: 8px;
}

/* El hero ocupa todo el ancho del wrapper */
.page-hero {
  margin: 0 0 16px;
  padding: 18px 18px 12px;
}

.page-hero--meteo {
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), #ffffff);
  box-shadow: var(--shadow-soft);
}

.page-hero-content h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.page-hero-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Justo debajo del hero, grid 2 columnes que comparte el mateix ample */
.page-layout--meteo {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-bottom: 8px;
}

.meteo-page-main {
  min-width: 0;
}

.meteo-page-side {
  min-width: 0;
}

.meteo-side-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
  color: var(--text);
}

.meteo-side-card h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.meteo-side-card ul {
  padding-left: 18px;
  margin: 6px 0 10px;
  font-size: 0.86rem;
}

.meteo-side-note {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Grid de targetes de meteo (pàgina) */
.meteo-page-grid {
  margin-top: 14px;
  display: grid;
  /* Tarjetes una mica més amples per evitar textos tallats */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  column-gap: 16px;
  row-gap: 18px;
}

.meteo-page-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.meteo-page-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  /* Permet que el text "Actualitzat..." baixi a una segona línia si no cap */
  flex-wrap: wrap;
  row-gap: 2px;
}

.meteo-page-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.meteo-page-card-title i {
  font-size: 0.9rem;
}

.meteo-page-card-updated {
  white-space: nowrap;
}

.meteo-page-card-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.meteo-page-card-temp {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.meteo-page-card-desc {
  font-size: 0.88rem;
  color: var(--muted);
}

.meteo-page-card-extra {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .page-layout--meteo {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------
   OVERRIDES TARJETAS PORTADA (IMAGEN A SANGRE)
   (no se borra nada, sólo se sobreescribe)
-------------------------------------------------- */

.article-card {
  padding: 0;              /* sin padding en el contenedor */
  gap: 0;                  /* la separación la da el body */
}

/* La imagen ocupa todo el ancho del card, sin hacks de width calc */
.article-card-image {
  margin: 0;
  width: 100%;
  left: 0;
  top: 0;
  height: 230px;
  background-color: #dde0ea;
  overflow: hidden;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* El contenido recibe ahora el padding que antes tenía el card */
.article-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}

/* Destacada: sin padding en el contenedor, sólo en el body */
.article-card--featured {
  padding: 0;
}

.article-card--featured .article-card-body {
  padding: 18px 20px 20px;
  gap: 8px;
}

/* Columna lateral: igual, padding en el body */
.article-card--small {
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 32, 86, 0.06);
  padding: 0;
}

.article-card--small .article-card-body {
  padding: 12px 13px 13px;
}

/* -------------------------------------------------
   NOTÍCIES RELACIONADES (detall de notícia)
-------------------------------------------------- */

.related-section {
  margin-top: 20px;
}

.related-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 768px) {
  .related-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* -------------------------------------------------
   PUBLICITAT – banners slideshow
-------------------------------------------------- */

.dcm-ad-banner {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: #eef0ff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
  position: relative;
}

.dcm-ad-banner img {
  width: 100%;
  height: auto;
  display: block;
}

.dcm-ad-mid {
  margin: 16px 0;
}

/* -------------------------------------------------
   MURO D'ACTIVITAT (sota l'anunci "mid")
-------------------------------------------------- */

.activity-wall-card {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid rgba(215, 217, 232, 0.96);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px 16px;
  margin-top: 8px;
}

.activity-wall-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.activity-wall-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-wall-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.activity-wall-text {
  flex: 1;
  min-width: 0;
}

.activity-wall-user {
  font-weight: 600;
  color: var(--text);
}

.activity-wall-article {
  font-weight: 500;
  text-decoration: none;
  color: var(--brand);
}

.activity-wall-article:hover {
  text-decoration: underline;
}

.activity-wall-time {
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.activity-wall-footer {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.activity-wall-more-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 5px 12px;
  font-size: 0.78rem;
  cursor: pointer;
}

.activity-wall-more-btn:hover {
  filter: brightness(1.03);
}

/* -------------------------------------------------
   CONTROLES DE ADMIN EN TARJETAS DE PORTADA
-------------------------------------------------- */

.article-card-admin-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.article-card-admin-delete-wrapper {
  display: flex;
  justify-content: flex-end;
}

.article-card-delete {
  border-radius: 999px;
  border: 1px solid #f2b2b2;
  background: #fff5f5;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: #c0392b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-card-delete:hover {
  background: #ffe9e9;
  border-color: #e57373;
}
