/*
Theme Name: Manga Fonds
Description: Thème coloré façon manga pour sites de fonds d'écran et d'images de profil anime. Conçu pour le plugin Galerie Fonds d'Écran.
Version: 1.3.4
Requires at least: 6.2
Requires PHP: 7.4
Author: Valentin
License: GPL-2.0-or-later
Text Domain: manga-fonds
*/

/* ---------- Polices (auto-hébergées, licence OFL) ---------- */
@font-face { font-family: "Dela Gothic One"; src: url("assets/fonts/dela-gothic-one.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url("assets/fonts/m-plus-rounded-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url("assets/fonts/m-plus-rounded-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

/* ---------- Jetons ---------- */
:root {
	--paper: #ffffff;
	--ink: #000000;
	--yellow: #ffd93b;
	--pink: #ff3e8a;
	--cyan: #29c5f6;
	--tone: #e9e4f5;
	--line: 3px;
	--wrap: 1240px;
	--display: "Dela Gothic One", "Arial Black", sans-serif;
	--text: "M PLUS Rounded 1c", "Trebuchet MS", sans-serif;
	--step-0: 1rem;
	--step-1: 1.25rem;
	--step-2: 1.6rem;
	--step-3: clamp(1.9rem, 4vw, 2.6rem);
	--step-4: clamp(2.1rem, 10vw, 5.2rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink);
	font-family: var(--text); font-size: 17px; line-height: 1.6;
}
/* Fonds au choix (Apparence → Personnaliser → Accueil → Fond du site) */
body.mf-bg-lilas { background: #f6f3fc; }
body.mf-bg-hachures { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 8px); }
body.mf-bg-cases { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='640' height='860' fill='none' stroke='%23ece7f6' stroke-width='5'><path d='M10 10h380v300H10zM410 10h220v300H410zM10 330l300 0 0 220H10zM330 330h300v120H330zM330 470h300v80H330zM10 570h620v280H10z'/></svg>"); background-size: 640px 860px; }
body.mf-bg-trame { background-image: radial-gradient(var(--tone) 1.1px, transparent 1.2px); background-size: 9px 9px; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--pink); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 .6em; letter-spacing: .01em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mf-skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--yellow); border: var(--line) solid var(--ink); padding: 8px 14px; font-weight: 800; }
.mf-skip:focus { top: 12px; }

/* ---------- En-tête ---------- */
.mf-header { background: var(--paper); border-bottom: var(--line) solid var(--ink); position: relative; z-index: 50; }
.mf-header__inner { max-width: var(--wrap); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.mf-brand__name { font-family: var(--display); font-size: 1.5rem; text-decoration: none; color: var(--ink); text-shadow: 3px 3px 0 var(--pink); }
.mf-brand__name:hover { color: var(--ink); }
.mf-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mf-brand .custom-logo-link { display: block; }
.mf-brand .custom-logo { display: block; max-height: 64px; width: auto; }
.mf-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.mf-nav__list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; font-weight: 800; }
.mf-nav__list a { text-decoration: none; padding: 4px 0; display: inline-block; }
.mf-nav__list .current-menu-item > a, .mf-nav__list .current_page_item > a, .mf-nav__list .current-menu-ancestor > a { box-shadow: inset 0 -6px 0 var(--yellow); }
.mf-nav__list li { position: relative; }
.mf-nav__list .sub-menu, .mf-nav__list .children {
	display: none; position: absolute; top: 100%; left: -12px; min-width: 200px; list-style: none; margin: 0; padding: 8px 0;
	background: var(--paper); border: var(--line) solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
}
.mf-nav__list li:hover > .sub-menu, .mf-nav__list li:focus-within > .sub-menu, .mf-nav__list li.is-open > .sub-menu { display: block; }
.mf-nav__list .menu-item-has-children { display: inline-flex; align-items: center; flex-wrap: wrap; }

/* Flèche des sous-menus */
.mf-sub-toggle {
	display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; margin-left: 2px;
	border: 0; border-radius: 50%; background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer;
	transition: transform .15s;
}
.mf-sub-toggle:hover { background: var(--yellow); }
.mf-sub-toggle[aria-expanded="true"] { transform: rotate(180deg); }
.mf-nav__list .sub-menu a { display: block; padding: 6px 14px; }
.mf-nav__search input {
	font: inherit; font-size: .95rem; width: 260px; padding: 7px 16px;
	border: var(--line) solid var(--ink); border-radius: 999px; background: var(--paper);
}
.mf-menu-toggle { display: none; }
.mf-menu-cb { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.mf-menu-cb:focus-visible + .mf-menu-toggle { outline: 3px solid var(--pink); outline-offset: 2px; }

/* Menu déroulant « Animes » en colonnes */
.mf-header__inner { position: relative; }
.mf-mega__btn {
	font: inherit; font-weight: 800; background: var(--yellow); color: var(--ink); cursor: pointer;
	border: var(--line) solid var(--ink); border-radius: 999px; padding: 5px 16px;
}
.mf-mega { position: static; }
.mf-mega__btn { list-style: none; display: inline-block; user-select: none; }
.mf-mega__btn::-webkit-details-marker { display: none; }
.mf-mega__btn:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.mf-mega[open] > .mf-mega__btn { background: var(--ink); color: var(--paper); }
.mf-mega__panel {
	position: absolute; left: 20px; right: 20px; top: calc(100% + 3px); z-index: 60;
	background: var(--paper); border: var(--line) solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
	padding: 18px 22px; max-height: 70vh; overflow: auto;
}



/* Liste des animes : en colonnes de journal (les noms longs passent à la ligne proprement) */
.mf-mega__list { list-style: none; margin: 0; padding: 0; columns: 5 170px; column-gap: 22px; }
.mf-mega__list li { break-inside: avoid; margin: 0; }
.mf-mega__list a { display: block; padding: 5px 8px; font-weight: 800; line-height: 1.25; text-decoration: none; border-radius: 6px; }
.mf-mega__list a:hover, .mf-mega__list a[aria-current="page"] { background: var(--yellow); color: var(--ink); }
/* Personnages : une ligne de pastilles par anime, sur toute la largeur */
.mf-mega__persos { margin-top: 14px; padding-top: 14px; border-top: 3px dashed var(--ink); }
.mf-mega__caption { font-family: var(--display); margin: 0 0 8px; }
.mf-mega__group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 10px; }
.mf-mega__group-name { font-weight: 800; text-decoration: none; padding: 3px 0; min-width: 120px; }
.mf-mega__group-name:hover { box-shadow: inset 0 -6px 0 var(--yellow); }
.mf-mega__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.mf-mega__chips a { display: inline-block; padding: 3px 11px; font-size: .9rem; border: 2px solid var(--ink); border-radius: 999px; text-decoration: none; background: var(--paper); line-height: 1.3; }
.mf-mega__chips a:hover, .mf-mega__chips a[aria-current="page"] { background: var(--yellow); }

@media (max-width: 860px) {
	.mf-header__inner { gap: 12px; }
	.mf-brand { min-width: 0; gap: 8px; }
	.mf-brand .custom-logo { max-height: 46px; }
	.mf-brand__name { font-size: 1.05rem; line-height: 1.15; text-shadow: 2px 2px 0 var(--pink); }
	.mf-menu-toggle { flex-shrink: 0; }
	.mf-menu-toggle {
		display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
		font: inherit; font-weight: 800; background: var(--yellow); border: var(--line) solid var(--ink); padding: 6px 12px; cursor: pointer;
	}
	.mf-menu-toggle__bars, .mf-menu-toggle__bars::before, .mf-menu-toggle__bars::after { display: block; width: 18px; height: 3px; background: var(--ink); position: relative; }
	.mf-menu-toggle__bars::before, .mf-menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
	.mf-menu-toggle__bars::before { top: -6px; } .mf-menu-toggle__bars::after { top: 6px; }
	.mf-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 14px;
		background: var(--paper); border-bottom: var(--line) solid var(--ink); padding: 16px 20px 20px; }
	.mf-nav.is-open, .mf-menu-cb:checked ~ .mf-nav { display: flex; }
	.mf-nav__list { flex-direction: column; font-size: 1.1rem; }
	.mf-nav__list .sub-menu, .mf-nav__list .children { display: none; position: static; border: 0; box-shadow: none; padding: 0 0 0 14px; width: 100%; }
	.mf-nav__list li:hover > .sub-menu, .mf-nav__list li:focus-within > .sub-menu { display: none; }
	.mf-nav__list li.is-open > .sub-menu, .mf-nav__list li.is-open:hover > .sub-menu, .mf-nav__list li.is-open:focus-within > .sub-menu { display: block; }
	.mf-nav__search input { width: 100%; }
	.mf-mega__btn { width: 100%; text-align: left; }
	.mf-mega__panel { position: static; box-shadow: none; border-width: 2px; margin-top: 8px; max-height: 50vh; padding: 10px; }
	.mf-mega__list { columns: 2; column-gap: 10px; }
	.mf-mega__group-name { min-width: 0; width: 100%; }
}

/* ---------- Mise en page ---------- */
.mf-main { flex: 1 0 auto; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px 48px; }
.mf-section { margin-top: 56px; }
.mf-page { padding-top: 28px; }
.mf-title { font-size: var(--step-3); margin-bottom: 18px; }
.mf-entry > p, .mf-entry > ul, .mf-entry > ol, .mf-entry > h2, .mf-entry > h3, .mf-entry > blockquote { max-width: 70ch; }
.mf-meta { margin-top: -8px; opacity: .7; }

/* Titre de section en « cartouche » de narration manga */
.mf-caption {
	display: inline-block; font-size: var(--step-1); background: var(--yellow);
	border: var(--line) solid var(--ink); padding: 6px 14px 4px; margin: 0 0 18px;
	transform: rotate(-1.2deg);
}

.mf-crumbs { font-size: .9rem; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mf-crumbs a { text-decoration: none; font-weight: 800; }
.mf-crumbs__sep { opacity: .45; }

/* ---------- Héros : lignes de vitesse vers la bulle de recherche ---------- */
.mf-hero {
	position: relative; overflow: hidden; margin: 24px 0 0;
	border: 4px solid var(--ink); background: var(--paper);
	min-height: 440px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; text-align: center; padding: 56px 20px 64px;
}
.mf-hero__lines {
	position: absolute; inset: -40%; pointer-events: none;
	background: repeating-conic-gradient(from 3deg at 50% 50%, var(--ink) 0deg 1.1deg, transparent 1.1deg 6.5deg);
	-webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 26%, #000 46%);
	        mask: radial-gradient(circle at 50% 50%, transparent 0 26%, #000 46%);
	opacity: .9;
}
.mf-hero__content { position: relative; max-width: 760px; width: 100%; }
.mf-hero__title {
	font-size: var(--step-4); line-height: 1.02; margin: 0 0 14px; color: var(--pink); overflow-wrap: break-word;
	-webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
	text-shadow: 5px 5px 0 var(--ink);
}
.mf-hero__text {
	display: inline-block; max-width: 52ch; margin: 0 auto 26px; font-weight: 800; font-size: var(--step-1); line-height: 1.45;
	background: var(--paper); padding: 4px 10px;
}

/* Bulle de dialogue = barre de recherche */
.mf-bubble {
	position: relative; display: flex; align-items: center; gap: 8px; max-width: 620px; margin: 0 auto;
	background: var(--paper); border: 4px solid var(--ink); border-radius: 999px; padding: 8px 8px 8px 24px;
}
.mf-bubble::before, .mf-bubble::after { /* la queue de la bulle : triangle noir + triangle blanc par-dessus */
	content: ""; position: absolute; width: 0; height: 0; border-style: solid; border-color: transparent;
}
.mf-bubble::before { top: calc(100% - 2px); left: 18%; border-width: 26px 0 0 30px; border-top-color: var(--ink); }
.mf-bubble::after { top: calc(100% - 5px); left: calc(18% + 4px); border-width: 20px 0 0 22px; border-top-color: var(--paper); }
.mf-bubble__input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.15rem; font-weight: 800; padding: 8px 0; color: var(--ink); }
.mf-bubble__input:focus { outline: none; }
.mf-bubble:focus-within { box-shadow: 0 0 0 4px var(--cyan); }
.mf-bubble__input::placeholder { color: #6b6578; font-weight: 400; }
.mf-bubble__btn {
	font: inherit; font-family: var(--display); font-size: 1rem; cursor: pointer;
	background: var(--pink); color: var(--paper); border: var(--line) solid var(--ink); border-radius: 999px; padding: 10px 22px;
}
.mf-bubble__btn:hover { background: var(--ink); }

@media (max-width: 600px) {
	.mf-hero { min-height: 380px; padding: 40px 14px 52px; }
	.mf-hero__title { -webkit-text-stroke-width: 2px; text-shadow: 3px 3px 0 var(--ink); }
	.mf-bubble { padding-left: 16px; }
	.mf-bubble__btn { padding: 9px 14px; }
}

/* ---------- Personnages populaires ---------- */
.mf-chars { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.mf-char {
	display: grid; grid-template-columns: 44px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
	text-decoration: none; background: var(--paper); border: var(--line) solid var(--ink); border-radius: 999px; padding: 5px 18px 5px 5px;
}
.mf-char__img { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); }
.mf-char__name { font-weight: 800; line-height: 1.1; }
.mf-char__anime { font-size: .8rem; opacity: .65; line-height: 1.2; }
.mf-char:hover { background: var(--cyan); color: var(--ink); }

/* ---------- Grille des animes : cases de manga ---------- */
.mf-animes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mf-anime a { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: var(--line) solid var(--ink); background: var(--tone); text-decoration: none; color: var(--ink); }
.mf-anime__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.mf-anime a:hover .mf-anime__img { transform: scale(1.05); }
.mf-anime__label {
	position: absolute; left: 0; bottom: 0; display: flex; flex-direction: column; max-width: calc(100% - 16px);
	background: var(--paper); border-top: var(--line) solid var(--ink); border-right: var(--line) solid var(--ink); padding: 6px 12px 5px;
}
.mf-anime__name { font-family: var(--display); font-size: 1.05rem; line-height: 1.15; }
.mf-anime__count { font-size: .8rem; opacity: .7; }
.mf-anime a:hover .mf-anime__label { background: var(--yellow); }
.mf-anime a:focus-visible { outline-offset: 4px; }

/* ---------- Recherche, listes ---------- */
.mf-search-again { margin: 0 0 40px; }
.mf-search-again .mf-bubble { margin: 0; }
.mf-pills { list-style: none; margin: 0 0 32px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.mf-pill { display: inline-block; text-decoration: none; font-weight: 800; border: var(--line) solid var(--ink); border-radius: 999px; padding: 6px 16px; background: var(--paper); }
.mf-pill small { font-weight: 400; opacity: .65; }
.mf-pill:hover { background: var(--yellow); color: var(--ink); }
.mf-results { margin: 0 0 32px; }
.mf-empty { font-weight: 800; }
.mf-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mf-list__item a { display: block; border: var(--line) solid var(--ink); background: var(--paper); text-decoration: none; }
.mf-list__img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: var(--line) solid var(--ink); }
.mf-list__title { display: block; padding: 10px 14px; font-weight: 800; }
.nav-links { display: flex; gap: 10px; margin-top: 24px; font-weight: 800; }
.mf-thumb { margin: 0 0 20px; }

/* ---------- 404 ---------- */
.mf-404 { text-align: center; max-width: 640px; margin: 0 auto; }
.mf-404__sfx { font-family: var(--display); font-size: 6rem; line-height: 1; margin: 10px 0; color: var(--cyan); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; transform: rotate(-6deg); }
.mf-404 .mf-bubble { margin: 24px auto 40px; }
.mf-link { font-weight: 800; }

/* ---------- Publicité : espace réservé pour éviter que la page saute ---------- */
.mf-ad { width: 100%; max-width: var(--wrap); margin: 20px auto; padding: 0 20px; min-height: 120px; text-align: center; }
.mf-ad--pub-image { padding: 0; margin: 0 0 20px; min-height: 280px; }
@media (max-width: 600px) { .mf-ad { min-height: 280px; } }

/* ---------- Pied de page ---------- */
.mf-footer { background: var(--ink); color: var(--paper); margin-top: 40px; }
.mf-footer__inner { max-width: var(--wrap); margin: 0 auto; padding: 36px 20px; display: grid; gap: 10px; }
.mf-footer__brand { font-family: var(--display); font-size: 1.3rem; color: var(--yellow); margin: 0; }
.mf-footer__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 800; }
.mf-footer__menu a { text-decoration: none; }
.mf-footer a:hover { color: var(--yellow); }
.mf-footer__note { max-width: 70ch; opacity: .85; font-size: .92rem; margin: 6px 0 0; }
.mf-footer__copy { opacity: .6; font-size: .85rem; margin: 0; }

/* ---------- Habillage manga de la galerie (plugin) ---------- */
body .feg, body .feg-single, body .feg-lb { --feg-accent: var(--pink); --feg-accent-text: #fff; --feg-radius: 0; --feg-gap: 12px; --feg-chip-bg: var(--paper); }
body .feg-chip, body .feg-filter { border: 2px solid var(--ink); font-weight: 800; }
body .feg-chip:hover, body .feg-filter:hover { border-color: var(--ink); background: var(--yellow); color: var(--ink); }
body .feg-chip.is-active, body .feg-filter.is-active { background: var(--ink); color: var(--paper); }
body .feg-color { border: 2px solid var(--ink); }
body .feg-item { border: var(--line) solid var(--ink); background: var(--tone); }
body .feg-more, body .feg-btn { border: var(--line) solid var(--ink); font-family: var(--display); font-weight: 400; letter-spacing: .02em; }
body .feg-more:hover, body .feg-btn:hover { background: var(--ink); }
body .feg-btn-ghost { background: var(--paper); }
body .feg-single-figure img { border: var(--line) solid var(--ink); }
body .feg-crumbs a { font-weight: 800; text-decoration: none; }
body .feg-share__btn { border: 2px solid var(--ink); }
body .feg-share--copy, body .feg-share--native { background: var(--paper); color: var(--ink) !important; border-color: var(--ink); }
body .feg-lb .feg-share__btn { border-color: transparent; }
body .feg-pin { border: 2px solid var(--ink); }
body .feg-related-title { display: inline-block; font-size: var(--step-1); background: var(--yellow); border: var(--line) solid var(--ink); padding: 6px 14px 4px; transform: rotate(-1.2deg); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Grille des animes insérée dans une page ([mf_animes], page Catégorie) */
.mf-entry .mf-animes, .entry-content .mf-animes, .mf-page .mf-animes { margin: 20px 0 32px; }
