/* Carmen Morillo Barragán — estilos */
/* Alegreya Sans SC servida desde la propia web (static/fonts/), sin conexiones a Google */
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 300; font-display: swap; src: url(/fonts/alegreya-sans-sc-latin-ext-300-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 300; font-display: swap; src: url(/fonts/alegreya-sans-sc-latin-300-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/alegreya-sans-sc-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/alegreya-sans-sc-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/alegreya-sans-sc-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/alegreya-sans-sc-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  --paper: #ffffff;
  --ink: #1f1f1f;
  --muted: #6d6d6d;
  --line: #d9d9d9;
  --black: #000000;
  --sold: #d7263d;
  --sans: 'Alegreya Sans SC', 'Gill Sans', 'Trebuchet MS', sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 17px; line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tipografía de rótulos: versalitas uniformes */
.brand, .menu a, .lang, .cap-title, .cap-meta, .ask, .btn, .series h2, .intro h1, .about-text h1,
.contact-page h1, .contact-form label, .work-nav, .site-footer, .contact-dialog h2, .cv h2, .cv h3, .cv-year, .statement h2, .legal h1, .legal h2 {
  font-family: var(--sans); text-transform: lowercase; font-weight: 400;
}

/* ---------- cabecera ---------- */
.site-header { position: relative; text-align: center; padding: 42px 20px 58px; }
.brand { display: inline-block; font-size: clamp(26px, 3.1vw, 40px); font-weight: 300; letter-spacing: .07em; text-decoration: none; line-height: 1.1; }
.menu { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 26px; margin-top: 22px; }
.menu a { font-size: 15px; letter-spacing: .14em; text-decoration: none; font-weight: 500; padding-top: 3px; border-top: 1px solid transparent; }
.menu a[aria-current="page"], .menu a:hover { border-top-color: var(--ink); }
.header-tools { position: absolute; top: 22px; right: 24px; display: flex; align-items: center; gap: 16px; }
.lang { font-size: 14px; letter-spacing: .14em; text-decoration: none; color: var(--muted); }
.ig { display: inline-flex; color: var(--muted); }
.lang:hover, .ig:hover { color: var(--ink); }
.menu-toggle { display: none; position: relative; z-index: 11; width: 32px; height: 28px; padding: 0; background: none; border: 0; cursor: pointer; color: var(--ink); flex: none; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { content: ''; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .25s, background .25s; }
.menu-toggle span { top: 13px; left: 3px; right: 3px; }
.menu-toggle span::before { top: -8px; }
.menu-toggle span::after { top: 8px; }
.menu-open .menu-toggle span { background: transparent; }
.menu-open .menu-toggle span::before { transform: translateY(8px) rotate(45deg); }
.menu-open .menu-toggle span::after { transform: translateY(-8px) rotate(-45deg); }

/* ---------- mosaico ---------- */
/* Columnas de igual ancho; main.js reparte las obras en .mosaic-col respetando su orden. */
.mosaic {
  --cols: 3; --gap-x: clamp(8px, .8vw, 14px); --gap-y: var(--gap-x);
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap-y) var(--gap-x); align-items: start;
  max-width: 1720px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 56px) clamp(60px, 8vw, 140px);
}
.mosaic.with-captions { --gap-x: clamp(16px, 2vw, 34px); --gap-y: clamp(34px, 3.4vw, 56px); }
.mosaic-col { display: flex; flex-direction: column; gap: var(--gap-y); min-width: 0; }
.tile { margin: 0; min-width: 0; }
.tile[hidden] { display: none; }
/* Botón + bajo el mosaico de Inicio */
.mosaic:has(+ .more-wrap) { padding-bottom: 0; }
.more-wrap { display: flex; justify-content: center; padding: clamp(28px, 3vw, 48px) 16px clamp(60px, 8vw, 140px); }
.more { width: 54px; height: 54px; display: grid; place-items: center; padding: 0; border: 1px solid var(--black); background: transparent; color: var(--ink); cursor: pointer; transition: background .2s, color .2s; }
.more:hover { background: var(--black); color: var(--paper); }
.tile-link { display: block; overflow: hidden; background: #f4f4f4; }
.tile-link img { width: 100%; transition: transform .45s ease-out, opacity .3s; }
.tile-link:hover img { transform: scale(1.07); }
.caption { padding: 14px 2px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.cap-title { font-size: 17px; letter-spacing: .06em; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; margin: 0; line-height: 1.3; }
.cap-meta { font-size: 13px; letter-spacing: .08em; color: var(--muted); margin: 0; }
.sold-dot { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f0616f, var(--sold) 60%); flex: none; }
.ask { margin-top: 10px; padding: 0; background: none; border: 0; cursor: pointer; font-size: 14px; letter-spacing: .12em; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.ask:hover { text-decoration-thickness: 2px; }

/* ---------- obras: lista de colecciones ---------- */
.series-list { padding-bottom: 8vw; }
.series { display: grid; grid-template-columns: 1fr 1fr; align-items: center; text-decoration: none; }
.series.flip .series-img { order: 2; }
.series-img { aspect-ratio: 2 / 1; overflow: hidden; }
.series-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.series-img.pos-top img { object-position: center top; }
.series-img.pos-bottom img { object-position: center bottom; }
.series-text { text-align: center; padding: 40px 8%; }
.series h2 { font-size: 20px; letter-spacing: .12em; margin: 0 0 6px; font-weight: 500; }
.short { font-family: var(--serif); font-size: 16px; color: var(--muted); max-width: 42ch; margin: 18px auto 0; }
.series:hover h2 { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* ---------- colección ---------- */
/* Cabecera de colección: mismo ancho que el mosaico; la descripción, en columnas alineadas con las de las obras */
.intro { max-width: 1720px; margin: 0 auto clamp(40px, 5vw, 80px); padding: 0 clamp(12px, 3vw, 56px); text-align: center; }
.intro h1 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: .1em; margin: 0 0 6px; font-weight: 400; }
.long { text-align: justify; hyphens: auto; margin-top: 30px; line-height: 1.7; columns: 3; column-gap: clamp(16px, 2vw, 34px); }
.long p { margin: 0 0 1em; }

/* ---------- obra ---------- */
.work { display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); gap: 4vw; padding: 0 4vw 8vw; }
.work-img { margin: 0 0 6vh; }
/* Altura limitada para que la obra se vea entera sin hacer scroll */
.work-img img { max-height: min(72vh, 860px); width: auto; margin: 0 auto; }
.work-zoom { display: block; cursor: zoom-in; }

/* ---------- visor de imagen con zoom ---------- */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); } /* la página se ve detrás, oscurecida */
.lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.lb-stage img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); width: auto; height: auto; transform-origin: center; cursor: zoom-in; user-select: none; -webkit-user-drag: none; will-change: transform; }
.lightbox.zoomed .lb-stage img { cursor: grab; }
.lightbox.dragging .lb-stage img { cursor: grabbing; }
.lb-btn { position: absolute; z-index: 1; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid var(--black); background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 28px; line-height: 1; cursor: pointer; transition: background .2s, color .2s; }
.lb-btn:hover { background: var(--black); color: var(--paper); }
.lb-close { top: 14px; right: 14px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-btn[hidden] { display: none; }
.work-info { position: sticky; top: 40px; align-self: start; padding-top: 8px; }
.work-info .cap-title { font-size: 22px; }
.work-info .cap-meta { font-size: 15px; margin-top: 4px; }
.work-desc { margin-top: 26px; max-width: 46ch; }
.work-desc p { margin: 0 0 1em; }
.work-info .btn { margin-top: 28px; }
.work-nav { margin-top: 46px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 15px; letter-spacing: .1em; }
.work-nav a { text-decoration: none; }
.work-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.work-nav span { display: flex; gap: 20px; }

/* ---------- sobre mí / contacto ---------- */
/* Sobre mí: foto a la izquierda y el texto la rodea; al acabar la foto, el texto ocupa todo el ancho */
.about { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px) 8vw; }
.about::after { content: ''; display: table; clear: both; }
.about.no-photo { max-width: 760px; }
.about-photo { float: left; width: 40%; margin: 6px clamp(28px, 3.5vw, 52px) 20px 0; }
.about-photo img { width: 100%; }
.about-text h1, .contact-page h1 { font-size: 26px; letter-spacing: .1em; margin: 0 0 24px; }
.about-text { line-height: 1.75; }
.about-text p { text-align: justify; hyphens: auto; }
.contact-page { max-width: 560px; margin: 0 auto; padding: 0 24px 10vw; }
.lead { color: var(--muted); margin: 0 0 30px; }
/* Con imagen de fondo (content/contacto/): imagen a todo el ancho y formulario en un panel */
.contact-page.has-bg { position: relative; isolation: isolate; max-width: none; display: flex; justify-content: center; align-items: flex-start; min-height: min(80vh, 860px); padding: clamp(24px, 4vw, 64px) 16px; }
.contact-bg { position: absolute; inset: 0; z-index: -1; margin: 0; overflow: hidden; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; }
.has-bg .contact-panel { width: min(560px, 100%); background: rgba(246, 245, 243, .96); padding: clamp(28px, 4vw, 46px) clamp(22px, 3.4vw, 42px) 18px; }

/* Statement (en Biografía): la voz de la artista, en cursiva y a dos columnas */
.statement { clear: both; padding-top: clamp(40px, 5vw, 70px); }
.statement h2 { font-size: 22px; letter-spacing: .1em; font-weight: 400; margin: 0 0 26px; padding-top: 28px; border-top: 1px solid var(--line); }
.statement-text { font-style: italic; line-height: 1.75; text-align: justify; hyphens: auto; columns: 2; column-gap: clamp(28px, 4vw, 64px); }
.statement-text p { margin: 0 0 1em; break-inside: avoid; }

/* Trayectoria (en Biografía) */
.cv { clear: both; padding-top: clamp(40px, 5vw, 70px); }
.cv h2 { font-size: 22px; letter-spacing: .1em; margin: 0 0 26px; padding-top: 28px; border-top: 1px solid var(--line); }
.cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 34px clamp(28px, 4vw, 64px); }
.cv-section h3 { font-size: 16px; letter-spacing: .12em; font-weight: 500; margin: 0 0 12px; }
.cv-section ul { list-style: none; margin: 0; padding: 0; }
.cv-section li { display: grid; grid-template-columns: 5.5em 1fr; gap: 14px; font-size: 16px; line-height: 1.5; margin-bottom: 10px; }
.cv-year { font-size: 14px; letter-spacing: .08em; color: var(--muted); padding-top: 2px; }
.cv-section a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Páginas legales */
.legal { max-width: 760px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 8vw; }
.legal h1 { font-size: 26px; letter-spacing: .1em; margin: 0 0 24px; }
.legal h2 { font-size: 18px; letter-spacing: .1em; font-weight: 500; margin: 34px 0 8px; }
.legal p { margin: 0 0 1em; }

/* ---------- formulario ---------- */
.contact-form { display: grid; gap: 20px; }
.contact-form label { display: grid; gap: 4px; font-size: 15px; letter-spacing: .1em; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font: 17px/1.5 var(--serif); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid #9a9a9a;
  padding: 8px 0; border-radius: 0; width: 100%;
}
.contact-form textarea { border: 1px solid #9a9a9a; padding: 10px 12px; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 1px 0 var(--black); }
.contact-form .hp { position: absolute; left: -9999px; }
.btn { justify-self: start; display: inline-block; background: transparent; color: var(--ink); border: 1px solid var(--black); padding: 11px 26px 13px; font-size: 16px; letter-spacing: .14em; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--black); color: var(--paper); }
.btn[disabled] { opacity: .5; cursor: wait; }
.form-status { margin: 0; min-height: 1.6em; font-size: 16px; }
.contact-form .consent { display: flex; align-items: flex-start; gap: 10px; font: 15px/1.5 var(--serif); text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer; }
.contact-form .consent input { width: 17px; height: 17px; margin: 3px 0 0; padding: 0; flex: none; accent-color: var(--black); }
.contact-form .consent a { text-underline-offset: 3px; }
.consent-info { margin: -10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.form-status.error { color: var(--sold); }

.contact-dialog { width: min(560px, 92vw); max-height: 92vh; border: 1px solid var(--black); padding: 44px 40px 30px; background: var(--paper); color: var(--ink); }
.contact-dialog::backdrop { background: rgba(255, 255, 255, .88); }
.contact-dialog h2 { font-size: 21px; letter-spacing: .08em; margin: 0 0 22px; }
.dialog-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--ink); padding: 4px 8px; }

/* ---------- pie ---------- */
.site-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; max-width: 1720px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 56px) 44px; border-top: 1px solid var(--line); font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-social { flex: none; padding-top: 1px; }

/* ---------- móvil ---------- */
@media (max-width: 1000px) { .mosaic { --cols: 2; } .long { columns: 2; } }
@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; row-gap: 0; }
  .work-info { display: contents; }            /* leyenda arriba, navegación al final */
  .work-info > * { order: -1; }
  .work-info .work-nav { order: 1; }
  .work-images { margin-top: 32px; }
  .work-img img { max-height: 70vh; width: auto; }
  .about-photo { float: none; width: 100%; margin: 0 0 28px; }
  .statement-text { columns: 1; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  body.menu-open { overflow: hidden; }
  main { padding-top: 28px; }
  .page-home main { padding-top: 0; }

  /* cabecera fija: nombre a la izquierda, idioma y menú a la derecha */
  .site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--paper); text-align: left; }
  .brand { font-size: clamp(17px, 5vw, 22px); letter-spacing: .04em; white-space: nowrap; }
  .header-tools { position: static; order: 1; margin-left: auto; gap: 12px; }
  .site-footer { flex-direction: column-reverse; align-items: center; text-align: center; gap: 14px; }
  .cv-section li { grid-template-columns: 6.5em 1fr; gap: 10px; }
  .menu-toggle { display: block; order: 2; }
  .menu { position: fixed; inset: 0; z-index: 10; margin: 0; padding: 0 14vw; flex-direction: column; flex-wrap: nowrap; justify-content: center; align-items: flex-start; gap: 16px; background: rgba(255, 255, 255, .93); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
  .menu-open .menu { opacity: 1; visibility: visible; }
  .menu a { font-size: 18px; letter-spacing: .14em; }

  .long { columns: 1; }
  .to-top { width: 42px; height: 42px; }
  /* mosaico: una columna */
  .mosaic { --cols: 1; --gap-x: 12px; padding: 0 12px 12vw; }
  .mosaic.with-captions { --gap-y: 44px; }
  .caption { align-items: center; text-align: center; padding: 14px 20px 0; }
  .contact-page.has-bg { min-height: 0; padding: 20px 12px; }

  .series { grid-template-columns: 1fr; }
  .series.flip .series-img { order: 0; }
  .series-text { padding: 22px 24px 60px; }
}
/* ---------- volver arriba ---------- */
.to-top { position: fixed; right: clamp(14px, 2vw, 28px); bottom: clamp(14px, 2vw, 28px); z-index: 30; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid var(--black); background: rgba(255, 255, 255, .92); color: var(--ink); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s, visibility .25s, transform .25s, background .2s, color .2s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--black); color: var(--paper); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
