/*
Theme Name: Del barrio al desierto
Theme URI:
Author:
Author URI:
Description: Thème du projet multimédia « Del barrio al desierto » / « Du quartier au désert ». Base Underscores (_s), réduite à l'essentiel.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: barrio-al-desierto
Tags: custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
	--bad-ink:        #1E1E1E;
	--bad-blue:       #443EC2;
	--bad-paper:      #F3F3F3;
	--bad-coral:      #FF656C;
	--bad-coral-soft: #F79898;
	--bad-pink:       #FF55A1;
	--bad-orange:     #FF8436;
	--bad-yellow:     #FFC534;

	--bad-sidebar-w:  340px;
	--bad-gap:        1.5rem;

	--bad-body:    "Inclusive Sans", system-ui, -apple-system, sans-serif;
	--bad-display: "Phudu", "Inclusive Sans", system-ui, sans-serif;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

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

body {
	margin: 0;
	font-family: var(--bad-body);
	font-size: 18px;
	line-height: 1.55;
	color: var(--bad-ink);
	background: var(--bad-coral);
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   3. Typographie
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--bad-display);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	margin: 0 0 0.5em;
}

p {
	margin: 0 0 1em;
}

/* Titre de section thématique (Exposiciones, Co-construcción, Campo) */
.bad-section-title {
	font-family: var(--bad-display);
	font-size: 32px;
	font-weight: 700;
	color: var(--bad-blue);
	text-transform: uppercase;
	margin: 0 0 1rem;
}

/* ==========================================================================
   4. Mise en page : colonne de gauche fixe + contenu à droite
   ========================================================================== */

.site {
	min-height: 100vh;
}

/* --- Colonne de gauche (branding + widgets projet) --- */
.site-header {
	background: var(--bad-paper);
	color: var(--bad-blue);
	padding: 2rem 1.75rem;
}

.site-branding {
	margin-bottom: 2rem;
}

.site-header .custom-logo-link {
	display: inline-block;
	margin-bottom: 1rem;
}

.site-header .custom-logo {
	max-width: 180px;
}

.site-title {
	font-family: var(--bad-display);
	font-size: 26px;
	font-weight: 800;
	text-transform: uppercase;
	margin: 0;
}

.site-title a {
	color: var(--bad-ink);
}

.site-description {
	font-size: 15px;
	color: var(--bad-blue);
	margin: 0.25rem 0 0;
}

/* Titres des blocs du projet (EL PROYECTO, FICHA TÉCNICA…) */
.site-header .widget-title {
	font-family: var(--bad-display);
	font-size: 20px;
	font-weight: 700;
	color: var(--bad-coral);
	text-transform: uppercase;
	margin: 0 0 0.75rem;
}

.site-header .widget {
	margin-bottom: 2rem;
	font-size: 17px;
	color: var(--bad-blue);
}

.site-header .widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* --- Colonne de droite (contenu) --- */
.site-content {
	background: var(--bad-coral);
	padding: 2rem clamp(1rem, 4vw, 3rem);
}

.site-main {
	max-width: none;
}

/* --- Pied --- */
.site-footer {
	background: var(--bad-coral);
	color: var(--bad-paper);
	padding: 1.5rem clamp(1rem, 4vw, 3rem);
	font-size: 14px;
}

/* --- Navigation (le vrai bouton MENU arrive plus tard) --- */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   5. Desktop : grille 2 colonnes, colonne de gauche « sticky »
   ========================================================================== */

@media (min-width: 900px) {
	.site {
		display: grid;
		grid-template-columns: var(--bad-sidebar-w) 1fr;
		grid-template-areas:
			"sidebar content"
			"sidebar footer";
		align-items: start;
	}

	.site-header {
		grid-area: sidebar;
		position: sticky;
		top: 0;
		height: 100vh;
		overflow-y: auto;
	}

	.site-content {
		grid-area: content;
		min-height: 100vh;
	}

	.site-footer {
		grid-area: footer;
	}
}

/* ==========================================================================
   6. Galerie plein écran (single-galeria)
   ========================================================================== */

body.single-galeria {
	overflow: hidden;
}

body.single-galeria .site-header,
body.single-galeria .site-footer {
	display: none;
}

.bad-gallery {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: #fff;
	color: var(--bad-ink);
	display: flex;
	flex-direction: column;
}

.bad-gallery__bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem clamp(1rem, 3vw, 2rem);
}

.bad-gallery__crumb {
	margin: 0;
	max-width: calc(100% - 60px);
	font-family: var(--bad-display);
	text-transform: uppercase;
	font-size: clamp(13px, 2.4vw, 18px);
	letter-spacing: 0.02em;
	line-height: 1.3;
}

.bad-gallery__crumb strong {
	font-weight: 800;
}

.bad-gallery__crumb span {
	opacity: 0.5;
	margin: 0 0.15em;
}

.bad-gallery__close {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px solid var(--bad-ink);
	display: grid;
	place-items: center;
	font-size: 26px;
	line-height: 1;
	color: var(--bad-ink);
}

.bad-gallery__close:hover {
	background: var(--bad-ink);
	color: #fff;
	text-decoration: none;
}

.bad-gallery__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: stretch;
}

.bad-gallery__viewport {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

.bad-gallery__track {
	display: flex;
	height: 100%;
	width: 100%;
	will-change: transform;
	transition: transform 0.4s ease;
}

.bad-gallery__track.is-dragging {
	transition: none;
}

.bad-slide {
	flex: 0 0 100%;
	width: 100%;
	scroll-snap-align: unset;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 clamp(1rem, 5vw, 4rem) 1rem;
	overflow-y: auto;
}

.bad-slide__inner {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
}

/* Slide photo */
.bad-slide--photo figure {
	margin: 0;
}

.bad-slide--photo img {
	width: auto;
	max-width: 100%;
	max-height: 72vh;
	margin: 0 auto;
	object-fit: contain;
}

.bad-slide--photo figcaption {
	margin-top: 1rem;
	font-size: 16px;
	line-height: 1.4;
	text-align: left;
}

/* Slide texte / audio */
.bad-slide--text .bad-slide__inner {
	font-size: clamp(18px, 2.4vw, 24px);
	line-height: 1.5;
	text-align: left;
}

.bad-slide--text .wp-block-audio,
.bad-slide--text audio {
	width: 100%;
}

.bad-slide--text .wp-block-audio {
	margin-top: 1.25rem;
}

/* Flèches */
.bad-gallery__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.06);
	color: var(--bad-ink);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.bad-gallery__nav:hover {
	background: var(--bad-blue);
	color: #fff;
}

.bad-gallery__nav:disabled {
	opacity: 0.25;
	cursor: default;
}

.bad-gallery__prev {
	left: 0.5rem;
}

.bad-gallery__next {
	right: 0.5rem;
}

/* Points de pagination */
.bad-gallery__dots {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	padding: 1rem;
}

.bad-gallery__dot {
	width: 12px;
	height: 12px;
	padding: 0;
	border-radius: 50%;
	border: 2px solid var(--bad-ink);
	background: transparent;
	cursor: pointer;
}

.bad-gallery__dot.is-active {
	background: var(--bad-ink);
}

@media (max-width: 640px) {
	.bad-gallery__nav {
		display: none;
	}
}

/* ==========================================================================
   7. Menu thématique (front-page) : sections + grille de cartes
   ========================================================================== */

.bad-thematic {
	display: flex;
	flex-direction: column;
	gap: 3rem;
}

.bad-section-intro {
	max-width: 60ch;
	margin: -0.25rem 0 1.5rem;
	color: var(--bad-ink);
}

.bad-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.25rem;
}

.bad-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 3px solid var(--bad-blue);
	color: var(--bad-blue);
	text-decoration: none;
	transition: transform 0.12s ease;
}

.bad-card:hover {
	transform: translateY(-3px);
	text-decoration: none;
}

.bad-card__media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--bad-coral-soft);
}

.bad-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bad-card__media--empty {
	background: var(--bad-coral-soft);
}

.bad-card__label {
	margin: 0.6rem 0.75rem 0;
	font-family: var(--bad-body);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bad-ink);
	opacity: 0.75;
}

.bad-card__title {
	margin: 0.1rem 0.75rem 0.8rem;
	font-family: var(--bad-display);
	font-size: 22px;
	font-weight: 800;
	text-transform: uppercase;
	color: var(--bad-blue);
}

/* ==========================================================================
   8. Panneau d'un lieu (taxonomy-lugar) — étape intermédiaire du parcours carto
   Aperçu du contenu réel des galerías ; chaque miniature ouvre le plein
   écran directement sur le contenu cliqué.
   ========================================================================== */

.bad-lugar {
	position: relative;
	background: #fff;
	border-radius: 14px;
	max-width: 1100px;
	margin: 0 auto;
	padding: clamp(1.5rem, 4vw, 3rem);
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.bad-lugar__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 2px solid var(--bad-ink);
	display: grid;
	place-items: center;
	font-size: 24px;
	line-height: 1;
	color: var(--bad-ink);
}

.bad-lugar__close:hover {
	background: var(--bad-ink);
	color: #fff;
	text-decoration: none;
}

.bad-lugar__title {
	font-size: clamp(28px, 4vw, 40px);
	color: var(--bad-ink);
	margin: 0;
	padding-right: 3rem;
}

/* Texte de présentation : deux copies dans le HTML, le CSS n'affiche
   que celle adaptée à l'écran. Plus robuste que de forcer un <details>
   à s'ouvrir en CSS (comportement non fiable selon les navigateurs). */
.bad-lugar__intro {
	max-width: 62ch;
	color: var(--bad-ink);
}

.bad-lugar__intro p {
	margin: 0.75rem 0 0;
	line-height: 1.55;
}

.bad-lugar__intro--mobile summary {
	cursor: pointer;
	font-family: var(--bad-body);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--bad-blue);
	list-style: none;
}

.bad-lugar__intro--mobile summary::-webkit-details-marker {
	display: none;
}

.bad-lugar__intro--mobile summary::after {
	content: ' ⌄';
}

.bad-lugar__intro--mobile[open] summary::after {
	content: ' ⌃';
}

.bad-lugar__intro--desktop {
	display: none;
}

@media (min-width: 900px) {
	.bad-lugar__intro--mobile {
		display: none;
	}

	.bad-lugar__intro--desktop {
		display: block;
	}

	.bad-lugar__intro--desktop p:first-child {
		margin-top: 0;
	}
}

/* Un bloc par galería (une entrée du parcours thématique pour ce lieu) */
.bad-lugar-block {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.bad-lugar-block__title {
	margin: 0;
	font-family: var(--bad-body);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--bad-ink);
}

/* Rangée de miniatures photo */
.bad-preview-row {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 0.75rem;
}

.bad-preview-thumb {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--bad-coral-soft);
}

.bad-preview-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bad-preview-thumb figcaption {
	display: none;
}

/* Amorce d'une slide texte / audio (teaser, non jouable ici) */
.bad-preview-text {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	max-width: 40ch;
	font-size: 15px;
	line-height: 1.5;
	color: var(--bad-ink);
}

.bad-preview-text__play {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--bad-blue);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 9px;
	margin-top: 0.15em;
}

.bad-preview-text__excerpt {
	opacity: 0.85;
}

.bad-card__label,
.bad-card__title,
.bad-lugar-block__title,
.bad-preview-text__excerpt,
.bad-gallery__crumb {
	overflow-wrap: break-word;
}
.bad-card__tema {
	margin: 0.6rem 0.75rem 0;
	font-family: var(--bad-body);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bad-blue);
}

.bad-card__tema + .bad-card__label {
	margin-top: 0.1rem;
}

/* Carte + lien de test vers le lugar (accès de secours en attendant la carte V2) */
.bad-card-wrap {
	display: flex;
	flex-direction: column;
}

.bad-card__lugar-link {
	margin-top: 0.4rem;
	font-size: 12px;
	text-decoration: underline;
	color: var(--bad-ink);
	opacity: 0.75;
}

/* ==========================================================================
   9. Garde-fous petits écrans (< 420px)
   ========================================================================== */

@media (max-width: 420px) {
	.bad-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.bad-preview-row {
		grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	}

	.bad-lugar {
		border-radius: 0;
		padding: 1.25rem 1rem;
	}
}
