/*
Theme Name: Sawte Al Mellah
Theme URI: https://sawtalmellah.ma
Author: Sawte Al Mellah Team
Author URI: https://sawtalmellah.ma
Description: Theme officiel de la radio mediterraneenne Sawte Al Mellah. Design moderne avec player audio, programme du jour, emissions, podcasts et TV Live.
Version: 2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sawte-almellah
*/

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

body.ltr {
    direction: ltr;
    text-align: left;
}

a {
    color: #c0392b;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #a93226;
}

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

ul, ol {
    list-style: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px; /* Space for sticky player */
}

/* ============================================
   TICKER / BANDEAU DEFILANT
   ============================================ */
.ticker-bar {
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 0.5rem 0;
    overflow: hidden;
    position: relative;
    z-index: 1001;
    border-bottom: 2px solid #c0392b;
}

.ticker-wrap {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.ticker-label {
    background: #c0392b;
    color: #fff;
    padding: 0.25rem 1rem;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    flex-shrink: 0;
    z-index: 2;
}

.ticker-content {
    overflow: hidden;
    flex: 1;
    position: relative;
}

.ticker-track {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
    padding-left: 100%;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

.ticker-item::before {
    content: "\2022";
    margin-right: 0.5rem;
    color: #c0392b;
}

body.rtl .ticker-track {
    animation: ticker-scroll-rtl 30s linear infinite;
    padding-left: 0;
    padding-right: 100%;
}

@keyframes ticker-scroll-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

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

.site-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.2;
}

.site-title span {
    color: #c0392b;
}

/* Live Buttons */
.live-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-live-radio {
    background: #c0392b;
    color: #fff;
}

.btn-live-radio:hover {
    background: #a93226;
    color: #fff;
}

.btn-live-tv {
    background: #1a1a2e;
    color: #fff;
}

.btn-live-tv:hover {
    background: #0f3460;
    color: #fff;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse-live 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Navigation */
.main-nav {
    flex: 1;
}

.main-nav ul {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.main-nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
    background: #c0392b;
    color: #fff;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #1a1a2e;
    padding: 0.5rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></svg>');
    background-size: 80px;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 3rem 0;
}

.hero-text h1 {
    font-size: 2.8rem;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-text h1 span {
    color: #c0392b;
}

.hero-text p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.btn-primary:hover {
    background: #a93226;
    border-color: #a93226;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    color: #fff;
}

/* Programme du Jour */
.programme-box {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 1.5rem;
}

.programme-box h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 0.75rem;
}

.programme-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.programme-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.programme-item:hover {
    background: rgba(255,255,255,0.1);
}

.programme-item.active {
    background: rgba(192, 57, 43, 0.2);
    border: 1px solid rgba(192, 57, 43, 0.4);
}

.programme-time {
    font-weight: 700;
    font-size: 0.85rem;
    color: #c0392b;
    min-width: 70px;
    flex-shrink: 0;
}

.programme-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.programme-host {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #666;
    font-size: 1.05rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.card-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.card-text {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

/* ============================================
   STICKY PLAYER
   ============================================ */
.sticky-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: #fff;
    z-index: 9999;
    border-top: 2px solid #c0392b;
    padding: 0.75rem 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.player-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.player-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: #333;
    flex-shrink: 0;
}

.player-text {
    min-width: 0;
}

.player-title {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.player-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.player-btn:hover {
    background: rgba(255,255,255,0.1);
}

.player-btn-play {
    width: 50px;
    height: 50px;
    background: #c0392b;
    font-size: 1.5rem;
}

.player-btn-play:hover {
    background: #a93226;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.player-volume input[type="range"] {
    width: 80px;
    accent-color: #c0392b;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    padding: 3rem 0 1.5rem;
    margin-bottom: 80px; /* Space for sticky player */
}

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

.footer-col h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #c0392b;
    display: inline-block;
}

.footer-col p,
.footer-col li {
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.7);
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col a {
    color: rgba(255,255,255,0.7);
}

.footer-col a:hover {
    color: #c0392b;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* Social Icons */
.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #c0392b;
    color: #fff;
}

/* ============================================
   PAGES & POSTS
   ============================================ */
.page-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: #fff;
    margin: 0;
}

.entry-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.entry-content h2,
.entry-content h3 {
    margin-top: 2rem;
    color: #1a1a2e;
}

.entry-content ul,
.entry-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    list-style: disc;
}

.entry-content blockquote {
    border-left: 4px solid #c0392b;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #555;
}

/* Post Thumbnail */
.post-thumbnail {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
}

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

/* Meta */
.entry-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.pagination .current {
    background: #c0392b;
    color: #fff;
}

/* Search Form */
.search-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid #ddd;
    border-radius: 50px 0 0 50px;
    font-size: 1rem;
    outline: none;
    border-right: none;
}

.search-form button {
    padding: 0.875rem 1.5rem;
    background: #c0392b;
    color: #fff;
    border: 2px solid #c0392b;
    border-radius: 0 50px 50px 0;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: #a93226;
    border-color: #a93226;
}

body.rtl .search-form input[type="search"] {
    border-radius: 0 50px 50px 0;
    border-right: 2px solid #ddd;
    border-left: none;
}

body.rtl .search-form button {
    border-radius: 50px 0 0 50px;
}

/* ============================================
   TV LIVE TEMPLATE
   ============================================ */
.tv-live-container {
    padding: 2rem 0;
}

.tv-player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #1a1a2e;
    margin-bottom: 2rem;
}

.tv-player-wrapper iframe,
.tv-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.tv-info {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.tv-info h2 {
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

/* ============================================
   CPT: EMISSIONS, PODCASTS, EQUIPE
   ============================================ */
.emission-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.emission-card:hover {
    transform: translateY(-5px);
}

.emission-card .card-image {
    height: 220px;
}

.emission-card .card-body {
    padding: 1.25rem;
}

.emission-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.emission-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Equipe */
.equipe-card {
    text-align: center;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.equipe-card:hover {
    transform: translateY(-5px);
}

.equipe-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid #c0392b;
}

.equipe-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.equipe-role {
    font-size: 0.9rem;
    color: #c0392b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.equipe-bio {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

/* Grille Horaire */
.grille-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.grille-table th {
    background: #1a1a2e;
    color: #fff;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.grille-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.grille-table tr:hover {
    background: #f9f9f9;
}

.grille-time {
    font-weight: 700;
    color: #c0392b;
}

/* ============================================
   WIDGETS
   ============================================ */
.widget {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #c0392b;
}

.widget ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.widget li:last-child {
    border-bottom: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .site-branding {
        flex: 1;
    }

    .menu-toggle {
        display: block;
        order: 3;
    }

    .main-nav {
        order: 4;
        width: 100%;
        display: none;
    }

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

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding-top: 1rem;
    }

    .main-nav a {
        padding: 0.75rem 0;
        border-bottom: 1px solid #eee;
    }

    .live-buttons {
        order: 2;
    }

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

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

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

    .player-volume {
        display: none;
    }

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

    .ticker-item {
        font-size: 0.8rem;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.6rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.8rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .site-title {
        font-size: 1.1rem;
    }

    .site-logo img {
        max-height: 40px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }


/* ============================================
   GRILLE HORAIRE TABLE
   ============================================ */
.grille-jour h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 0.75rem;
}

.grille-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.grille-table thead {
    background: #1a1a2e;
    color: #fff;
}

.grille-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grille-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.grille-table tr:last-child td {
    border-bottom: none;
}

.grille-table tr:hover {
    background: #f9f9f9;
}

.grille-time {
    font-weight: 700;
    color: #c0392b;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

body.rtl .grille-table th,
body.rtl .grille-table td {
    text-align: right;
}

@media (max-width: 768px) {
    .grille-table {
        font-size: 0.85rem;
    }
    .grille-table th,
    .grille-table td {
        padding: 0.75rem;
    }
    .grille-table th:nth-child(3),
    .grille-table td:nth-child(3) {
        display: none;
    }
}
