/* Global theme: Tavern / Parchment */

/*font-family: "Montserrat", sans-serif;*/
/*font-family: "Redressed", cursive;*/
/*font-family: "Dancing Script", cursive;*/
/* font-family: "Oldenburg", serif; */
/*font-family: "Cinzel Decorative", serif;*/



:root {
    --bg: #f4efe6;
    --bg-accent: #e8dfcf;
    --ink: #2a241e;
    --muted: #4d4640;
    --brand: #901f1f;
    /* wood/brown */
    --brand-accent: #b07a4a;
    --card: #fffaf0;
    --border: #d5c9b8;
}

html,
body {
    height: 100%;
}

body {
    font-family: "Oldenburg", serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /*background: radial-gradient(1200px 800px at 50% -10%, var(--bg) 40%, var(--bg-accent) 100%);*/
    background-image: url("../img/bois.webp");
    background-position: fixed;
    background-size: cover;
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.6;
}



.logo {
    width: 10rem;
    height: 10rem;
    margin-right: 2rem;
    border-radius: 50%;
    transform: scale(1.9);
    /* Zoom supplémentaire */
}

.titre-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Simple utilities to replace inline styles */
.row-right {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.center-text {
    text-align: center;
}

.mb-16 {
    margin-bottom: 16px;
}

.between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.inline {
    display: inline;
}

.flex-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

a {
    /* color: var(--brand);  */
    text-decoration: none;
    color: #7a4b2e;
    font-weight: bold;
}

a:hover {
    text-decoration: none;
}

/* Layout helpers */
.container {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    flex: 1 0 auto;
    /* grow to push footer down on short pages */
}

.cardContainer {
    /* background: var(--card); */
    background-image: url("../img/papier.webp");
    border: 1px solid var(--border);
    /* border-radius: 8px; */
    padding: 16px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), inset 0 0 60px rgba(176, 122, 74, 0.06);
    font-weight: bold;
    max-width: 1000px;
    /* Largeur maximale augmentée */
    margin: 0 auto;
    /* Centrer le conteneur */
}

.card {
    /* background: var(--card); */
    background-image: url("../img/papier.webp");
    background-color: rgba(222, 212, 174, 0.486);
    background-blend-mode: lighten;
    border: 1px solid var(--border);
    /* border-radius: 8px; */
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), inset 0 0 60px rgba(176, 122, 74, 0.06);
    font-weight: bold;
}

.muted {
    color: var(--muted);
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    margin: 0 0 8px;
    font-family: "Cinzel Decorative", serif;
    /*font-weight: weight;*/
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 22px;
}

input,
textarea {
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    padding: 12px;
    /* Padding augmenté */
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 16px;
    max-width: 100%;
    /* Assurer la largeur maximale */
}

textarea {
    min-height: 400px;
    resize: vertical;
    /* Permettre le redimensionnement vertical */
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #00000010;
}

.btn:hover {
    background: var(--brand-accent);
}

/* Lists */
.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list>li {
    padding: 10px 0;
    border-bottom: 1px solid #000;
}

.list>li:last-child {
    border-bottom: 0;
}

/* Article content */
.prose {
    white-space: pre-wrap;
}

.story-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 colonnes égales */
    gap: 16px;
    /* espace entre les colonnes */
    padding: 10px 0;
    border: 1px solid #000;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .container {
        padding: 12px;
    }

    .container-narrow {
        padding: 12px;
    }
}

/* Articles Styles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.article-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--muted);
    flex-wrap: wrap;
}

.article-date,
.article-author,
.article-reading-time {
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.article-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    line-height: 1.3;
}

.article-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: var(--brand);
}

.article-excerpt {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.article-footer {
    margin-top: auto;
}

.article-full {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 32px;
    text-align: center;
}

.article-header .article-meta {
    justify-content: center;
    margin-bottom: 16px;
}

.article-header .article-title {
    font-size: 32px;
    margin-bottom: 0;
}

.article-content {
    line-height: 1.7;
    font-size: 16px;
}

.article-share {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.btn-social {
    margin: 0 8px;
    background: var(--brand);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-social:hover {
    background: var(--brand-accent);
}

.sidebar {
    margin-top: 32px;
}

.recent-articles {
    list-style: none;
    padding: 0;
}

.recent-articles li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.recent-articles li:last-child {
    border-bottom: none;
}

.recent-articles a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.recent-articles a:hover {
    color: var(--brand);
}

.recent-articles small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Form Styles */
.article-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(144, 31, 31, 0.2);
}

.form-control[type="file"] {
    padding: 8px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.form-check-input {
    margin: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    transform: scale(1.2);
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    margin: 0;
}

/* Style spécial pour les cases à cocher de publication */
.form-check-input[type="checkbox"] {
    accent-color: var(--brand);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

/* Hover effect pour les cases à cocher */
.form-check:hover .form-check-input {
    transform: scale(1.3);
    transition: transform 0.2s ease;
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: var(--muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: var(--muted);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: var(--text);
}

.current-image {
    margin-top: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 4px;
    text-align: center;
}

.article-preview {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin: 20px 0;
}

.article-preview h3 {
    margin: 0 0 8px 0;
    color: var(--text);
}

.article-preview .published {
    color: #28a745;
    font-weight: 600;
}

.article-preview .draft {
    color: #ffc107;
    font-weight: 600;
}

.warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 16px;
    margin: 20px 0;
}

.warning-box p {
    margin: 0;
    color: #856404;
}

/* Story Styles */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.story-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 470px;
    /* Augmenté de 420px à 470px pour compenser l'image plus grande */
    max-height: none;
    /* Supprimer la hauteur maximale fixe */
}

.story-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.story-card .story-image {
    width: 100%;
    height: 150px;
    /* Augmenté de 100px à 150px */
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
    /* Empêche l'image de rétrécir */
}

.story-card .story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Recadre l'image pour remplir l'espace */
    transition: transform 0.3s ease;
}

.story-card:hover .story-image img {
    transform: scale(1.05);
}

.story-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Permet au contenu de s'adapter */
}

.story-title {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.story-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.story-title a:hover {
    color: var(--brand);
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--muted);
}

.story-author {
    font-weight: 500;
}

.story-date {
    opacity: 0.8;
}

.story-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.story-status.draft {
    background: #fff3cd;
    color: #856404;
}

.story-excerpt {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 12px;
    flex-grow: 1;
    max-height: 90px;
    /* Augmenté pour plus de contenu */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    /* 4 lignes au lieu de 3 */
    -webkit-box-orient: vertical;
}

.story-footer {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    flex-shrink: 0;
    /* Empêche le footer de rétrécir */
    min-height: 40px;
    /* Hauteur minimale pour les boutons */
}

.story-footer .btn {
    color: white !important;
    background: var(--brand) !important;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.story-footer .btn:hover {
    background: var(--brand-accent) !important;
    color: white !important;
}

.story-footer .btn-secondary {
    background: var(--muted);
    color: white !important;
}

.story-footer .btn-secondary:hover {
    background: var(--text);
    color: white !important;
}

.story-full-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Top Story Styles */
.top-story {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.top-story-image {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
}

.top-story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-story-content {
    flex-grow: 1;
}

.top-story-content h3 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
}

.top-story-content h3 a {
    color: var(--brand);
    text-decoration: none;
}

.top-story-content h3 a:hover {
    color: var(--brand-accent);
}

.top-story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--muted);
}

.top-story-author {
    font-weight: 500;
}

.top-story-likes {
    color: #e74c3c;
    font-weight: 500;
}

.top-story-caption {
    font-style: italic;
    color: var(--muted);
    margin: 0;
}

/* Pagination Styles */
.pagination-container {
    margin-top: 40px;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--brand);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.pagination-btn:hover {
    background: var(--brand-accent);
    color: white;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
    margin: 0 16px;
}

.pagination-number {
    padding: 8px 12px;
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.pagination-number:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.pagination-current {
    padding: 8px 12px;
    background: var(--brand);
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.pagination-info {
    color: var(--muted);
    font-size: 14px;
}

.text-center {
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-story {
        flex-direction: column;
    }

    .top-story-image {
        width: 100%;
        height: 200px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination-numbers {
        margin: 8px 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .container-narrow {
        padding: 10px;
    }

    .row-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .between {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .story-item {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .article-header .article-title {
        font-size: 24px;
    }

    .article-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-image: url("../img/pierre.webp");
    background-position: center;
    background-size: cover;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.navbar-brand {
    position: absolute;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1001;
}

.navbar-content {
    display: flex;
    align-items: center;
    /*justify-content: flex-end;*/
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 16px 0 200px;
    /* Moins d'espace à droite, plus à gauche */
}

.navbar-brand .logo {
    width: 32px;
    height: 32px;
    margin-right: 0;
}

.navbar-brand .brand-name {
    font-weight: 600;
    font-size: 24px;
    font-family: "Cinzel Decorative", serif;
}

.nav-links {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
}

/* À partir de 1566px, réduire le titre pour éviter les collisions avec "Cinzel Decorative" */
@media (max-width: 1566px) {
    .navbar-brand .brand-name {
        font-size: 22px;
    }
}

/* À partir de 1497px, réduire encore plus le titre et coller le menu à droite */
@media (max-width: 1497px) {
    .nav-links {
        justify-content: flex-end;
    }

    .navbar-content {
        padding: 0 16px 0 200px;
        justify-content: flex-end;
    }

    /* Réduire la taille du titre pour éviter les collisions */
    .navbar-brand .brand-name {
        font-size: 20px;
    }
}

/* À partir de 1336px, réduire encore plus le titre pour éviter le chevauchement */
@media (max-width: 1336px) {
    .nav-links {
        justify-content: flex-end;
    }

    .navbar-content {
        padding: 0 16px 0 180px;
        justify-content: flex-end;
    }

    /* Réduire la taille du titre pour éviter les collisions */
    .navbar-brand .brand-name {
        font-size: 18px;
    }
}

/* À partir de 1260px, réduire encore plus le titre et le padding */
@media (max-width: 1260px) {
    .nav-links {
        justify-content: flex-end;
    }

    .navbar-content {
        padding: 0 16px 0 160px;
        justify-content: flex-end;
    }

    /* Réduire la taille du titre pour éviter les collisions */
    .navbar-brand .brand-name {
        font-size: 17px;
    }
}

/* À partir de 1223px, réduire encore plus le titre et le padding */
@media (max-width: 1223px) {
    .nav-links {
        justify-content: flex-end;
    }

    .navbar-content {
        padding: 0 16px 0 150px;
        justify-content: flex-end;
    }

    /* Réduire la taille du titre pour éviter les collisions */
    .navbar-brand .brand-name {
        font-size: 16px;
    }
}

/* À partir de 1240px, maintenir le menu collé à droite */
@media (max-width: 1240px) {
    .nav-links {
        justify-content: flex-end;
    }

    .navbar-content {
        padding: 0 16px 0 150px;
        justify-content: flex-end;
    }

    /* Réduire la taille du titre pour éviter les collisions */
    .navbar-brand .brand-name {
        font-size: 16px;
    }
}

/* Navbar links as plain links (no red button background) */
.navbar .btn {
    background: transparent;
    color: #7a4b2e;
    border: 0;
    box-shadow: none;
    padding: 4px 8px;
}

.navbar .btn:hover {
    background: transparent;
    color: var(--brand);
    text-decoration: underline;
}

/* Styles spécifiques pour les nouveaux types de navigation */
.nav-primary {
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-primary:hover {
    background: rgba(var(--brand-rgb), 0.1);
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
}

.nav-action {
    background: var(--brand);
    color: white;
    border: 1px solid var(--brand);
}

.nav-action:hover {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    text-decoration: none;
}

.nav-admin {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.nav-admin:hover {
    background: #5a6268;
    border-color: #5a6268;
    text-decoration: none;
}

.nav-login {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--brand);
}

.nav-login:hover {
    background: var(--brand);
    color: white;
    text-decoration: none;
}

.nav-register {
    background: var(--brand);
    color: white;
    border: 1px solid var(--brand);
}

.nav-register:hover {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    text-decoration: none;
}

.nav-logout {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.nav-logout:hover {
    background: #c82333;
    border-color: #c82333;
    text-decoration: none;
}

.nav-separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

.navbar .btn:focus {
    outline: 2px solid rgba(122, 75, 46, 0.35);
    outline-offset: 2px;
}

/* Burger menu */
.burger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
    position: absolute;
    right: 16px;
    z-index: 1001;
}

.burger-line {
    width: 25px;
    height: 3px;
    background-color: #7a4b2e;
    margin: 3px 0;
    transition: 0.3s;
}

.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-image: url("../img/pierre.webp");
    background-position: center;
    background-size: cover;
    border-top: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
    min-height: 300px;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu .nav-links {
    flex-direction: column;
    padding: 16px;
    gap: 8px;
    display: flex;
    min-height: 200px;
}

.mobile-menu .btn {
    width: 100%;
    text-align: center;
    padding: 12px;
    color: #7a4b2e !important;
    text-decoration: none;
    display: block;
    border: none;
    background: transparent;
    font-weight: bold;
    min-height: 40px;
    line-height: 1.2;
    border-bottom: 1px solid rgba(122, 75, 46, 0.2);
}

.mobile-menu .btn:hover {
    background: transparent;
    color: var(--brand) !important;
}

@media (max-width: 768px) {
    .navbar-brand {
        left: 12px;
    }

    .navbar-brand .brand-name {
        font-size: 20px;
    }

    .navbar-content {
        padding: 0 12px 0 200px;
    }

    .nav-links {
        display: none;
    }

    .burger-menu {
        display: flex;
    }
}

/* Footer */
.footer {
    margin-top: auto;
    background-image: url("../img/pierre.webp");
    background-position: center;
    background-size: cover;
    border-top: 1px solid var(--border);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.footer-inner {
    max-width: 1024px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer small {
    color: var(--muted);
}

@media (max-width: 768px) {
    .footer-inner {
        padding: 12px;
        gap: 8px;
    }

    .footer-links {
        gap: 8px;
        flex-wrap: wrap;
    }
}

/* Login centered */
.login-centered {
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

/* Image container (16:9 responsive hero) */
.img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    /* border: 1px solid var(--border); */
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Markdown Content Styles */
.story-content {
    font-family: "Oldenburg", serif;
    line-height: 1.8;
    color: var(--ink);
}

.story-content h1,
.story-content h2,
.story-content h3,
.story-content h4,
.story-content h5,
.story-content h6 {
    color: var(--brand);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.story-content h1 {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--brand-accent);
    padding-bottom: 0.5rem;
}

.story-content h2 {
    font-size: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}

.story-content h3 {
    font-size: 1.5rem;
}

.story-content h4 {
    font-size: 1.25rem;
}

.story-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.story-content strong {
    color: var(--brand);
    font-weight: bold;
}

.story-content em {
    font-style: italic;
    color: var(--muted);
}

.story-content ul,
.story-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.story-content li {
    margin-bottom: 0.5rem;
}

.story-content blockquote {
    border-left: 4px solid var(--brand-accent);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--card);
    font-style: italic;
    color: var(--muted);
}

.story-content code {
    background: var(--bg-accent);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    color: var(--brand);
}

.story-content pre {
    background: var(--bg-accent);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.story-content pre code {
    background: none;
    padding: 0;
    color: var(--ink);
}

.story-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--brand-accent), transparent);
    margin: 2rem 0;
}

.story-content a {
    color: var(--brand);
    text-decoration: none;
    border-bottom: 1px dotted var(--brand-accent);
}

.story-content a:hover {
    color: var(--brand-accent);
    border-bottom-style: solid;
}

.story-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.story-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--card);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.story-content th,
.story-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.story-content th {
    background: var(--brand);
    color: white;
    font-weight: bold;
}

.story-content tr:hover {
    background: var(--bg-accent);
}

/* Admin Link */
.admin-link {
    background: var(--brand) !important;
    color: white !important;
    font-weight: bold;
}

.admin-link:hover {
    background: var(--brand-accent) !important;
    transform: scale(1.05);
}


/* === Corrections mobiles globales === */
html,
body {
    overflow-x: hidden;
    /* Empêche le scroll horizontal parasite */
    width: 100%;
}

/* Corrige le padding exagéré sur mobile */


/* Assure que toutes les images ne débordent pas */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Corrige le box-sizing global */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Optionnel : recentrer le contenu dans la navbar mobile */
@media (max-width: 768px) {
    .navbar-brand {
        position: relative;
        left: 0;
        margin-left: 12px;
    }
}

/* Améliore la lisibilité mobile */
@media (max-width: 768px) {
    body {
        font-size: 17px;
        line-height: 1.7;
        background-attachment: scroll;
        /* évite les bugs de fond sur mobile */
    }
}

/* Corrige le menu mobile */
.mobile-menu {
    min-height: auto;
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .navbar {
        min-height: 70px;
        padding: 10px 0;
    }

    .navbar-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        position: relative;
        left: 0;
        margin-left: 12px;
    }

    .navbar-brand .logo {
        width: 38px;
        height: 38px;
    }

    .navbar-brand .brand-name {
        font-size: 21px;
        line-height: 1;
        white-space: nowrap;
    }

    .navbar-content {
        padding: 0 12px;
    }

    .nav-links {
        display: none;
    }

    .burger-menu {
        display: flex;
    }
}

/* === Fond beige uniforme pour les histoires === */
.article-content,
.story-content {
    background-color: #f0e0b8;
    /* beige parchemin clair, très lisible */
    background-image: none;
    /* supprime la texture */
    border: 1px solid #d8c9a7;
    /* bord discret pour rappeler le parchemin */
    box-shadow: 0 4px 12px rgba(122, 75, 46, 0.15);
    /* ombre chaude et douce */
    padding: 24px;
    border-radius: 4px;
}

.article-content,
.story-content,
.cardContainer,
.card {
    font-weight: normal;
}

h1,
h2,
h3,
strong,
b {
    font-weight: bold;
}

/* Admin Styles */
.admin-stats {
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--brand);
    margin: 0 0 8px 0;
    font-family: "Cinzel Decorative", serif;
}

.stat-card p {
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text);
}

.stat-card small {
    color: var(--muted);
    font-size: 14px;
}

.admin-actions {
    margin-bottom: 32px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.action-buttons .btn {
    padding: 12px 20px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--brand);
    color: white;
    border: 1px solid var(--brand);
}

.btn-primary:hover {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--muted);
    color: white;
    border: 1px solid var(--muted);
}

.btn-secondary:hover {
    background: var(--text);
    border-color: var(--text);
    transform: translateY(-1px);
}

.admin-recent {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.recent-section h2 {
    margin-bottom: 16px;
    color: var(--brand);
    font-family: "Cinzel Decorative", serif;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: box-shadow 0.2s ease;
}

.recent-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recent-content {
    flex-grow: 1;
}

.recent-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.recent-content h4 a {
    color: var(--text);
    text-decoration: none;
}

.recent-content h4 a:hover {
    color: var(--brand);
}

.recent-meta {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.status.published {
    background: #d4edda;
    color: #155724;
}

.status.draft {
    background: #fff3cd;
    color: #856404;
}

.status.admin {
    background: #d1ecf1;
    color: #0c5460;
}

.status.user {
    background: #e2e3e5;
    color: #383d41;
}

.status.writer {
    background: #e7f3ff;
    color: #004085;
}

.recent-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Admin Table Styles */
.admin-table {
    margin-top: 24px;
    overflow-x: auto;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--brand);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.admin-table td {
    font-size: 14px;
}

.admin-table tr:hover {
    background: var(--bg-accent);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table .actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.admin-table .actions form {
    margin: 0;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
}

/* Admin Help Styles */
.admin-help {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
}

.admin-help p {
    margin: 0 0 12px 0;
    font-weight: 600;
    color: var(--brand);
}

.admin-help ul {
    margin: 0;
    padding-left: 20px;
}

.admin-help li {
    margin-bottom: 8px;
    color: var(--text);
}

/* Responsive admin */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .admin-recent {
        grid-template-columns: 1fr;
    }

    .recent-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .recent-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.navbar .btn {
    white-space: nowrap;
    /* Empêche les retours à la ligne dans les boutons */
    display: inline-flex;
    /* Centre verticalement le texte */
    align-items: center;
    justify-content: space-between;
}

/* Très grands écrans */
@media (min-width: 1600px) {
    .container {
        max-width: 1200px;
    }

    .cardContainer {
        max-width: 1400px;
    }
}

/* Écrans ultra-larges */
@media (min-width: 2000px) {
    .container {
        max-width: 1400px;
    }

    .cardContainer {
        max-width: 1600px;
    }
}

@media (min-width: 2500px) {
    .container {
        max-width: 1800px;
    }

    .cardContainer {
        max-width: 2000px;
    }
}

/* ===== HERO SECTION ===== */
.hero-container .hero-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.25);
    text-align: center;
}

/* Texte du Hero */
.hero-tagline {
    font-size: 1.4rem;
    line-height: 1.6;
    color: #fff;
    margin: 0;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    max-width: 800px;
}

/* Bouton principal du Hero */
.btn-hero {
    padding: 14px 36px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 6px;
    text-shadow: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    /* Empêche le retour à la ligne */
    max-width: 280px;
    text-align: center;
}

/* ===== RESPONSIVE ===== */

/* Tablettes */
@media (max-width: 768px) {
    .hero-container .hero-content {
        padding: 1.5rem;
        gap: 1rem;
    }

    .hero-tagline {
        font-size: 1.05rem;
        line-height: 1.45;
        max-width: 90%;
    }

    .btn-hero {
        padding: 10px 26px;
        font-size: 0.95rem;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    .hero-container .hero-content {
        padding: 1rem;
        gap: 0.8rem;
    }

    .hero-tagline {
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .btn-hero {
        padding: 8px 20px;
        font-size: 0.85rem;
        border-radius: 5px;
    }

    .navbar-brand .brand-name {
        font-size: 16px;
        max-width: 120px;
    }
}

    @media (max-width: 1024px) {
        .navbar-brand {
            left: 12px;
        }

        .navbar-brand .brand-name {
            display: none;
        }

        .navbar-content {
            padding: 0 12px 0 60px;
        }

        .nav-links {
            display: none;
        }

        .burger-menu {
            display: flex;
        }
    }


    @media (max-width: 1024px) {
        .navbar {
            min-height: 70px;
            padding: 10px 0;
        }

        .navbar-brand {
            display: flex;
            align-items: center;
            gap: 8px;
            position: relative;
            left: 0;
            margin-left: 12px;
        }

        .navbar-brand .logo {
            width: 38px;
            height: 38px;
        }

        .navbar-brand .brand-name {
            display: none;
        }

        .navbar-content {
            padding: 0 12px 0 60px;
        }

        .nav-links {
            display: none;
        }

        .burger-menu {
            display: flex;
        }
    }
    
    .support-taverne {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.support-taverne .support-text {
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.support-taverne .support-link a {
    text-decoration: none;
}

.support-taverne .support-link a:hover {
    text-decoration: underline;
}