/* Carmen Morillo Barragán — estilos */
: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 {
  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); }
.lang { position: absolute; top: 22px; right: 24px; font-size: 14px; letter-spacing: .14em; text-decoration: none; color: var(--muted); }
.lang: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); }

/* ---------- collage ---------- */
.collage { display: grid; grid-template-columns: repeat(12, 1fr); row-gap: clamp(40px, 6vw, 130px); padding-bottom: 10vw; }
.tile { grid-row: var(--r); grid-column: var(--c) / span var(--s, 1); margin: calc(var(--o) * 1vw) 0 0; min-width: 0; }
.tile-link { display: block; }
.square { width: clamp(56px, 10.3vw, 200px); aspect-ratio: 1; background: var(--black); justify-self: start; }
.caption { padding: 16px 14px 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 img { width: 100%; }
.series-text { text-align: center; padding: 40px 8%; }
.series h2 { font-size: 20px; letter-spacing: .12em; margin: 0 0 6px; font-weight: 500; }
.subtitle { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink); margin: 0; }
.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 ---------- */
.intro { max-width: 640px; margin: 0 auto clamp(50px, 7vw, 110px); padding: 0 24px; text-align: center; }
.intro h1 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: .1em; margin: 0 0 6px; font-weight: 400; }
.intro .subtitle { font-size: 18px; }
.long { text-align: left; margin-top: 30px; line-height: 1.75; }
.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; }
.work-img img { max-height: 88vh; width: auto; margin: 0 auto; }
.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 ---------- */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: 6vw; align-items: start; padding: 0 6vw 8vw; max-width: 1400px; margin: 0 auto; }
.about.no-photo { grid-template-columns: 1fr; max-width: 700px; }
.about-text h1, .contact-page h1 { font-size: 26px; letter-spacing: .1em; margin: 0 0 24px; }
.about-text { max-width: 62ch; line-height: 1.75; }
.contact-page { max-width: 560px; margin: 0 auto; padding: 0 24px 10vw; }
.lead { color: var(--muted); margin: 0 0 30px; }

/* ---------- 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; }
.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 { text-align: center; padding: 40px 20px 50px; font-size: 13px; letter-spacing: .1em; color: var(--muted); }

/* ---------- móvil ---------- */
@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: none; width: 100%; }
  .about { grid-template-columns: 1fr; }
}
@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: 14px; padding: 14px 16px; background: var(--paper); text-align: left; }
  .brand { font-size: clamp(18px, 5.4vw, 22px); letter-spacing: .05em; }
  .lang { position: static; order: 1; margin-left: auto; }
  .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; }

  /* collage: una columna a todo el ancho */
  .collage { display: block; padding-bottom: 12vw; }
  .tile { width: 100%; margin: 0 0 8vw; }
  .with-captions .tile { margin-bottom: 14vw; }
  .square { width: 30vw; margin: 20vw auto 28vw; }
  .caption { align-items: center; text-align: center; padding: 14px 20px 0; }

  .series { grid-template-columns: 1fr; }
  .series.flip .series-img { order: 0; }
  .series-text { padding: 22px 24px 60px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
