/* =============================================
   OBRA — mundo serif sobre fondo rosa.
   Espejo de /diseno/ con tipografías invertidas.
   ============================================= */

body.obra {
  background: var(--c-bg);
  color: var(--c-grey);
  font-family: var(--f-serif);
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

/* ---------- Sub-nav top (oculto globalmente, queda por compat) ---------- */
.o-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--gutter);
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 12px;
}
.o-nav__back { font-weight: 500; }
.o-nav__back:hover { color: var(--c-mint); }
.o-nav__title { text-align: center; color: var(--o-mute); }
.o-nav__links { text-align: right; display: flex; gap: 1.5rem; justify-content: flex-end; }
.o-nav__links a:hover { color: var(--c-mint); }

/* ---------- Hero ---------- */
.o-hero {
  padding: clamp(90px, 12vh, 160px) var(--gutter) clamp(40px, 6vw, 80px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.o-hero__label {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--o-mute);
  display: flex;
  justify-content: space-between;
}
.o-hero__title {
  font-family: var(--f-serif);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(54px, 11vw, 180px);
  line-height: 0.88;
  letter-spacing: -0.02em;
}

/* ---------- Wrapper grid de portadas ---------- */
.o-grid {
  /* legacy, sin uso */
}
.o-projects-wrap {
  padding: 0 var(--gutter) clamp(40px, 6vw, 80px);
  position: relative;
}

/* Grid de portadas */
.o-projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(40px, 4vw, 80px);
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 520px) {
  .o-projects { grid-template-columns: 1fr; }
}

.o-card {
  position: relative;
  display: block;
  color: inherit;
}
.o-card__media-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: center;
}
/* Inclinación sutil estática — solo la imagen, no el título ni las pastillas */
.o-card:nth-child(4n+1) .o-card__media-link { transform: rotate(-0.7deg); }
.o-card:nth-child(4n+2) .o-card__media-link { transform: rotate(0.4deg); }
.o-card:nth-child(4n+3) .o-card__media-link { transform: rotate(0.6deg); }
.o-card:nth-child(4n+4) .o-card__media-link { transform: rotate(-0.4deg); }
@media (hover: hover) {
  .o-card:hover .o-card__media-link {
    transform: rotate(0deg) scale(1.02);
    z-index: 2;
  }
}
.o-card__title {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}
@media (hover: hover) {
  .o-card__title:hover { color: var(--c-purple); }
}
.o-card__media {
  position: relative;
  overflow: hidden;
  background: var(--c-grey);
}
.o-card__media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.4s;
}
.o-card:hover .o-card__media img {
  transform: scale(1.05);
  filter: saturate(1.15) contrast(1.05);
}
.o-card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--o-mute);
  background: var(--c-bg);
}

.o-card__info {
  padding: clamp(10px, 1.2vw, 16px) 0 0;
  display: grid;
  gap: 8px;
  color: var(--c-grey);
}
.o-card__title {
  font-family: var(--f-serif);
  font-style: normal;
  font-weight: 700;
  font-size: clamp(24px, 2.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
.o-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
}
.o-card__pill {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(16px, 1.4vw, 22px);
  color: var(--c-grey);
  padding: 2px 14px;
  border: 1px solid var(--c-grey);
  border-radius: 999px;
  line-height: 1.3;
  white-space: nowrap;
}

/* Indicador de venta — al lado de la pastilla de técnica */
.o-card__sale {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(16px, 1.4vw, 22px);
  padding: 2px 14px;
  border-radius: 999px;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
}
.o-card__sale--sold {
  background: transparent;
  color: var(--c-grey);
  border: 1px solid var(--o-line);
  opacity: 0.7;
}
.o-card__sale--buy {
  background: transparent;
  color: var(--c-grey);
  border: 1px solid var(--c-grey);
}

/* ---------- Filtro por tags ---------- */
.o-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4em 0.8em;
  padding: clamp(20px, 2.4vw, 36px) 0 clamp(20px, 2.4vw, 32px);
}
.o-filter__label {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.1;
  color: var(--c-grey);
}
.o-filter__chip {
  font-family: var(--f-serif);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.3;
  padding: 2px 12px;
  border: 1px solid var(--o-line);
  border-radius: 999px;
  background: transparent;
  color: var(--c-grey);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.o-filter__chip:hover {
  background: var(--c-mint);
  color: var(--c-grey);
  border-color: var(--c-mint);
}
.o-filter__chip.is-active {
  background: var(--c-grey);
  color: var(--c-bg);
  border-color: var(--c-grey);
}

/* ---------- Lista ---------- */
.o-list { display: block; }

.o-list__row {
  display: grid;
  grid-template-columns: 60px 2.2fr 0.7fr 2fr 40px;
  gap: var(--gutter);
  align-items: baseline;
  padding: clamp(20px, 3vw, 36px) 0;
  transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s;
  text-decoration: none;
}
.o-list__row:hover {
  padding-left: clamp(12px, 1.5vw, 20px);
  color: var(--c-mint);
}
.o-list__num {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--o-mute);
  align-self: center;
}
.o-list__title {
  font-family: var(--f-serif);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 64px);
  letter-spacing: -0.015em;
  line-height: 1;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
.o-list__year {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 13px;
  color: var(--o-mute);
  align-self: center;
}
.o-list__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-self: center;
}
.o-pill {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 11px;
  color: var(--c-grey);
  padding: 4px 10px;
  border: 1px solid var(--o-line);
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}
.o-pill--sold {
  background: var(--c-grey);
  color: var(--c-pink);
  border-color: var(--c-grey);
}
.o-list__arrow {
  font-size: 22px;
  align-self: center;
  text-align: right;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.o-list__row:hover .o-list__arrow {
  transform: translate(6px, -6px);
}

/* ---------- Miniatura (mobile) + preview flotante (desktop) ---------- */
.o-list__thumb { display: none; }

.o-preview {
  position: fixed;
  top: 0; left: 0;
  width: clamp(280px, 26vw, 440px);
  aspect-ratio: 4 / 3;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 0.3s ease;
  margin: -180px 0 0 -200px;
  border: 1px solid var(--o-line);
  background: var(--c-grey);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(72, 72, 72, 0.4);
}
.o-preview.is-visible { opacity: 1; }
.o-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Status / vacío ---------- */
.o-status {
  padding: 4rem var(--gutter);
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--o-mute);
  text-align: center;
}

@media (max-width: 760px) {
  /* Título de página a ancho completo en móvil */
  .o-hero__title {
    font-size: clamp(64px, 19vw, 130px);
  }

  .o-list__row {
    grid-template-columns: 72px 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 4px 14px;
    padding: 18px 0;
  }
  .o-list__thumb {
    display: block;
    grid-column: 1 / 2;
    grid-row: 1 / 4;
    width: 72px;
    height: 72px;
    overflow: hidden;
    background: var(--c-grey);
    border: 1px solid var(--o-line);
    align-self: start;
  }
  .o-list__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .o-list__num   { grid-column: 2 / 3; grid-row: 1 / 2; font-size: 11px; }
  .o-list__title { grid-column: 2 / 3; grid-row: 2 / 3; font-size: 26px; line-height: 1; }
  .o-list__arrow { grid-column: 3 / 4; grid-row: 1 / 2; align-self: start; font-size: 18px; }
  .o-list__year  { grid-column: 2 / 3; grid-row: 3 / 4; }
  .o-list__tags  { grid-column: 3 / 4; grid-row: 3 / 4; text-align: right; }
  .o-list__row:hover { padding-left: 0; }
  .o-preview { display: none; }
}
