/*
Theme Name: DA Woisard
Theme URI: https://www.d-a-woisard.com/
Author: D-A WOISARD
Author URI: https://www.d-a-woisard.com/
Description: Thème sur mesure pour le portfolio photographique de D-A WOISARD, photographe noir et blanc argentique.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: da-woisard
Tags: photography, portfolio, custom-menu, featured-images
*/

/* =========================================================
   RESET & BASE
   ========================================================= */

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--color-bg:          #ffffff;
	--color-text:        #333333;
	--color-text-light:  #666666;
	--color-nav-bg:      #111111;
	--color-nav-text:    #ffffff;
	--color-nav-active:  #8b8b8b;
	--color-footer-bg:   #111111;
	--color-footer-text: #ffffff;
	--color-border:      #cccccc;
	--color-deco:        #999999;

	--font-logo:  'Raleway', sans-serif;
	--font-nav:   'Roboto', sans-serif;
	--font-body:  -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

	--nav-height: 50px;
	--max-width:  1400px;
	--gap:        3px;
}

html {
	font-size: 16px;
	scroll-behavior: smooth;
}

body {
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-weight: 400;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: var(--color-text);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--color-nav-active);
}

ul, ol {
	list-style: none;
}

p {
	margin-bottom: 1.2em;
}
p:last-child {
	margin-bottom: 0;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.site-wrapper {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main {
	flex: 1;
}

.container {
	width: 100%;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 2rem;
}

/* =========================================================
   SITE HEADER (zone branding — défile avec la page)
   ========================================================= */

.site-header {
	background-color: var(--color-bg);
	text-align: center;
	padding-bottom: 1rem;
}

/* Ligne décorative avec icône pellicule */
.header-decoration {
	display: flex;
	align-items: center;
	padding: 14px 40px 0;
	gap: 0;
}

.header-decoration__line {
	flex: 1;
	height: 1px;
	background-color: var(--color-deco);
}

.header-decoration__icon {
	flex-shrink: 0;
	display: block;
	margin: 0 12px;
	opacity: 0.6;
}

/* Branding : logo + tagline */
.site-branding {
	padding: 12px 2rem 0;
}

.site-title {
	font-family: var(--font-logo);
	font-size: clamp(2rem, 5vw, 3.2rem);
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--color-text);
	line-height: 1.1;
	margin: 0;
}

.site-title a {
	color: inherit;
	text-decoration: none;
}

.site-title a:hover {
	color: var(--color-text-light);
}

.site-tagline {
	font-family: var(--font-logo);
	font-size: 1.1rem;
	font-weight: 400;
	color: var(--color-text);
	margin-top: 0.3rem;
}

/* =========================================================
   BARRE DE NAVIGATION (sticky — reste en haut au scroll)
   ========================================================= */

.site-nav-wrapper {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--color-nav-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--nav-height);
}

.main-navigation {
	display: flex;
	align-items: center;
	justify-content: center;
}

.main-navigation ul {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	margin: 0;
	padding: 0;
}

.main-navigation ul li {
	list-style: none;
}

.main-navigation ul li a {
	display: block;
	padding: 0.85rem 1.1rem;
	font-family: var(--font-nav);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--color-nav-text);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current-page-ancestor > a {
	color: var(--color-nav-active);
}

/* Hamburger (mobile) */
.nav-toggle {
	display: none;
	position: absolute;
	right: 1rem;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 101;
}

.nav-toggle span {
	display: block;
	width: 22px;
	height: 1px;
	background-color: var(--color-nav-text);
	transition: all 0.3s ease;
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* =========================================================
   SITE FOOTER (fond noir, 3 colonnes)
   ========================================================= */

.site-footer {
	background-color: var(--color-footer-bg);
	color: var(--color-footer-text);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 2.5rem;
	gap: 1rem;
}

.footer-col {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.footer-col--left {
	align-items: flex-start;
}

.footer-col--center {
	align-items: center;
	text-align: center;
}

.footer-col--right {
	align-items: flex-end;
}

.footer-name {
	font-family: var(--font-logo);
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--color-footer-text);
	letter-spacing: 0.05em;
}

.footer-subtitle {
	font-size: 0.78rem;
	color: rgba(255, 255, 255, 0.7);
}

.footer-copyright {
	font-size: 0.82rem;
	color: var(--color-footer-text);
}

/* Réseaux sociaux */
.footer-social {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.footer-social a {
	color: var(--color-footer-text);
	display: inline-flex;
	align-items: center;
	transition: opacity 0.2s;
}

.footer-social a:hover {
	opacity: 0.7;
	color: var(--color-footer-text);
}

.footer-social svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.footer-contact-link {
	font-family: var(--font-nav);
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--color-footer-text);
	text-decoration: none;
	margin-left: 0.25rem;
}

.footer-contact-link:hover {
	opacity: 0.7;
	color: var(--color-footer-text);
}

/* =========================================================
   PAGE ACCUEIL (front-page.php)
   ========================================================= */

.front-photo {
	display: flex;
	justify-content: center;
	padding: 2rem 2rem 0;
}

.front-photo img {
	max-height: 80vh;
	width: auto;
	max-width: 100%;
}

.front-text {
	max-width: 860px;
	margin: 2.5rem auto;
	padding: 0 2rem;
	font-size: 0.97rem;
	line-height: 1.8;
	color: var(--color-text);
}

/* =========================================================
   GALERIES PHOTOS
   ========================================================= */

/* Template page-galerie.php */
.gallery-page .entry-content {
	padding: 0;
	max-width: none;
}

/* Blocs Gutenberg gallery — centré, max-width 1140px, carrés, gap 8px */
.gallery-page .wp-block-gallery {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 8px !important;
	max-width: 1140px !important;
	margin: 0 auto !important;
	padding: 0 !important;
}

.gallery-page .wp-block-gallery .wp-block-image,
.gallery-page .wp-block-gallery figure {
	position: relative;
	margin: 0 !important;
	padding: 0 !important;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.gallery-page .wp-block-gallery .wp-block-image img,
.gallery-page .wp-block-gallery figure img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	cursor: pointer;
	display: block;
}

/* Figcaptions natifs masqués (remplacés par overlay JS) */
.gallery-page figcaption {
	display: none !important;
}

/* Ancien shortcode WordPress gallery */
.gallery-page .gallery {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 8px !important;
	max-width: 1140px !important;
	margin: 0 auto !important;
	padding: 0 !important;
}

.gallery-page .gallery-item {
	position: relative;
	margin: 0 !important;
	padding: 0 !important;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.gallery-page .gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	cursor: pointer;
	display: block;
}

/* =========================================================
   OVERLAY HOVER SUR LES MINIATURES (nom de la photo)
   ========================================================= */

.daw-overlay {
	position: absolute;
	inset: 0;
	background: rgba(7, 7, 7, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease;
	z-index: 2;
	pointer-events: none;
}

.gallery-page .wp-block-image:hover .daw-overlay,
.gallery-page .wp-block-gallery figure:hover .daw-overlay,
.gallery-page .gallery-item:hover .daw-overlay {
	opacity: 1;
}

.daw-overlay-title {
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	font-family: var(--font-nav);
	text-align: center;
	padding: 0 12px;
	line-height: 1.4;
	text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* =========================================================
   PAGE GÉNÉRIQUE (L'artiste, Contact…)
   ========================================================= */

.page-content {
	max-width: 800px;
	margin: 3rem auto;
	padding: 0 2rem 4rem;
}

.page-header-title {
	font-family: var(--font-logo);
	font-size: clamp(1.5rem, 4vw, 2.5rem);
	font-weight: 500;
	color: var(--color-text);
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--color-border);
}

.entry-content {
	font-size: 0.97rem;
	line-height: 1.85;
	color: var(--color-text);
}

.entry-content > * + * {
	margin-top: 1.25rem;
}

/* Formulaire contact */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
	width: 100%;
	border: 1px solid var(--color-border);
	background: #fff;
	color: var(--color-text);
	padding: 0.7rem 0.85rem;
	font-family: var(--font-body);
	font-size: 0.9rem;
	outline: none;
	transition: border-color 0.2s;
	margin-bottom: 1rem;
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
	border-color: #555;
}

.wpcf7-form textarea {
	min-height: 160px;
	resize: vertical;
}

.wpcf7-form input[type="submit"] {
	background: var(--color-nav-bg);
	color: #fff;
	border: none;
	padding: 0.75rem 2.5rem;
	font-family: var(--font-nav);
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: background 0.2s;
}

.wpcf7-form input[type="submit"]:hover {
	background: #333;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */

.daw-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	background-color: rgba(0, 0, 0, 0.95);
	align-items: center;
	justify-content: center;
}

.daw-lightbox.is-open {
	display: flex;
}

.daw-lightbox-inner {
	max-width: 90vw;
	max-height: 82vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Bordure blanche autour de la photo (effet tirage argentique) */
.daw-lightbox-img {
	max-width: 90vw;
	max-height: 82vh;
	object-fit: contain;
	border: 10px solid #ffffff;
	display: block;
}

.daw-lightbox-close {
	position: fixed;
	top: 1rem;
	right: 1rem;
	width: 36px;
	height: 36px;
	background: none;
	border: 1px solid rgba(255,255,255,0.3);
	color: #fff;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.2s;
}

.daw-lightbox-close:hover {
	border-color: #fff;
}

.daw-lightbox-prev,
.daw-lightbox-next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	background: none;
	border: 1px solid rgba(255,255,255,0.2);
	color: #fff;
	font-size: 1.1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.2s;
}

.daw-lightbox-prev { left: 1rem; }
.daw-lightbox-next { right: 1rem; }

.daw-lightbox-prev:hover,
.daw-lightbox-next:hover {
	border-color: #fff;
}

/* Barre du bas : nom de la photo + compteur */
.daw-lightbox-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.6rem 1rem 0.8rem;
}

/* Nom de la photo — Open Sans italic bold, identique à l'original */
.daw-lightbox-caption {
	font-family: 'Open Sans', 'Roboto', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	font-style: italic;
	color: rgb(243, 243, 243);
	text-align: center;
	min-height: 1.4em;
}

/* Compteur x / n */
.daw-lightbox-counter {
	font-size: 0.75rem;
	color: rgb(243, 243, 243);
	letter-spacing: 0.08em;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
	.gallery-page .wp-block-gallery,
	.gallery-page .gallery {
		grid-template-columns: repeat(2, 1fr) !important;
		max-width: 100% !important;
	}
}

@media (max-width: 768px) {
	.site-header {
		padding-bottom: 0.75rem;
	}

	.header-decoration {
		padding: 10px 20px 0;
	}

	.site-title {
		font-size: clamp(1.6rem, 6vw, 2.4rem);
	}

	.site-tagline {
		font-size: 0.85rem;
	}

	/* Nav mobile : hamburger */
	.site-nav-wrapper {
		justify-content: flex-start;
		min-height: 48px;
		position: sticky;
	}

	.nav-toggle {
		display: flex;
	}

	.main-navigation {
		display: none;
		width: 100%;
	}

	.main-navigation.is-open {
		display: flex;
	}

	.main-navigation ul {
		flex-direction: column;
		width: 100%;
	}

	.main-navigation ul li a {
		padding: 0.9rem 1.5rem;
		font-size: 0.9rem;
		width: 100%;
		text-align: center;
		border-bottom: 1px solid rgba(255,255,255,0.05);
	}

	/* Footer en colonne sur mobile */
	.site-footer {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 1.25rem;
		padding: 2rem 1.5rem;
	}

	.footer-col--left,
	.footer-col--right {
		align-items: center;
	}

	.footer-social {
		justify-content: center;
	}

	.gallery-page .wp-block-gallery,
	.gallery-page .gallery {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 480px) {
	.gallery-page .wp-block-gallery,
	.gallery-page .gallery {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}
