/*
Theme Name: Crispu
Theme URI: https://www.agencecrispu.com
Author: Xavier Renucci
Author URI: https://renucci.ovh
Description: Thème sur mesure pour l'Agence Crispu & Crispu, architecture d'intérieur et agencement. Accueil en mosaïque de réalisations, fiches très photographiques, sans page builder.
Version: 1.0.3
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.3
License: Propriétaire — usage réservé à l'Agence Crispu & Crispu
Text Domain: crispu
*/

/* ==========================================================================
   Polices (auto-hébergées, conformes RGPD)
   ========================================================================== */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300; font-display: swap; src: url("assets/fonts/jost-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: italic; font-weight: 300; font-display: swap; src: url("assets/fonts/jost-latin-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/jost-latin-500-normal.woff2") format("woff2"); }

/* ==========================================================================
   Variables — à remplacer par la nouvelle charte (couleurs aussi dans le Customizer)
   ========================================================================== */
:root {
	--bg: #f4f3f1;
	--ink: #2b2a28;
	--muted: #6f6b66;
	--line: #dcd9d4;
	--accent: #8a6f55;
	--white: #ffffff;

	--font: "Jost", "Futura", "Century Gothic", "Helvetica Neue", sans-serif;
	--track-wide: 0.2em;
	--track: 0.08em;

	--gutter: clamp(16px, 4vw, 56px);
	--gap: clamp(10px, 1.4vw, 20px);
	--sheet-max: 1120px;
	--header-h: 88px;

	--ease: cubic-bezier(.22, .61, .36, 1);
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-weight: 300;
	font-size: 16px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; transition: color .2s var(--ease), opacity .2s var(--ease); }
a:hover { color: var(--accent); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, h4 { font-weight: 400; margin: 0; }
p { margin: 0 0 1.1em; }
strong, b { font-weight: 500; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link {
	position: absolute; left: 12px; top: -60px; z-index: 100;
	background: var(--ink); color: var(--bg); padding: 10px 16px; font-size: 14px;
}
.skip-link:focus { top: 12px; color: var(--bg); }

/* ==========================================================================
   En-tête
   ========================================================================== */
.crispu-header {
	position: fixed; inset: 0 0 auto 0; z-index: 9990;
	height: var(--header-h);
	background: var(--bg);
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: transform .45s var(--ease), box-shadow .3s var(--ease);
}
.crispu-header.is-hidden { transform: translateY(-100%); }
.crispu-header.is-scrolled { background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.admin-bar .crispu-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .crispu-header { top: 46px; } }
.crispu-header__inner {
	height: 100%;
	padding: 0 var(--gutter);
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.crispu-brand__link { display: block; line-height: 0; }
.crispu-brand__logo { display: block; height: 52px; width: auto; max-width: min(320px, 55vw); object-fit: contain; object-position: left center; }
.crispu-brand__text { display: flex; flex-direction: column; line-height: 1.15; color: var(--ink); }
.crispu-brand__text:hover { color: var(--ink); }
.crispu-brand__name { font-size: 20px; font-weight: 400; letter-spacing: 0.3em; text-transform: uppercase; }
.crispu-brand__tagline { font-size: 10.5px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.crispu-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.crispu-nav__link {
	position: relative;
	display: grid; place-items: center;
	width: 44px; height: 44px;
	color: var(--ink);
}
.crispu-nav__link .icon { width: 22px; height: 22px; }
.crispu-nav__link.is-current { color: var(--accent); }
.crispu-nav__link::after {
	content: attr(data-label);
	position: absolute; top: calc(100% + 2px); left: 50%;
	transform: translate(-50%, -4px);
	font-size: 10.5px; letter-spacing: var(--track-wide); text-transform: uppercase; white-space: nowrap;
	color: var(--muted);
	opacity: 0; pointer-events: none;
	transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.crispu-nav__link:hover::after, .crispu-nav__link:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.crispu-nav__sep { width: 1px; height: 22px; background: var(--line); margin: 0 10px; }

/* ==========================================================================
   Accueil — mosaïque
   ========================================================================== */
.site-main { padding-top: var(--header-h); min-height: 70vh; }

.mosaic {
	padding: clamp(16px, 3vw, 40px) var(--gutter) 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--gap);
	align-items: start;
}
/* Quand le JS a réparti les tuiles en colonnes (mosaïque « à la Pinterest ») */
.mosaic.is-masonry, .gallery.is-masonry { display: flex; align-items: flex-start; gap: var(--gap); }
.mosaic__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--gap) * 2.2); }
.mosaic { row-gap: calc(var(--gap) * 2.2); }

.tile { margin: 0; }
.tile__link { display: block; color: var(--ink); }
.tile__link:hover { color: var(--ink); }
.tile__media {
	position: relative; overflow: hidden;
	background: var(--line);
	background: color-mix(in srgb, var(--line) 60%, var(--bg));
}
.tile__img {
	width: 100%; height: 100%; object-fit: cover;
	transform: scale(1.001);
	transition: transform 1.1s var(--ease), opacity .8s var(--ease), filter .6s var(--ease);
}
.js .tile__img, .js .gallery__img { opacity: 0; }
.js .tile__img.is-loaded, .js .gallery__img.is-loaded { opacity: 1; }
.tile__link:hover .tile__img { transform: scale(1.035); }

.tile__caption { padding: 14px 2px 0; }
.tile__title {
	font-size: 13px; font-weight: 400;
	letter-spacing: var(--track-wide); text-transform: uppercase;
	line-height: 1.5;
}
.tile__title::after {
	content: ""; display: block; width: 0; height: 1px; margin-top: 6px;
	background: var(--accent); transition: width .5s var(--ease);
}
.tile__link:hover .tile__title::after, .tile__link:focus-visible .tile__title::after { width: 36px; }
.tile__place { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* La tuile Agence se distingue discrètement */
.tile--agence .tile__title { font-weight: 500; }

/* ==========================================================================
   Fiche (réalisation / page)
   ========================================================================== */
.sheet { padding: clamp(40px, 7vw, 110px) var(--gutter) 0; }
.sheet__head {
	max-width: var(--sheet-max); margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
	gap: clamp(32px, 7vw, 120px);
	align-items: start;
}
.sheet__title {
	font-size: clamp(30px, 4.4vw, 54px);
	font-weight: 300;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	line-height: 1.12;
	margin-bottom: 14px;
	overflow-wrap: anywhere;
}
.sheet__place {
	font-size: 12.5px; letter-spacing: var(--track-wide); text-transform: uppercase;
	color: var(--muted); margin: 0 0 clamp(28px, 4vw, 48px);
}
.sheet__title + .sheet__text { margin-top: clamp(28px, 4vw, 48px); }

.entry { font-size: 16.5px; line-height: 1.8; max-width: 66ch; }
.entry > *:last-child { margin-bottom: 0; }
.entry a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry h2, .entry h3 {
	font-size: 14px; font-weight: 500; letter-spacing: var(--track-wide); text-transform: uppercase;
	margin: 2.4em 0 1em;
}
.single-post .entry > p:first-child { font-style: italic; color: var(--muted); }
.entry .wp-block-embed { margin: 2em 0; }
.entry .wp-block-embed__wrapper { position: relative; }
.entry iframe { width: 100%; }
.entry .wp-has-aspect-ratio .wp-block-embed__wrapper::before { content: ""; display: block; padding-top: 56.25%; }
.entry .wp-has-aspect-ratio iframe { position: absolute; inset: 0; height: 100%; }

.sheet__fiche { position: sticky; top: calc(var(--header-h) + 24px); padding-top: 8px; }
.sheet__fiche dl { margin: 0; display: grid; gap: 20px; }
.sheet__row dt {
	font-size: 12px; font-weight: 500; letter-spacing: var(--track-wide); text-transform: uppercase;
	margin-bottom: 2px;
}
.sheet__row dd { margin: 0; font-size: 15.5px; color: var(--muted); line-height: 1.6; }
.sheet__row dd a { color: var(--muted); }
.sheet__row dd a:hover { color: var(--accent); }

/* Galerie photos */
.gallery {
	max-width: var(--sheet-max);
	margin: clamp(48px, 7vw, 96px) auto 0;
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap);
	align-items: start;
}
.gallery .mosaic__col { gap: var(--gap); }
.gallery__item { margin: 0; }
.gallery__link { display: block; cursor: zoom-in; }
.gallery__media { display: block; overflow: hidden; background: var(--line); background: color-mix(in srgb, var(--line) 60%, var(--bg)); }
.gallery__img { width: 100%; height: 100%; object-fit: cover; transition: opacity .8s var(--ease), transform 1.1s var(--ease); }
.gallery__link:hover .gallery__img { transform: scale(1.02); }

/* Navigation entre réalisations */
.sheet__nav {
	max-width: var(--sheet-max);
	margin: clamp(64px, 9vw, 120px) auto 0;
	padding: 28px 0;
	border-top: 1px solid var(--line);
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
	font-size: 13px; letter-spacing: var(--track); text-transform: uppercase;
}
.sheet__nav a { display: inline-flex; align-items: center; gap: 14px; }
.sheet__nav small { display: block; font-size: 10.5px; letter-spacing: var(--track-wide); color: var(--muted); }
.sheet__nav .icon { width: 20px; height: 20px; flex: none; }
.sheet__nav-side--end { text-align: right; justify-self: end; }
.sheet__nav-all { font-size: 11px; letter-spacing: var(--track-wide); color: var(--muted); }

/* Contact */
.contact-form { margin-top: 40px; max-width: 620px; }
.contact-map { max-width: var(--sheet-max); margin: clamp(48px, 7vw, 96px) auto 0; }
.contact-map iframe { width: 100%; height: 440px; border: 0; filter: grayscale(1) contrast(.95); }
.contact-form .wpforms-container input[type="text"],
.contact-form .wpforms-container input[type="email"],
.contact-form .wpforms-container input[type="tel"],
.contact-form .wpforms-container textarea {
	font-family: var(--font) !important; font-weight: 300 !important;
	border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important;
	background: transparent !important; padding-left: 0 !important; box-shadow: none !important;
}
.contact-form .wpforms-container button[type="submit"] {
	font-family: var(--font) !important; text-transform: uppercase; letter-spacing: var(--track-wide);
	background: var(--ink) !important; color: var(--bg) !important; border: 0 !important; border-radius: 0 !important;
	padding: 14px 28px !important; height: auto !important;
}

/* ==========================================================================
   Pied de page
   ========================================================================== */
.site-footer {
	margin-top: clamp(80px, 10vw, 160px);
	padding: 56px var(--gutter) 48px;
	text-align: center;
	font-size: 12px; letter-spacing: var(--track-wide); text-transform: uppercase;
	color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer__name { font-size: 15px; letter-spacing: 0.3em; color: var(--ink); }
.site-footer__tagline { margin-top: 6px !important; }
.site-footer__contact { font-style: normal; margin-top: 28px; display: flex; flex-direction: column; gap: 4px; line-height: 1.8; }
.site-footer__contact .dot { margin: 0 8px; }
.site-footer__contact a[href^="mailto"] { text-transform: none; letter-spacing: var(--track); }
.site-footer__social { list-style: none; padding: 0; margin: 24px 0 0; display: flex; justify-content: center; gap: 4px; }
.site-footer__social a { display: grid; place-items: center; width: 44px; height: 44px; }
.site-footer__social .icon { width: 20px; height: 20px; }
.site-footer__credits { margin-top: 24px !important; font-size: 10.5px; text-transform: none; letter-spacing: var(--track); }
.site-footer__legal { margin-top: 10px !important; font-size: 10.5px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; }

/* ==========================================================================
   Visionneuse plein écran
   ========================================================================== */
.lightbox {
	position: fixed; inset: 0; z-index: 200;
	background: var(--bg);
	background: color-mix(in srgb, var(--bg) 97%, transparent);
	display: grid; place-items: center;
	opacity: 0; visibility: hidden;
	transition: opacity .3s var(--ease), visibility 0s linear .3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .3s var(--ease); }
.lightbox__stage { width: 100%; height: 100%; display: grid; place-items: center; padding: 72px clamp(16px, 7vw, 110px); touch-action: pan-y; }
.lightbox__img { max-width: 100%; max-height: calc(100vh - 144px); max-height: calc(100dvh - 144px); width: auto; height: auto; object-fit: contain; transition: opacity .25s var(--ease); }
.lightbox__img.is-loading { opacity: 0; }
.lightbox button {
	position: absolute; display: grid; place-items: center;
	width: 52px; height: 52px; padding: 0; border: 0; background: none; cursor: pointer;
	color: var(--ink);
}
.lightbox button:hover { color: var(--accent); }
.lightbox button .icon { width: 26px; height: 26px; }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__count {
	position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
	font-size: 11px; letter-spacing: var(--track-wide); color: var(--muted);
}
body.has-lightbox { overflow: hidden; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1399px) {
	.mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 999px) {
	.mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.sheet__head { grid-template-columns: 1fr; }
	.sheet__fiche { position: static; border-top: 1px solid var(--line); padding-top: 28px; }
	.sheet__fiche dl { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 639px) {
	:root { --header-h: 68px; }
	.crispu-brand__logo { height: 38px; }
	.mosaic { grid-template-columns: 1fr; }
	.gallery { grid-template-columns: 1fr; }
	.crispu-brand__name { font-size: 16px; letter-spacing: 0.24em; }
	.crispu-brand__tagline { font-size: 8.5px; letter-spacing: 0.14em; white-space: nowrap; }
	.crispu-nav__social, .crispu-nav__sep { display: none; }
	.crispu-nav__link::after { display: none; }
	.sheet__nav { grid-template-columns: 1fr 1fr; }
	.sheet__nav-all { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
	.lightbox__prev, .lightbox__next { display: none !important; }
}

@media (max-width: 419px) {
	.crispu-nav__map { display: none; }
	.crispu-nav__link { width: 40px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
	@view-transition { navigation: none; }
	.js .tile__img, .js .gallery__img { opacity: 1; }
}

@media print {
	.crispu-header, .sheet__nav, .site-footer__social { display: none; }
	.site-main { padding-top: 0; }
}
