/*
	Theme Name: gürlz Theme
	Theme URI: http://gurlz.spry.fr
	Description: Moi. Les filles. Un blog. Thème minimaliste, refondu aux standards actuels (HTML5, responsive, mode sombre) en gardant la philosophie de départ.
	Author: Spry
	Author URI: http://gurlz.spry.fr
	Version: 2.0
	Requires at least: 6.0
	Tested up to: 7.1
	Requires PHP: 8.0
	License: GNU General Public License v2 or later
	License URI: http://www.gnu.org/licenses/gpl-2.0.html
	Text Domain: gurlz
	Tags: minimalist, blog, one-column, translation-ready, custom-menu, dark-mode
*/

/* -------------------------------------------------------------
   Variables & thème (clair / sombre)
------------------------------------------------------------- */

:root {
	--bg:          #ffffff;
	--text:        #1e1e1e;
	--text-soft:   #5a5a5a;
	--accent:      #2c8eb0;
	--accent-ink:  #216f8a; /* accent lisible sur fond clair pour le texte */
	--rule:        #dcdcdc;
	--rule-strong: #787878;
	--selection:   #cfe9f2;

	--serif: "Times New Roman", Times, Georgia, "DejaVu Serif", serif;
	--sans:  Arial, Helvetica, "Segoe UI", system-ui, -apple-system, sans-serif;

	--text-w:  640px; /* largeur de la colonne de texte */
	--media-w: 800px; /* largeur de l'entête, du menu et des images (déborde le texte) */
	--gap:     clamp(20px, 4vw, 36px);
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg:          #16191c;
		--text:        #e7e9eb;
		--text-soft:   #a2abb2;
		--accent:      #4fb3d4;
		--accent-ink:  #6cc4e2;
		--rule:        #2c3238;
		--rule-strong: #3a424a;
		--selection:   #204653;
	}
}

/* -------------------------------------------------------------
   Base
------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.65;
	margin: 0;
	padding: 0;
	border-top: 10px solid var(--accent);
	-webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection); }

img { max-width: 100%; height: auto; }

a {
	color: var(--accent-ink);
	outline: none;
	text-decoration: none;
}

a:hover,
a:focus-visible { text-decoration: underline; }

a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 2px;
}

p {
	line-height: 1.65;
	margin: 0 0 1em;
}

li, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }

/* Contenu rédigé : on rend les listes lisibles à l'intérieur des articles */
.entry ul { list-style: disc; padding-left: 1.4em; margin: 0 0 1em; }
.entry ol { list-style: decimal; padding-left: 1.4em; margin: 0 0 1em; }
.entry li { margin: 0.2em 0; }

blockquote {
	margin: 1.2em 0;
	padding: 0.2em 0 0.2em 1em;
	border-left: 3px solid var(--accent);
	color: var(--text-soft);
	font-style: italic;
}

code, pre {
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 0.9em;
}

pre {
	overflow: auto;
	padding: 1em;
	background: rgba(44, 142, 176, 0.08);
	border-radius: 4px;
}

hr {
	border: 0;
	border-top: 1px solid var(--rule);
	margin: 2em 0;
}

/* Accessibilité : lien d'évitement + textes lecteur d'écran */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--bg);
	color: var(--accent-ink);
	padding: 8px 14px;
	z-index: 1000;
}

.skip-link:focus {
	left: var(--gap);
	outline: 2px solid var(--accent);
}

/* -------------------------------------------------------------
   Structure
------------------------------------------------------------- */

#container {
	width: 100%;
	max-width: calc(var(--media-w) + var(--gap) * 2);
	margin: 0;              /* aligné à gauche de l'écran (fidèle à l'original) */
	padding: var(--gap);
}

/* -------------------------------------------------------------
   Header
------------------------------------------------------------- */

#header {
	border-bottom: 1px solid var(--rule-strong);
	padding-bottom: 16px;
}

#header .site-logo { display: inline-block; }

#header img {
	display: block;
	width: 160px;
	height: auto;
	max-width: 100%;
}

/* -------------------------------------------------------------
   Menu (liste des pages)
------------------------------------------------------------- */

#menu {
	font-family: var(--serif);
	font-size: 1.15em;
	font-style: italic;
	margin: 12px 0 36px;
}

#menu ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 4px 18px;
}

#menu li { position: relative; }

#menu a { color: var(--text); }

#menu a:hover,
#menu a:focus-visible { color: var(--accent-ink); }

#menu .current-menu-item > a,
#menu .current_page_item > a { color: var(--accent-ink); }

/* -------------------------------------------------------------
   Article / Page
------------------------------------------------------------- */

#post,
#page {
	font-size: 1em;
	border-bottom: 1px solid var(--accent);
	text-align: justify;
	text-justify: inter-word;
	padding-bottom: 20px;
	margin-bottom: 28px;
}

#post + #post { margin-top: 8px; }

#post h2,
#post h2 a,
#page h2,
#page h2 a {
	font-weight: normal;
	color: var(--text);
	font-family: var(--serif);
	font-style: italic;
	line-height: 1.25;
}

#post h2 { font-size: 1.7em; margin: 0 0 2px; }
#page h2 { font-size: 1.9em; margin: 0 0 2px; }

#post h2 a:hover,
#post h2 a:focus-visible,
#page h2 a:hover,
#page h2 a:focus-visible { color: var(--accent-ink); }

p.postmetadata {
	font-size: 1em;
	margin: 0 0 1.2em;
	padding: 0;
	font-style: italic;
	font-family: var(--serif);
	color: var(--text-soft);
}

p.postmetadata a { color: var(--text-soft); }
p.postmetadata a:hover { color: var(--accent-ink); }

/* La colonne de texte reste étroite (--text-w)…                            */
.entry { max-width: var(--media-w); }

.entry > p,
.entry > ul,
.entry > ol,
.entry > dl,
.entry > blockquote,
.entry > h2,
.entry > h3,
.entry > h4,
.entry > h5,
.entry > h6,
.entry > pre {
	max-width: var(--text-w);
}

/* …tandis que les images débordent la colonne, plus larges que le texte
   (jusqu'à --media-w), ce qui restaure l'effet esthétique d'origine.       */
.entry img,
.entry figure,
.entry .wp-block-image,
.entry .wp-block-embed,
.entry .alignwide,
.entry .alignfull {
	max-width: 100%;
	height: auto;
}

.entry figure { margin: 1.4em 0; }
.entry figure img { display: block; }

.entry figcaption {
	max-width: var(--text-w);
	margin-top: 6px;
	font-family: var(--serif);
	font-style: italic;
	font-size: 0.9em;
	color: var(--text-soft);
}

.entry a {
	border-bottom: 1px dotted var(--accent);
}

.entry a:hover,
.entry a:focus-visible { text-decoration: none; border-bottom-style: solid; }

.entry h2, .entry h3, .entry h4 {
	font-family: var(--serif);
	font-style: italic;
	font-weight: normal;
	line-height: 1.3;
}

.entry img { border-radius: 3px; }

/* Pagination interne d'un article (wp_link_pages) */
.page-links {
	margin: 1.5em 0 0;
	font-family: var(--serif);
	font-style: italic;
}

/* Lien retour accueil */
p.return {
	margin: 18px 0 0;
	font-family: var(--serif);
	font-style: italic;
}

p.return a { font-size: 1.15em; color: var(--accent-ink); }
p.return a:hover { text-decoration: underline; }

/* -------------------------------------------------------------
   Navigation (listes / pagination entre articles)
------------------------------------------------------------- */

/* Pagination numérotée (accueil, archives, recherche) */
.pagination {
	margin: 40px 0 0;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-family: var(--serif);
	font-style: italic;
	font-size: 1.05em;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.3em;
	height: 2.3em;
	padding: 0 0.55em;
	color: var(--text-soft);
	border: 1px solid var(--rule);
	border-radius: 4px;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pagination a.page-numbers:hover,
.pagination a.page-numbers:focus-visible {
	color: var(--bg);
	background: var(--accent);
	border-color: var(--accent);
	text-decoration: none;
}

.pagination .page-numbers.current {
	color: var(--bg);
	background: var(--accent);
	border-color: var(--accent);
}

.pagination .page-numbers.dots {
	border-color: transparent;
	min-width: 1em;
	padding: 0 0.2em;
}

.pagination .prev.page-numbers,
.pagination .next.page-numbers {
	padding: 0 0.95em;
}

/* Navigation entre articles (article seul) */
.post-navigation {
	margin: 28px 0 0;
	padding-top: 18px;
	border-top: 1px solid var(--rule);
}

.post-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	justify-content: space-between;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
	flex: 1 1 42%;
	min-width: 200px;
}

.post-navigation .nav-next { text-align: right; }

.post-navigation a {
	display: inline-block;
	max-width: var(--text-w);
}

.post-navigation .nav-subtitle {
	display: block;
	font-family: var(--sans);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.72em;
	color: var(--text-soft);
	margin-bottom: 3px;
}

.post-navigation .nav-title {
	font-family: var(--serif);
	font-style: italic;
	font-size: 1.15em;
	line-height: 1.25;
	color: var(--accent-ink);
}

.post-navigation a:hover .nav-title,
.post-navigation a:focus-visible .nav-title { text-decoration: underline; }

/* -------------------------------------------------------------
   Recherche
------------------------------------------------------------- */

.search-form {
	display: flex;
	gap: 8px;
	margin: 18px 0;
}

.search-form .search-field {
	flex: 1 1 auto;
	font: inherit;
	padding: 8px 10px;
	color: var(--text);
	background: var(--bg);
	border: 1px solid var(--rule-strong);
	border-radius: 4px;
}

.search-form .search-submit {
	font-family: var(--serif);
	font-style: italic;
	font-size: 1em;
	padding: 8px 16px;
	color: var(--bg);
	background: var(--accent);
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.search-form .search-submit:hover { background: var(--accent-ink); }

.page-title {
	font-family: var(--serif);
	font-style: italic;
	font-weight: normal;
	font-size: 1.6em;
	color: var(--text);
	margin: 0 0 24px;
}

.page-title .search-terms,
.page-title .archive-term { color: var(--accent-ink); }

/* -------------------------------------------------------------
   Footer
------------------------------------------------------------- */

#footer {
	margin-top: 48px;
	padding-top: 18px;
	border-top: 1px solid var(--rule);
	font-family: var(--serif);
	font-style: italic;
	font-size: 0.95em;
	color: var(--text-soft);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 20px;
}

#footer a { color: var(--text-soft); }
#footer a:hover { color: var(--accent-ink); }

/* -------------------------------------------------------------
   Responsive
------------------------------------------------------------- */

@media (max-width: 600px) {
	body { font-size: 15px; }

	#menu {
		font-size: 1.05em;
		margin-bottom: 28px;
	}

	#menu ul { justify-content: flex-start; }

	#post, #page { text-align: left; }

	.post-navigation .nav-links { flex-direction: column; gap: 14px; }
	.post-navigation .nav-next { text-align: left; }
}

/* -------------------------------------------------------------
   Réduction des animations
------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
