/*
Theme Name: Matt Moser
Description: Portfolio photo inspiré du thème Madison 2 de Koken : colonne de navigation fixe, albums en colonnes, visionneuse plein écran.
Author: Matthieu Moser
Version: 1.0.0
Requires PHP: 8.0
Text Domain: mattmoser
*/

@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 300; font-display: swap; src: url(assets/fonts/source-sans-3-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 400; font-display: swap; src: url(assets/fonts/source-sans-3-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/source-sans-3-latin-700-normal.woff2) format("woff2"); }

:root {
	--side: 250px;
	--pad: 30px;
	--gap: 30px;
	--ink: #000;
	--text: #666;
	--nav: #444;
	--muted: #aaa;
	--line: #e5e5e5;
	--tile: #f2f2f2;
	--font: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: #fff;
	color: var(--ink);
	font: 14px/1.5 var(--font);
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Colonne de navigation */
.site-side {
	position: fixed;
	inset: 0 auto 0 0;
	width: var(--side);
	padding: 50px var(--pad) 40px;
	overflow-y: auto;
	font-size: 11px;
	line-height: 1.5;
	color: var(--muted);
	background: #fff;
	z-index: 20;
}
.site-title { margin: 0 0 30px; font-size: 19px; line-height: 24px; font-weight: 700; text-transform: uppercase; }
.site-title a { color: var(--ink); }
.nav-group { list-style: none; margin: 0 0 22px; padding: 0; }
.nav-group a {
	display: block;
	color: var(--nav);
	text-transform: uppercase;
	letter-spacing: 1px;
	transition: color .2s;
}
.nav-group a:hover { color: var(--ink); }
.nav-group .current-menu-item > a,
.nav-group .current-menu-ancestor > a,
.nav-group .current_page_item > a,
.nav-group .current-menu-parent > a { color: var(--ink); font-weight: 700; }
.site-copy { margin: 26px 0 0; }
.nav-toggle { display: none; }

/* Colonne principale */
.site-main { margin-left: var(--side); padding: 50px var(--pad) 60px 0; min-height: 100vh; }
.entry-title { margin: 0 0 16px; font-size: 16px; line-height: 24px; font-weight: 700; }
.entry-intro, .entry-content { max-width: 800px; color: var(--text); line-height: 1.5; }
.entry-intro { margin-bottom: 30px; }
.entry-intro p, .entry-content p { margin: 0 0 1em; }
.entry-content a { color: var(--ink); border-bottom: 1px solid var(--line); }
.entry-content a:hover { border-color: var(--ink); }
.entry-content h2 { color: var(--ink); font-size: 16px; }

/* Album : colonnes à la Madison, sans recadrage */
.photo-grid { columns: 3; column-gap: var(--gap); }
.photo-grid .photo { break-inside: avoid; margin: 0 0 var(--gap); }
.photo a { display: block; position: relative; background: var(--tile); }
.photo img { width: 100%; opacity: 0; transition: opacity .6s ease; }
.photo img.is-loaded, .no-js .photo img { opacity: 1; }
.photo a:hover img.is-loaded { opacity: .85; }
.photo figcaption { padding: 6px 0 0; font-size: 12px; color: var(--text); }

/* Ensemble : vignettes d'albums */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.album-tile a { display: block; background: var(--tile); }
.album-tile .cover { display: block; aspect-ratio: 3 / 2; overflow: hidden; }
.album-tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.album-tile a:hover img { opacity: .85; }
.album-tile .label { display: block; padding: 6px 10px; font-size: 11px; color: var(--nav); background: #ececec; }

/* Accueil : diaporama plein cadre */
.home-slides { position: fixed; inset: 0 0 0 var(--side); background: #111; overflow: hidden; }
.home-slides .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.home-slides .slide.is-active { opacity: 1; }
.home-slides img { width: 100%; height: 100%; object-fit: cover; }

/* Visionneuse */
.pswp { --pswp-bg: #0c0c0c; --pswp-placeholder-bg: #0c0c0c; }
.pswp__mm-caption {
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	max-width: min(90vw, 900px);
	padding: 4px 12px;
	color: #bbb;
	font: 12px/1.5 var(--font);
	text-align: center;
	pointer-events: none;
}
.pswp__mm-caption strong { color: #fff; font-weight: 600; }
.pswp__mm-caption .sep { margin: 0 .6em; color: #666; }

/* Boutique WooCommerce */
.woocommerce .site-main, .woocommerce-page .site-main { padding-right: var(--pad); }

/* Tablette */
@media (max-width: 1100px) {
	.photo-grid { columns: 2; }
	.album-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile : la colonne devient une barre en haut */
@media (max-width: 760px) {
	:root { --pad: 16px; --gap: 16px; }
	.site-side { position: sticky; top: 0; width: auto; height: auto; padding: 14px var(--pad); border-bottom: 1px solid var(--line); overflow: visible; }
	.site-title { margin: 0; font-size: 17px; }
	.nav-toggle {
		display: block;
		position: absolute;
		top: 10px;
		right: 8px;
		width: 40px;
		height: 32px;
		border: 0;
		background: none;
		cursor: pointer;
	}
	.nav-toggle span, .nav-toggle::before, .nav-toggle::after { content: ""; display: block; height: 2px; margin: 5px 10px; background: #000; }
	.site-nav { display: none; padding: 18px 0 4px; }
	.nav-open .site-nav { display: block; }
	.nav-group a { padding: 4px 0; font-size: 13px; }
	.site-main { margin-left: 0; padding: 24px var(--pad) 40px; }
	.photo-grid { columns: 1; }
	.album-grid { grid-template-columns: 1fr; }
	.home-slides { position: relative; inset: auto; height: calc(100svh - 61px); }
}
