/*
 * Calico — thème inspiré de Hestia (ThemeIsle) : en-tête plein écran avec image filtrée,
 * conteneur principal « surélevé » qui chevauche l'en-tête, cartes à ombres douces,
 * titres en Roboto Slab, accent rose.
 * Licence : AGPL-3.0-or-later
 */

@font-face { font-family: "Roboto"; font-weight: 300; font-display: swap; src: url(../fonts/roboto-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url(../fonts/roboto-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url(../fonts/roboto-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-display: swap; src: url(../fonts/roboto-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-weight: 400; font-display: swap; src: url(../fonts/roboto-slab-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-weight: 700; font-display: swap; src: url(../fonts/roboto-slab-latin-700-normal.woff2) format("woff2"); }

:root {
    --accent: #e91e63;
    --accent-dark: #c2185b;
    --accent-shadow: rgba(233, 30, 99, .28);
    --text: #3c4858;
    --muted: #999;
    --bg: #e5e5e5;
    --surface: #fff;
    --surface-alt: #f7f7f7;
    --border: #e7e7e7;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #00bcd4;
    --radius: 6px;
    --shadow-1: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12);
    --shadow-2: 0 16px 38px -12px rgba(0,0,0,.56), 0 4px 25px 0 rgba(0,0,0,.12), 0 8px 10px -5px rgba(0,0,0,.2);
    --shadow-raised: 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12), 0 8px 10px -5px rgba(0,0,0,.2);
    --font: "Roboto", "Helvetica Neue", Arial, sans-serif;
    --font-title: "Roboto Slab", "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 700; line-height: 1.25; color: var(--text); margin: 0 0 .6em; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
strong, b { font-weight: 500; }
.container { width: 100%; max-width: 1170px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 780px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Barre de navigation (transparente au-dessus de l'en-tête, blanche au défilement) ---------- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 18px 0;
    color: #fff;
    transition: background .3s, padding .3s, box-shadow .3s, color .3s;
}
.navbar.is-solid, .navbar.navbar-default {
    background: var(--surface); color: var(--text); padding: 8px 0;
    box-shadow: 0 4px 18px 0 rgba(0,0,0,.12), 0 7px 10px -5px rgba(0,0,0,.15);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-family: var(--font-title); font-weight: 700; font-size: 1.35rem; }
.brand:hover { color: inherit; }
.brand svg { width: 34px; height: 34px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
    display: block; padding: 8px 14px; border-radius: 3px; color: inherit;
    font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em;
}
.nav-links a:hover { background: rgba(255,255,255,.15); }
.navbar.is-solid .nav-links a:hover, .navbar.navbar-default .nav-links a:hover { background: rgba(0,0,0,.06); color: var(--accent); }
.nav-links .btn, .nav-links .btn:hover { margin-left: 8px; color: #fff; background: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: inherit; padding: 6px; cursor: pointer; }
.nav-toggle svg { width: 26px; height: 26px; }
.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 500; text-align: center; }

/* ---------- En-tête de page ---------- */
.page-header {
    position: relative;
    min-height: 62vh;
    display: flex; align-items: center;
    background-size: cover; background-position: center;
    color: #fff;
    padding: 120px 0 140px;
}
.page-header { overflow: hidden; }
.header-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
/* Couverture utilisée en fond : floutée et agrandie pour masquer les marges de la planche */
.header-blur .header-bg { inset: -40px; filter: blur(14px) saturate(1.2); transform: scale(1.15); }
.page-header::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: rgba(0,0,0,.5);
}
.page-header.header-small { min-height: 38vh; padding: 110px 0 120px; }
.page-header > .container { position: relative; z-index: 2; }
.page-header h1, .page-header h2 { color: #fff; }
.page-header .title { font-size: 3.4rem; margin-bottom: .3em; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.page-header .subtitle { font-size: 1.25rem; font-weight: 300; max-width: 640px; opacity: .92; }
.page-header.text-center .subtitle { margin-left: auto; margin-right: auto; }
.header-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.text-center .header-actions { justify-content: center; }

/* ---------- Conteneur principal surélevé (signature Hestia) ---------- */
.main { position: relative; z-index: 3; background: var(--surface); min-height: 30vh; }
.footer { margin-top: 40px; }
.main-raised {
    margin: -70px 30px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
}
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-alt { background: var(--surface-alt); }
.section-title { text-align: center; margin-bottom: 8px; }
.section-description { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 44px; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 30px;
    border: 0; border-radius: 3px;
    background: var(--accent); color: #fff;
    font: 500 12px/1.4 var(--font); text-transform: uppercase; letter-spacing: .03em;
    box-shadow: 0 2px 2px 0 var(--accent-shadow), 0 3px 1px -2px rgba(233,30,99,.2), 0 1px 5px 0 rgba(233,30,99,.12);
    cursor: pointer; transition: box-shadow .2s, background .2s, transform .1s;
}
.btn:hover, .btn:focus-visible { color: #fff; background: var(--accent); box-shadow: 0 14px 26px -12px rgba(233,30,99,.42), 0 4px 23px 0 rgba(0,0,0,.12), 0 8px 10px -5px rgba(233,30,99,.2); }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 16px 40px; font-size: 14px; }
.btn-sm { padding: 6px 14px; font-size: 11px; }
.btn-white { background: #fff; color: var(--text); box-shadow: var(--shadow-1); }
.btn-white:hover { background: #fff; color: var(--accent); box-shadow: var(--shadow-2); }
.btn-ghost { background: transparent; color: inherit; box-shadow: none; border: 1px solid currentColor; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: inherit; box-shadow: none; }
.btn-success { background: var(--success); box-shadow: 0 2px 2px 0 rgba(76,175,80,.28); }
.btn-success:hover { background: var(--success); box-shadow: 0 14px 26px -12px rgba(76,175,80,.42), 0 8px 10px -5px rgba(76,175,80,.2); }
.btn-danger { background: var(--danger); box-shadow: 0 2px 2px 0 rgba(244,67,54,.28); }
.btn-danger:hover { background: var(--danger); box-shadow: 0 14px 26px -12px rgba(244,67,54,.42), 0 8px 10px -5px rgba(244,67,54,.2); }
.btn-neutral { background: #999; box-shadow: 0 2px 2px 0 rgba(153,153,153,.28); }
.btn-neutral:hover { background: #888; box-shadow: 0 14px 26px -12px rgba(153,153,153,.42); }
.btn-link { background: none; box-shadow: none; color: var(--accent); padding-left: 0; padding-right: 0; }
.btn-link:hover { background: none; box-shadow: none; color: var(--accent-dark); }
.btn-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn-group form { margin: 0; }

/* ---------- Grille de couvertures ---------- */
.grid { display: grid; gap: 30px; }
.grid-covers { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.card {
    position: relative; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-1); transition: box-shadow .25s;
}
.card-plain { box-shadow: none; background: transparent; }
.card-body { padding: 18px 20px 22px; }
.card-header-image {
    position: relative; display: block; overflow: hidden;
    margin: -20px 15px 0; border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    transition: transform .3s cubic-bezier(.34,1.61,.7,1), box-shadow .3s;
}
.card-blog { margin-top: 30px; }
.card-blog:hover .card-header-image { transform: translateY(-8px); box-shadow: 0 30px 50px -18px rgba(0,0,0,.6), 0 8px 20px 0 rgba(0,0,0,.15); }
.card-header-image img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.card-category { display: block; margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.card-title { font-size: 1.15rem; margin: 0 0 8px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-description { color: var(--muted); font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.card-footer .author { display: flex; align-items: center; gap: 8px; color: var(--text); }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; flex: none; }
.avatar-lg { width: 130px; height: 130px; font-size: 3rem; box-shadow: var(--shadow-2); border: 4px solid #fff; }

/* Pages récentes : vignettes horizontales */
.page-thumb { display: block; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow-1); transition: box-shadow .25s, transform .25s; background: #fff; }
.page-thumb:hover { box-shadow: var(--shadow-2); transform: translateY(-4px); }
.page-thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; object-position: top; }
.page-thumb span { display: block; padding: 10px 14px; color: var(--text); font-size: .9rem; }
.page-thumb small { display: block; color: var(--muted); }

/* ---------- Bloc « fonctionnalités » ---------- */
.info { text-align: center; padding: 0 12px; }
.info .icon { display: inline-flex; width: 64px; height: 64px; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 14px; }
.info .icon svg { width: 52px; height: 52px; }
.info h4 { font-size: 1.2rem; }
.info p { color: var(--muted); }

/* ---------- Lecteur de page ---------- */
.reader { background: #222; padding: 36px 0; border-radius: var(--radius) var(--radius) 0 0; }
.reader figure { margin: 0 auto; max-width: 960px; }
.reader img { margin: 0 auto; box-shadow: 0 20px 50px rgba(0,0,0,.6); background: #fff; }
.reader-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 16px; max-width: 960px; margin: 0 auto; }
.reader-nav .btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.reader-nav .position { color: #ddd; font-size: .9rem; }
.page-meta { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; }
.reactions { display: flex; gap: 20px; color: var(--muted); font-size: .95rem; margin: 10px 0 20px; }
.reactions span { display: inline-flex; align-items: center; gap: 6px; }
.reactions svg { width: 18px; height: 18px; color: var(--accent); }
.reply { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.reply-body { flex: 1; min-width: 0; }
.reply-author { font-weight: 500; color: var(--text); }
.reply-content { white-space: pre-line; overflow-wrap: anywhere; margin: 4px 0 0; }

.fedi-box { background: var(--surface-alt); border-radius: var(--radius); padding: 22px; box-shadow: inset 0 0 0 1px var(--border); }
.fedi-box h4 { display: flex; align-items: center; gap: 8px; }
.fedi-box svg { width: 22px; height: 22px; color: #6364ff; }
.fedi-box .feed-link { margin: 14px 0 0; }
.fedi-box .feed-link a { display: inline-flex; align-items: center; gap: 6px; }
.fedi-box .feed-link svg { width: 16px; height: 16px; color: #f28c28; }
.handle { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; background: #fff; padding: 6px 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--border); display: inline-block; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; min-width: 0; }

/* Liste des pages d'un comic */
.page-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.page-list a { display: block; color: var(--text); text-align: center; font-size: .9rem; }
.page-list img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top; border-radius: var(--radius); box-shadow: var(--shadow-1); margin-bottom: 8px; transition: box-shadow .25s; }
.page-list a:hover img { box-shadow: var(--shadow-2); }
.comic-intro { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
.comic-intro .cover { margin-top: -120px; border-radius: var(--radius); box-shadow: var(--shadow-2); }
.license svg { width: 16px; height: 16px; flex: none; }
.license { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 4px 10px; border-radius: 3px; background: var(--surface-alt); font-size: .8rem; font-weight: 500; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tag { padding: 3px 10px; border-radius: 12px; background: rgba(233,30,99,.1); color: var(--accent); font-size: .8rem; font-weight: 500; }
.tag-suggest { margin: 0 0 16px; }
.tag-suggest summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.tag-suggest form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.tag-suggest input[type=text] { max-width: 220px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Formulaires ---------- */
.form-card { max-width: 640px; margin: 0 auto; }
.form-row { margin-bottom: 22px; }
.form-row .form-row { margin-bottom: 0; }
.form-row:has(> div > .form-row) > div > .form-row + .form-row { margin-top: 22px; }
.has-error input, .has-error textarea { border-color: var(--danger); }
label { display: block; font-size: .85rem; font-weight: 500; color: #666; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], textarea, select {
    width: 100%; padding: 9px 0 7px; border: 0; border-bottom: 1px solid #d2d2d2; border-radius: 0;
    background: transparent no-repeat center bottom / 0 2px; background-image: linear-gradient(var(--accent), var(--accent));
    font: 400 1rem var(--font); color: var(--text); transition: background-size .3s;
}
textarea { border: 1px solid #d2d2d2; border-radius: 3px; padding: 10px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; background-size: 100% 2px; }
textarea:focus { border-color: var(--accent); }
input[type=file] { font: inherit; font-size: .9rem; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; margin-right: 8px; }
.checkbox-row label, form div > input[type=checkbox] + label { display: inline; font-weight: 400; }
.help-text, .form-help { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
ul.form-errors { color: var(--danger); font-size: .85rem; }
ul.form-errors { list-style: none; padding: 0; margin: 4px 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 30px; }

/* ---------- Alertes ---------- */
.flashes { position: fixed; top: 80px; right: 20px; z-index: 200; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.alert { padding: 14px 18px; border-radius: 3px; color: #fff; box-shadow: var(--shadow-2); font-weight: 400; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.alert button { background: none; border: 0; color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: .8; }
.alert-success { background: var(--success); }
.alert-error { background: var(--danger); }
.alert-info { background: var(--info); }
.alert-warning { background: var(--warning); }
.callout { padding: 16px 20px; border-left: 4px solid var(--accent); background: var(--surface-alt); border-radius: 0 3px 3px 0; margin-bottom: 24px; }

/* ---------- Tableaux (admin, studio) ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 2px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #fafafa; }
.status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .75rem; font-weight: 500; color: #fff; }
.status-pending { background: var(--warning); }
.status-active { background: var(--success); }
.status-banned { background: var(--danger); }
.status-hidden { background: #999; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 18px; text-align: center; }
.stat strong { display: block; font-family: var(--font-title); font-size: 2rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: .85rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 18px; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active, .tabs a:hover { color: var(--accent); border-color: var(--accent); }
.pending-card { padding: 20px; margin-bottom: 16px; }
.pending-card blockquote { margin: 10px 0 16px; padding: 10px 16px; background: var(--surface-alt); border-left: 3px solid var(--warning); white-space: pre-line; }

/* ---------- Pied de page ---------- */
.footer { padding: 40px 0; background: var(--surface); color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }
.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.footer ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.footer a { color: var(--text); font-size: 12px; font-weight: 500; text-transform: uppercase; }
.footer a:hover { color: var(--accent); }
.footer-dark { background: #323437; color: #aaa; border: 0; }
.footer-dark a { color: #fff; }
.footer .languages { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; }
.footer .languages a, .footer .languages strong { font-size: .85rem; text-transform: none; font-weight: 500; }
.footer .languages strong { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .page-meta, .comic-intro { grid-template-columns: 1fr; }
    .comic-intro .cover { max-width: 240px; margin: -110px auto 0; }
}
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .page-header .title { font-size: 2.3rem; }
    .main-raised { margin: -50px 10px 0; }
    .section { padding: 44px 0; }
    .nav-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; padding: 10px 16px 18px;
        background: var(--surface); color: var(--text); box-shadow: var(--shadow-2);
    }
    .nav-links.is-open { display: flex; }
    .nav-links .btn { margin: 8px 0 0; }
    .grid-covers { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
