/*
Theme Name: Bon Voyage à Deux
Theme URI: http://localhost:8090
Description: Thème enfant de Twenty Twenty-Five — design carnet de voyage, assorti au logo (traits d'encre, rose poudré).
Author: Kilian
Template: twentytwentyfive
Version: 1.11.0
Text Domain: bonvoyageadeux
*/

/* ---- Sketchbook feel ------------------------------------------------ */

body {
	letter-spacing: 0.01em;
}

/* Site title in handwritten Caveat */
.wp-block-site-title a {
	font-family: "Caveat", cursive;
	font-size: clamp(2rem, 4vw, 2.6rem);
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

/* Round the logo like the badge it is */
.wp-block-site-logo img {
	border-radius: 50%;
}

/* Navigation: soft pill hover */
.wp-block-navigation a {
	border-radius: 999px;
	padding: 0.35em 0.9em;
	transition: background-color 0.2s ease;
}
.wp-block-navigation a:hover {
	background-color: var(--wp--preset--color--blush-soft);
	text-decoration: none;
}

/* Featured images: rounded, gentle blush frame */
.wp-block-post-featured-image img,
.wp-block-image img {
	border-radius: 20px;
}
.wp-block-post-featured-image {
	border-radius: 20px;
	overflow: hidden;
}

/* Post cards on archive/home views */
.wp-block-post {
	border-radius: 24px;
	transition: transform 0.25s ease;
}
.wp-block-post:hover {
	transform: translateY(-3px);
}

/* Post titles */
h1, h2, h3,
.wp-block-post-title {
	font-weight: 800;
}
.wp-block-post-title a {
	text-decoration: none;
}
.wp-block-post-title a:hover {
	color: var(--wp--preset--color--rose);
}

/* Post meta (date, author) in blush rose */
.wp-block-post-date,
.wp-block-post-author-name,
.wp-block-post-terms {
	color: var(--wp--preset--color--rose);
	font-size: 0.85rem;
}

/* Buttons: pill, blush, ink text — like the logo ring */
.wp-block-button__link,
button,
input[type="submit"] {
	border-radius: 999px;
	box-shadow: none;
}

/* Separator: short blush stroke, like a brush mark */
hr.wp-block-separator {
	border: none;
	height: 4px;
	width: 72px;
	border-radius: 999px;
	background-color: var(--wp--preset--color--blush);
	opacity: 1;
}

/* Quotes: hand-written accent */
.wp-block-quote {
	border-left: 4px solid var(--wp--preset--color--blush);
	border-radius: 0 16px 16px 0;
	background-color: var(--wp--preset--color--blush-soft);
	padding: 1.2em 1.5em;
	font-family: "Caveat", cursive;
	font-size: 1.45em;
	line-height: 1.4;
}

/* Card groups: any group with a background becomes a rounded card */
.wp-block-group.has-background {
	border-radius: 20px;
	padding: 1.4rem 1.8rem;
}

/* Tables: soft rounded, blush header */
.wp-block-table table {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	border: 1px solid var(--wp--preset--color--sable);
	border-radius: 16px;
	overflow: hidden;
}
.wp-block-table th {
	background-color: var(--wp--preset--color--blush-soft);
	font-weight: 700;
	text-align: left;
}
.wp-block-table th,
.wp-block-table td {
	border: none;
	border-bottom: 1px solid var(--wp--preset--color--sable);
	padding: 0.7em 1em;
}
.wp-block-table tr:last-child td {
	border-bottom: none;
}
.wp-block-table tbody tr:nth-child(even) {
	background-color: color-mix(in srgb, var(--wp--preset--color--blush-soft) 45%, transparent);
}

/* Language switcher (header) */
.bvad-lang-switcher {
	display: flex;
	gap: 0.25rem;
	align-items: center;
}
.bvad-lang-switcher a {
	font-size: 0.85rem;
	font-weight: 700;
	padding: 0.25em 0.75em;
	border-radius: 999px;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	transition: background-color 0.2s ease;
}
.bvad-lang-switcher a:hover {
	background-color: var(--wp--preset--color--blush-soft);
}
.bvad-lang-switcher a.is-current {
	background-color: var(--wp--preset--color--blush);
}

/* Screenshot placeholder: replace the block with a real image when available */
.bvad-screenshot-placeholder {
	border: 2px dashed var(--wp--preset--color--blush);
	border-radius: 16px;
	background-color: color-mix(in srgb, var(--wp--preset--color--blush-soft) 55%, transparent);
	text-align: center;
	padding: 2.5rem 1rem;
	color: var(--wp--preset--color--rose);
	font-size: 0.9rem;
}

/* Selection color */
::selection {
	background-color: var(--wp--preset--color--blush);
	color: var(--wp--preset--color--contrast);
}

/* Instagram button ([bvad_instagram]) */
.bvad-instagram {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-width: 2.4rem;
	height: 2.4rem;
	padding: 0 0.6rem;
	border-radius: 999px;
	background-color: var(--wp--preset--color--blush-soft);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	line-height: 1;
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.bvad-instagram.has-label {
	padding: 0 1rem 0 0.75rem;
	font-size: 0.9rem;
	font-weight: 700;
}
.bvad-instagram__icon {
	display: block;
	flex: none;
}
.bvad-instagram:hover,
.bvad-instagram:focus-visible {
	color: #fff;
	background: linear-gradient(45deg, #f9ce34 0%, #ee2a7b 50%, #6228d7 100%);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(238, 42, 123, 0.28);
}
.bvad-instagram:focus-visible {
	outline: 2px solid var(--wp--preset--color--rose);
	outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
	.bvad-instagram { transition: none; }
	.bvad-instagram:hover { transform: none; }
}

/* Post list (home, archives, search): excerpt cards, newest first */
.bvad-post-list .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}
.bvad-card {
	display: flex;
	gap: 1.75rem;
	align-items: center;
	padding: 1.25rem;
	border-radius: 24px;
	background-color: var(--wp--preset--color--blush-soft);
}
.bvad-card .wp-block-post-featured-image {
	flex: 0 0 38%;
	margin: 0;
}
.bvad-card__body {
	flex: 1;
	min-width: 0;
}
.bvad-card__body > * {
	margin-block: 0 0.5rem;
}
.bvad-card .wp-block-post-title {
	line-height: 1.3;
}
.bvad-card .wp-block-post-excerpt__excerpt {
	margin: 0 0 0.6rem;
}
.bvad-card .wp-block-post-excerpt__more-link {
	font-weight: 700;
	text-decoration: none;
}
.bvad-post-list .wp-block-query-pagination {
	margin-top: 2rem;
}
@media (max-width: 640px) {
	.bvad-card {
		flex-direction: column;
		align-items: stretch;
		padding: 1rem;
	}
}

/* Reading width: theme.json sets 700px (about 80 Latin characters per line).
   Chinese packs more per character, so zh articles and pages get a wider column
   (about 44 characters per line); listings keep 700px so the side doodles fit. */
html[lang^="zh"] body:is(.single, .page) {
	--wp--style--global--content-size: 780px;
}
@media (min-width: 1200px) {
	body:is(.single, .page) .wp-block-post-content {
		font-size: 1.1rem;
	}
}

/* Article headings: more air above (ends the previous section), less below
   (ties the heading to its own section). Theme blockGap is 1.2rem everywhere. */
.wp-block-post-content > h2 {
	margin-block-start: 3rem;
}
.wp-block-post-content > :is(h3, h4) {
	margin-block-start: 2.25rem;
}
.wp-block-post-content > :is(h2, h3, h4) + * {
	margin-block-start: 0.75rem;
}
.wp-block-post-content > :is(h2, h3, h4):first-child {
	margin-block-start: 0;
}

/* Side doodles: Taiwan (left) and France (right) with a dashed route between the flags,
   faded behind the content. Only on screens wide enough to have empty margins.
   Drawings come from tools/doodles.py. Both frames are 1.2x the base width.
   Pole tips sit at 57.5% of Taiwan's width, 30.4% of France's, and 11.3% of the height;
   the route's ends are computed from those so it lands on both flags. France hangs lower
   by --bvad-fr-drop, which route.svg's path accounts for (see tools/doodles.py). */
@media (min-width: 1200px) {
	:root {
		--bvad-doodle-w: clamp(150px, 12vw, 210px);
		--bvad-doodle-h: calc(var(--bvad-doodle-w) * 2.3);
		--bvad-gutter: calc((100vw - var(--wp--style--global--content-size, 645px)) / 2);
		/* route box height if both flags were level; France drops by half of it */
		--bvad-route-base: calc(41vh - var(--bvad-doodle-h) * 0.307 - 6px);
		--bvad-fr-drop: calc(var(--bvad-route-base) * 0.5);
	}
	body::before,
	body::after,
	html::before {
		content: "";
		position: fixed;
		background: no-repeat center / contain;
		opacity: 0.5;
		pointer-events: none;
		z-index: -1;
	}
	body::before,
	body::after {
		top: calc(50vh - var(--bvad-doodle-h) * 0.42);
		width: var(--bvad-doodle-w);
		height: var(--bvad-doodle-h);
	}
	body::before {
		width: calc(var(--bvad-doodle-w) * 1.2);
		left: calc(var(--bvad-gutter) / 2 - var(--bvad-doodle-w) * 0.6);
		background-image: url("assets/doodles/taiwan.svg?v=1.7.1");
	}
	body::after {
		top: calc(50vh - var(--bvad-doodle-h) * 0.42 + var(--bvad-fr-drop));
		width: calc(var(--bvad-doodle-w) * 1.2);
		right: calc(var(--bvad-gutter) / 2 - var(--bvad-doodle-w) * 0.6);
		background-image: url("assets/doodles/france.svg?v=1.7.1");
	}
	html::before {
		top: 9vh;
		bottom: calc(50vh + var(--bvad-doodle-h) * 0.307 + 6px - var(--bvad-fr-drop));
		left: calc(var(--bvad-gutter) / 2 + var(--bvad-doodle-w) * 0.09);
		right: calc(var(--bvad-gutter) / 2 + var(--bvad-doodle-w) * 0.235);
		background: url("assets/doodles/route.svg?v=1.7.1") no-repeat 0 0 / 100% 100%;
	}
}
/* The side doodles and route only decorate listing pages (home, categories, search);
   articles and pages stay clean so readers focus on the content. */
body:not(.blog, .archive, .search)::before,
body:not(.blog, .archive, .search)::after,
html:not(:has(body.blog, body.archive, body.search))::before {
	display: none;
}

/* Very light watercolor landscape on top of the footer (tools/landscape.py).
   Its bottom edge is blush-soft, the footer color, so the two melt together. */
footer.wp-block-template-part::before {
	content: "";
	display: block;
	height: clamp(110px, 13vw, 200px);
	margin-top: var(--wp--preset--spacing--60);
	background: url("assets/doodles/landscape.svg?v=1.7.1") center bottom / cover no-repeat;
}
/* full-width footer stays square so it joins the landscape without notches */
footer .wp-block-group.alignfull.has-background {
	border-radius: 0;
}
/* Side doodles fade out while the footer (with its landscape) scrolls in,
   so the two never overlap. Browsers without scroll-driven animations keep them faint. */
@supports (animation-timeline: view()) {
	html { timeline-scope: --bvad-footer; }
	footer.wp-block-template-part { view-timeline: --bvad-footer block; }
	@media (min-width: 1200px) {
		body::before,
		body::after,
		html::before {
			animation: bvad-doodles-out linear both;
			animation-timeline: --bvad-footer;
			animation-range: entry 0% entry 70%;
		}
	}
	@keyframes bvad-doodles-out {
		from { opacity: 0.5; }
		to { opacity: 0; }
	}
}

@media print {
	body::before,
	body::after,
	html::before,
	footer.wp-block-template-part::before { display: none; }
}
