/* ========================================
   RCTV19 - Ripley Community Television
   Premium Modern News Layout
   ======================================== */

/* CSS Custom Properties (Design Tokens) */
:root {
  /* Brand Colors */
  --rctv-blue: #203090;
  --rctv-blue-dark: #1a2570;
  --rctv-blue-light: #2d40a8;
  --rctv-yellow: #F0D000;
  --rctv-yellow-dark: #d4b800;
  --rctv-yellow-light: #fff033;
  --white: #FFFFFF;
  --black: #111111;

  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-headline: "Georgia", "Times New Roman", serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --container-max: 1200px;
  --sidebar-width: 320px;
  --header-height: 140px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--rctv-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--rctv-blue-dark);
}

/* Focus Styles for Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--rctv-yellow);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--rctv-blue);
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--rctv-blue);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-lg);
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo img {
  height: 120px;
  width: auto;
}

@media (min-width: 768px) {
  .site-logo img {
    height: 180px;
    width: auto;
  }

  :root {
    --header-height: 200px;
  }
}

/* Desktop Navigation */
.main-nav {
  display: none;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
}

.nav-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-weight: 500;
  color: var(--gray-700);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: var(--gray-100);
  color: var(--rctv-blue);
}

.nav-link.highlight {
  background: var(--rctv-yellow);
  color: var(--rctv-blue);
  font-weight: 700;
  padding: var(--space-sm) var(--space-lg);
}

.nav-link.highlight:hover {
  background: var(--rctv-yellow-dark);
  transform: translateY(-1px);
}

/* Hamburger Menu */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--rctv-blue);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  padding: var(--space-lg);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
  z-index: 99;
}

.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mobile-nav-link {
  display: block;
  padding: var(--space-md);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--gray-700);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
  background: var(--gray-100);
}

.mobile-nav-link.highlight {
  background: var(--rctv-yellow);
  color: var(--rctv-blue);
  font-weight: 700;
  text-align: center;
  margin-top: var(--space-md);
}

/* Desktop breakpoint */
@media (min-width: 768px) {
  .main-nav {
    display: block;
  }

  .menu-toggle,
  .mobile-nav {
    display: none;
  }
}

/* ========================================
   MAIN CONTENT LAYOUT
   ======================================== */

.site-main {
  flex: 1;
  padding: var(--space-xl) 0;
}

.content-wrapper {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr var(--sidebar-width);
  }
}

/* ========================================
   SECTION HEADERS
   ======================================== */

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 3px solid var(--rctv-blue);
}

.section-title {
  font-family: var(--font-headline);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--rctv-blue);
  margin: 0;
}

.section-link {
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rctv-blue);
}

/* ========================================
   TOP STORIES GRID
   ======================================== */

.top-stories-grid {
  display: grid;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 640px) {
  .top-stories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .top-stories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   POST CARDS
   ======================================== */

.post-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.post-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--gray-200);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

.post-card-content {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-date {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.post-card-title {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-900);
  margin-bottom: var(--space-sm);
}

.post-card-title a {
  color: inherit;
}

.post-card-title a:hover {
  color: var(--rctv-blue);
}

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.5;
  flex: 1;
}

/* List Style Post Card */
.post-card--list {
  flex-direction: row;
  gap: var(--space-md);
}

.post-card--list .post-card-image {
  width: 120px;
  flex-shrink: 0;
  aspect-ratio: 1;
}

@media (min-width: 640px) {
  .post-card--list .post-card-image {
    width: 180px;
    aspect-ratio: 16 / 9;
  }
}

.post-card--list .post-card-content {
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
}

/* ========================================
   WATCH LIVE BADGE
   ======================================== */

.watch-live-section {
  text-align: center;
  padding: var(--space-2xl) 0;
  margin: var(--space-xl) 0;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--white) 100%);
  border-radius: var(--radius-xl);
}

.watch-live-badge {
  display: inline-block;
  max-width: 500px;
  width: 100%;
  transition: transform var(--transition-base);
}

.watch-live-badge:hover {
  transform: scale(1.03);
}

.watch-live-badge img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(32, 48, 144, 0.3));
}

.watch-live-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

/* ========================================
   LATEST UPDATES LIST
   ======================================== */

.latest-updates {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.load-more {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: var(--space-xl) auto 0;
  padding: var(--space-md) var(--space-xl);
  background: var(--rctv-blue);
  color: var(--white);
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.load-more:hover {
  background: var(--rctv-blue-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
}

.sidebar-widget {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.sidebar-widget-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--gray-200);
}

/* ========================================
   AD SLOTS
   ======================================== */

.ad-slot {
  position: relative;
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
}

.top-ad-wrapper {
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.ad-slot--banner {
  padding: 0;
  margin-bottom: var(--space-lg);
  width: 100%;
  height: auto;
  display: block;
  border: none;
  background: transparent;
}

.ad-slot--banner img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 350px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
}

.ad-slot--rectangle {
  width: 300px;
  height: 250px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-label {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  font-size: 0.625rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--white);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.ad-slot img {
  max-width: 100%;
  height: auto;
}

.ad-slot-placeholder {
  padding: var(--space-lg);
  color: var(--gray-400);
  font-size: 0.875rem;
}

/* Mobile In-Feed Ads */
.mobile-ad {
  display: block;
  margin: var(--space-lg) 0;
}

@media (min-width: 1024px) {
  .mobile-ad {
    display: none;
  }
}

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

.post-header {
  margin-bottom: var(--space-xl);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: var(--space-md);
}

.post-title {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .post-title {
    font-size: 2.5rem;
  }
}

.post-featured-image {
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.post-featured-image img {
  width: 100%;
  height: auto;
}

.post-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--gray-700);
}

.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-headline);
  color: var(--gray-900);
  margin: var(--space-xl) 0 var(--space-md);
}

.post-content h2 {
  font-size: 1.75rem;
}

.post-content h3 {
  font-size: 1.5rem;
}

.post-content p {
  margin-bottom: var(--space-lg);
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

.post-content li {
  margin-bottom: var(--space-sm);
}

.post-content blockquote {
  border-left: 4px solid var(--rctv-yellow);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--gray-600);
}

.post-content a {
  color: var(--rctv-blue);
  text-decoration: underline;
}

/* ========================================
   SHARE LINKS
   ======================================== */

.share-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  margin: var(--space-xl) 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.share-label {
  font-weight: 600;
  color: var(--gray-700);
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
  transition: all var(--transition-fast);
}

.share-button:hover {
  background: var(--rctv-blue);
  color: var(--white);
}

.share-button svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   RELATED POSTS
   ======================================== */

.related-posts {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 3px solid var(--gray-200);
}

.related-posts-grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .related-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--white);
  border: 2px solid var(--rctv-blue);
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--rctv-blue);
  transition: all var(--transition-fast);
}

.pagination-link:hover {
  background: var(--rctv-blue);
  color: var(--white);
}

.pagination-current {
  font-weight: 600;
  color: var(--gray-600);
}

/* ========================================
   PAGE CONTENT
   ======================================== */

.page-header {
  text-align: center;
  padding: var(--space-2xl) 0;
  margin-bottom: var(--space-xl);
  background: linear-gradient(135deg, var(--rctv-blue) 0%, var(--rctv-blue-light) 100%);
  color: var(--white);
  border-radius: var(--radius-xl);
}

.page-title {
  font-family: var(--font-headline);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.page-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
}

.page-content {
  background: var(--white);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.page-content h2 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  color: var(--rctv-blue);
  margin: var(--space-xl) 0 var(--space-md);
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content p {
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.page-content ul,
.page-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.page-content li {
  margin-bottom: var(--space-sm);
}

/* ========================================
   WATCH LIVE PAGE
   ======================================== */

.watch-live-container {
  text-align: center;
}

.video-embed {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: var(--space-xl) auto;
  aspect-ratio: 16 / 9;
  background: var(--gray-900);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

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

.video-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--space-xl);
  color: var(--gray-400);
}

.video-fallback-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.direct-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-xl);
  background: var(--rctv-yellow);
  color: var(--rctv-blue);
  font-weight: 700;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.direct-link:hover {
  background: var(--rctv-yellow-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   CONTACT FORM
   ======================================== */

.contact-info {
  display: grid;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (min-width: 640px) {
  .contact-info {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-card {
  padding: var(--space-lg);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  text-align: center;
}

.contact-card-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.contact-card-title {
  font-weight: 600;
  color: var(--rctv-blue);
  margin-bottom: var(--space-xs);
}

.contact-card-value {
  color: var(--gray-600);
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-2xl) 0;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-large-logo img {
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
  display: block;
  max-width: 100%;
}

.footer-description {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--gray-400);
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  margin-bottom: var(--space-md);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-links a {
  color: var(--gray-400);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--rctv-yellow);
}

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gray-700);
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-500);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

/* ========================================
   BLOG INDEX PAGE
   ======================================== */

.blog-grid {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 640px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}