/* krishnaposso.com — hoja de estilos única, sin build. */

:root {
  --papel: #f6f2ea;
  --papel-2: #ece5d8;
  --tinta: #15110f;
  --tinta-suave: #5d544c;
  --linea: #d9cfbe;
  --acento: #b5532f;

  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;

  --ancho: 1180px;
  --canal: clamp(16px, 4vw, 40px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.55;
}

/* `hidden` debe ganar a cualquier display de clase (.boton es inline-flex). */
[hidden] {
  display: none !important;
}

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

h1,
h2 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

h2 {
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 3px;
}

.saltar {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 30;
  padding: 8px 14px;
  background: var(--tinta);
  color: var(--papel);
  font-family: var(--sans);
  font-size: 0.8rem;
}

.saltar:focus {
  left: 8px;
}

.icono {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Cabecera ----------------------------------------------------------- */

.cabecera {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px var(--canal);
  background: color-mix(in srgb, var(--papel) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cabecera a {
  text-decoration: none;
}

.cabecera__marca {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
  margin-right: auto;
  font-weight: 700;
}

.cabecera__marca img {
  width: auto;
  height: 40px;
}

.cabecera__nav {
  display: flex;
  gap: 28px;
}

.cabecera__nav a {
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}

.cabecera__nav a:hover {
  border-bottom-color: var(--tinta);
}

.idioma {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--tinta-suave);
}

.idioma button {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.idioma button[aria-pressed="true"] {
  color: var(--tinta);
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* --- Portada ------------------------------------------------------------ */

.portada {
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: clamp(48px, 9vw, 110px) var(--canal) clamp(56px, 9vw, 120px);
  text-align: center;
}

.portada__logo img {
  width: min(420px, 72vw);
}

.portada__lema {
  max-width: 24ch;
  font-size: clamp(1.5rem, 3.6vw, 2.2rem);
  font-style: italic;
  line-height: 1.25;
}

.portada__acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* --- Botones y enlaces -------------------------------------------------- */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--tinta);
  border-radius: 999px;
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.boton:hover {
  background: var(--tinta);
  color: var(--papel);
}

.boton--lleno {
  background: var(--tinta);
  color: var(--papel);
}

.boton--lleno:hover {
  background: var(--acento);
  border-color: var(--acento);
}

.enlace {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-underline-offset: 6px;
}

.enlace:hover {
  color: var(--acento);
}

/* --- Secciones ---------------------------------------------------------- */

.seccion {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) var(--canal);
}

.seccion__cabecera {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-bottom: clamp(28px, 5vw, 52px);
  text-align: center;
}

.seccion__cabecera h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin: 18px auto 0;
  background: var(--acento);
}

.seccion__cabecera p {
  max-width: 46ch;
  color: var(--tinta-suave);
}

.seccion__pie {
  margin-top: 40px;
  text-align: center;
}

/* --- Galería ------------------------------------------------------------ */

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(8px, 1.6vw, 18px);
}

.pieza {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--papel-2);
  aspect-ratio: 4 / 5;
  cursor: zoom-in;
}

.pieza img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pieza:hover img,
.pieza:focus-visible img {
  transform: scale(1.045);
}

.pieza__texto {
  position: absolute;
  inset: auto 0 0 0;
  padding: 44px 16px 14px;
  background: linear-gradient(to top, rgb(21 17 15 / 0.78), transparent);
  color: var(--papel);
  font-size: 1.05rem;
  line-height: 1.3;
  text-align: left;
  opacity: 0;
  transition: opacity 0.3s;
  /* Una sola línea con elipsis. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pieza:hover .pieza__texto,
.pieza:focus-visible .pieza__texto {
  opacity: 1;
}

.pieza__marca {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  padding: 5px;
  border-radius: 50%;
  background: rgb(21 17 15 / 0.55);
  color: var(--papel);
}

.pieza__marca svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* --- La marca ----------------------------------------------------------- */

.seccion--marca {
  max-width: none;
  background: var(--tinta);
  color: var(--papel);
}

.marca {
  display: grid;
  gap: 26px;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.marca__destacado {
  font-size: clamp(1.6rem, 3.8vw, 2.4rem);
  font-style: italic;
  line-height: 1.25;
}

.marca p:last-child {
  color: color-mix(in srgb, var(--papel) 78%, transparent);
}

/* --- Contacto y pie ----------------------------------------------------- */

.contacto {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.pie {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px var(--canal) 48px;
  border-top: 1px solid var(--linea);
  color: var(--tinta-suave);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-align: center;
}

.pie img {
  width: 48px;
}

/* --- Visor -------------------------------------------------------------- */

.visor {
  width: min(1040px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: var(--papel);
  color: var(--tinta);
  overflow: hidden;
}

.visor[open] {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr);
}

.visor::backdrop {
  background: rgb(21 17 15 / 0.82);
}

.visor__medio {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  background: var(--tinta);
}

.visor__medio img {
  max-height: calc(100dvh - 24px);
  object-fit: contain;
}

.visor__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-height: calc(100dvh - 24px);
  padding: 56px 28px 28px;
  overflow-y: auto;
}

.visor__info time {
  color: var(--tinta-suave);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.visor__info p {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.visor__info .boton {
  margin-top: auto;
}

.visor__cerrar,
.visor__flecha {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  border: 0;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.visor__cerrar {
  top: 8px;
  right: 8px;
  background: none;
  color: var(--tinta);
}

.visor__flecha {
  top: 50%;
  translate: 0 -50%;
  background: rgb(246 242 234 / 0.88);
  color: var(--tinta);
}

.visor__flecha--ant {
  left: 10px;
}

.visor__flecha--sig {
  right: 10px;
}


.visor__cuenta {
  position: absolute;
  bottom: 10px;
  left: 50%;
  translate: -50% 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgb(21 17 15 / 0.6);
  color: var(--papel);
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}

.visor__cuenta:empty {
  display: none;
}

/* --- Pantallas pequeñas -------------------------------------------------- */

@media (max-width: 760px) {
  body {
    font-size: 1.15rem;
  }

  .cabecera {
    gap: 14px;
  }

  .cabecera__nav a[href="#marca"] {
    display: none;
  }

  .cabecera__nav {
    gap: 16px;
  }

  .galeria {
    grid-template-columns: repeat(2, 1fr);
  }

  .pieza__texto {
    display: none;
  }

  .visor[open] {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow-y: auto;
  }

  .visor__medio img {
    max-height: 62dvh;
  }

  .visor__info {
    max-height: none;
    padding: 20px 20px 24px;
    overflow: visible;
  }

  .visor__cerrar {
    background: rgb(246 242 234 / 0.88);
  }
}

/* Con el enlace "Piezas" visible ya no cabe el texto del logo: queda el mapache. */
@media (max-width: 480px) {
  .cabecera:has(.cabecera__nav [data-con-piezas]:not([hidden])) .cabecera__texto {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
