/*
Theme Name: Zinlinks
Theme URI: https://zinlinks.com/
Author: Zinlinks
Description: Thème de blog voyage léger et moderne pour Zinlinks. Sans dépendance externe, compatible Polylang, Rank Math et l'éditeur de blocs.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zinlinks
*/

:root {
	--zl-accent: #b5532c;
	--zl-accent-dark: #8a3d1f;
	--zl-sand: #fbf6ef;
	--zl-sand-2: #f3e9dc;
	--zl-ink: #1f1a17;
	--zl-muted: #6b625b;
	--zl-line: #e8ddd0;
	--zl-white: #ffffff;
	--zl-radius: 14px;
	--zl-shadow: 0 1px 2px rgba(31,26,23,.06), 0 6px 20px rgba(31,26,23,.06);
	--zl-content: 740px;
	--zl-wide: 1180px;
	--zl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--zl-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; }

body {
	margin: 0;
	font-family: var(--zl-font);
	font-size: 18px;
	line-height: 1.7;
	color: var(--zl-ink);
	background: var(--zl-sand);
	-webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--zl-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--zl-accent-dark); }

h1, h2, h3, h4 {
	font-family: var(--zl-serif);
	line-height: 1.2;
	color: var(--zl-ink);
	margin: 1.6em 0 .5em;
	letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.05rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p, ul, ol, table, figure { margin: 0 0 1.25em; }

.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: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto;
	background: var(--zl-white); padding: 10px 16px; border-radius: 8px;
}

.zl-wrap { max-width: var(--zl-wide); margin: 0 auto; padding: 0 20px; }
.zl-narrow { max-width: var(--zl-content); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.zl-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(251,246,239,.92);
	backdrop-filter: saturate(160%) blur(10px);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--zl-line);
}
.admin-bar .zl-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .zl-header { top: 0; position: relative; } }

.zl-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }

.zl-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--zl-ink); }
.zl-brand:hover { color: var(--zl-ink); }
.zl-brand__mark {
	width: 34px; height: 34px; border-radius: 10px; background: var(--zl-accent);
	display: grid; place-items: center; color: #fff; font-family: var(--zl-serif); font-weight: 700; font-size: 20px;
}
.zl-brand__name { font-family: var(--zl-serif); font-weight: 700; font-size: 1.45rem; letter-spacing: -.02em; }
.custom-logo { max-height: 44px; width: auto; }

.zl-nav { display: flex; align-items: center; gap: 6px; }
.zl-nav ul { list-style: none; margin: 0; padding: 0; }
.zl-menu { display: flex; align-items: center; gap: 4px; }
.zl-menu > li { position: relative; }
.zl-menu a {
	display: block; padding: 10px 14px; border-radius: 10px;
	color: var(--zl-ink); text-decoration: none; font-size: .97rem; font-weight: 500; line-height: 1.3;
}
.zl-menu a:hover, .zl-menu .current-menu-item > a, .zl-menu .current-menu-ancestor > a { color: var(--zl-accent); background: var(--zl-sand-2); }
.zl-menu .menu-item-has-children > a::after {
	content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; vertical-align: 3px;
	border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.zl-menu .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 230px; padding: 8px;
	background: var(--zl-white); border: 1px solid var(--zl-line); border-radius: var(--zl-radius); box-shadow: var(--zl-shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s ease;
}
.zl-menu li:hover > .sub-menu, .zl-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.zl-menu .sub-menu a { font-weight: 400; }

.zl-menu .lang-item img { display: inline-block; vertical-align: middle; margin-right: 6px; }

.zl-toggle {
	display: none; border: 1px solid var(--zl-line); background: var(--zl-white); border-radius: 10px;
	width: 44px; height: 44px; cursor: pointer; padding: 0; color: var(--zl-ink);
}
.zl-toggle span, .zl-toggle span::before, .zl-toggle span::after {
	display: block; width: 18px; height: 2px; background: currentColor; margin: 0 auto; position: relative; transition: .2s;
}
.zl-toggle span::before, .zl-toggle span::after { content: ""; position: absolute; left: 0; }
.zl-toggle span::before { top: -6px; }
.zl-toggle span::after { top: 6px; }
.zl-nav-open .zl-toggle span { background: transparent; }
.zl-nav-open .zl-toggle span::before { top: 0; transform: rotate(45deg); }
.zl-nav-open .zl-toggle span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
	.zl-toggle { display: block; }
	.zl-nav {
		position: absolute; top: 100%; left: 0; right: 0; display: none;
		background: var(--zl-sand); border-bottom: 1px solid var(--zl-line); padding: 10px 20px 20px;
		max-height: calc(100vh - 68px); overflow-y: auto;
	}
	.zl-nav-open .zl-nav { display: block; }
	.zl-menu { flex-direction: column; align-items: stretch; }
	.zl-menu .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0;
		background: transparent; padding: 0 0 0 14px; min-width: 0;
	}
	.zl-menu .menu-item-has-children > a::after { display: none; }
}

/* ---------- Main ---------- */
.zl-main { min-height: 60vh; }

/* Front page / pages: full-bleed blocks */
.entry-content > .alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.entry-content > .alignwide { max-width: var(--zl-wide); margin-left: auto; margin-right: auto; width: calc(100vw - 40px); position: relative; left: 50%; transform: translateX(-50%); }

.zl-front .entry-content > *:not(.alignfull):not(.alignwide) { max-width: var(--zl-wide); margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }
.zl-front .entry-content > .wp-block-cover:first-child { margin-top: 0; }
.zl-front .entry-content { padding-bottom: 60px; }

/* ---------- Page header (archives, pages) ---------- */
.zl-pagehead { padding: 56px 0 24px; text-align: center; }
.zl-pagehead h1 { margin: .2em 0 .3em; }
.zl-pagehead__desc { color: var(--zl-muted); max-width: 640px; margin: 0 auto; font-size: 1.05rem; }
.zl-eyebrow {
	display: inline-block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
	color: var(--zl-accent); text-decoration: none;
}

/* ---------- Cards grid ---------- */
.zl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 24px 0 64px; }
@media (max-width: 960px) { .zl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .zl-grid { grid-template-columns: 1fr; } }

.zl-card {
	background: var(--zl-white); border-radius: var(--zl-radius); overflow: hidden; box-shadow: var(--zl-shadow);
	display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.zl-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(31,26,23,.06), 0 14px 32px rgba(31,26,23,.1); }
.zl-card__media { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--zl-sand-2), #e9d3bd); overflow: hidden; }
.zl-card__media img { width: 100%; height: 100%; object-fit: cover; }
.zl-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.zl-card__title { font-size: 1.25rem; margin: 0; }
.zl-card__title a { color: var(--zl-ink); text-decoration: none; }
.zl-card__title a:hover { color: var(--zl-accent); }
.zl-card__excerpt { color: var(--zl-muted); font-size: .96rem; margin: 0; }
.zl-card__meta { margin-top: auto; padding-top: 6px; font-size: .85rem; color: var(--zl-muted); }

/* ---------- Single ---------- */
.zl-article__head { text-align: center; padding: 48px 0 28px; }
.zl-article__head h1 { margin: .3em 0 .4em; }
.zl-meta { color: var(--zl-muted); font-size: .92rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.zl-meta span + span::before { content: "·"; margin-right: 14px; color: var(--zl-line); }

.zl-article__hero { max-width: var(--zl-wide); margin: 0 auto 40px; padding: 0 20px; }
.zl-article__hero img { width: 100%; max-height: 560px; object-fit: cover; border-radius: var(--zl-radius); }

.zl-article .entry-content, .zl-page .entry-content { max-width: var(--zl-content); margin: 0 auto; padding: 0 20px 48px; }

.entry-content h2 { padding-top: .2em; }
.entry-content li { margin-bottom: .35em; }
.entry-content blockquote {
	margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--zl-accent);
	font-family: var(--zl-serif); font-size: 1.15em; color: var(--zl-ink);
}
.entry-content img { border-radius: 10px; }
.entry-content figcaption, .wp-element-caption { font-size: .85rem; color: var(--zl-muted); text-align: center; margin-top: 8px; }

.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--zl-white); border-radius: 10px; overflow: hidden; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content th, .entry-content td { padding: 12px 14px; border-bottom: 1px solid var(--zl-line); text-align: left; vertical-align: top; }
.entry-content thead th { background: var(--zl-sand-2); font-weight: 600; }

.wp-block-button__link, .zl-btn {
	display: inline-block; background: var(--zl-accent); color: #fff; text-decoration: none;
	padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 1rem; line-height: 1.2;
	transition: background .15s ease, transform .15s ease;
}
.wp-block-button__link:hover, .zl-btn:hover { background: var(--zl-accent-dark); color: #fff; transform: translateY(-1px); }
.wp-block-buttons { margin: 1.6em 0; }
.entry-content .wp-block-group.has-background { border-radius: var(--zl-radius); }
.entry-content .wp-block-column.has-background { border-radius: var(--zl-radius); }
.entry-content .wp-block-cover.alignfull { border-radius: 0; }
.entry-content .wp-block-column > :first-child,
.entry-content .wp-block-group > :first-child,
.wp-block-cover__inner-container > :first-child { margin-top: 0; }
.entry-content .wp-block-column > :last-child,
.entry-content .wp-block-group > :last-child { margin-bottom: 0; }
.entry-content h2 a, .entry-content h3 a { text-decoration: none; }
.entry-content h2 a:hover, .entry-content h3 a:hover { text-decoration: underline; }

/* Latest posts block */
.wp-block-latest-posts.is-grid { padding: 0; gap: 24px; }
.wp-block-latest-posts.is-grid li {
	background: var(--zl-white); border-radius: var(--zl-radius); box-shadow: var(--zl-shadow);
	padding: 0 0 18px; overflow: hidden; margin: 0 !important;
}
.wp-block-latest-posts__featured-image { margin: 0 0 14px; }
.wp-block-latest-posts__featured-image img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 0; }
.wp-block-latest-posts__post-title { display: block; padding: 0 18px; font-family: var(--zl-serif); font-size: 1.2rem; font-weight: 700; color: var(--zl-ink); text-decoration: none; line-height: 1.3; }
.wp-block-latest-posts__post-excerpt { padding: 0 18px; margin: 8px 0 0; color: var(--zl-muted); font-size: .95rem; }
@media (max-width: 781px) { .wp-block-latest-posts.is-grid li { width: 100%; } }

/* Related */
.zl-related { background: var(--zl-sand-2); padding: 48px 0 8px; }
.zl-related h2 { text-align: center; margin-top: 0; }

/* Tags & nav */
.zl-tags { max-width: var(--zl-content); margin: 0 auto 32px; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.zl-tags a { font-size: .85rem; background: var(--zl-white); border: 1px solid var(--zl-line); padding: 4px 12px; border-radius: 999px; text-decoration: none; color: var(--zl-ink); }

.zl-pagination { display: flex; justify-content: center; gap: 8px; padding: 0 0 64px; flex-wrap: wrap; }
.zl-pagination .page-numbers {
	min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0 14px; border-radius: 999px;
	background: var(--zl-white); border: 1px solid var(--zl-line); text-decoration: none; color: var(--zl-ink);
}
.zl-pagination .current { background: var(--zl-accent); border-color: var(--zl-accent); color: #fff; }

/* Search form */
.zl-search { display: flex; gap: 8px; max-width: 520px; margin: 24px auto; }
.zl-search input[type="search"] {
	flex: 1; font: inherit; font-size: 1rem; padding: 12px 18px; border: 1px solid var(--zl-line);
	border-radius: 999px; background: var(--zl-white); color: var(--zl-ink);
}
.zl-search button { border: 0; cursor: pointer; font: inherit; }

/* Empty state */
.zl-empty { text-align: center; padding: 40px 20px 80px; color: var(--zl-muted); }

/* Comments */
.zl-comments { max-width: var(--zl-content); margin: 0 auto; padding: 0 20px 48px; }
.zl-comments ol { list-style: none; padding: 0; }
.zl-comments .comment-body { background: var(--zl-white); border-radius: var(--zl-radius); padding: 18px 20px; margin-bottom: 14px; }
.zl-comments textarea, .zl-comments input[type="text"], .zl-comments input[type="email"], .zl-comments input[type="url"] {
	width: 100%; font: inherit; padding: 10px 14px; border: 1px solid var(--zl-line); border-radius: 10px; background: var(--zl-white);
}
.zl-comments .submit { background: var(--zl-accent); color: #fff; border: 0; padding: 12px 22px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- Footer ---------- */
.zl-footer { background: var(--zl-ink); color: #d9cfc4; padding: 56px 0 28px; font-size: .95rem; }
.zl-footer a { color: #f1e6da; text-decoration: none; }
.zl-footer a:hover { color: #fff; text-decoration: underline; }
.zl-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .zl-footer__grid { grid-template-columns: 1fr; gap: 28px; } }
.zl-footer .zl-brand { color: #fff; }
.zl-footer .zl-brand__name { color: #fff; }
.zl-footer h3 { color: #fff; font-family: var(--zl-font); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 14px; }
.zl-footer ul { list-style: none; margin: 0; padding: 0; }
.zl-footer li { margin-bottom: 8px; }
.zl-footer__about { max-width: 380px; margin-top: 14px; color: #b8aca0; }
.zl-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 22px; font-size: .85rem; color: #9a8f84; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Accessibility */
:focus-visible { outline: 2px solid var(--zl-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
