/*
Theme Name: FHERVY Portfolio
Theme URI: https://fhervy.com
Author: Francois Hervy
Description: Reconstruction du portfolio Adobe Portfolio de fhervy.com (fond sombre, grille de projets, galeries justifiées avec lightbox, page About en splash, formulaire de contact). Inclut un importeur qui rapatrie automatiquement projets et photos depuis le site Adobe Portfolio (Apparence > Importer fhervy.com).
Version: 1.0.7
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: fhervy
*/

/* ---------- Fonts (Barlow Condensed, SIL OFL, hébergée localement) ---------- */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-condensed-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
	--fh-bg: #111111;
	--fh-text: #ffffff;
	--fh-muted: #999999;
	--fh-nav: #aeaeae;
	--fh-field: #373737;
	--fh-font: "Barlow Condensed", "DIN Condensed", "Arial Narrow", sans-serif;
	--fh-weight: 500;
	--fh-side: 4%;
	--fh-max: 1400px;
	--fh-cover-gap: 10px;
	--fh-grid-gap: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--fh-bg); }
body {
	margin: 0;
	background: var(--fh-bg);
	color: var(--fh-text);
	font-family: var(--fh-font);
	font-weight: var(--fh-weight);
	font-size: 16px;
	line-height: 1.25;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .15s, opacity .15s; }
img { max-width: 100%; height: auto; display: block; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* ---------- Header ---------- */
.fh-header {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	min-height: 160px;
	padding: 0 var(--fh-side) 10px;
}
.fh-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.fh-nav a { font-size: 19px; line-height: 19px; text-transform: uppercase; color: var(--fh-nav); }
.fh-nav a:hover,
.fh-nav .current-menu-item > a,
.fh-nav .current_page_item > a,
.fh-nav .fh-current > a { color: var(--fh-text); }
.fh-logo { font-size: 35px; line-height: 35px; text-transform: uppercase; color: var(--fh-text); text-align: center; margin: 0; font-weight: var(--fh-weight); }
.fh-social { display: flex; justify-content: flex-end; gap: 18px; align-items: center; }
.fh-social a { color: var(--fh-text); display: inline-flex; }
.fh-social a:hover { opacity: .6; }
.fh-social svg { width: 16px; height: 16px; fill: currentColor; }

.fh-burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--fh-text); }
.fh-burger span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px 0; }
.fh-mobile-menu { display: none; }

/* ---------- Work grid (covers) ---------- */
.fh-covers {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--fh-cover-gap);
	padding: 0 var(--fh-side) 60px;
}
.fh-cover { position: relative; display: block; overflow: hidden; aspect-ratio: 709 / 404; background: #1a1a1a; }
.fh-cover img { width: 100%; height: 100%; object-fit: cover; }
.fh-cover__details {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	padding: 20px; text-align: center;
	background: rgba(17,17,17,.85);
	opacity: 0; transition: opacity .15s;
}
.fh-cover:hover .fh-cover__details,
.fh-cover:focus-visible .fh-cover__details { opacity: 1; }
.fh-cover__title { font-size: 24px; line-height: 28px; text-transform: uppercase; color: var(--fh-text); }
.fh-cover__date { font-size: 16px; line-height: 20px; color: var(--fh-muted); margin-top: 4px; }

/* ---------- Page header (project / contact) ---------- */
.fh-page-header { text-align: center; padding: 0 var(--fh-side) 50px; max-width: calc(var(--fh-max) + 8%); margin: 0 auto; }
.fh-page-title { font-size: 30px; line-height: 1.2; margin: 0; font-weight: var(--fh-weight); text-transform: uppercase; }
.fh-page-desc { font-size: 20px; line-height: 1.4; color: var(--fh-muted); margin: 14px auto 0; max-width: 900px; }

/* ---------- Project content ---------- */
.fh-project { width: min(var(--fh-max), calc(100% - 2 * var(--fh-side))); margin: 0 auto; }
.fh-project > * { margin: 0 0 var(--fh-cover-gap); }
.fh-project .wp-block-image { margin: 0 0 var(--fh-cover-gap); }
.fh-project .wp-block-image img { width: 100%; height: auto; cursor: zoom-in; }
.fh-project p { font-size: 20px; line-height: 1.5; color: var(--fh-muted); text-align: center; }

/* Justified grid (même principe qu'Adobe Portfolio) */
.fh-grid { display: flex; flex-wrap: wrap; margin: 0 calc(var(--fh-grid-gap) / -2) var(--fh-cover-gap); }
.fh-grid::after { content: ""; flex-grow: 999999999; }
.fh-grid__item { position: relative; display: block; margin: calc(var(--fh-grid-gap) / 2); cursor: zoom-in; overflow: hidden; background: #1a1a1a; }
.fh-grid__item i { display: block; }
.fh-grid__item img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- You may also like ---------- */
.fh-related { padding: 60px var(--fh-side) 60px; max-width: calc(var(--fh-max) + 8%); margin: 0 auto; }
.fh-related h2 { font-size: 24px; text-transform: uppercase; text-align: center; margin: 0 0 30px; font-weight: var(--fh-weight); }
.fh-related .fh-covers { grid-template-columns: repeat(2, 1fr); padding: 0; }

/* ---------- Generic pages ---------- */
.fh-content { max-width: 800px; margin: 0 auto; padding: 0 var(--fh-side) 80px; font-size: 18px; line-height: 1.5; color: #ddd; }

/* ---------- Contact ---------- */
.fh-form { width: 600px; max-width: 100%; margin: 0 auto; padding: 0 0 60px; }
.fh-form label { display: block; font-size: 16px; color: var(--fh-text); margin: 0 0 8px; }
.fh-form .fh-field { margin-bottom: 22px; }
.fh-form input[type=text], .fh-form input[type=email], .fh-form textarea {
	width: 100%; background: var(--fh-field); color: var(--fh-text);
	border: 1px solid var(--fh-field); border-radius: 3px;
	font: inherit; font-size: 16px; padding: 10px 12px; height: 42px;
}
.fh-form textarea { height: 132px; resize: vertical; }
.fh-form input:focus, .fh-form textarea:focus { outline: none; border-color: #666; }
.fh-form ::placeholder { color: #8a8a8a; }
.fh-btn, .fh-form button {
	display: inline-block; background: #fff; color: var(--fh-bg); border: 0; border-radius: 100px;
	font: inherit; font-size: 16px; text-transform: uppercase; padding: 8px 22px; cursor: pointer;
}
.fh-btn:hover, .fh-form button:hover { opacity: .85; }
.fh-hp { position: absolute; left: -9999px; }
.fh-notice { width: 600px; max-width: 100%; margin: 0 auto 30px; padding: 14px 16px; border-radius: 3px; background: #1f3a23; color: #d7f5dc; text-align: center; }
.fh-notice.is-error { background: #4a1d1d; color: #ffd9d9; }

/* ---------- About (splash) ---------- */
body.fh-splash-page { min-height: 100vh; }
.fh-splash { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.fh-splash__content { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 60px 8%; }
.fh-splash__image { background-size: cover; background-position: center; min-height: 100vh; }
.fh-splash h1, .fh-splash .wp-block-heading { font-size: 50px; line-height: 50px; font-weight: 600; margin: 0 0 14px; text-transform: uppercase; }
.fh-splash p { font-size: 16px; line-height: 20px; color: var(--fh-muted); margin: 0 0 6px; }
.fh-splash .wp-block-buttons { justify-content: center; margin: 22px 0 0; display: flex; }
.fh-splash .wp-block-button__link { background: #fff; color: var(--fh-bg); border-radius: 100px; font-family: var(--fh-font); font-size: 18px; padding: 6px 22px; }
.fh-splash .fh-social { justify-content: center; margin-top: 34px; gap: 22px; }
.fh-splash .fh-social a { color: var(--fh-nav); }

/* ---------- Back to top ---------- */
.fh-top {
	position: fixed; right: 20px; bottom: 20px; width: 36px; height: 36px; border-radius: 50%;
	background: #333; color: #fff; display: flex; align-items: center; justify-content: center;
	opacity: 0; pointer-events: none; transition: opacity .2s; border: 0; cursor: pointer; z-index: 50;
}
.fh-top.is-visible { opacity: 1; pointer-events: auto; }
.fh-top svg { width: 14px; height: 14px; fill: currentColor; }

.fh-footer { padding: 20px var(--fh-side) 40px; text-align: center; color: #666; font-size: 13px; letter-spacing: .02em; }
.fh-footer a { color: #888; }
.fh-footer a:hover { color: #fff; }
.fh-content h2 { font-size: 22px; font-weight: var(--fh-weight); text-transform: uppercase; color: #fff; margin: 36px 0 10px; }
.fh-content p, .fh-content li { color: #bbb; }
.fh-content a { text-decoration: underline; }

/* ---------- Lightbox ---------- */
.fh-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(17,17,17,.97); display: none; align-items: center; justify-content: center; }
.fh-lb.is-open { display: flex; }
.fh-lb img { max-width: 92vw; max-height: 90vh; width: auto; height: auto; object-fit: contain; user-select: none; }
.fh-lb button { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; padding: 16px; opacity: .7; }
.fh-lb button:hover { opacity: 1; }
.fh-lb svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.fh-lb__close { top: 10px; right: 10px; }
.fh-lb__prev { left: 10px; top: 50%; transform: translateY(-50%); }
.fh-lb__next { right: 10px; top: 50%; transform: translateY(-50%); }
.fh-lb__count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--fh-muted); font-size: 14px; }
body.fh-lb-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.fh-covers { grid-template-columns: repeat(2, 1fr); }
	.fh-logo { font-size: 28px; line-height: 30px; }
}
@media (max-width: 768px) {
	.fh-header { grid-template-columns: 40px 1fr 40px; min-height: 90px; padding-bottom: 0; }
	.fh-header .fh-nav, .fh-header .fh-social { display: none; }
	.fh-burger { display: block; }
	.fh-logo { font-size: 22px; line-height: 24px; }
	.fh-mobile-menu { position: fixed; inset: 0; z-index: 500; background: var(--fh-bg); flex-direction: column; align-items: center; justify-content: center; gap: 30px; }
	.fh-mobile-menu.is-open { display: flex; }
	.fh-mobile-menu .fh-nav ul { flex-direction: column; align-items: center; gap: 22px; }
	.fh-mobile-menu .fh-nav a { font-size: 26px; line-height: 28px; }
	.fh-mobile-menu .fh-social { justify-content: center; }
	.fh-mobile-close { position: absolute; top: 24px; right: 20px; background: none; border: 0; color: #fff; font-size: 34px; cursor: pointer; line-height: 1; }
	.fh-covers, .fh-related .fh-covers { grid-template-columns: 1fr; }
	.fh-cover__details { opacity: 1; background: linear-gradient(transparent 45%, rgba(17,17,17,.85)); justify-content: flex-end; }
	.fh-page-title { font-size: 24px; }
	.fh-page-desc { font-size: 17px; }
	.fh-splash { grid-template-columns: 1fr; }
	.fh-splash__image { min-height: 70vh; order: -1; }
	.fh-splash h1, .fh-splash .wp-block-heading { font-size: 38px; line-height: 40px; }
}
.fh-spacer { display: none; }
@media (max-width: 768px) { .fh-spacer { display: block; } }

/* Protection des photos (anti-glisser, anti appui long mobile, anti-sélection) */
.fh-protect img { -webkit-user-drag: none; user-drag: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fh-protect .fh-cover, .fh-protect .fh-grid, .fh-protect .fh-lb, .fh-protect .fh-project { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.fh-grid__item::after, .fh-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.fh-cover__details { z-index: 2; }
