/* =====================================================
   RADYO KAISAHAN 107.7 FM — MOBILE RESPONSIVE FIXES
   Add this file AFTER style.css:
   <link rel="stylesheet" href="css/mobile-fix.css">
   ===================================================== */

/* ── Base: ensure viewport meta is respected ──────── */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  width: 100%;
}

/* ── Container: safe padding on all screen sizes ───── */
.container {
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

/* =====================================================
   HEADER FIXES
   ===================================================== */

/* Reduce header side padding on smaller screens */
@media (max-width: 1024px) {
  .header .container {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 14px 0;
  }

  .header .container {
    padding: 0 16px;
    gap: 0;
  }

  .logo img {
    width: 48px;
    height: 48px;
  }

  .logo-text {
    font-size: 17px;
  }

  /* Hamburger always visible on mobile */
  .hamburger {
    display: flex;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* Slide-in nav drawer */
  .nav {
    position: fixed;
    top: 78px;  /* matches reduced header height */
    right: -100%;
    width: 260px;
    height: calc(100vh - 78px);
    background: rgba(10, 14, 18, 0.97);
    border-left: 1px solid rgba(255,255,255,0.08);
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    flex-direction: column;
    padding: 16px;
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 9998;
    gap: 4px;
  }

  .nav.active {
    right: 0;
  }

  .nav a {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }

  .nav a:last-child {
    border-bottom: none;
  }
}

@media (max-width: 400px) {
  .logo-text {
    font-size: 15px;
  }

  .logo img {
    width: 40px;
    height: 40px;
  }
}

/* =====================================================
   HERO SECTION FIXES  — THE MAIN CULPRIT
   ===================================================== */

/* Tablet: collapse sidebar below content */
@media (max-width: 900px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero {
    min-height: auto;
    padding: 24px 16px 36px;
  }

  .hero-content {
    order: 1;
  }

  .hero-sidebar {
    order: 2;
    width: 100%;
    /* On tablet, lay the two info boxes side-by-side */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
    align-self: stretch;
  }

  .now-playing-box {
    grid-column: 1;
    grid-row: 1;
  }

  .up-next-box {
    grid-column: 2;
    grid-row: 1;
  }

  .hero-cta {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Mobile: full single column */
@media (max-width: 600px) {
  .hero {
    padding: 20px 14px 30px;
  }

  .hero-container {
    gap: 20px;
  }

  .hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .now-playing-box,
  .up-next-box {
    padding: 18px;
    border-radius: 12px;
  }

  .now-playing-box h4,
  .up-next-box h4 {
    font-size: 14px;
  }

  .now-playing-box p,
  .up-next-box p {
    font-size: 14px;
  }

  .hero-cta .btn-play {
    padding: 16px;
    font-size: 16px;
    border-radius: 14px;
  }

  /* OBB image/video: full width, consistent ratio */
  .hero-content .obb-image,
  .hero-content .obb-video,
  .hero-content img {
    border-radius: 14px;
    max-height: 260px;
  }

  /* Hero welcome text */
  .hero-welcome h1 {
    font-size: clamp(20px, 6vw, 28px);
    text-align: center;
  }

  .hero-welcome p {
    font-size: 14px;
    text-align: center;
  }
}

/* =====================================================
   ANNOUNCEMENT TICKER
   ===================================================== */

@media (max-width: 480px) {
  .rk-ticker {
    height: 38px;
  }

  .rk-ticker__label {
    padding: 0 10px;
    font-size: 0.6rem;
    letter-spacing: 0.05em;
  }

  .rk-ticker__item {
    font-size: 0.74rem;
    padding: 0 12px;
  }
}

/* =====================================================
   SCHEDULE / PROGRAM TABLE FIXES
   ===================================================== */

/* Make schedule tables scroll horizontally on small screens */
.schedule-table-wrap,
.rk-schedule-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  /* Program cards stack */
  .programs-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Schedule table: allow horizontal scroll */
  table {
    min-width: 480px;
  }

  .schedule-section,
  .upcoming-programs {
    padding: 30px 14px;
  }

  /* Section headings */
  section h2 {
    font-size: 22px;
    margin-bottom: 24px;
  }
}

@media (max-width: 600px) {
  /* Wrap any raw <table> in a scroll container automatically */
  .container > table,
  section table,
  .schedule-section table,
  .upcoming-programs table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
  }
}

/* =====================================================
   NEWS SECTION FIXES
   ===================================================== */

@media (max-width: 768px) {
  .news-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .news-header h2 {
    font-size: 22px;
    text-align: left;
  }

  .view-all-btn {
    align-self: flex-start;
  }
}

@media (max-width: 600px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .news-card img {
    height: 180px;
  }

  .news-content {
    padding: 16px;
  }

  .news-title {
    font-size: 16px;
  }

  .news-excerpt {
    font-size: 13px;
  }

  .news-meta {
    flex-direction: column;
    gap: 6px;
  }
}

/* =====================================================
   ANCHOR / DJ TEAM SECTION FIXES
   ===================================================== */

@media (max-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .team-card {
    padding: 18px 12px;
  }

  .team-card img {
    width: 70px;
    height: 70px;
  }

  .team-card h3 {
    font-size: 14px;
  }

  .team-card p {
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .team-card img {
    width: 60px;
    height: 60px;
  }
}

/* =====================================================
   ANNOUNCEMENT BANNER (SIDEBAR / INLINE)
   ===================================================== */

@media (max-width: 600px) {
  .rk-ann-banner,
  #rkAnnBanner {
    margin: 0 0 16px;
    padding: 14px 14px;
    border-radius: 12px;
  }

  .rk-inline-ann-card {
    padding: 14px 14px 14px 20px;
  }

  .rk-inline-ann-top {
    flex-wrap: wrap;
    gap: 8px;
  }

  .rk-inline-ann-title {
    font-size: 15px;
  }

  .rk-inline-ann-message {
    font-size: 13px;
  }
}

/* =====================================================
   GENERAL SECTIONS
   ===================================================== */

@media (max-width: 768px) {
  section {
    padding: 36px 14px;
  }

  .container {
    padding: 0 14px;
  }
}

@media (max-width: 480px) {
  section {
    padding: 28px 12px;
  }

  .container {
    padding: 0 12px;
  }
}

/* =====================================================
   PREVENT HORIZONTAL OVERFLOW FROM FIXED-WIDTH ELEMENTS
   ===================================================== */

@media (max-width: 768px) {
  /* Any element that could break layout */
  img,
  video,
  iframe,
  table,
  .obb-image,
  .obb-video {
    max-width: 100%;
  }

  /* Fix subscribe input width */
  .rk-subscribe-input input {
    width: 100%;
    min-width: 0;
  }

  .rk-subscribe-card {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-right: 0;
  }

  .rk-subscribe-right {
    flex-direction: column;
    align-items: stretch;
  }

  .rk-subscribe-input,
  .rk-subscribe-btn {
    width: 100%;
  }

  /* Games grid */
  .games-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   SMALL PHONES (< 380px)
   ===================================================== */

@media (max-width: 380px) {
  .hero-welcome h1 {
    font-size: 19px;
  }

  .hero-welcome p {
    font-size: 13px;
  }

  .now-playing-box h4,
  .up-next-box h4 {
    font-size: 13px;
  }

  .now-playing-box p,
  .up-next-box p {
    font-size: 13px;
  }

  .hero-cta .btn-play {
    font-size: 15px;
    padding: 14px;
  }

  section h2,
  .news-header h2 {
    font-size: 20px;
  }
}