/*
Theme Name: Kenh14 Entertainment
Theme URI: https://yoursite.com
Author: Your Name
Description: A modern Vietnamese entertainment news theme inspired by Kenh14.vn. Features breaking news ticker, hero layout, category navigation, and grid article cards.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: kenh14-theme
Tags: news, entertainment, magazine, responsive
*/

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --red:        #e82323;
  --red-dark:   #c01a1a;
  --red-light:  #ff4444;
  --black:      #0d0d0d;
  --dark:       #1a1a1a;
  --gray-900:   #222222;
  --gray-800:   #333333;
  --gray-600:   #555555;
  --gray-400:   #888888;
  --gray-200:   #e0e0e0;
  --gray-100:   #f4f4f4;
  --white:      #ffffff;
  --accent:     #ff6b35;

  --font-heading: 'Oswald', 'Be Vietnam Pro', sans-serif;
  --font-body:    'Be Vietnam Pro', 'Nunito Sans', sans-serif;

  --container:  1280px;
  --gap:        16px;
  --radius:     6px;
  --shadow:     0 2px 12px rgba(0,0,0,0.12);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.18);

  --nav-h:      52px;
  --ticker-h:   36px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}
.container--wide { max-width: 1440px; }

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
  background: var(--black);
  color: var(--gray-400);
  font-size: 12px;
  padding: 6px 0;
}
.top-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar__left { display: flex; gap: 16px; align-items: center; }
.top-bar__right { display: flex; gap: 12px; align-items: center; }
.top-bar a { color: var(--gray-400); transition: color .2s; }
.top-bar a:hover { color: var(--white); }
.top-bar__date { color: var(--gray-600); }
.top-bar__social { display: flex; gap: 8px; }
.top-bar__social a {
  width: 24px; height: 24px;
  background: var(--gray-800);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: background .2s;
}
.top-bar__social a:hover { background: var(--red); color: var(--white); }

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.site-logo__mark {
  background: var(--red);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  padding: 6px 14px;
  letter-spacing: -1px;
  border-radius: 4px;
  line-height: 1;
  text-transform: uppercase;
}
.site-logo__sub {
  font-size: 11px;
  color: var(--gray-400);
  line-height: 1.3;
  display: flex;
  flex-direction: column;
}
.site-logo__sub strong { color: var(--gray-800); font-size: 13px; }

.header-search {
  display: flex;
  align-items: center;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 6px 14px;
  gap: 8px;
  flex: 0 0 260px;
}
.header-search input {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--gray-800);
  outline: none;
  width: 100%;
}
.header-search input::placeholder { color: var(--gray-400); }
.header-search__btn { color: var(--gray-400); font-size: 16px; cursor: pointer; }
.header-search__btn:hover { color: var(--red); }

.header-actions { display: flex; gap: 8px; align-items: center; }
.btn-login {
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 20px;
  transition: background .2s;
}
.btn-login:hover { background: var(--red-dark); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  background: var(--dark);
  position: sticky;
  top: 64px;
  z-index: 999;
}
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav__list::-webkit-scrollbar { display: none; }
.site-nav__item { position: relative; }
.site-nav__link {
  display: block;
  padding: 0 16px;
  height: var(--nav-h);
  line-height: var(--nav-h);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-200);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.site-nav__link:hover,
.site-nav__item.active .site-nav__link {
  color: var(--white);
  background: var(--red);
}
.site-nav__item--home .site-nav__link { color: var(--red-light); }
.site-nav__item--home .site-nav__link:hover { color: var(--white); background: var(--red); }

/* Dropdown */
.site-nav__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--white);
  border-top: 3px solid var(--red);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  border-radius: 0 0 var(--radius) var(--radius);
}
.site-nav__item:hover .site-nav__dropdown { display: block; }
.site-nav__dropdown a {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  transition: background .15s, color .15s;
}
.site-nav__dropdown a:hover { background: var(--gray-100); color: var(--red); padding-left: 24px; }

/* ============================================================
   BREAKING NEWS TICKER
   ============================================================ */
.breaking-ticker {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  height: var(--ticker-h);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.breaking-ticker__label {
  background: var(--red);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  gap: 6px;
}
.breaking-ticker__label::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--white);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.breaking-ticker__track {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.breaking-ticker__items {
  display: flex;
  gap: 60px;
  animation: ticker-scroll 35s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.breaking-ticker__items:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.breaking-ticker__item {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  transition: color .2s;
}
.breaking-ticker__item:hover { color: var(--red); }
.breaking-ticker__item::before {
  content: '▶';
  color: var(--red);
  font-size: 9px;
  margin-right: 8px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  padding: 20px 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto auto;
  gap: var(--gap);
}
.hero-main {
  grid-row: 1 / 3;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  group: true;
}
.hero-main__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform .4s ease;
}
.hero-main:hover .hero-main__img { transform: scale(1.03); }
.hero-main__overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 60px 20px 20px;
}
.hero-main__cat {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
}
.hero-main__title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.hero-main__meta { font-size: 12px; color: rgba(255,255,255,0.65); }

/* Hero side cards */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.hero-card {
  display: flex;
  gap: 12px;
  cursor: pointer;
  background: var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s;
}
.hero-card:hover { box-shadow: var(--shadow); }
.hero-card__img {
  width: 120px;
  aspect-ratio: 16/10;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform .3s;
}
.hero-card:hover .hero-card__img { transform: scale(1.05); }
.hero-card__body {
  padding: 10px 12px 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-card__cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.hero-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-card:hover .hero-card__title { color: var(--red); }
.hero-card__meta { font-size: 11px; color: var(--gray-400); margin-top: 6px; }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--red);
}
.section-header__title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-header__title::before {
  content: '';
  display: block;
  width: 4px;
  height: 22px;
  background: var(--red);
  border-radius: 2px;
}
.section-header__more {
  font-size: 13px;
  color: var(--red);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s;
}
.section-header__more:hover { gap: 8px; }

/* ============================================================
   MAIN CONTENT LAYOUT
   ============================================================ */
.content-area {
  padding: 24px 0;
}
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* ============================================================
   ARTICLE GRID
   ============================================================ */
.article-section { margin-bottom: 32px; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.article-grid--2col { grid-template-columns: repeat(2, 1fr); }
.article-grid--4col { grid-template-columns: repeat(4, 1fr); }

/* Article Card */
.article-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .25s, transform .25s;
  cursor: pointer;
}
.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.article-card__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}
.article-card__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.article-card:hover .article-card__img { transform: scale(1.06); }
.article-card__badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--red);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 3px;
}
.article-card__badge--video { background: var(--black); }
.article-card__badge--video::before {
  content: '▶ ';
  font-size: 8px;
}
.article-card__body { padding: 12px; }
.article-card__cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.article-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.article-card:hover .article-card__title { color: var(--red); }
.article-card__excerpt {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.article-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gray-400);
}
.article-card__views { display: flex; align-items: center; gap: 3px; }

/* List-style article (sidebar) */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-list-item {
  display: flex;
  gap: 10px;
  cursor: pointer;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-200);
}
.article-list-item:last-child { border-bottom: none; }
.article-list-item__img {
  width: 90px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  transition: opacity .2s;
}
.article-list-item:hover .article-list-item__img { opacity: 0.85; }
.article-list-item__body { flex: 1; }
.article-list-item__cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.article-list-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-list-item:hover .article-list-item__title { color: var(--red); }
.article-list-item__meta { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar-widget {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sidebar-widget__title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-900);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--red);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Trending numbered list */
.trending-list { display: flex; flex-direction: column; gap: 12px; }
.trending-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.trending-item__num {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: var(--gray-200);
  line-height: 1;
  width: 28px;
  flex-shrink: 0;
}
.trending-item:nth-child(-n+3) .trending-item__num { color: var(--red); }
.trending-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trending-item:hover .trending-item__title { color: var(--red); }

/* Tags widget */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  transition: all .2s;
  cursor: pointer;
}
.tag-pill:hover {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* Ad banner widget */
.ad-banner {
  background: var(--gray-100);
  border-radius: var(--radius);
  aspect-ratio: 300/250;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 12px;
  text-align: center;
  border: 1px dashed var(--gray-300);
}

/* ============================================================
   CATEGORY SECTIONS (colored headers)
   ============================================================ */
.cat-star .section-header__title::before { background: #e91e8c; }
.cat-star .section-header { border-color: #e91e8c; }
.cat-cine .section-header__title::before { background: #9c27b0; }
.cat-cine .section-header { border-color: #9c27b0; }
.cat-musik .section-header__title::before { background: #2196f3; }
.cat-musik .section-header { border-color: #2196f3; }

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--dark);
  color: var(--gray-400);
  padding: 40px 0 0;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.footer-brand__logo {
  background: var(--red);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
  margin-bottom: 16px;
}
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 34px; height: 34px;
  background: var(--gray-800);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--gray-400);
  transition: all .2s;
}
.footer-social a:hover { background: var(--red); color: var(--white); }

.footer-col__title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-800);
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col li a {
  font-size: 13px;
  color: var(--gray-400);
  transition: color .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-col li a::before {
  content: '›';
  color: var(--red);
  font-size: 16px;
  line-height: 1;
}
.footer-col li a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-600);
}
.footer-bottom a { color: var(--gray-500); }
.footer-bottom a:hover { color: var(--red); }

/* ============================================================
   MOBILE NAV TOGGLE
   ============================================================ */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: all .3s;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .article-grid--4col { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .top-bar { display: none; }
  .site-header__inner { height: 56px; }
  .header-search { flex: 0 0 180px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { display: grid; grid-template-columns: repeat(2, 1fr); }
  .hero-card__img { width: 90px; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid--4col { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .site-nav__list { display: none; }
  .site-nav__list.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--dark); z-index: 100; }
  .site-nav__link { padding: 0 20px; }
}

@media (max-width: 480px) {
  .article-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ============================================================
   WORDPRESS CORE CLASSES
   ============================================================ */
.wp-post-image { max-width: 100%; height: auto; }
.sticky { border-left: 3px solid var(--red); }
.bypostauthor { background: var(--gray-100); }
.alignleft { float: left; margin: 0 20px 10px 0; }
.alignright { float: right; margin: 0 0 10px 20px; }
.aligncenter { display: block; margin: 0 auto 10px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.entry-content { line-height: 1.8; }
.entry-content p { margin-bottom: 1em; }
.entry-content h2, .entry-content h3 { font-family: var(--font-heading); margin: 1.5em 0 .75em; }
.comments-area { background: var(--white); padding: 24px; border-radius: var(--radius); margin-top: 24px; }
.comment-form input, .comment-form textarea {
  width: 100%; border: 1px solid var(--gray-200);
  padding: 8px 12px; border-radius: 4px; font-family: var(--font-body);
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none; border-color: var(--red);
}
.pagination { display: flex; gap: 6px; justify-content: center; padding: 24px 0; }
.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 4px;
  font-size: 14px; font-weight: 600; color: var(--gray-700);
  background: var(--white); border: 1px solid var(--gray-200);
  transition: all .2s;
}
.page-numbers.current, .page-numbers:hover { background: var(--red); color: var(--white); border-color: var(--red); }
