/*
 * static/css/custom.css
 * ──────────────────────────────────────────────────────────────
 * Styles complémentaires à Tailwind CDN :
 *   – Variables CSS de la palette RTEE KIVU
 *   – Animations : pulse-dot, equalizer-bar, fade-in-up, shimmer
 *   – Contenu CKEditor (.article-content / .prose-custom)
 *   – Scrollbar personnalisée (WebKit)
 *   – Transitions player sticky
 *   – Utilitaires non couverts par Tailwind Play CDN
 * ──────────────────────────────────────────────────────────────
 */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --rtee-bg: #F8F5F2;
    --rtee-dark: #EDE8E3;
    --rtee-card: #FFFFFF;
    --rtee-border: rgba(180, 100, 20, 0.20);
    --warm-400: #6B5A4E;
    --orange-500: #F97316;
    --orange-400: #FB923C;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset base ───────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--rtee-bg);
    color: #1C1009;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Sélection de texte ───────────────────────────────────── */
::selection {
    background-color: rgba(249, 115, 22, 0.35);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════════ */

/* Barre d'égaliseur */
@keyframes equalizer-anim {

    0%,
    100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1);
    }
}

.equalizer-bar {
    transform-origin: bottom;
    animation: equalizer-anim 0.6s ease-in-out infinite alternate;
}

.equalizer-bar:nth-child(1) {
    animation-delay: 0s;
}

.equalizer-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.equalizer-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.equalizer-bar:nth-child(4) {
    animation-delay: 0.05s;
}

.equalizer-bar:nth-child(5) {
    animation-delay: 0.15s;
}

/* Fade-in-up (cartes) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(24px);
    transition: none;
}

.fade-in-up.animated {
    animation: fadeInUp 0.55s ease both;
}

/* Shimmer (squelette de chargement) */
@keyframes shimmer {
    from {
        background-position: -400px 0;
    }

    to {
        background-position: 400px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--rtee-card) 25%,
            #E8E0D8 50%,
            var(--rtee-card) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}

/* ══════════════════════════════════════════════════════════
   SCROLLBAR PERSONNALISÉE (WebKit)
══════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--rtee-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--orange-500);
}

/* Classe utilitaire pour scrollbar fine dans les zones de contenu */
.scrollbar-thin::-webkit-scrollbar {
    height: 4px;
    width: 4px;
}

/* ══════════════════════════════════════════════════════════
   CONTENU RICHE CKEDITOR (.article-content / .prose-custom)
══════════════════════════════════════════════════════════ */
.article-content,
.prose-custom {
    color: #3A2C22;
    line-height: 1.8;
    font-size: 1rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #1C1009;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content h2 {
    font-size: 1.5rem;
}

.article-content h3 {
    font-size: 1.25rem;
}

.article-content h4 {
    font-size: 1.1rem;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content a {
    color: var(--orange-400);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.article-content a:hover {
    color: var(--orange-500);
}

.article-content strong {
    color: #1C1009;
    font-weight: 600;
}

.article-content em {
    color: #4A3B30;
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.25rem 1.5rem;
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li {
    margin-bottom: 0.4rem;
}

.article-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--orange-500);
    background: #FFF8F4;
    border-radius: 0 8px 8px 0;
    color: #4A3B30;
    font-style: italic;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 1px solid var(--rtee-border);
}

.article-content figure {
    margin: 1.5rem 0;
}

.article-content figcaption {
    text-align: center;
    font-size: 0.8rem;
    color: #A8998A;
    margin-top: 0.5rem;
}

.article-content pre,
.article-content code {
    font-family: 'Courier New', Courier, monospace;
    background: #F0EAE4;
    border-radius: 6px;
}

.article-content code {
    padding: 2px 6px;
    font-size: 0.875em;
    color: #fb923c;
    border: 1px solid var(--rtee-border);
}

.article-content pre {
    padding: 1rem 1.25rem;
    overflow-x: auto;
    border: 1px solid var(--rtee-border);
    margin: 1.25rem 0;
}

.article-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #4A3B30;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.article-content th,
.article-content td {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--rtee-border);
    text-align: left;
}

.article-content th {
    background: #F0EAE4;
    color: #1C1009;
    font-weight: 600;
}

.article-content tr:hover td {
    background: rgba(249, 115, 22, 0.05);
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--rtee-border);
    margin: 2rem 0;
}

/* ══════════════════════════════════════════════════════════
   PLAYER STICKY – transition d'entrée
══════════════════════════════════════════════════════════ */
#radio-player {
    will-change: transform;
}

/* Slider range (volume) */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #D4C9C0;
    border-radius: 2px;
    outline: none;
    border: 1px solid var(--rtee-border);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--orange-500);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--orange-400);
    transform: scale(1.2);
}

/* ══════════════════════════════════════════════════════════
   UTILITAIRES DIVERS
══════════════════════════════════════════════════════════ */

/* Line clamp compatible */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* Bouton scale au survol */
.active\:scale-95:active {
    transform: scale(0.95);
}

.active\:scale-90:active {
    transform: scale(0.90);
}

/* Focus visible global */
:focus-visible {
    outline: 2px solid var(--orange-500);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Input style global pour les formulaires (site public uniquement) */
html:not(.dark) input[type="text"],
html:not(.dark) input[type="email"],
html:not(.dark) input[type="search"],
html:not(.dark) textarea,
html:not(.dark) select {
    background-color: #FFFFFF;
    border: 1px solid rgba(180, 100, 20, 0.20);
    border-radius: 8px;
    color: #1C1009;
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

html:not(.dark) input[type="text"]::placeholder,
html:not(.dark) input[type="email"]::placeholder,
html:not(.dark) input[type="search"]::placeholder,
html:not(.dark) textarea::placeholder {
    color: #9B8B80;
}

html:not(.dark) input[type="text"]:focus,
html:not(.dark) input[type="email"]:focus,
html:not(.dark) input[type="search"]:focus,
html:not(.dark) textarea:focus,
html:not(.dark) select:focus {
    border-color: var(--orange-500);
}

/* Dashboard (html.dark) : inputs sombres préservés */
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="search"],
html.dark textarea,
html.dark select {
    background-color: #2B1B0F;
    border: 1px solid rgba(249, 115, 22, 0.28);
    border-radius: 8px;
    color: #fff;
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

html.dark input[type="text"]:focus,
html.dark input[type="email"]:focus,
html.dark input[type="search"]:focus,
html.dark textarea:focus,
html.dark select:focus {
    border-color: var(--orange-500);
}

html.dark textarea {
    resize: vertical;
    min-height: 120px;
}

html:not(.dark) textarea {
    resize: vertical;
    min-height: 120px;
}

/* Lecteur audio natif (podcast_detail) */
audio {
    filter: invert(0.85) sepia(0.6) saturate(4) hue-rotate(348deg);
    border-radius: 8px;
}

/* ══════════════════════════════════════════════════════════
   PLAYER STICKY — reste sombre même en thème clair
══════════════════════════════════════════════════════════ */
#radio-player {
    background-color: #1C1009 !important;
    border-top-color: rgba(249, 115, 22, 0.28) !important;
}

#radio-player .text-warm-400 {
    color: #CEC0B4 !important;
}

#radio-player .text-white {
    color: #ffffff !important;
}

#radio-player .bg-rtee-card,
#radio-player [class*="hover:bg-rtee-card"]:hover {
    background-color: #2B1B0F !important;
}

#radio-player input[type="range"] {
    background: #2B1B0F;
    border-color: rgba(249, 115, 22, 0.28);
}

/* Séparateur player live badge ring */
#player-live-badge {
    --tw-ring-color: #1C1009 !important;
}