/*
Theme Name: Pantalla Viva
Theme URI: http://telelocura.com
Description: Portal de televisión y entretenimiento español — magazine layout con feeds en vivo y base de datos de series.
Version: 1.0
Author: Telelocura
Text Domain: pantalla-viva
*/

/* ============================================================
   RESET & BASE
   ============================================================ */

:root {
  --clr-main: #E91E63;
  --clr-secondary: #FFD600;
  --clr-accent: #2196F3;
  --clr-dark: #1A1A2E;
  --clr-light: #FFFFFF;
  --clr-text: #333333;
  --clr-gray: #F5F5F5;
  --clr-border: #E0E0E0;
  --clr-main-hover: #C2185B;
  --clr-accent-hover: #1976D2;
  --wrap: 1280px;
  --radius-sm: 4px;
  --ff-head: 'Poppins', sans-serif;
  --ff-body: 'Nunito', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-body);
  color: var(--clr-text);
  background: var(--clr-gray);
  line-height: 1.7;
}

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

a {
  color: var(--clr-accent);
  text-decoration: none;
  transition: color .2s ease;
}

a:hover {
  color: var(--clr-accent-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-head);
  font-weight: 700;
  line-height: 1.25;
  color: var(--clr-dark);
}

h1 { font-size: 2.2rem; margin-bottom: .6em; }
h2 { font-size: 1.6rem; margin-bottom: .5em; }
h3 { font-size: 1.25rem; margin-bottom: .4em; }

p { margin-bottom: 1em; }

ul, ol { padding-left: 1.4em; margin-bottom: 1em; }

/* ============================================================
   LAYOUT — WRAP
   ============================================================ */

.wrap {
  width: 92%;
  max-width: var(--wrap);
  margin-inline: auto;
}

/* ============================================================
   MASTHEAD (Header)
   ============================================================ */

.masthead {
  background: var(--clr-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px; padding: 0.5rem 0;
}

.brand-logo img {
  height: 48px;
  width: auto;
}

.topnav {
  display: flex;
  list-style: none;
  gap: 0.8rem; flex-wrap: nowrap; align-items: center;
  padding: 0;
  margin: 0;
}

.topnav a {
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: .85rem;
  color: var(--clr-light);
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: .35em 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}

.topnav a:hover,
.topnav .current-menu-item > a,
.topnav .current_page_item > a {
  color: var(--clr-secondary);
  border-bottom-color: var(--clr-secondary);
}

/* hamburger */
.ham-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.ham-btn span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--clr-light);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.ham-btn.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.ham-btn.is-open span:nth-child(2) { opacity: 0; }
.ham-btn.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   HERO (front-page)
   ============================================================ */

.hero-banner {
  background: linear-gradient(135deg, var(--clr-dark) 0%, #16213E 100%);
  color: var(--clr-light);
  padding: 3.5rem 0 3rem;
  text-align: center;
}

.hero-banner h1 {
  color: var(--clr-light);
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: .3em;
}

.hero-banner h1 em {
  font-style: normal;
  color: var(--clr-secondary);
}

.hero-banner p {
  font-size: 1.15rem;
  opacity: .85;
  max-width: 560px;
  margin-inline: auto;
}

.hero-search {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.hero-search input[type="search"] {
  width: 380px;
  max-width: 70vw;
  padding: .75em 1.2em;
  border: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 1rem;
  font-family: var(--ff-body);
  outline: none;
}

.hero-search button {
  padding: .75em 1.4em;
  background: var(--clr-main);
  color: var(--clr-light);
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s ease;
}

.hero-search button:hover {
  background: var(--clr-main-hover);
}

/* ============================================================
   SECTION TITLES
   ============================================================ */

.section-block {
  padding: 2.5rem 0;
}

.section-block:nth-child(even) {
  background: var(--clr-light);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  padding-bottom: .5rem;
  border-bottom: 3px solid var(--clr-main);
  display: inline-block;
}

.section-title--accent {
  border-bottom-color: var(--clr-accent);
}

.section-title--secondary {
  border-bottom-color: var(--clr-secondary);
}

/* ============================================================
   CARDS — GRID
   ============================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.entry-card {
  background: var(--clr-light);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s ease;
}

.entry-card:hover {
  border-color: var(--clr-main);
}

.entry-card__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.entry-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-card__label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--ff-head);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-light);
  background: var(--clr-main);
  padding: .25em .65em;
  border-radius: 2px;
}

.entry-card__label--series { background: var(--clr-accent); }
.entry-card__label--reality { background: #FF5722; }
.entry-card__label--celeb { background: #9C27B0; }
.entry-card__label--cine { background: #FF9800; }

.entry-card__body {
  padding: 1rem 1.1rem 1.2rem;
}

.entry-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .4em;
  line-height: 1.3;
}

.entry-card__title a {
  color: var(--clr-dark);
}

.entry-card__title a:hover {
  color: var(--clr-main);
}

.entry-card__meta {
  font-size: .82rem;
  color: #888;
  margin-bottom: .5em;
}

.entry-card__excerpt {
  font-size: .92rem;
  color: #555;
  line-height: 1.55;
}

/* featured card (big first item) */
.card-grid--featured .entry-card:first-child {
  grid-column: 1 / -1;
}

.card-grid--featured .entry-card:first-child .entry-card__thumb {
  aspect-ratio: 21/9;
}

.card-grid--featured .entry-card:first-child .entry-card__title {
  font-size: 1.4rem;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  padding: 2rem 0;
}

.content-main { min-width: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.widget-box {
  background: var(--clr-light);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
}

.widget-box__title {
  font-family: var(--ff-head);
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--clr-dark);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--clr-main);
}

/* ============================================================
   SINGLE POST
   ============================================================ */

.post-single {
  background: var(--clr-light);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  margin-bottom: 2rem;
}

.post-single__hero {
  margin: -2rem -2rem 1.5rem;
  aspect-ratio: 21/9;
  overflow: hidden;
}

.post-single__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-single__meta {
  font-size: .85rem;
  color: #888;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

.post-single__content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-single__content h2 {
  margin-top: 1.8em;
}

.post-single__content img {
  border-radius: var(--radius-sm);
  margin: 1.5em 0;
}

.post-single__tags {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--clr-border);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.post-single__tags a {
  font-size: .82rem;
  background: var(--clr-gray);
  color: var(--clr-text);
  padding: .3em .7em;
  border-radius: 2px;
  transition: background .2s ease;
}

.post-single__tags a:hover {
  background: var(--clr-main);
  color: var(--clr-light);
}

/* Author box */
.author-box {
  display: flex;
  gap: 1.2rem;
  background: var(--clr-gray);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-top: 2rem;
}

.author-box__avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
}

.author-box__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-box__name {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: .3em;
}

.author-box__bio {
  font-size: .9rem;
  color: #555;
  line-height: 1.5;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination-nav {
  display: flex;
  justify-content: center;
  gap: .4rem;
  padding: 2rem 0;
}

.pagination-nav a,
.pagination-nav span {
  display: inline-block;
  padding: .5em .9em;
  font-family: var(--ff-head);
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  transition: background .2s ease, border-color .2s ease;
}

.pagination-nav a:hover {
  background: var(--clr-main);
  border-color: var(--clr-main);
  color: var(--clr-light);
}

.pagination-nav .current {
  background: var(--clr-main);
  border-color: var(--clr-main);
  color: var(--clr-light);
}

/* ============================================================
   FOOTER — 4-column
   ============================================================ */

.colophon {
  background: var(--clr-dark);
  color: rgba(255,255,255,.7);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.colophon a {
  color: rgba(255,255,255,.85);
}

.colophon a:hover {
  color: var(--clr-secondary);
}

.colophon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.colophon-block h3 {
  font-size: .95rem;
  color: var(--clr-light);
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--clr-main);
}

.colophon-block ul {
  list-style: none;
  padding: 0;
}

.colophon-block li {
  margin-bottom: .5em;
  font-size: .88rem;
}

.colophon-bottom {
  text-align: center;
  font-size: .82rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */

.breadcrumbs {
  font-size: .82rem;
  color: #888;
  padding: .8rem 0;
}

.breadcrumbs a {
  color: #666;
}

.breadcrumbs a:hover {
  color: var(--clr-main);
}

.breadcrumbs .sep {
  margin: 0 .4em;
  color: #bbb;
}

/* ============================================================
   404 & SEARCH
   ============================================================ */

.error-404,
.search-results-header {
  text-align: center;
  padding: 4rem 0;
}

.error-404 h1 {
  font-size: 5rem;
  color: var(--clr-main);
  margin-bottom: .1em;
}

.error-404 p {
  font-size: 1.15rem;
  color: #666;
}

.search-field {
  width: 100%;
  padding: .75em 1em;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--ff-body);
  outline: none;
  transition: border-color .2s ease;
}

.search-field:focus {
  border-color: var(--clr-accent);
}

.search-submit {
  padding: .75em 1.5em;
  background: var(--clr-main);
  color: var(--clr-light);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--ff-head);
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease;
}

.search-submit:hover {
  background: var(--clr-main-hover);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  .content-area {
    grid-template-columns: 1fr;
  }

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

  .card-grid--featured .entry-card:first-child {
    grid-column: auto;
  }

  .card-grid--featured .entry-card:first-child .entry-card__thumb {
    aspect-ratio: 16/9;
  }
}

@media (max-width: 768px) {
  .topnav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--clr-dark);
    flex-direction: column;
    padding: 1rem 5%;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,.1);
  }

  .topnav.is-open {
    display: flex;
  }

  .topnav li {
    padding: .6em 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }

  .ham-btn {
    display: flex;
  }

  .hero-banner h1 {
    font-size: 1.8rem;
  }

  .post-single {
    padding: 1.2rem;
  }

  .post-single__hero {
    margin: -1.2rem -1.2rem 1.2rem;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }

  .author-box__avatar {
    margin-inline: auto;
  }
}

@media (max-width: 540px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .colophon-grid {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
}

/* ============================================================
   UTILITIES
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* ============================================================
   LIVE WIDGETS — RSS News, TV Schedule, Google Trends
   ============================================================ */

/* --- News Feed Grid --- */
.news-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.news-feed__item {
  padding: 1rem;
  border-left: 3px solid var(--clr-main);
  background: var(--clr-gray);
  border-radius: 4px;
  transition: border-color 0.2s;
}

.news-feed__item:hover {
  border-left-color: var(--clr-accent);
}

.news-feed__src {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-light);
  background: var(--clr-main);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.news-feed__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0.4rem 0;
}

.news-feed__title a {
  color: var(--clr-dark);
  text-decoration: none;
}

.news-feed__title a:hover {
  color: var(--clr-main);
}

.news-feed__date {
  font-size: 0.75rem;
  color: #999;
}

/* --- TV Schedule --- */
.tv-sched__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--clr-border);
}

.tv-sched__row:last-child {
  border-bottom: none;
}

.tv-sched__time {
  flex-shrink: 0;
  width: 55px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--clr-main);
  font-family: var(--ff-heading);
}

.tv-sched__img {
  width: 60px;
  height: 34px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.tv-sched__name {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.3;
}

.tv-sched__name strong {
  color: var(--clr-dark);
}

.tv-sched__net {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clr-accent);
  background: rgba(33,150,243,0.1);
  padding: 3px 8px;
  border-radius: 3px;
}

/* --- Google Trends --- */
.trends-list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--clr-border);
}

.trends-list__row:last-child {
  border-bottom: none;
}

.trends-list__rank {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--clr-main);
  width: 32px;
  text-align: center;
}

.trends-list__title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: capitalize;
}

.trends-list__traffic {
  font-size: 0.75rem;
  color: #999;
  font-weight: 600;
}

.trends-list__news-wrap {
  width: 100%;
  padding-left: 42px;
  font-size: 0.8rem;
  line-height: 1.3;
}

.trends-list__news {
  color: var(--clr-accent);
  text-decoration: none;
}

.trends-list__news:hover {
  text-decoration: underline;
}

.trends-list__news-src {
  color: #999;
  font-size: 0.75rem;
}

.feed-empty {
  color: #888;
  font-style: italic;
  padding: 1rem 0;
}

@media (max-width: 600px) {
  .news-feed-grid {
    grid-template-columns: 1fr;
  }
  .tv-sched__img {
    display: none;
  }
  .trends-list__news-wrap {
    padding-left: 0;
  }
}

/* --- Schedule Network Grouping --- */
.sched-network {
  margin-bottom: 1.5rem;
}

.sched-network__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-accent);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--clr-accent);
  margin-bottom: 0.5rem;
}

/* --- Page intro text --- */
.page-intro {
  font-size: 1.05rem;
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.rss-feed-section {
  margin-bottom: 1rem;
}

/* ===================== Serie Detail ===================== */
.serie-detail__hero { margin-bottom: 1.5rem; border-radius: 4px; overflow: hidden; }
.serie-detail__hero img { width: 100%; height: auto; display: block; }
.serie-detail__title { font-family: var(--ff-heading); font-size: 2rem; margin-bottom: 1rem; color: var(--clr-dark); }

.ficha-tecnica { width: 100%; border-collapse: collapse; margin-bottom: 2rem; background: #fafafa; border-radius: 4px; overflow: hidden; }
.ficha-tecnica th { text-align: left; padding: 0.6rem 1rem; font-weight: 600; width: 140px; color: var(--clr-main); background: #f0f0f0; border-bottom: 1px solid #e0e0e0; }
.ficha-tecnica td { padding: 0.6rem 1rem; border-bottom: 1px solid #e0e0e0; }

.estado-badge { display: inline-block; padding: 2px 10px; border-radius: 3px; font-size: 0.85rem; font-weight: 600; }
.estado-badge--en-emisión, .estado-badge--running { background: #c8e6c9; color: #2e7d32; }
.estado-badge--finalizada, .estado-badge--ended { background: #ffcdd2; color: #c62828; }

.serie-detail__cast { margin-bottom: 2rem; }
.serie-detail__cast h2 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--clr-main); }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; }
.cast-card { background: #f5f5f5; padding: 0.7rem 1rem; border-radius: 4px; border-left: 3px solid var(--clr-main); }
.cast-card__actor { display: block; font-weight: 600; color: var(--clr-dark); }
.cast-card__role { display: block; font-size: 0.85rem; color: #777; font-style: italic; }

.serie-detail__content { line-height: 1.75; margin-bottom: 2rem; }
.serie-detail__content h2 { font-size: 1.3rem; margin: 1.5rem 0 0.8rem; color: var(--clr-main); }
.serie-detail__content h3 { font-size: 1.1rem; margin: 1.2rem 0 0.6rem; }

/* ============================================================
   SUB-MENU DROPDOWN
   ============================================================ */

.topnav li {
  position: relative;
}

.topnav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--clr-dark);
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  z-index: 1001;
  border-top: 2px solid var(--clr-main);
}

.topnav li:hover > .sub-menu {
  display: block;
}

.topnav .sub-menu li {
  padding: 0;
}

.topnav .sub-menu a {
  display: block;
  padding: 0.5rem 1.2rem;
  font-size: 0.82rem;
  white-space: nowrap;
  border-bottom: none;
}

.topnav .sub-menu a:hover {
  background: rgba(255,255,255,.08);
}

@media (max-width: 768px) {
  .topnav .sub-menu {
    position: static;
    box-shadow: none;
    border-top: none;
    padding-left: 1rem;
    display: block;
    min-width: auto;
  }
}
