/*
Theme Name: Histoires Coquines
Description: Thème léger et responsive pour sites d'histoires érotiques. Compatible PHP 8.x, polices locales, optimisé SEO.
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.8
Text Domain: histoires
License: GPL-2.0-or-later
*/

/* ---------- Polices locales ---------- */
@font-face {
	font-family: "Lora";
	src: url("assets/fonts/lora-latin-400-normal.woff2") format("woff2");
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: "Lora";
	src: url("assets/fonts/lora-latin-400-italic.woff2") format("woff2");
	font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
	font-family: "Lora";
	src: url("assets/fonts/lora-latin-700-normal.woff2") format("woff2");
	font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
	font-family: "Playfair Display";
	src: url("assets/fonts/playfair-display-latin-700-normal.woff2") format("woff2");
	font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Variables ---------- */
:root {
	--bg: #fdf6f4;
	--surface: #ffffff;
	--text: #2b1d22;
	--muted: #6e5a61;
	--accent: #9b1b3a;        /* bordeaux */
	--accent-dark: #6f0f27;
	--accent-soft: #f6dfe4;   /* rose poudré */
	--border: #ecd7dc;
	--radius: 10px;
	--shadow: 0 4px 18px rgba(111, 15, 39, .08);
	--font-text: "Lora", Georgia, "Times New Roman", serif;
	--font-title: "Playfair Display", Georgia, serif;
	--wrap: 1180px;
	--read: 720px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-text);
	font-size: 1.125rem;
	line-height: 1.75;
	text-rendering: optimizeLegibility;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover, a:focus { color: var(--accent-dark); }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-title);
	font-weight: 700;
	line-height: 1.25;
	color: var(--accent-dark);
	margin: 1.6em 0 .6em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.45rem); }
blockquote {
	margin: 1.5em 0; padding: .6em 1.2em;
	border-left: 4px solid var(--accent);
	background: var(--accent-soft);
	font-style: italic;
}
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 10px; left: 10px; z-index: 999;
	width: auto; height: auto; clip: auto;
	background: var(--accent); color: #fff; padding: .6em 1em; border-radius: 6px;
}
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
	background: var(--surface);
	border-bottom: 3px solid var(--accent);
	box-shadow: var(--shadow);
}
.site-header .wrap {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; min-height: 72px; flex-wrap: wrap;
}
.site-branding { padding: .6rem 0; }
.site-title {
	font-family: var(--font-title); font-weight: 700;
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	margin: 0; line-height: 1.2;
}
.site-title a { color: var(--accent); text-decoration: none; }
.site-description { margin: 0; font-size: .9rem; color: var(--muted); font-style: italic; }

.menu-toggle {
	display: none; background: var(--accent); color: #fff; border: 0;
	border-radius: 6px; padding: .5em .9em; font: inherit; font-size: 1rem; cursor: pointer;
}
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem; }
.main-navigation a {
	display: block; padding: .5em .8em; border-radius: 6px;
	color: var(--text); text-decoration: none; font-size: 1rem;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-cat > a { background: var(--accent-soft); color: var(--accent-dark); }
.main-navigation ul ul { display: none; }

/* ---------- Layout ---------- */
.site-main { padding: 2rem 0 3rem; }
.intro-home {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-bottom: 2rem;
	font-size: 1.02rem; box-shadow: var(--shadow);
}
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { margin-top: 0; }
.archive-description { color: var(--muted); }

/* ---------- Grille de cartes ---------- */
.posts-grid {
	display: grid; gap: 1.6rem;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
	display: flex; flex-direction: column;
	transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(111,15,39,.14); }
.card-thumb { display: block; aspect-ratio: 3 / 2; background: var(--accent-soft); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-title { margin: 0; font-size: 1.25rem; }
.card-title a { color: var(--accent-dark); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-meta { font-size: .85rem; color: var(--muted); }
.card-excerpt { font-size: 1rem; margin: 0; }
.card-excerpt p { margin: 0; }

/* ---------- Article ---------- */
.breadcrumbs { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3em; }
.breadcrumbs li + li::before { content: "›"; margin-right: .3em; }

.entry { max-width: var(--read); margin: 0 auto; }
.entry-header h1 { margin-top: 0; }
.entry-meta { font-size: .9rem; color: var(--muted); margin-bottom: 1.4rem; }
.entry-meta a { color: var(--muted); }
.entry-hero { margin: 0 0 1.8rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.entry-hero img { display: block; width: 100%; height: auto; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content img { border-radius: 6px; }
.entry-content .alignleft { float: left; margin: .3em 1.2em 1em 0; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.2em; }
.entry-content .aligncenter { display: block; margin: 1em auto; }
.wp-caption, figure { max-width: 100%; margin: 1.5em 0; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; }

.ad-block {
	margin: 2em 0; padding: 1em; border-radius: var(--radius);
	background: var(--accent-soft); text-align: center; overflow: hidden; clear: both;
}

.entry-footer { margin-top: 2rem; font-size: .95rem; }
.tags-links a {
	display: inline-block; background: var(--accent-soft); color: var(--accent-dark);
	padding: .2em .7em; border-radius: 999px; text-decoration: none; margin: 0 .3em .4em 0; font-size: .85rem;
}
.post-navigation { display: flex; justify-content: space-between; gap: 1rem; margin: 2.5rem 0; flex-wrap: wrap; }
.post-navigation a { text-decoration: none; }
.post-navigation .nav-subtitle { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Histoires aléatoires ---------- */
.related { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--border); }
.related > h2 { margin-top: 0; text-align: center; }
.related-grid {
	display: grid; gap: 1.2rem;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.related-grid .card-title { font-size: 1.08rem; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 2.5rem; text-align: center; }
.pagination .nav-links { display: inline-flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.pagination .page-numbers {
	display: inline-block; min-width: 2.4em; padding: .4em .7em; border-radius: 6px;
	background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.pagination .page-numbers.current,
.pagination a.page-numbers:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Commentaires ---------- */
.comments-area { max-width: var(--read); margin: 3rem auto 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.comment-meta { font-size: .85rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
	width: 100%; padding: .6em .8em; font: inherit; font-size: 1rem;
	border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, input[type="submit"] {
	background: var(--accent); color: #fff; border: 0; border-radius: 6px;
	padding: .6em 1.2em; font: inherit; font-size: 1rem; cursor: pointer;
}
button:hover, input[type="submit"]:hover { background: var(--accent-dark); }
.search-form { display: flex; gap: .5rem; }

/* ---------- Footer ---------- */
.site-footer {
	background: var(--accent-dark); color: #f7e6ea;
	padding: 2rem 0; font-size: .95rem; text-align: center;
}
.site-footer a { color: #fff; }
.footer-navigation ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

/* ---------- Pages pleine largeur (page.php) ---------- */
body.page article.entry.entry--full,
.entry.entry--full { max-width: var(--wrap); width: 100%; }
.entry--full .entry-hero img { max-height: 520px; object-fit: cover; }
.entry--full .entry-content { font-size: 1.15rem; line-height: 1.8; }
.entry--full .entry-content p,
.entry--full .entry-content ul,
.entry--full .entry-content ol { max-width: 1000px; }   /* lignes lisibles, même en pleine largeur */
.entry--full .entry-content .alignwide { width: 100%; max-width: none; }
.entry--full .entry-content .alignfull {
	width: 100vw; max-width: 100vw;
	margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
}
.entry--full .entry-content table { width: 100%; border-collapse: collapse; }
.entry--full .entry-content th,
.entry--full .entry-content td { border: 1px solid var(--border); padding: .5em .8em; text-align: left; }
.comments-full .comments-area { max-width: none; }
body { overflow-x: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 782px) {
	body { font-size: 1.0625rem; }
	.menu-toggle { display: block; }
	.main-navigation { width: 100%; }
	.main-navigation ul { display: none; flex-direction: column; padding-bottom: .8rem; }
	.main-navigation.toggled ul { display: flex; }
	.site-main { padding: 1.3rem 0 2rem; }
	.intro-home { padding: 1rem 1.1rem; }
	.entry-content .alignleft, .entry-content .alignright { float: none; margin: 1em auto; display: block; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
