/*
Theme Name: Julie & Marc, notre carnet
Description: Le design de juliemarc.com : un carnet à deux, chaleureux et lisible. Utilise les fonctions PHP de Détox Journal (thème parent), mais ni ses gabarits ni ses styles.
Template: detox-journal
Version: 2.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: juliemarc-journal
License: GPL-2.0-or-later
*/

/* ---------- Fonts (self-hosted, SIL OFL: see assets/fonts) ---------- */
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/instrument-serif-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("assets/fonts/instrument-serif-latin-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("assets/fonts/figtree-latin-wght.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("assets/fonts/caveat-latin-wght.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
	--paper: #faf6ef;
	--paper-2: #f3ece0;
	--card: #fffdf9;
	--ink: #22303a;
	--ink-2: #4a5761;
	--ink-3: #7b8790;
	--line: #e6ddcf;
	--coral: #e07a5f;
	--coral-dark: #c65f45;
	--sage: #81b29a;
	--mustard: #f2cc8f;
	--tc: var(--coral);
	--tc-soft: #fbe4dc;

	--f-title: "Instrument Serif", "Iowan Old Style", Georgia, serif;
	--f-text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
	--f-hand: "Caveat", "Bradley Hand", cursive;

	--wrap: 1180px;
	--text: 700px;
	--gutter: clamp(16px, 4vw, 40px);
	--r: 22px;
	--shadow: 0 1px 2px rgba(34, 48, 58, .05), 0 12px 32px -12px rgba(34, 48, 58, .18);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.65 var(--f-text); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-title); font-weight: 400; line-height: 1.08; letter-spacing: -.01em; margin: 0; }
p { margin: 0 0 1em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { clip: auto; width: auto; height: auto; z-index: 1000; top: 8px; left: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-text { max-width: calc(var(--text) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: calc(980px + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.hand { font-family: var(--f-hand); font-weight: 600; color: var(--coral-dark); line-height: 1.1; }

.btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 999px; border: 1.5px solid var(--ink);
	background: var(--ink); color: var(--paper); font: 600 15px/1 var(--f-text); text-decoration: none; cursor: pointer; transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: #34444f; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.link { font-weight: 600; color: var(--coral-dark); text-decoration: none; border-bottom: 1.5px solid currentColor; }

.pill {
	display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--tc-soft); color: var(--tc);
	font: 700 12px/1.2 var(--f-text); letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}
a.pill:hover { background: var(--tc); color: #fff; }
.meta { margin: 0; color: var(--ink-3); font-size: 14px; }

.section-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 28px; }
.section-title h2 { font-size: clamp(34px, 4vw, 46px); }
.section-title .hand { font-size: 24px; margin: 0; transform: rotate(-2deg); }

/* ---------- Header ---------- */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(250, 246, 239, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.admin-bar .site-head { top: 32px; }
.site-head__in { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.logo { display: flex; flex-direction: column; text-decoration: none; line-height: 1; flex: none; }
.logo__name { font: 600 34px/1 var(--f-hand); color: var(--ink); }
.logo__amp { color: var(--coral); }
.logo__sub { font: 500 11px/1 var(--f-text); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 0 2px; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 999px; font: 500 15px/1.2 var(--f-text); text-decoration: none; color: var(--ink-2); }
.site-nav a:hover, .site-nav a[aria-current] { background: var(--tc-soft); color: var(--tc); }
.site-nav__about a { color: var(--ink); font-weight: 600; }
.site-head__actions { display: flex; gap: 8px; }
.round-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.round-btn:hover { border-color: var(--ink); }
.round-btn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }
.search-panel { display: none; border-top: 1px solid var(--line); }
.search-panel.is-open { display: block; }
.search-panel .wrap { padding-top: 18px; padding-bottom: 18px; }
.search-form { display: flex; gap: 8px; max-width: 620px; margin: 0 auto; }
.search-form input[type="search"] { flex: 1; min-width: 0; height: 50px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font: 400 17px var(--f-text); color: var(--ink); }
.search-form input[type="search"]:focus { border-color: var(--ink); outline: none; }
.search-form .btn { height: 50px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 56px); overflow: hidden; }
.hero__in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero__hello { font-size: 34px; margin: 0 0 6px; transform: rotate(-3deg); transform-origin: left; display: inline-block; }
.hero h1 { font-size: clamp(44px, 6.4vw, 84px); line-height: 1; margin-bottom: 26px; }
.hero__lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 36em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__photo { position: relative; margin: 0; justify-self: center; width: min(100%, 400px); }
.arch { aspect-ratio: 4 / 5; border-radius: 999px 999px 28px 28px; overflow: hidden; background: linear-gradient(160deg, var(--mustard), var(--coral)); box-shadow: var(--shadow); }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.arch__initials { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font: 400 112px/1 var(--f-title); font-style: italic; color: var(--paper); }
.hero__photo::before { content: ""; position: absolute; inset: auto -26px -22px auto; width: 120px; height: 120px; border-radius: 50%; background: var(--sage); opacity: .55; z-index: -1; }
.note {
	position: absolute; left: -36px; bottom: 34px; padding: 14px 18px; background: #fff7d6; color: var(--ink);
	font: 600 22px/1.1 var(--f-hand); transform: rotate(-5deg); box-shadow: 0 10px 24px -10px rgba(34, 48, 58, .35);
}
.note::before { content: ""; position: absolute; top: -10px; left: 50%; width: 64px; height: 20px; margin-left: -32px; background: rgba(129, 178, 154, .55); transform: rotate(3deg); }

/* ---------- This week (feature) ---------- */
.week { margin-top: 8px; margin-bottom: clamp(56px, 8vw, 96px); }
.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.feature__img { display: block; min-height: 320px; background: var(--tc-soft); }
.feature__img img { width: 100%; height: 100%; object-fit: cover; }
.feature__body { padding: clamp(28px, 4vw, 52px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; }
.feature__label { font-size: 28px; transform: rotate(-2deg); }
.feature__title { font-size: clamp(32px, 3.6vw, 46px); }
.feature__title a, .card__title a, .entry__title a { text-decoration: none; }
.feature__title a:hover, .card__title a:hover, .entry__title a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: var(--tc); }
.feature__excerpt { color: var(--ink-2); margin: 0; font-size: 17px; }
.noimg { display: flex; width: 100%; height: 100%; min-height: inherit; align-items: center; justify-content: center; font: italic 400 120px/1 var(--f-title); color: var(--tc); }

/* ---------- Theme tiles ---------- */
.themes { padding: clamp(56px, 8vw, 88px) 0; background: var(--paper-2); }
.themes__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile {
	position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 172px; padding: 24px 24px 22px; border-radius: var(--r);
	background: var(--tc-soft); text-decoration: none; overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.tile::after { content: ""; position: absolute; right: -28px; top: -28px; width: 104px; height: 104px; border-radius: 50%; background: var(--tc); opacity: .18; transition: transform .3s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile:hover::after { transform: scale(1.25); }
.tile__name { font: 400 30px/1.05 var(--f-title); color: var(--ink); }
.tile__desc { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.tile__count { margin-top: auto; font: 600 22px/1 var(--f-hand); color: var(--tc); }

/* ---------- Journal entries ---------- */
.journal { padding-top: clamp(56px, 8vw, 88px); padding-bottom: clamp(40px, 6vw, 64px); }
.entries { display: flex; flex-direction: column; }
.entry { display: grid; grid-template-columns: 76px minmax(0, 1fr) 140px; gap: 24px; align-items: center; padding: 26px 0; border-top: 1px dashed var(--line); }
.entry:last-child { border-bottom: 1px dashed var(--line); }
.entry__date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 76px; height: 76px; border-radius: 50%; background: var(--tc-soft); color: var(--tc); text-decoration: none; line-height: 1; }
.entry__day { font: 400 34px/1 var(--f-title); }
.entry__month { font: 700 11px/1 var(--f-text); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.entry__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.entry__title { font-size: clamp(25px, 2.4vw, 31px); }
.entry__excerpt { margin: 0; color: var(--ink-2); font-size: 16px; }
.entry__img { display: block; width: 140px; aspect-ratio: 1; border-radius: 18px; overflow: hidden; transform: rotate(2deg); box-shadow: var(--shadow); }
.entry__img img { width: 100%; height: 100%; object-fit: cover; }
.entry:nth-child(even) .entry__img { transform: rotate(-2deg); }
.journal__more { text-align: center; margin: 36px 0 0; }
.empty { padding: 40px 0; text-align: center; font: 600 26px/1.3 var(--f-hand); color: var(--ink-2); }

/* ---------- Promise ---------- */
.promise { padding: clamp(48px, 7vw, 80px) 0; }
.promise__in { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; max-width: 920px; background: var(--card); border-radius: var(--r); padding: clamp(28px, 4vw, 48px); box-shadow: var(--shadow); }
.promise h2 { font-size: clamp(30px, 3vw, 40px); margin-bottom: 14px; }
.promise ul { list-style: none; margin: 0 0 18px; padding: 0; }
.promise li { position: relative; padding-left: 28px; margin-bottom: 10px; color: var(--ink-2); }
.promise li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--sage); font-weight: 800; }
.promise strong { color: var(--ink); }
.portraits { display: flex; }
.portraits img, .portraits .initials { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 4px solid var(--card); }
.portraits img + img { margin-left: -22px; }
.portraits .initials { display: flex; align-items: center; justify-content: center; background: var(--coral); color: var(--paper); font: italic 400 34px/1 var(--f-title); }

/* ---------- Lists (themes, search) and pages ---------- */
.list-head { padding: clamp(48px, 7vw, 80px) 0 clamp(24px, 4vw, 40px); text-align: center; background: linear-gradient(180deg, var(--tc-soft), var(--paper)); }
.list-head__label { font-size: 28px; margin: 0 0 4px; }
.list-head h1 { font-size: clamp(42px, 6vw, 72px); }
.list-head__intro { margin: 16px auto 0; max-width: 36em; color: var(--ink-2); font-size: 18px; }
.list-head .search-form { margin-top: 24px; }
.page-body { padding-bottom: 72px; }
.navigation.pagination { margin-top: 36px; }
.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: inline-flex; min-width: 44px; height: 44px; padding: 0 14px; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
a.page-numbers:hover { border-color: var(--ink); }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--tc, var(--coral)); z-index: 100; }
.article__head { padding-top: clamp(40px, 6vw, 72px); text-align: center; }
.article__head h1 { font-size: clamp(40px, 5.6vw, 64px); margin: 18px 0 18px; }
.article__lead { font-size: clamp(18px, 1.8vw, 21px); color: var(--ink-2); line-height: 1.55; }
.byline { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 22px 0 0; color: var(--ink-3); font-size: 14px; }
.byline .hand { font-size: 26px; }
.article__cover { margin: clamp(28px, 4vw, 44px) auto clamp(28px, 4vw, 48px); }
.article__cover img { width: 100%; border-radius: var(--r); box-shadow: var(--shadow); }
.article__cover figcaption { margin-top: 10px; text-align: center; font-size: 13px; color: var(--ink-3); }

.prose { font-size: 18.5px; line-height: 1.75; color: #2b3943; }
.prose p, .prose ul, .prose ol, .prose figure, .prose details, .prose blockquote, .prose .table-wrap { margin: 0 0 1.15em; }
.prose h2 { font-size: clamp(32px, 3.4vw, 40px); margin: 1.6em 0 .5em; }
.prose h3 { font: 700 21px/1.3 var(--f-text); margin: 1.5em 0 .5em; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--tc); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { background: var(--tc-soft); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--tc); font-weight: 700; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 20px 24px; background: #fff7d6; border-radius: 4px 18px 18px 18px; font: 600 25px/1.3 var(--f-hand); color: var(--ink); transform: rotate(-.6deg); }
.prose blockquote p:last-child { margin: 0; }
.prose img { border-radius: 16px; }
.prose hr { border: 0; border-top: 1px dashed var(--line); margin: 2em 0; }
.prose .table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px; }
.prose th { background: var(--tc-soft); text-align: left; padding: 10px 14px; }
.prose td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.prose .jm-sources, .prose .bw-sources { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.prose .jm-sources a, .prose .bw-sources a { text-decoration-thickness: 1px; }
.toc { background: var(--card); border-radius: 18px; padding: 18px 24px; box-shadow: var(--shadow); font-size: 16px; }
.toc summary { cursor: pointer; font: 600 24px/1.2 var(--f-hand); color: var(--coral-dark); }
.toc ol { margin: 10px 0 0; padding-left: 1.2em; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.partner-note { padding: 14px 18px; background: var(--paper-2); border-radius: 14px; font-size: 15px; color: var(--ink-2); }
.partner-note a { text-decoration-color: var(--coral); }

.careful { margin: 40px 0 0; padding: 18px 22px; border: 1.5px dashed var(--line); border-radius: 18px; font-size: 15px; color: var(--ink-2); }
.careful p { margin: 0; }
.duo { display: flex; gap: 22px; align-items: center; margin: 28px 0 0; padding: 24px; background: var(--tc-soft); border-radius: var(--r); }
.duo .portraits img, .duo .portraits .initials { width: 64px; height: 64px; font-size: 24px; border-color: var(--tc-soft); }
.duo__title { font-size: 28px; margin: 0 0 4px; }
.duo p:last-child { margin: 0; color: var(--ink-2); font-size: 15px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 28px 0 0; padding-bottom: clamp(48px, 7vw, 80px); font-size: 14px; }
.share span { font-weight: 700; margin-right: 6px; }
.share a, .share button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font: 500 14px var(--f-text); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--ink); }
.copy-link.copied { background: var(--sage); color: #fff; border-color: var(--sage); }

.related { padding: clamp(48px, 7vw, 80px) 0; background: var(--paper-2); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.card { display: flex; flex-direction: column; gap: 14px; }
.card__img { display: block; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: var(--tc-soft); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card__img img { transform: scale(1.04); }
.card__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.card__title { font-size: 26px; }
.card__excerpt { margin: 0; color: var(--ink-2); font-size: 15.5px; }

/* ---------- Footer ---------- */
.site-foot { background: var(--ink); color: #d8dee2; padding: 64px 0 28px; }
.site-foot a { color: #fff; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-foot__top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.site-foot__sign .hand { font-size: 44px; color: var(--mustard); margin: 0 0 10px; transform: rotate(-2deg); display: inline-block; }
.site-foot h2 { font: 700 13px/1 var(--f-text); text-transform: uppercase; letter-spacing: .12em; color: var(--mustard); margin: 8px 0 16px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 9px; }
.site-foot__legal { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; justify-content: space-between; gap: 24px; font-size: 13px; color: #9aa6ae; }
.site-foot__legal p { margin: 0; max-width: 60em; }
.social { display: flex; gap: 12px; margin-top: 18px; }
.social svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.menu-toggle { display: inline-flex; }
	.site-nav { position: absolute; left: 0; right: 0; top: 100%; display: none; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; gap: 2px; }
	.site-nav a { font-size: 17px; padding: 12px 14px; }
	.site-head__actions { margin-left: auto; }
}
@media (max-width: 900px) {
	.hero__in { grid-template-columns: 1fr; }
	.hero__photo { width: min(78%, 320px); order: -1; }
	.note { left: auto; right: -14px; bottom: 18px; font-size: 19px; }
	.feature { grid-template-columns: 1fr; }
	.feature__img { min-height: 0; aspect-ratio: 16 / 9; }
	.themes__grid, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.site-foot__top { grid-template-columns: 1fr 1fr; }
	.site-foot__sign { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	body { font-size: 16.5px; }
	.site-head__in { min-height: 64px; gap: 12px; }
	.logo__name { font-size: 29px; }
	.themes__grid, .cards { grid-template-columns: 1fr; }
	.tile { min-height: 0; }
	.entry { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; }
	.entry__date { width: 56px; height: 56px; }
	.entry__day { font-size: 26px; }
	.entry__img { display: none; }
	.promise__in { grid-template-columns: 1fr; }
	.prose { font-size: 17.5px; }
	.duo { flex-direction: column; align-items: flex-start; }
	.site-foot__legal { flex-direction: column; }
	.search-form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
