/* Radio Portal Theme Styles */

/* CSS Variables */
:root {
  --primary-color: #1a73e8; /* 4.65:1 contrast ratio with white */
  --secondary-color: #0d47a1; /* 7.58:1 contrast ratio with white */
  --accent-color: #ff6d00; /* 4.55:1 contrast ratio with white */
  --text-color: #212121; /* Improved contrast 12.5:1 with white */
  --text-light: #595959; /* Improved contrast 5.6:1 with white */
  --bg-color: #fff;
  --bg-light: #f5f5f5;
  --border-color: #9e9e9e; /* 4.5:1 contrast ratio with white */
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-heading: 'Roboto Slab', Georgia, serif;
  --transition: all 0.3s ease;
}

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

/* Screen reader text for accessibility */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--primary-color);
  color: white;
  padding: 10px 15px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-block;
  font-weight: bold;
  margin: 10px;
}

body {
  font-family: var(--font-main);
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--bg-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  /* Underline on focus for keyboard navigation */
  outline: none;
}

a:hover, a:focus {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Focus visible for keyboard navigation */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
  color: var(--secondary-color);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

/* Header */
.site-header {
  background-color: var(--bg-color);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.site-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.site-title a {
  color: inherit;
}

.main-navigation {
  display: flex;
  align-items: center;
}

.main-navigation ul {
  display: flex;
  list-style: none;
}

.main-navigation li {
  margin-left: 1.5rem;
}

.main-navigation a {
  font-weight: 500;
  color: var(--text-color);
  padding: 0.5rem 0;
  position: relative;
}

.main-navigation a:hover {
  color: var(--primary-color);
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.main-navigation a:hover::after {
  width: 100%;
}

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

/* Main Content */
.site-main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Hero Section */
.hero-section {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  text-align: center;
}

.hero-section h1 {
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

.hero-section p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Cards */
.card {
  background: var(--bg-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-image {
  height: 200px;
  overflow: hidden;
}

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

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

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  margin-top: 0;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

/* Radio Player */
.radio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--secondary-color);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  /* Ensure player is always visible for accessibility */
  min-height: 60px;
}

.player-inner {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  /* Wrap items on small screens */
  flex-wrap: wrap;
}

.player-controls {
  margin-right: 1rem;
  /* Ensure adequate spacing for touch targets */
  min-width: 44px;
}

.play-pause-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Ensure sufficient touch target size */
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  /* Add transition for smooth state changes */
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.play-pause-btn:hover, .play-pause-btn:focus {
  background: #1565c0;
  transform: scale(1.05);
}

.play-pause-btn:active {
  transform: scale(0.95);
}

.play-icon, .pause-icon {
  display: none;
  /* Ensure icons are centered */
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-pause-btn.playing .pause-icon {
  display: flex;
}

.play-pause-btn:not(.playing) .play-icon {
  display: flex;
}

.player-info {
  flex-grow: 1;
  min-width: 0;
  /* Prevent text overflow */
  overflow: hidden;
}

.now-playing {
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  /* Ensure adequate spacing */
  min-height: 24px;
}

.live-indicator {
  background: var(--accent-color);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-right: 0.5rem;
  flex-shrink: 0;
  /* Ensure indicator is always visible */
  min-width: 60px;
  text-align: center;
}

.program-name {
  overflow: hidden;
  text-overflow: ellipsis;
  /* Prevent text wrapping */
  white-space: nowrap;
  /* Ensure good contrast */
  color: white;
}

.player-volume {
  display: flex;
  align-items: center;
  margin-left: 1rem;
  flex-shrink: 0;
  /* Ensure adequate spacing */
  min-width: 120px;
}

.player-volume label {
  margin-right: 0.5rem;
  font-size: 0.875rem;
  /* Ensure good contrast */
  color: white;
}

.volume-control {
  width: 80px;
  margin-left: 0.5rem;
  /* Ensure adequate touch target */
  min-width: 80px;
  min-height: 20px;
  /* Improve slider appearance for better accessibility */
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  height: 5px;
}

.volume-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 0 2px 0 #555;
}

.volume-control::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 2px 0 #555;
}

/* Schedule Grid */
.parrilla-radio {
  margin: 2rem 0;
}

.dia-programacion {
  margin-bottom: 2rem;
}

.dia-titulo {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

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

.programa-item {
  background: var(--bg-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  transition: var(--transition);
}

.programa-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.programa-imagen {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}

.programa-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.programa-info {
  padding: 1rem;
  flex-grow: 1;
}

.programa-titulo {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
}

.programa-titulo a {
  color: var(--text-color);
  text-decoration: none;
}

.programa-titulo a:hover {
  color: var(--primary-color);
}

.programa-locutor {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0 0 0.25rem 0;
}

.programa-horario {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 500;
  margin: 0;
}

/* News Articles */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.news-article {
  background: var(--bg-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.news-article:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-thumbnail {
  height: 200px;
  overflow: hidden;
}

.article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.news-article:hover .article-thumbnail img {
  transform: scale(1.05);
}

.article-content {
  padding: 1.5rem;
}

.article-title {
  margin-top: 0;
}

.article-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
}

.read-more {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 500;
}

.read-more:hover {
  color: var(--secondary-color);
}

/* Footer */
.site-footer {
  background: var(--secondary-color);
  color: white;
  padding: 2rem 1rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-navigation ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin-bottom: 1rem;
}

.footer-navigation li {
  margin: 0 1rem;
}

.footer-navigation a {
  color: white;
}

.footer-navigation a:hover {
  color: var(--accent-color);
}

.copyright {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-navigation {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem;
  }

  .main-navigation.active {
    display: block;
  }

  .main-navigation ul {
    flex-direction: column;
  }

  .main-navigation li {
    margin: 0.5rem 0;
  }

  .menu-toggle {
    display: block;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .player-inner {
    flex-wrap: wrap;
  }

  .player-info {
    order: 3;
    margin-top: 0.5rem;
    width: 100%;
  }

  .volume-control {
    width: 60px;
  }

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

  .programa-item {
    flex-direction: column;
  }

  .programa-imagen {
    width: 100%;
    height: 150px;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1.5rem;
  }

  .player-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-controls {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }

  .player-volume {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .now-playing {
    width: 100%;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.margin-bottom {
  margin-bottom: 2rem;
}

.padding-vertical {
  padding: 2rem 0;
}

.bg-light {
  background-color: var(--bg-light);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}