/*
Theme Name: تشريع 24
Theme URI: http://example.com/tashree3-24
Author: مطور تشريع 24
Description: قالب مخصص لمنصة تشريع 24 المعنية بأخبار مجلس النواب حصراً.
Version: 1.7
Text Domain: tashree3-24
*/

:root {
    --main-blue: #0850a4;
    --bg-light: #f4f7f9;
    --card-gray: #e9ecef;
    --text-dark: #111;
    --header-bg: #fff;
    --border-color: #ddd;
    --mobile-btn-bg: #f3f4f6;
    --mobile-btn-color: #4b5563;
}

body.dark-mode {
    --main-blue: #0a3d7a;
    --bg-light: #121212;
    --card-gray: #1e1e1e;
    --text-dark: #f1f1f1;
    --header-bg: #1a1a1a;
    --border-color: #333;
    --mobile-btn-bg: #2d2d2d;
    --mobile-btn-color: #f1f1f1;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Cairo', sans-serif; }
body { background-color: var(--bg-light); color: var(--text-dark); direction: rtl; transition: background-color 0.3s, color 0.3s; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 15px; position: relative; }

.desktop-only { display: block; }
.mobile-only { display: none; }

/* الهيدر العلوي */
.top-header-wrapper { background: var(--header-bg); border-bottom: 1px solid var(--border-color); }
.top-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.header-stats { text-align: center; }
.header-stats .label { display: block; font-size: 13px; font-weight: 700; color: var(--text-dark); }
.header-stats .number { display: block; font-size: 26px; font-weight: 900; line-height: 1.2; color: var(--text-dark); }
.header-logo { text-align: center; }
.header-logo h1 { font-size: 32px; font-weight: 900; margin: 0; line-height: 1; letter-spacing: -1px; }
.header-logo h1 a { color: var(--text-dark); text-decoration: none; }
.header-logo span { font-size: 11px; font-weight: 700; color: #777; display: block; }
.header-icons { display: flex; gap: 20px; font-size: 22px; color: var(--text-dark); cursor: pointer; align-items: center; }

/* القائمة الرئيسية */
.navbar { background-color: var(--main-blue); position: relative; z-index: 100; }
.navbar ul { list-style: none; display: flex; justify-content: center; gap: 50px; margin: 0; padding: 12px 0; }
.navbar a { color: #fff; text-decoration: none; font-size: 18px; font-weight: 800; transition: opacity 0.3s; }
.navbar a:hover { opacity: 0.8; }

/* الصفحة الرئيسية */
.hero-section { margin: 30px auto; display: grid; grid-template-columns: 2fr 1fr; gap: 20px; height: 420px; }
.hero-card { border-radius: 15px; overflow: hidden; position: relative; background-color: var(--main-blue); display: flex; align-items: flex-end; width: 100%; height: 100%; }
.hero-card img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(8,80,164,0.95) 90%); z-index: 2; }
.hero-content { position: relative; z-index: 3; padding: 25px; width: 100%; text-align: right; }
.hero-content h2, .hero-content h3 { margin: 0; font-weight: 800; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.hero-content a { color: #fff; text-decoration: none; }
.hero-content a:hover { text-decoration: underline; }
.hero-main .hero-content h2 { font-size: 24px; }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 20px; height: 100%; }
.hero-side .hero-content h3 { font-size: 16px; text-align: center; }

.section-title { text-align: center; font-size: 20px; font-weight: 800; margin: 40px 0 30px; color: var(--text-dark); }
.audio-grid, .opinions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.audio-card { background-color: var(--card-gray); border-radius: 20px; text-align: center; padding: 30px 15px 20px; position: relative; }
.mic-icon { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-size: 20px; color: var(--text-dark); background: var(--bg-light); border-radius: 50%; padding: 5px; }
.opinion-card { background-color: var(--header-bg); border-radius: 20px; text-align: center; padding: 50px 15px 20px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.05); margin-top: 40px; }
.opinion-card .avatar-img { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); }
.quote-icon { position: absolute; top: 15px; right: 15px; font-size: 30px; color: var(--text-dark); opacity: 0.2; }
.opinion-text { margin-top: 15px; font-size: 15px; font-weight: 800; color: var(--text-dark); line-height: 1.6; }
.avatar-img { width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--header-bg); object-fit: cover; margin-bottom: 10px; background: #fff; }
.card-name { font-size: 16px; font-weight: 800; margin-bottom: 5px; color: var(--text-dark); }
.card-badge { background-color: var(--main-blue); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 5px; display: inline-block; }
.btn-show-all { display: block; width: fit-content; margin: 30px auto 50px; background-color: var(--main-blue); color: #fff; text-decoration: none; padding: 10px 30px; font-size: 16px; font-weight: 800; border-radius: 5px; transition: 0.3s; }
.btn-show-all:hover { opacity: 0.9; }

.footer { background-color: var(--main-blue); color: #fff; text-align: center; padding: 30px 0; font-size: 16px; font-weight: 700; margin-top: 40px; }

/* --- صفحة المقال الصوتي الواحد (Single Audio Post) المطورة --- */
.audio-post-wrapper { margin: 40px 0; max-width: 900px; margin-left: auto; margin-right: auto; }
.audio-player-hero { background: var(--header-bg); border-radius: 24px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid var(--border-color); }
.audio-hero-image { position: relative; height: 350px; }
.audio-hero-image>img { width: 100%; height: 100%; object-fit: cover; }
.hero-audio-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(8, 80, 164, 0.9), transparent); display: flex; justify-content: center; align-items: center; }

/* دائرة صورة المتحدث */
.speaker-circle { 
    width: 120px; height: 120px; 
    background: #fff; 
    border-radius: 50%; 
    display: flex; justify-content: center; align-items: center; 
    font-size: 40px; color: var(--main-blue); 
    box-shadow: 0 0 30px rgba(255,255,255,0.4); 
    overflow: hidden; 
    border: 4px solid #fff;
}
.speaker-circle img { width: 100%; height: 100%; object-fit: cover; }
.pulse { animation: pulse-animation 2s infinite; }
@keyframes pulse-animation { 0% { box-shadow: 0 0 0 0px rgba(255, 255, 255, 0.7); } 100% { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); } }

.audio-hero-content { padding: 30px; text-align: center; }
.post-badge { background: var(--bg-light); color: var(--main-blue); font-size: 14px; font-weight: 800; padding: 6px 15px; border-radius: 8px; display: inline-block; margin-bottom: 15px; }
.post-title { font-size: 28px; font-weight: 900; margin-bottom: 30px; color: var(--text-dark); }

/* تصميم المشغل التفاعلي (SoundCloud Style) */
.custom-audio-container { margin-top: 20px; }
.sc-player-wrapper { display: flex; align-items: center; gap: 20px; background: var(--bg-light); padding: 20px 25px; border-radius: 15px; direction: ltr; border: 1px solid var(--border-color); }
.sc-play-btn { width: 65px; height: 65px; min-width: 65px; border-radius: 50%; background: var(--main-blue); color: #fff; border: none; font-size: 24px; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.3s; box-shadow: 0 5px 15px rgba(8, 80, 164, 0.3); }
.sc-play-btn:hover { transform: scale(1.05); }
.sc-waveform-container { flex-grow: 1; display: flex; flex-direction: column; }
#waveform { width: 100%; cursor: pointer; }
.sc-time-indicators { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text-dark); margin-top: 8px; }

.post-text-content { margin-top: 30px; background: var(--header-bg); padding: 30px; border-radius: 20px; line-height: 1.8; font-size: 18px; color: var(--text-dark); }
.no-audio-alert { padding: 20px; background: #fff3cd; color: #856404; border-radius: 10px; border: 1px solid #ffeeba; text-align: center; }

/* التوافق مع الشاشات والهاتف */
@media (max-width: 992px) {
    .audio-archive-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }

    .mobile-top-bar { background: var(--header-bg); border-bottom: 1px solid var(--border-color); padding: 8px 0; }
    .flex-space-between { display: flex; justify-content: space-between; align-items: center; }
    .dark-mode-switch { width: 44px; height: 24px; background: #6c757d; border-radius: 12px; position: relative; cursor: pointer; display: flex; align-items: center; }
    .dark-mode-switch .switch-circle { width: 26px; height: 26px; background: #fff; border-radius: 50%; position: absolute; right: -2px; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: 0.3s; }
    .dark-mode-switch .switch-circle i { color: #6c757d; font-size: 14px; }
    body.dark-mode .dark-mode-switch .switch-circle { transform: translateX(-20px); background: #333; }
    body.dark-mode .dark-mode-switch .switch-circle i { color: #fff; }

    .gold-coin { background: #dca341; color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 13px; }
    .top-header { flex-direction: row; justify-content: space-between; padding: 12px 0; align-items: center; }
    .header-logo { text-align: right; }
    .header-logo h1 { font-size: 24px; }
    .mobile-actions { display: flex; gap: 8px; align-items: center; }
    .mobile-btn { background: var(--mobile-btn-bg); color: var(--mobile-btn-color); border: none; border-radius: 8px; height: 38px; display: flex; justify-content: center; align-items: center; font-size: 16px; cursor: pointer; text-decoration: none; font-weight: 700; }
    .mobile-btn.search-btn, .mobile-btn.menu-btn { width: 38px; }
    .mobile-btn.text-btn { padding: 0 16px; font-size: 15px; }

    .navbar ul { display: none; flex-direction: column; width: 100%; position: absolute; top: 100%; left: 0; background-color: var(--main-blue); padding: 0; box-shadow: 0 10px 15px rgba(0,0,0,0.2); }
    .navbar ul.active { display: flex; }
    .navbar ul li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .navbar ul li a { display: block; padding: 15px; text-align: right; }

    .hero-section { grid-template-columns: 1fr; height: auto; gap: 15px; }
    .hero-main { height: 250px; }
    .hero-side { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; height: 200px; gap: 15px; }
    .hero-side .hero-content h3 { font-size: 13px; }

    .audio-grid, .opinions-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .avatar-img { width: 70px; height: 70px; }
    .opinion-card { padding-top: 45px; }
    .opinion-card .avatar-img { top: -35px; }

    /* توافق صفحة المقال الصوتي مع الهاتف */
    .audio-hero-image { height: 250px; }
    .speaker-circle { width: 90px; height: 90px; }
    .post-title { font-size: 22px; }
    .sc-player-wrapper { flex-direction: column; padding: 15px; }
    .sc-waveform-container { width: 100%; }
}