/* ═══════════════════════════════════════════════════════════════
   NOTICIAS PORTAL — Hoja de estilos principal
═══════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --red:       #c0392b;
  --red-dark:  #96281b;
  --dark:      #1a1a1a;
  --gray:      #555;
  --gray-lt:   #f4f4f4;
  --border:    #e0e0e0;
  --white:     #fff;
  --font:      'Segoe UI', Arial, sans-serif;
  --radius:    4px;
  --shadow:    0 2px 8px rgba(0,0,0,.12);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--dark); background: #f0f0f0; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ══════════════════════════════════════
   BARRA SUPERIOR
══════════════════════════════════════ */
.top-bar { background: var(--dark); color: #aaa; font-size: .78rem; padding: 5px 0; }
.top-bar__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.top-bar__date { text-transform: capitalize; }
.top-menu { display: flex; gap: 12px; }
.top-menu a:hover { color: var(--white); }

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.site-header { background: var(--white); padding: 12px 0; border-bottom: 3px solid var(--red); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-header__title { font-size: 2rem; font-weight: 900; color: var(--red); letter-spacing: -1px; }
.site-header__logo img { max-height: 70px; width: auto; }
.site-header__banner img { max-height: 90px; border-radius: var(--radius); }

/* ══════════════════════════════════════
   TICKER ÚLTIMAS NOTICIAS
══════════════════════════════════════ */
.breaking-bar { background: var(--red); color: var(--white); padding: 7px 0; overflow: hidden; }
.breaking-bar__inner { display: flex; align-items: center; gap: 12px; }
.breaking-bar__label {
  background: var(--dark); color: var(--white);
  padding: 2px 10px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; white-space: nowrap; border-radius: 2px; flex-shrink: 0;
}
.breaking-bar__ticker { overflow: hidden; flex: 1; }
.ticker-list { display: flex; gap: 40px; animation: ticker 35s linear infinite; white-space: nowrap; }
.ticker-list li a { color: var(--white); font-size: .85rem; }
.ticker-list li a:hover { text-decoration: underline; }
@keyframes ticker {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ══════════════════════════════════════
   NAVEGACIÓN PRINCIPAL
══════════════════════════════════════ */
.main-nav { background: var(--red); }
.main-nav__inner { display: flex; align-items: center; }
.main-menu { display: flex; flex-wrap: wrap; }
.main-menu > li > a {
  display: block; padding: 12px 16px; color: var(--white);
  font-size: .9rem; font-weight: 600; text-transform: uppercase;
  transition: background .2s;
}
.main-menu > li > a:hover,
.main-menu > li.current-menu-item > a { background: var(--red-dark); }

/* Submenú */
.main-menu li { position: relative; }
.main-menu .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 100;
  background: var(--dark); min-width: 200px; border-top: 3px solid var(--red);
  box-shadow: var(--shadow);
}
.main-menu li:hover .sub-menu { display: block; }
.main-menu .sub-menu a { display: block; padding: 10px 16px; color: #ddd; font-size: .85rem; }
.main-menu .sub-menu a:hover { background: var(--red); color: var(--white); }

/* Hamburger */
.main-nav__hamburger { display: none; flex-direction: column; gap: 5px; padding: 12px; }
.main-nav__hamburger span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; }

/* ══════════════════════════════════════
   SLIDER DE PUBLICIDAD
══════════════════════════════════════ */
.ad-slider {
  position: relative; overflow: hidden;
  margin: 16px 0; border-radius: var(--radius);
  box-shadow: var(--shadow); background: #000;
  max-height: 280px;
}
.ad-slider__track { display: flex; transition: transform .5s ease; }
.ad-slide { min-width: 100%; position: relative; }
.ad-slide img { width: 100%; height: 280px; object-fit: cover; opacity: .9; }
.ad-slide__label {
  position: absolute; bottom: 12px; left: 12px;
  background: rgba(0,0,0,.65); color: #fff;
  padding: 4px 10px; border-radius: 3px; font-size: .8rem;
}
.ad-slider__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5); color: #fff;
  width: 36px; height: 36px; border-radius: 50%; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.ad-slider__btn:hover { background: var(--red); }
.ad-slider__btn--prev { left: 10px; }
.ad-slider__btn--next { right: 10px; }
.ad-slider__dots { position: absolute; bottom: 10px; right: 14px; display: flex; gap: 6px; }
.ad-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.5); cursor: pointer; transition: background .2s;
}
.ad-dot.active { background: var(--white); }

/* ══════════════════════════════════════
   LAYOUT PRINCIPAL
══════════════════════════════════════ */
.site-main { padding: 0 0 32px; }
.content-wrapper { display: grid; grid-template-columns: 1fr 300px; gap: 24px; margin-top: 20px; }
.main-content { min-width: 0; }

/* ══════════════════════════════════════
   TÍTULOS DE SECCIÓN
══════════════════════════════════════ */
.section-title {
  font-size: 1.1rem; font-weight: 800; text-transform: uppercase;
  border-left: 4px solid var(--red); padding-left: 10px;
  margin: 24px 0 14px; color: var(--dark);
}

/* ══════════════════════════════════════
   NOTICIA DESTACADA
══════════════════════════════════════ */
.featured-post { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 20px; }
.featured-post__img-wrap { display: block; position: relative; }
.featured-post__img-wrap img { width: 100%; height: 360px; object-fit: cover; }
.featured-post__cat {
  position: absolute; top: 12px; left: 12px;
  background: var(--red); color: #fff;
  padding: 3px 10px; border-radius: 3px; font-size: .75rem; font-weight: 700; text-transform: uppercase;
}
.featured-post__body { padding: 16px 20px 20px; }
.featured-post__title { font-size: 1.5rem; line-height: 1.3; margin-bottom: 8px; }
.featured-post__title a:hover { color: var(--red); }
.featured-post__excerpt { color: var(--gray); font-size: .93rem; margin-bottom: 10px; }

/* ══════════════════════════════════════
   META (fecha / autor)
══════════════════════════════════════ */
.post-meta { font-size: .78rem; color: #888; display: flex; gap: 12px; flex-wrap: wrap; }
.post-meta__date::before { content: '📅 '; }
.post-meta__author::before { content: '✍ '; }

/* ══════════════════════════════════════
   GRID DE NOTICIAS
══════════════════════════════════════ */
.news-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px;
}
.news-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s; }
.news-card:hover { transform: translateY(-3px); }
.news-card__img-wrap { display: block; position: relative; overflow: hidden; aspect-ratio: 16/9; }
.news-card__img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.news-card:hover .news-card__img-wrap img { transform: scale(1.04); }
.news-card__no-img { background: var(--gray-lt); height: 100%; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 2rem; }
.news-card__no-img::after { content: '📰'; }
.news-card__cat {
  position: absolute; bottom: 6px; left: 6px;
  color: #fff; padding: 2px 8px; border-radius: 2px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
}
.news-card__body { padding: 10px 12px 12px; }
.news-card__title { font-size: .88rem; line-height: 1.4; margin-bottom: 5px; }
.news-card__title a:hover { color: var(--red); }
.news-card__date { font-size: .72rem; color: #999; }

/* ══════════════════════════════════════
   SECCIÓN POR CATEGORÍA
══════════════════════════════════════ */
.category-section { margin-bottom: 28px; }
.category-section__header { display: flex; align-items: center; justify-content: space-between; }
.see-more { font-size: .8rem; color: var(--red); font-weight: 600; }
.see-more:hover { text-decoration: underline; }
.category-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.widget-title {
  background: var(--red); color: var(--white);
  padding: 8px 14px; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px;
}

/* Últimas noticias sidebar */
.sidebar-post { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sidebar-post:last-child { border-bottom: none; }
.sidebar-post__img { width: 70px; height: 50px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.sidebar-post__body { flex: 1; min-width: 0; }
.sidebar-post__title { font-size: .8rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sidebar-post__title:hover { color: var(--red); }
.sidebar-post__date { font-size: .7rem; color: #999; display: block; margin-top: 3px; }

/* Lista de categorías */
.cat-list { padding: 8px 0; }
.cat-list__item { display: flex; justify-content: space-between; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--border); }
.cat-list__item:last-child { border-bottom: none; }
.cat-list__item a { font-size: .85rem; font-weight: 500; }
.cat-list__item a:hover { color: var(--red); }
.cat-list__count { background: var(--gray-lt); color: var(--gray); font-size: .72rem; padding: 1px 7px; border-radius: 10px; }

/* ══════════════════════════════════════
   NOTICIA INDIVIDUAL
══════════════════════════════════════ */
.single-post { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.single-post__meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.single-post__cat { background: var(--red); color: #fff; padding: 2px 10px; border-radius: 3px; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.single-post__date, .single-post__author { font-size: .8rem; color: #888; }
.single-post__title { font-size: 1.8rem; line-height: 1.3; margin-bottom: 14px; }
.single-post__featured { margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; }
.single-post__featured img { width: 100%; max-height: 480px; object-fit: cover; }
.single-post__content { font-size: 1rem; line-height: 1.8; color: #333; }
.single-post__content p { margin-bottom: 14px; }
.single-post__content h2, .single-post__content h3 { margin: 20px 0 8px; }
.single-post__content img { border-radius: var(--radius); margin: 14px 0; }

/* Compartir */
.share-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; font-size: .85rem; font-weight: 600; }
.share-btn { padding: 5px 14px; border-radius: 3px; color: #fff; font-size: .8rem; font-weight: 600; }
.share-btn--fb { background: #1877f2; }
.share-btn--tw { background: #000; }
.share-btn--wa { background: #25d366; }
.share-btn:hover { opacity: .85; }

/* Tags */
.single-post__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.tag-pill { background: var(--gray-lt); color: var(--gray); padding: 4px 12px; border-radius: 20px; font-size: .78rem; }
.tag-pill:hover { background: var(--red); color: #fff; }

/* Nav anterior/siguiente */
.post-nav { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; }
.post-nav__btn { background: var(--gray-lt); padding: 8px 16px; border-radius: var(--radius); font-size: .82rem; font-weight: 600; max-width: 48%; }
.post-nav__btn:hover { background: var(--red); color: #fff; }
.post-nav__btn--next { margin-left: auto; }

/* Noticias relacionadas */
.related-posts { margin-top: 8px; }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer { background: var(--dark); color: #aaa; margin-top: 32px; padding: 32px 0 0; }
.footer-widgets { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; padding-bottom: 32px; }
.footer-col .widget-title { background: transparent; color: var(--white); padding: 0 0 8px; border-bottom: 2px solid var(--red); margin-bottom: 12px; }
.footer-col .widget { background: transparent; box-shadow: none; }
.footer-col a { color: #bbb; font-size: .85rem; display: block; padding: 3px 0; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid #333; padding: 16px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; flex-wrap: wrap; gap: 8px;
}
.footer-menu { display: flex; gap: 16px; }
.footer-menu a:hover { color: var(--white); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 992px) {
  .content-wrapper { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2,1fr); }
  .news-grid { grid-template-columns: repeat(2,1fr); }
  .category-grid { grid-template-columns: repeat(2,1fr); }
  .footer-widgets { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 640px) {
  .site-header__banner { display: none; }
  .main-nav__hamburger { display: flex; }
  .main-menu { display: none; flex-direction: column; width: 100%; }
  .main-menu.open { display: flex; }
  .main-menu > li > a { padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .main-menu .sub-menu { position: static; border-top: none; }
  .news-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2,1fr); }
  .sidebar { grid-template-columns: 1fr; }
  .footer-widgets { grid-template-columns: 1fr; }
  .featured-post__img-wrap img { height: 220px; }
  .ad-slider { max-height: 180px; }
  .ad-slide img { height: 180px; }
  .single-post__title { font-size: 1.4rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ══════════════════════════════════════
   UTILITIES
══════════════════════════════════════ */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
