/*
Theme Name: Gustavo Villarroel
Theme URI: https://gustavov.com
Author: Gustavo Villarroel
Description: Portafolio fotográfico de fondo negro para Gustavo Villarroel · Fotógrafo · Digital + Film. Incluye portada con presentación a pantalla completa, galerías por categoría con visor, página Sobre mí y formulario de contacto. Al activarlo crea las páginas y el menú automáticamente.
Version: 1.5.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gustavov
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #0b0a09;
	--panel: #141210;
	--ink: #e9e8e4;
	--muted: #9a9893;
	--line: rgba(233, 232, 228, 0.14);
	--red: #a8161d;
	--cyan: #1c3550;
	--serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
	--sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
	--gutter: clamp(16px, 3.2vw, 48px);
	--gap: clamp(8px, 1.2vw, 18px);
	--header-h: 76px;
	--ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-weight: 300;
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--red); color: var(--ink); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.screen-reader-text, .sr-only {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 999; top: 8px; left: 8px;
	padding: 10px 14px; background: var(--ink); color: var(--bg);
}

/* ---------- Type helpers ---------- */
.mono, .eyebrow {
	font-family: var(--mono);
	font-weight: 400;
	font-size: 11px;
	letter-spacing: .16em;
	text-transform: uppercase;
}
.eyebrow { color: var(--muted); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); vertical-align: middle; margin-right: 10px; transform: translateY(-1px); }
.display {
	font-family: var(--serif);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .14em;
	line-height: 1.02;
}
.wide { font-family: var(--sans); font-stretch: 118%; font-variation-settings: "wdth" 118; }

/* ---------- Header ---------- */
.site-header {
	position: fixed; inset: 0 0 auto 0; z-index: 50;
	height: var(--header-h);
	display: flex; align-items: center; justify-content: space-between;
	padding: 0 var(--gutter);
	transition: background .4s var(--ease), border-color .4s var(--ease), transform .4s var(--ease);
	border-bottom: 1px solid transparent;
}
.site-header.is-solid { background: rgba(11, 10, 9, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: var(--line); }
.site-header.is-hidden { transform: translateY(-100%); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand svg { width: 26px; height: auto; color: var(--ink); }
.brand__name { font-family: var(--serif); font-weight: 500; font-size: 15px; letter-spacing: .24em; text-transform: uppercase; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(18px, 2.4vw, 36px); }
.nav a {
	font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
	position: relative; padding: 6px 0; color: var(--ink); opacity: .78; transition: opacity .25s;
}
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a { opacity: 1; }
.nav a::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--red);
	transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav a:hover::after, .nav .current-menu-item > a::after, .nav .current_page_item > a::after { transform: scaleX(1); }

.menu-toggle { display: none; width: 34px; height: 34px; position: relative; z-index: 60; }
.menu-toggle span { position: absolute; left: 6px; right: 6px; height: 1px; background: var(--ink); transition: transform .35s var(--ease), opacity .2s; }
.menu-toggle span:nth-child(1) { top: 13px; }
.menu-toggle span:nth-child(2) { top: 20px; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 860px) {
	:root { --header-h: 64px; }
	.brand__name { font-size: 13px; letter-spacing: .2em; }
	.menu-toggle { display: block; }
	.nav {
		position: fixed; inset: 0; z-index: 55; background: var(--bg);
		flex-direction: column; justify-content: center; align-items: flex-start;
		padding: var(--header-h) var(--gutter) 40px;
		opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
	}
	.menu-open .nav { opacity: 1; visibility: visible; }
	.nav ul { flex-direction: column; gap: 6px; }
	.nav a { font-family: var(--serif); font-size: clamp(30px, 9vw, 44px); letter-spacing: .1em; opacity: 1; }
	.nav a::after { height: 2px; }
	.nav__social { margin-top: 36px; }
	.menu-open { overflow: hidden; }
	.menu-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; background: var(--bg); }
}
@media (max-width: 380px) { .brand__name { font-size: 11px; letter-spacing: .16em; } }
.nav__social { display: flex; gap: 22px; }
.nav__social a { font-family: var(--mono); font-size: 11px; }
@media (min-width: 861px) { .nav__social { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; background: #000; }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s var(--ease); }
.hero__slide.is-active { opacity: 1; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 7s linear; }
.hero__slide.is-active img { transform: scale(1); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,10,9,.85) 0%, rgba(11,10,9,.1) 45%, rgba(11,10,9,.35) 100%); pointer-events: none; }
.hero__content { position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: clamp(28px, 6vh, 64px); }
.hero__title { font-size: clamp(34px, 7.6vw, 128px); margin: 0 0 18px; letter-spacing: .1em; }
.hero__meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.hero__tag { font-family: var(--serif); font-style: italic; font-size: clamp(16px, 1.6vw, 22px); }
.hero__count { color: var(--muted); }
.hero__count b { color: var(--ink); font-weight: 400; }
.hero__dots { display: flex; gap: 8px; }
.hero__dots button { width: 26px; height: 18px; position: relative; }
.hero__dots button::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 1px; background: var(--muted); opacity: .5; transition: background .3s, opacity .3s; }
.hero__dots button.is-active::before { background: var(--ink); opacity: 1; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 12vw, 160px) var(--gutter); }
.section--tight { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(40px, 6vw, 80px); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: clamp(24px, 4vw, 48px); }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: var(--gutter); align-items: start; }
.intro__text { font-size: clamp(22px, 2.8vw, 42px); line-height: 1.22; font-weight: 300; margin: 0; letter-spacing: -.005em; }
.intro__text em { font-family: var(--serif); font-style: italic; font-weight: 400; }
@media (max-width: 760px) { .intro { grid-template-columns: 1fr; } }

/* Work index */
.work-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.work-card { position: relative; display: block; overflow: hidden; background: var(--panel); }
.work-card__img { aspect-ratio: 3 / 4; overflow: hidden; }
.work-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s; filter: grayscale(.25) brightness(.82); }
.work-card:hover .work-card__img img { transform: scale(1.04); filter: none; }
.work-card__label { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 2px 0; background: var(--bg); }
.work-card__title { font-family: var(--sans); font-stretch: 118%; font-variation-settings: "wdth" 118; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: clamp(15px, 1.4vw, 20px); }
.work-card__num { color: var(--muted); }
.work-card:hover .work-card__num { color: var(--red); }
@media (max-width: 960px) { .work-index { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; } }

/* Selected stack (editorial rows) */
.stack { display: grid; gap: var(--gap); }
.stack__row { display: grid; gap: var(--gap); grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); align-items: start; }
.stack__row--full .stack__item img { width: 100%; max-height: 94vh; object-fit: cover; object-position: center 35%; }
.stack__row--offset { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: end; }
.stack__row--offset-r { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: end; }
.stack__item { position: relative; margin: 0; overflow: hidden; cursor: zoom-in; }
.stack__item img { width: 100%; transition: transform 1.4s var(--ease); }
.stack__item:hover img { transform: scale(1.02); }
.stack__item figcaption { position: absolute; left: 12px; bottom: 10px; color: var(--ink); opacity: 0; transition: opacity .4s; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.stack__item:hover figcaption { opacity: .9; }
@media (max-width: 700px) {
	.stack__row, .stack__row--offset, .stack__row--offset-r { grid-template-columns: 1fr; }
	.stack__row[style*="--cols: 3"] { grid-template-columns: 1fr 1fr; }
	.stack__row[style*="--cols: 3"] .stack__item:first-child { grid-column: 1 / -1; }
}

/* CTA */
.cta { text-align: center; padding: clamp(90px, 16vw, 220px) var(--gutter); border-top: 1px solid var(--line); }
.cta__title { font-size: clamp(34px, 7vw, 110px); margin: 18px 0 34px; letter-spacing: .08em; }
.cta__title em { font-style: italic; text-transform: none; letter-spacing: 0; }
.cta__links { display: flex; justify-content: center; gap: clamp(18px, 4vw, 56px); flex-wrap: wrap; }
.link-line { position: relative; padding-bottom: 6px; }
.link-line::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); opacity: .35; transition: background .3s, opacity .3s; }
.link-line:hover::after { background: var(--red); opacity: 1; }

/* ---------- Page heads ---------- */
.page-head { padding: calc(var(--header-h) + clamp(48px, 9vw, 120px)) var(--gutter) clamp(32px, 5vw, 64px); }
.page-head__top { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-title { font-size: clamp(40px, 9vw, 150px); margin: 0; letter-spacing: .08em; overflow-wrap: anywhere; }
.page-lead { max-width: 640px; color: var(--muted); font-size: clamp(16px, 1.35vw, 19px); margin: 24px 0 0; }

/* ---------- Gallery (masonry) ---------- */
.gallery { padding: 0 var(--gutter); column-count: 3; column-gap: var(--gap); }
.gallery__item { break-inside: avoid; margin: 0 0 var(--gap); position: relative; overflow: hidden; cursor: zoom-in; background: var(--panel); }
.gallery__item img { width: 100%; transition: transform 1.2s var(--ease), opacity .8s; }
.gallery__item:hover img { transform: scale(1.025); }
.gallery__item .num { position: absolute; top: 10px; left: 12px; opacity: 0; transition: opacity .3s; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.gallery__item:hover .num { opacity: .85; }
@media (max-width: 1000px) { .gallery { column-count: 2; } }
@media (max-width: 560px) { .gallery { column-count: 1; } }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; }
	.hero__slide img, .hero__slide.is-active img { transform: none; transition: none; }
	html { scroll-behavior: auto; }
}

.next-series { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: clamp(60px, 10vw, 140px) var(--gutter) 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.next-series__title { font-size: clamp(28px, 6vw, 88px); margin: 8px 0 0; letter-spacing: .08em; transition: color .3s; }
.next-series:hover .next-series__title { color: var(--muted); }
.next-series__arrow { font-family: var(--serif); font-size: clamp(28px, 5vw, 70px); line-height: 1; transition: transform .4s var(--ease); }
.next-series:hover .next-series__arrow { transform: translateX(10px); color: var(--red); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 4, .98); display: none; }
.lightbox.is-open { display: block; }
.lightbox__stage { position: absolute; inset: 64px 72px 56px; display: flex; align-items: center; justify-content: center; }
.lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; opacity: 0; transition: opacity .35s; user-select: none; -webkit-user-drag: none; }
.lightbox__stage img.is-loaded { opacity: 1; }
.lightbox__bar { position: absolute; left: 0; right: 0; top: 0; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter); color: var(--muted); }
.lightbox__close { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); padding: 10px 0; }
.lightbox__nav { position: absolute; top: 64px; bottom: 56px; width: 50%; display: flex; align-items: center; padding: 0 22px; font-family: var(--serif); font-size: 34px; color: var(--ink); opacity: .55; transition: opacity .2s; }
.lightbox__nav:hover { opacity: 1; }
.lightbox__prev { left: 0; justify-content: flex-start; cursor: w-resize; }
.lightbox__next { right: 0; justify-content: flex-end; cursor: e-resize; }
.lightbox__cap { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
@media (max-width: 700px) {
	.lightbox__stage { inset: 56px 0 56px; }
	.lightbox__nav { font-size: 0; }
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(32px, 6vw, 96px); padding: 0 var(--gutter); align-items: start; }
.about__img { position: sticky; top: calc(var(--header-h) + 24px); }
.about__img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about__body { font-size: clamp(17px, 1.35vw, 20px); }
.about__body p:first-child { font-size: clamp(22px, 2.3vw, 34px); line-height: 1.28; margin-top: 0; }
.about__body p:first-child em { font-family: var(--serif); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px var(--gutter); margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); padding-top: 28px; }
.facts h3 { margin: 0 0 12px; }
.facts ul { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } .about__img { position: static; } }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(32px, 6vw, 96px); padding: 0 var(--gutter); }
.contact__list { list-style: none; margin: 0; padding: 0; }
.contact__list li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact__list .eyebrow { display: block; margin-bottom: 6px; }
.contact__list a, .contact__list span.val { font-size: clamp(18px, 1.7vw, 24px); }
.contact__list a:hover { color: var(--muted); }
.form { display: grid; gap: 22px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field label { display: block; margin-bottom: 8px; }
.field input, .field select, .field textarea {
	width: 100%; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line);
	padding: 10px 0; font: inherit; font-size: 17px; border-radius: 0; transition: border-color .3s;
}
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 10px) 52%, calc(100% - 5px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: var(--panel); }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.hp { position: absolute; left: -9999px; }
.btn { display: inline-flex; align-items: center; gap: 14px; justify-self: start; border: 1px solid var(--ink); padding: 15px 26px; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; transition: background .3s, color .3s, border-color .3s; }
.btn:hover { background: var(--ink); color: var(--bg); }
.notice { padding: 14px 16px; border-left: 2px solid var(--ink); background: var(--panel); font-size: 15px; }
.notice--error { border-color: var(--red); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form__row { grid-template-columns: 1fr; } }

/* ---------- Generic content (pages / editor) ---------- */
.entry { max-width: 760px; padding: 0 var(--gutter); }
.entry a { border-bottom: 1px solid var(--line); }
.entry h2, .entry h3 { font-family: var(--sans); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.entry .wp-block-image, .entry figure { margin: 2em 0; }
.alignwide, .alignfull { max-width: none; }

/* ---------- Footer ---------- */
.site-footer { padding: 28px var(--gutter) 32px; border-top: 1px solid var(--line); margin-top: clamp(80px, 12vw, 160px); display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; color: var(--muted); }
.home .site-footer, .page-template-contact .site-footer { margin-top: 0; }
.site-footer__mark svg { width: 22px; color: var(--ink); }
.site-footer__links { display: flex; justify-content: center; gap: clamp(14px, 3vw, 36px); flex-wrap: wrap; }
.site-footer__links a:hover { color: var(--ink); }
@media (max-width: 760px) { .site-footer { grid-template-columns: 1fr; justify-items: start; } .site-footer__links { justify-content: flex-start; } }

.error-404 { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; padding: var(--header-h) var(--gutter) 0; }
