/* =================================
   STYLE JONATHAN ET LE CLAN DE L'OISEAU tonnerre
   ================================= */

/* Variables CSS - Light Mode */
:root {
    --primary-color: #2c1810;
    --secondary-color: #8b6f47;
    --accent-color: #d4af37;
    --text-color: #333;
    --light-bg: #f5f1ed;
    --border-color: #d4c5b9;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Dark Mode */
body.dark-mode {
    --primary-color: #1a1a1a;
    --secondary-color: #3a3a3a;
    --accent-color: #c9a961;
    --text-color: #e0e0e0;
    --light-bg: #0f0f0f;
    --border-color: #444;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.7);
}

/* Reset et Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Georgia', 'Garamond', serif;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--light-bg) 0%, #e8ddd3 100%);
    line-height: 1.8;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ================================= 
   HEADER / TITRE
   ================================= */

.header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    color: var(--accent-color);
    border-radius: 8px;
    margin-bottom: 50px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--accent-color);
}

.title {
    font-size: 3.5rem;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInDown 0.8s ease-out;
}

.subtitle {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #f0e8d8;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Arial', sans-serif;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ================================= 
   INTRODUCTION
   ================================= */

.introduction {
    background: white;
    padding: 40px;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    border-left: 6px solid var(--accent-color);
    transition: background-color 0.3s ease;
}

body.dark-mode .introduction {
    background: #1a1a1a;
    color: var(--text-color);
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-color);
    margin-bottom: 25px;
    font-style: italic;
    text-align: center;
}

.intro-highlights {
    background: #faf7f3;
    padding: 30px;
    border-radius: 6px;
    margin: 30px 0;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

body.dark-mode .intro-highlights {
    background: #2a2a2a;
}

.intro-highlights p {
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.8;
    text-align: center;
    color: var(--secondary-color);
    font-weight: 500;
}

.intro-highlights p:last-child {
    margin-bottom: 0;
}

.author-note {
    text-align: right;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--secondary-color);
    margin-top: 30px;
}

/* ================================= 
   COPYRIGHT
   ================================= */

.copyright {
    background: var(--primary-color);
    color: var(--accent-color);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.copyright p {
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.copyright-legal {
    font-size: 0.85rem;
    font-style: italic;
    color: #d4c5b9;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* ================================= 
   AUTHOR BIO
   ================================= */

.author-bio {
    background: white;
    padding: 40px;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    border-right: 6px solid var(--secondary-color);
    transition: background-color 0.3s ease;
}

body.dark-mode .author-bio {
    background: #1a1a1a;
    color: var(--text-color);
}

.author-bio h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 15px;
}

body.dark-mode .author-bio h2 {
    color: var(--accent-color);
}

.author-bio p {
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.8;
    text-align: justify;
}

.author-bio em {
    color: var(--secondary-color);
    font-weight: 600;
    font-style: italic;
}

.works-list {
    list-style: none;
    margin: 25px 0;
    padding-left: 20px;
}

.works-list li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.7;
}

.works-list li:before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.works-list em {
    color: var(--secondary-color);
    font-style: italic;
    font-weight: 600;
}

.works-list ul {
    list-style: none;
    margin-top: 10px;
    padding-left: 20px;
}

.works-list ul li:before {
    content: "◆";
    font-size: 0.8rem;
}

/* ================================= 
   STORY SECTION
   ================================= */

.story {
    background: white;
    padding: 50px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transition: background-color 0.3s ease;
}

body.dark-mode .story {
    background: #1a1a1a;
    color: var(--text-color);
}

.story-date {
    text-align: center;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.story-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 15px;
}

body.dark-mode .story-title {
    color: var(--accent-color);
}

.story-content {
    font-size: 0.95rem;
    line-height: 1.9;
    text-align: justify;
}

.story-content p {
    margin-bottom: 20px;
    text-indent: 2em;
}

.story-content p:first-child {
    text-indent: 2em;
}

.story-content em {
    color: var(--secondary-color);
    font-style: italic;
    font-weight: 500;
}

.dialogue {
    background: #faf7f3;
    padding: 15px 20px;
    border-radius: 4px;
    text-indent: 0;
    line-height: 1.7;
    transition: background-color 0.3s ease;
}

body.dark-mode .dialogue {
    background: #2a2a2a;
    color: var(--text-color);
}

.narrative-break {
    text-align: center;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 40px 0;
    letter-spacing: 4px;
    font-weight: bold;
}

.story-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    text-indent: 0;
}

.character-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.character-item {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

body.dark-mode .character-item {
    background: #1f1f1f;
    border-color: #444;
}

.character-item:hover {
    transform: translateY(-2px);
}

.character-name {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--primary-color);
}

body.dark-mode .character-name {
    color: var(--accent-color);
}

.character-note {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

body.dark-mode .character-note {
    color: #ccc;
}

.glossary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.glossary-item {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 18px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

body.dark-mode .glossary-item {
    background: #1f1f1f;
    border-color: #444;
}

.glossary-item:hover {
    transform: translateY(-2px);
}

.glossary-term {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

body.dark-mode .glossary-term {
    color: var(--accent-color);
}

.glossary-definition {
    color: var(--secondary-color);
    line-height: 1.8;
}

body.dark-mode .glossary-definition {
    color: #d0d0d0;
}

/* ================================= 
   FOOTER
   ================================= */

.footer {
    text-align: center;
    padding: 30px;
    color: var(--primary-color);
    font-size: 0.9rem;
    border-top: 2px solid var(--border-color);
    margin-top: 50px;
}

/* ================================= 
   ANIMATIONS
   ================================= */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================= 
   RESPONSIVE DESIGN
   ================================= */

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .title {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    .introduction {
        padding: 25px;
    }

    .intro-text {
        font-size: 0.95rem;
    }

    .intro-highlights {
        padding: 20px;
    }

    .intro-highlights p {
        font-size: 0.9rem;
    }

    .author-bio {
        padding: 25px;
    }

    .author-bio h2 {
        font-size: 1.5rem;
    }

    .story {
        padding: 25px;
    }

    .story-title {
        font-size: 1.5rem;
    }

    .story-content {
        font-size: 0.9rem;
    }

    .story-content p {
        text-indent: 1.5em;
    }

    .dialogue {
        padding: 12px 15px;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }

    .story-content p {
        text-indent: 1em;
    }

    .author-bio h2,
    .story-title {
        font-size: 1.3rem;
    }
}

.page-meta {
    text-align: center;
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: 500;
}

body.dark-mode .page-meta {
    color: var(--accent-color);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    align-items: center;
    margin: 40px 0 20px;
}

.pagination .button,
.pagination span.page-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    min-width: 120px;
}

.pagination .button {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.pagination .button:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

.pagination .button.disabled {
    background: #d8d2cc;
    color: #7a6f65;
    pointer-events: none;
    transform: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .pagination .button.disabled {
    background: #3a3a3a;
    color: #888;
}

.pagination span.page-counter {
    background: #f6f0ea;
    color: var(--primary-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .pagination span.page-counter {
    background: #2a2a2a;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* ================================= 
   PRINT STYLE
   ================================= */

@media print {
    body {
        background: white;
    }

    .container {
        max-width: 100%;
    }

    .header {
        page-break-after: avoid;
    }

    .story-content p {
        orphans: 3;
        widows: 3;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}

/* ==================================
    POUR SONIA
   ================================== */

.story-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    transition: font-size 0.2s ease;
}
.accessibility-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
}
.access-btn {
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #333;
    border-radius: 10px;
    background-color: #f0f0f0;
    color: #000;
}
.access-btn:hover, .access-btn:focus {
    background-color: #333;
    color: #fff;
}
body.high-contrast,
body.high-contrast .container,
body.high-contrast .story,
body.high-contrast .story-content,
body.high-contrast p,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast span {
    background-color: #000000 !important;
    color: #ffff00 !important;
}
body.high-contrast .button,
body.high-contrast .access-btn,
body.high-contrast .theme-toggle {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}
body.high-contrast a {
    color: #ffff00 !important;
    text-decoration: underline;
}

