/* =========================
   BASE
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f1ea;
    color: #111;
}

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

.container {
    width: min(1100px, 90%);
    margin: 0 auto;
}


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

.header {
    background: #111;
    color: white;
}

.nav {
    min-height: 75px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: bold;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    opacity: 0.8;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 1;
}


/* =========================
   HERO
========================= */

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;

    background:
        linear-gradient(
            rgba(0, 0, 0, 0.25),
            rgba(0, 0, 0, 0.75)
        ),
        url("/images/banniere.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    color: white;
}

.hero-overlay {
    width: min(1100px, 90%);
    margin: 0 auto;
    padding: 100px 0;
}

.hero h1 {
    max-width: 800px;
    margin: 15px 0 20px;

    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.95;
}

.hero-text {
    max-width: 550px;
    margin-bottom: 30px;

    font-size: 1.2rem;
    line-height: 1.6;
    color: #ddd;
}


/* =========================
   PETITS TITRES
========================= */

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: bold;
}


/* =========================
   BOUTONS
========================= */

.btn {
    display: inline-block;
    padding: 13px 22px;

    background: #111;
    color: white;

    border: 2px solid #111;

    font-weight: bold;

    transition:
        transform 0.2s,
        background 0.2s,
        color 0.2s;
}

.hero .btn {
    background: white;
    color: #111;
    border-color: white;
}

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

.btn-outline {
    background: transparent;
    color: #111;
}


/* =========================
   SECTIONS
========================= */

.section {
    padding: 100px 0;
}

.section-heading {
    margin-bottom: 50px;
}

.section h2,
.about h2,
.contact h2 {
    margin: 10px 0;

    font-size: clamp(2rem, 5vw, 4rem);
}


/* =========================
   BANDES DESSINÉES
========================= */

.comics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: start;
}

.comic-card {
    background: white;
    overflow: hidden;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.comic-card:hover {
    transform: translateY(-5px);

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.comic-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.comic-cover img {
    width: 100%;
    height: 100%;
    display: block;

    object-fit: cover;
}

.placeholder {
    width: 100%;
    height: 100%;

    background:
        repeating-linear-gradient(
            45deg,
            #111,
            #111 10px,
            #1b1b1b 10px,
            #1b1b1b 20px
        );

    color: white;

    display: grid;
    place-items: center;

    font-size: 1.5rem;
    font-weight: bold;
}

.comic-content {
    padding: 22px;
}

.comic-content h3 {
    margin: 5px 0 12px;

    font-size: 1.5rem;
}

.comic-content p {
    line-height: 1.6;
}

.comic-number {
    margin: 0;

    font-size: 0.75rem;

    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.comic-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 22px;
}


/* =========================
   À PROPOS
========================= */

.about {
    padding: 100px 0;

    background: #111;
    color: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 80px;

    align-items: center;
}

.about-content > p {
    font-size: 1.2rem;
    line-height: 1.8;

    color: #ccc;
}


/* =========================
   CONTACT
========================= */

.contact {
    text-align: center;
}

.contact h2 {
    max-width: 800px;

    margin: 15px auto 35px;
}


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

.site-footer {
    padding: 35px 20px;

    background: #111;
    color: #bbb;

    text-align: center;
}

.footer-credit {
    margin: 0 0 18px;

    font-size: 14px;
}

.footer-legal {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 10px;

    flex-wrap: wrap;
}

.footer-legal a {
    color: #ff00c8;

    font-weight: 600;

    text-decoration: none;
}

.footer-legal a:hover {
    text-decoration: underline;
}


/* =========================
   ADMINISTRATION
========================= */

.admin-page {
    width: calc(100% - 40px);
    max-width: 1100px;
    margin: 60px auto;
    padding: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-header-actions form {
    margin: 0;
    display: block;
}

.admin-empty {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
}

.admin-empty h2 {
    margin-bottom: 15px;
}

.admin-empty p {
    margin-bottom: 25px;
}

/* Formulaire d'ajout uniquement */
.admin-page > form,
.admin-form {
    display: grid;
    gap: 15px;
}

.admin-page input,
.admin-page textarea {
    width: 100%;
    padding: 12px;
    font: inherit;
}

.admin-page textarea {
    min-height: 150px;
    resize: vertical;
}

.admin-page button {
    padding: 14px 20px;
    border: 0;
    background: #111;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.admin-list {
    width: 100%;
}

.admin-comic {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 25px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
}

.admin-comic img {
    width: 120px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.admin-comic-content {
    min-width: 0;
}

.admin-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.admin-actions form {
    margin: 0;
    display: block;
}

.btn-delete {
    display: inline-block;
    padding: 13px 22px;
    border: 2px solid #b00020;
    background: #b00020;
    color: white;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
    transition:
        transform 0.2s,
        opacity 0.2s;
}

.btn-delete:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}


/* =========================
   TABLETTE
========================= */

@media (max-width: 1000px) and (min-width: 751px) {

    .comics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* =========================
   MOBILE
========================= */

@media (max-width: 750px) {

    .nav {
        flex-direction: column;

        justify-content: center;

        gap: 15px;

        padding: 20px 0;
    }

    nav {
        gap: 15px;

        flex-wrap: wrap;

        justify-content: center;
    }

    .hero {
        min-height: 75vh;

        background-position: center;
    }

    .hero-overlay {
        padding: 70px 0;
    }

    .hero h1 {
        font-size: clamp(2.7rem, 13vw, 4.5rem);
    }

    .hero-text {
        font-size: 1rem;
    }

    .section {
        padding: 70px 0;
    }

    .comics-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-content {
        grid-template-columns: 1fr;

        gap: 20px;
    }

    .about {
        padding: 70px 0;
    }

    .admin-page {
        width: calc(100% - 30px);
        max-width: 1100px;
        margin: 30px auto;
    }

    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .admin-header-actions .btn,
    .admin-header-actions form,
    .admin-header-actions button {
        width: 100%;
        text-align: center;
    }

    .admin-comic {
        grid-template-columns: 90px 1fr;
    }

    .admin-comic img {
        width: 90px;
    }
}


/* =========================
   PETITS ÉCRANS
========================= */

@media (max-width: 480px) {

    nav {
        font-size: 0.9rem;
    }

    .hero {
        min-height: 70vh;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .comic-content {
        padding: 20px;
    }

    .comic-actions {
        flex-direction: column;
    }

    .comic-actions .btn {
        text-align: center;
    }

    .admin-comic {
        grid-template-columns: 1fr;
    }

    .admin-comic img {
        width: 120px;
    }
}
/* =========================
   PAGES LÉGALES
========================= */

.legal-page {
    min-height: 100vh;
    padding: 60px 20px;
}

.legal-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.legal-container h1 {
    margin-bottom: 40px;
}

.legal-container section {
    margin: 40px 0;
}

.legal-container h2 {
    margin-bottom: 15px;
}

.legal-container p {
    line-height: 1.7;
    margin-bottom: 15px;
}

.legal-container a {
    color: #ff00aa;
}

.legal-back {
    display: inline-block;
    margin-bottom: 30px;
    text-decoration: none;
}

.legal-back:hover,
.legal-container a:hover {
    text-decoration: underline;
}

.legal-update {
    margin-top: 50px;
    font-size: 0.9rem;
    opacity: 0.7;
}
/* =========================
   CONNEXION ADMIN
========================= */

.admin-login {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-container h1 {
    margin-bottom: 15px;
}

.login-container > p {
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group input {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #444;
    font-size: 1rem;
}

.login-form button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.login-error {
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid;
}

.login-links {
    margin-top: 20px;
}
/* =========================
   CHAMPS MOT DE PASSE
========================= */

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    width: 100%;
    padding-right: 52px;
}


/* Bouton afficher / masquer */

.admin-page .password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;

    transform: translateY(-50%);

    width: 34px;
    height: 34px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: transparent;
    color: #111;

    font-size: 20px;
    font-weight: normal;
    line-height: 1;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}


/* Petit effet au survol */

.admin-page .password-toggle:hover {
    background: rgba(0, 0, 0, 0.06);

    transform:
        translateY(-50%)
        scale(1.1);
}


/* Navigation clavier */

.admin-page .password-toggle:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}
/* =========================
   CASES À COCHER ADMIN
========================= */

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;

    width: fit-content;

    cursor: pointer;
    user-select: none;
}

.admin-page .checkbox-field input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;

    width: 20px;
    height: 20px;
    min-width: 20px;

    padding: 0;
    margin: 0;

    border: 2px solid #111;
    border-radius: 3px;

    background: #fff;

    display: grid;
    place-content: center;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.admin-page .checkbox-field input[type="checkbox"]::before {
    content: "✓";

    color: #fff;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;

    transform: scale(0);

    transition: transform 0.15s ease;
}

.admin-page .checkbox-field input[type="checkbox"]:checked {
    background: #111;
}

.admin-page .checkbox-field input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.admin-page .checkbox-field input[type="checkbox"]:hover {
    transform: scale(1.08);
}

.checkbox-field span {
    line-height: 1.4;
}
/* =========================
   PORTFOLIO - LIGHTBOX
========================= */

.artwork-open {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.artwork-open img {
    transition: transform 0.3s ease;
}

.artwork-open:hover img {
    transform: scale(1.03);
}

.artwork-view {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.55);
    color: #fff;

    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    opacity: 0;
    transition: opacity 0.3s ease;
}

.artwork-open:hover .artwork-view {
    opacity: 1;
}


/* LIGHTBOX */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 40px;

    background: rgba(0, 0, 0, 0.92);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;

    text-align: center;
}

.lightbox-content img {
    display: block;

    max-width: 90vw;
    max-height: 80vh;

    width: auto;
    height: auto;

    object-fit: contain;
}

.lightbox-content p {
    margin-top: 15px;

    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;

    padding: 0;

    border: none;
    background: transparent;

    color: #fff;
    font-size: 3rem;
    line-height: 1;

    cursor: pointer;
}

.lightbox-open {
    overflow: hidden;
}


/* MOBILE */

@media (max-width: 768px) {

    .lightbox {
        padding: 20px;
    }

    .lightbox-content img {
        max-width: 95vw;
        max-height: 75vh;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
    }
}
/* =========================
   RETOUR EN HAUT
========================= */
.back-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;

    text-decoration: none;
    cursor: pointer;
    z-index: 1000;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        background 0.3s ease,
        visibility 0.3s ease;
}

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

.back-to-top-icon {
    width: 10px;
    height: 10px;

    border-top: 2px solid #fff;
    border-left: 2px solid #fff;

    transform: rotate(45deg) translate(2px, 2px);
}

.back-to-top:hover {
    background: #fff;
    transform: translateY(-4px);
}

.back-to-top:hover .back-to-top-icon {
    border-color: #111;
}