/*
Theme Name: RécitPlus
Theme URI: https://example.com
Author: Votre nom
Description: Thème WordPress d'écriture en ligne inspiré de Wattpad, avec comptes lecteurs/écrivains, pièces virtuelles, déblocage de chapitres et lecture immersive façon Pocket FM.
Version: 1.0
Requires PHP: 7.4
Text Domain: recitplus
*/

/* =========================================================
   PALETTE DE COULEURS — douce, confortable pour les yeux
   ========================================================= */
:root {
    --rp-bg: #FAF7F2;           /* fond crème très clair */
    --rp-bg-alt: #F1ECE3;       /* fond secondaire beige doux */
    --rp-surface: #FFFFFF;      /* cartes / surfaces */
    --rp-primary: #B5654B;      /* terracotta doux (accent principal) */
    --rp-primary-dark: #9A5140; /* hover / actif */
    --rp-secondary: #6B7F73;    /* vert sauge (accent secondaire) */
    --rp-text: #3A3530;         /* texte principal, brun-noir doux */
    --rp-text-light: #74695F;  /* texte secondaire */
    --rp-border: #E4DCCF;       /* bordures discrètes */
    --rp-gold: #C9A24B;         /* couleur des pièces */
    --rp-success: #6B7F73;
    --rp-danger: #B5654B;
    --rp-radius: 14px;
    --rp-shadow: 0 2px 12px rgba(58, 53, 48, 0.06);
    --rp-shadow-hover: 0 6px 20px rgba(58, 53, 48, 0.10);
    --rp-font-main: 'Georgia', 'Merriweather', serif;
    --rp-font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Mode lecture sombre (activable par l'utilisateur) */
body.rp-dark-mode {
    --rp-bg: #241F1A;
    --rp-bg-alt: #2E2823;
    --rp-surface: #2A2420;
    --rp-primary: #D98F72;
    --rp-primary-dark: #E2A78C;
    --rp-secondary: #8FA89A;
    --rp-text: #EDE6DC;
    --rp-text-light: #B3A99C;
    --rp-border: #3D362F;
    --rp-shadow: 0 2px 12px rgba(0,0,0,0.3);
    --rp-shadow-hover: 0 6px 20px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
    background: var(--rp-bg);
    color: var(--rp-text);
    font-family: var(--rp-font-ui);
    margin: 0;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--rp-primary); text-decoration: none; }
a:hover { color: var(--rp-primary-dark); }

.rp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Boutons */
.rp-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: var(--rp-radius);
    background: var(--rp-primary);
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
}
.rp-btn:hover { background: var(--rp-primary-dark); color: #fff; transform: translateY(-1px); }
.rp-btn-secondary { background: var(--rp-secondary); }
.rp-btn-outline { background: transparent; border: 2px solid var(--rp-primary); color: var(--rp-primary); }
.rp-btn-gold { background: var(--rp-gold); color: #fff; }
.rp-btn-full { width: 100%; text-align: center; }

/* Cartes */
.rp-card {
    background: var(--rp-surface);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    border: 1px solid var(--rp-border);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.rp-card:hover { box-shadow: var(--rp-shadow-hover); transform: translateY(-2px); }

/* Header */
.rp-header {
    background: var(--rp-surface);
    border-bottom: 1px solid var(--rp-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.rp-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}
.rp-logo { font-family: var(--rp-font-main); font-size: 24px; font-weight: bold; color: var(--rp-primary); }
.rp-nav { display: flex; gap: 24px; align-items: center; }
.rp-coins-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--rp-bg-alt); padding: 6px 14px; border-radius: 20px;
    color: var(--rp-gold); font-weight: 600; font-size: 14px;
}

/* Grille d'histoires */
.rp-story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 24px 0;
}
.rp-story-cover {
    width: 100%; aspect-ratio: 2/3; object-fit: cover;
    border-radius: var(--rp-radius); background: var(--rp-bg-alt);
}
.rp-story-title { font-weight: 600; margin: 8px 0 4px; font-size: 15px; }
.rp-story-meta { font-size: 13px; color: var(--rp-text-light); }

/* Formulaires */
.rp-form-group { margin-bottom: 18px; }
.rp-form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.rp-input, .rp-textarea, textarea, input[type="text"], input[type="email"], input[type="password"] {
    width: 100%; padding: 12px 14px; border-radius: 10px;
    border: 1px solid var(--rp-border); background: var(--rp-surface);
    color: var(--rp-text); font-size: 15px; font-family: var(--rp-font-ui);
}
.rp-textarea { min-height: 120px; resize: vertical; }

/* Auth pages */
.rp-auth-box {
    max-width: 420px; margin: 60px auto; padding: 36px;
    background: var(--rp-surface); border-radius: var(--rp-radius); box-shadow: var(--rp-shadow);
}
.rp-social-login { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.rp-social-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 11px; border-radius: 10px; border: 1px solid var(--rp-border);
    background: var(--rp-surface); font-weight: 600; cursor: pointer;
}
.rp-divider { text-align: center; color: var(--rp-text-light); margin: 16px 0; font-size: 13px; }

/* Lecture immersive style Pocket FM */
.rp-reader {
    max-width: 720px; margin: 0 auto; padding: 40px 24px 120px;
    font-family: var(--rp-font-main); font-size: 19px; line-height: 1.9;
}
.rp-reader-topbar {
    position: sticky; top: 0; background: var(--rp-bg); padding: 14px 0;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--rp-border); z-index: 50;
}
.rp-progress-bar {
    position: fixed; top: 0; left: 0; height: 3px; background: var(--rp-primary);
    z-index: 200; transition: width 0.1s ease;
}
.rp-chapter-locked {
    text-align: center; padding: 60px 20px; background: var(--rp-bg-alt);
    border-radius: var(--rp-radius);
}
.rp-reader-controls {
    position: fixed; bottom: 0; left: 0; right: 0; background: var(--rp-surface);
    border-top: 1px solid var(--rp-border); padding: 12px 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.rp-font-size-controls { display: flex; gap: 8px; align-items: center; }

/* Dashboard écrivain */
.rp-dashboard { display: grid; grid-template-columns: 240px 1fr; gap: 30px; margin: 30px 0; }
.rp-dashboard-sidebar { background: var(--rp-surface); border-radius: var(--rp-radius); padding: 20px; box-shadow: var(--rp-shadow); height: fit-content; }
.rp-dashboard-sidebar a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--rp-text); margin-bottom: 4px; }
.rp-dashboard-sidebar a.active, .rp-dashboard-sidebar a:hover { background: var(--rp-bg-alt); color: var(--rp-primary); }
.rp-become-writer-box {
    background: linear-gradient(135deg, var(--rp-primary), var(--rp-secondary));
    color: #fff; padding: 30px; border-radius: var(--rp-radius); text-align: center; margin: 20px 0;
}
.rp-become-writer-box .rp-btn { background: #fff; color: var(--rp-primary); }

@media (max-width: 768px) {
    .rp-dashboard { grid-template-columns: 1fr; }
    .rp-reader { font-size: 17px; padding: 24px 16px 120px; }
}
