/*
Theme Name: Beriyack Theme
Theme URI: https://github.com/beriyack/beriyack-theme
Author: Beriyack
Author URI: https://beriyack.ch
Description: Un thème WordPress moderne, rapide et responsive basé sur Bootstrap 5, conçu pour les astuces de jeux vidéo/vie quotidienne, les avis matériels et les checklists interactives.
Version: 1.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT
Text Domain: beriyack-theme
*/

/* ==========================================================================
   1. VARIABLES & SYSTEME DE DESIGN
   ========================================================================== */
:root {
    --by-primary: #6366f1; /* Indigo */
    --by-primary-rgb: 99, 102, 241;
    --by-secondary: #06b6d4; /* Teal / Cyan */
    --by-secondary-rgb: 6, 182, 212;
    --by-accent: #f43f5e; /* Rose / Coral */
    --by-accent-rgb: 244, 63, 94;
    
    /* Variables de transition */
    --by-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Variables du thème clair */
[data-bs-theme="light"] {
    --by-bg: #f8fafc;
    --by-card-bg: rgba(255, 255, 255, 0.8);
    --by-card-border: rgba(226, 232, 240, 0.8);
    --by-text: #0f172a;
    --by-text-muted: #64748b;
    --by-navbar-bg: rgba(255, 255, 255, 0.7);
    --by-nav-link: #334155;
    --by-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --by-shadow-hover: 0 20px 40px -15px rgba(99, 102, 241, 0.12);
}

/* Variables du thème sombre */
[data-bs-theme="dark"] {
    --by-bg: #090d16;
    --by-card-bg: rgba(15, 23, 42, 0.6);
    --by-card-border: rgba(51, 65, 85, 0.5);
    --by-text: #f8fafc;
    --by-text-muted: #94a3b8;
    --by-navbar-bg: rgba(9, 13, 22, 0.7);
    --by-nav-link: #cbd5e1;
    --by-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
    --by-shadow-hover: 0 20px 40px -15px rgba(99, 102, 241, 0.25);
}

/* ==========================================================================
   2. STYLES GENERAUX & TYPOGRAPHIE
   ========================================================================== */
body {
    background-color: var(--by-bg);
    color: var(--by-text);
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--by-primary);
    text-decoration: none;
    transition: var(--by-transition);
}
a:hover {
    color: var(--by-secondary);
}

/* Titres */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--by-primary), var(--by-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   3. NAVIGATION (GLASSMORPHISM)
   ========================================================================== */
.navbar-custom {
    background-color: var(--by-navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--by-card-border);
    transition: var(--by-transition);
}

.navbar-custom .navbar-brand {
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 1.5rem;
}

.navbar-custom .nav-link {
    color: var(--by-nav-link);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--by-transition);
}

.navbar-custom .nav-link:hover, 
.navbar-custom .nav-link.active {
    color: var(--by-primary);
    background-color: rgba(99, 102, 241, 0.08);
}

/* Sélecteur de Thème */
.theme-toggle-btn {
    border: none;
    background: transparent;
    color: var(--by-text-muted);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--by-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle-btn:hover {
    color: var(--by-primary);
    background-color: rgba(99, 102, 241, 0.08);
}

/* ==========================================================================
   4. COMPOSANTS MODERNES (CARDS, BADGES)
   ========================================================================== */
.card-custom {
    background: var(--by-card-bg);
    border: 1px solid var(--by-card-border);
    border-radius: 20px;
    box-shadow: var(--by-shadow);
    transition: var(--by-transition);
    overflow: hidden;
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: var(--by-shadow-hover);
    border-color: rgba(99, 102, 241, 0.3);
}

.card-custom .card-img-wrapper {
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/10;
}

.card-custom .card-img-top {
    object-fit: cover;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Badges Catégories */
.badge-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35em 0.75em;
    border-radius: 30px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--by-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   5. CONTENU D'ARTICLE (SINGLE.PHP)
   ========================================================================== */
.post-header {
    padding: 4rem 0 3rem 0;
    border-bottom: 1px solid var(--by-card-border);
    margin-bottom: 3rem;
}

.post-meta {
    font-size: 0.9rem;
    color: var(--by-text-muted);
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content p {
    margin-bottom: 1.5rem;
}

/* Bloc "Avis Matériel" */
.review-box {
    background: var(--by-card-bg);
    border: 1px solid var(--by-card-border);
    border-radius: 20px;
    padding: 2rem;
    margin: 2.5rem 0;
    box-shadow: var(--by-shadow);
}

.review-stars {
    font-size: 1.5rem;
    color: #ffb703;
    letter-spacing: 2px;
}

.pro-con-list {
    margin-top: 1.5rem;
}
.pro-con-item {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
}
.pro-con-item::before {
    font-family: "bootstrap-icons";
    position: absolute;
    left: 0;
    font-weight: bold;
}
.pro-item::before {
    content: "\F26B"; /* check-circle */
    color: #10b981;
}
.con-item::before {
    content: "\F5C2"; /* x-circle */
    color: #ef4444;
}

/* Bloc "Astuces / Pro Tip" */
.tip-box {
    background: rgba(6, 182, 212, 0.05);
    border-left: 5px solid var(--by-secondary);
    border-radius: 0 16px 16px 0;
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
}

.tip-box-gaming {
    background: rgba(99, 102, 241, 0.05);
    border-left-color: var(--by-primary);
}

.tip-icon {
    font-size: 2rem;
    color: var(--by-secondary);
    line-height: 1;
}
.tip-box-gaming .tip-icon {
    color: var(--by-primary);
}

/* ==========================================================================
   6. CHECKLISTS INTERACTIVES (TEMPLATE-CHECKLIST.PHP)
   ========================================================================== */
.checklist-container {
    background: var(--by-card-bg);
    border: 1px solid var(--by-card-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--by-shadow);
    margin: 2rem 0;
}

/* Barre de progression */
.checklist-progress-wrapper {
    background: rgba(226, 232, 240, 0.2);
    border-radius: 20px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.checklist-progress-bar {
    background: linear-gradient(90deg, var(--by-primary), var(--by-secondary));
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Items de checklist */
.checklist-list {
    list-style: none !important;
    padding-left: 0 !important;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--by-card-border);
    cursor: pointer;
    transition: var(--by-transition);
    border-radius: 10px;
    margin-bottom: 0.25rem;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

.checklist-checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--by-text-muted);
    border-radius: 6px;
    margin-right: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--by-transition);
    flex-shrink: 0;
}

.checklist-checkbox-custom::after {
    content: "\F26B"; /* Code Bootstrap Icons check */
    font-family: "bootstrap-icons";
    font-size: 1rem;
    color: white;
    font-weight: 900;
    opacity: 0;
    transform: scale(0);
    transition: var(--by-transition);
}

.checklist-item.checked .checklist-checkbox-custom {
    background: var(--by-primary);
    border-color: var(--by-primary);
}

.checklist-item.checked .checklist-checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.checklist-label {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--by-text);
    transition: var(--by-transition);
    user-select: none;
}

.checklist-item.checked .checklist-label {
    text-decoration: line-through;
    color: var(--by-text-muted);
    opacity: 0.7;
}

/* Action Bouton Reset */
.checklist-reset-btn {
    border: 1px solid var(--by-card-border);
    background: rgba(244, 63, 94, 0.05);
    color: var(--by-accent);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--by-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.checklist-reset-btn:hover {
    background: var(--by-accent);
    color: white;
    border-color: var(--by-accent);
    transform: translateY(-2px);
}

/* ==========================================================================
   7. WIDGETS ET PIED DE PAGE
   ========================================================================== */
.footer-custom {
    background-color: var(--by-navbar-bg);
    border-top: 1px solid var(--by-card-border);
    padding: 4rem 0 2rem 0;
    margin-top: auto;
}

.footer-logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.footer-link-list {
    list-style: none;
    padding-left: 0;
}
.footer-link-list li {
    margin-bottom: 0.75rem;
}
.footer-link-list a {
    color: var(--by-text-muted);
}
.footer-link-list a:hover {
    color: var(--by-primary);
    padding-left: 4px;
}

.social-icon {
    font-size: 1.25rem;
    color: var(--by-text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--by-card-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--by-transition);
}
.social-icon:hover {
    color: white;
    background-color: var(--by-primary);
    border-color: var(--by-primary);
    transform: translateY(-3px);
}

/* ==========================================================================
   8. TABLE DES MATIERES (SOMMAIRE) & RETOUR EN HAUT
   ========================================================================== */
.toc-sidebar-widget {
    position: sticky;
    top: 100px;
    background: var(--by-card-bg);
    border: 1px solid var(--by-card-border);
    border-radius: 20px;
    box-shadow: var(--by-shadow);
    padding: 1.5rem;
    transition: var(--by-transition);
}

.toc-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--by-card-border);
}

.toc-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-item.toc-level-3 {
    padding-left: 1rem;
}

.toc-link {
    font-size: 0.95rem;
    color: var(--by-text-muted);
    font-weight: 500;
    transition: var(--by-transition);
    display: block;
    padding: 0.2rem 0;
}

.toc-link:hover,
.toc-link.active {
    color: var(--by-primary);
    padding-left: 4px;
}

/* Bouton Retour en Haut (Floating) */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--by-primary);
    color: white !important;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--by-transition);
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--by-secondary);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
    transform: scale(1.05);
}

/* ==========================================================================
   9. BOITES & BANNIERES D'AFFILIATION
   ========================================================================== */
.affiliate-banner-box {
    margin: 2.5rem 0;
    transition: var(--by-transition);
}

.affiliate-banner-box .card-custom {
    transition: var(--by-transition);
    border-style: dashed;
}

.affiliate-banner-box .card-custom:hover {
    transform: none;
    border-color: var(--by-primary);
    box-shadow: var(--by-shadow);
}

/* Fixes pour les scripts de bannières tierces */
.ig-banner-official-container {
    max-width: 100%;
    overflow: hidden;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.ig-banner-official-container iframe {
    max-width: 100%;
    border: none;
    border-radius: 8px;
}
