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

@font-face {
  font-family: "Clifton";
  src: url("./fonts/Clifton-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Clifton";
  src: url("./fonts/Clifton.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "FreeSans";
  src: url("./fonts/FreeSans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #1a1917;
  --muted: #6b6860;
  --faint: #b0aea6;
  --bg: #e5e5e5;
  --hi: #d1d1d1;
  --dark: #a4a4a4;
  --title: "Clifton", Georgia, serif;
  --body: "FreeSans", "Helvetica Neue", Arial, sans-serif;
  --mono: "FreeSans", "Helvetica Neue", Arial, sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
}
body {
  position: fixed;
  inset: 0;
}

/* ── HEADER ARCHIVO ORSINI ── */

#orsini-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
}

#orsini-nav {
  position: relative;
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: white;
  border-bottom: 1px solid var(--hi);
  height: 34px;
}

.orsini-title {
  color: black;
  font-size: 13px;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.orsini-item-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}

.orsini-item {
  list-style: none;
  margin-left: 1rem;
}

.orsini-item a {
  text-decoration: none;
  color: var(--dark);
  font-size: 13px;
  transition: color 0.2s;
}
.orsini-item a:hover {
  color: var(--ink);
}

#orsini-menu-btn {
  display: none;
  padding: 0;
  border: none;
  cursor: pointer;
  background: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dark);
}

.orsini-hidden-menu {
  display: none;
  flex-direction: column;
  background: white;
  border-bottom: 1px solid var(--hi);
}

.orsini-hidden-item {
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-decoration: none;
  color: var(--dark);
  padding: 8px 16px;
  border-bottom: 1px solid var(--hi);
}
.orsini-hidden-item:hover {
  color: var(--ink);
}

@media (max-width: 1024px) {
  .orsini-item-wrapper {
    display: none;
  }
  #orsini-menu-btn {
    display: block;
  }
}

/* ── NAV MICROSITE ── */

#nav {
  position: fixed;
  top: 34px;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 40px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--hi);
}

#nav-label {
  flex: 1;
  padding-left: 1.4rem;
  font-size: 9px;
  color: var(--dark);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-btns {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.nav-btns::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.fbtn {
  border: none;
  background: transparent;
  font-family: "FreeSans", "Helvetica Neue", Arial, sans-serif;
  color: var(--dark);
  font-size: 13px;
  padding: 0 1rem;
  cursor: pointer;
  border-left: 1px solid var(--hi);
  transition: color 0.2s;
  position: relative;
  letter-spacing: 0.03em;
}
.fbtn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.fbtn:hover {
  color: var(--ink);
}
.fbtn.on {
  color: var(--ink);
}
.fbtn.on::after {
  transform: scaleX(1);
}

.info-btn {
  border: none;
  background: transparent;
  color: var(--dark);
  font-family: "FreeSans", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 0 1rem;
  cursor: pointer;
  border-left: 1px solid var(--hi);
  height: 100%;
  transition: color 0.2s;
}
.info-btn:hover,
.info-btn.active {
  color: var(--ink);
}

/* ── HEADER BOX */

#header-box {
  position: fixed;
  top: 74px;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: stretch;
  pointer-events: none;
  height: 300px;
}

#intro {
  flex-shrink: 0;
  padding: 1.4rem 1.8rem;
  background: var(--bg);
  border-right: 1px solid var(--hi);
  border-bottom: 1px solid var(--hi);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}

.intro-tag {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dark);
}

.intro-h {
  font-family: var(--title);
  font-style: italic;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  line-height: 1;
  font-weight: 400;
  color: var(--ink);
}

.intro-p {
  font-family: var(--body);
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}

/* panel texto — overlay sobre la galería, sin altura propia cuando cerrado */
#text-panel {
  flex: 1;
  background: var(--bg);
  border-bottom: 1px solid var(--hi);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.panel-inner {
  padding: 2rem 2.5rem 1.8rem;
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

.panel-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.panel-number {
  font-family: var(--title);
  font-style: italic;
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: rgba(0, 0, 0, 0.07);
  line-height: 1;
  user-select: none;
}

.panel-title {
  font-family: var(--title);
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  line-height: 1.1;
  font-weight: 400;
  color: var(--ink);
}

.panel-subtitle {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark);
  font-family: var(--mono);
  margin-top: 0.2rem;
}

.panel-body {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  columns: 2;
  column-gap: 2rem;
}
.panel-body p + p {
  margin-top: 0.8em;
}
.panel-body em {
  font-style: italic;
  color: var(--ink);
}

.panel-footer {
  padding: 0.6rem 2rem 0.8rem;
  border-top: 1px solid var(--hi);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-meta {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark);
  display: flex;
  gap: 1.2rem;
}

.panel-close-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark);
  transition: color 0.2s;
  padding: 0;
}
.panel-close-btn:hover {
  color: var(--ink);
}

/* ── GALLERY ── */

#gallery {
  position: fixed;
  inset: 0;
  top: 74px; /* se ajusta con JS */
  overflow: hidden;
}

#vgrid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  will-change: transform;
}

.cell {
  position: absolute;
  overflow: hidden;
  background: var(--hi);
  border: 1px solid rgba(0, 0, 0, 0.07);
  will-change: transform;
  backface-visibility: hidden;
  cursor: pointer;
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ── ZOOM ── */

#zoom-box {
  position: fixed;
  z-index: 99999;
  width: 320px;
  background: var(--hi);
  display: none;
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
#zoom-box img {
  width: 320px;
  height: 320px;
  object-fit: cover;
  display: block;
}
#zoom-lbl {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.75);
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 0.7rem;
  font-family: var(--mono);
  text-transform: uppercase;
}

@media (max-width: 600px) {
  #header-box {
    display: flex;
    flex-direction: column;
  }
  .intro-tag {
    font-size: 10px;
  }

  .intro-h {
    font-size: 32px;
    padding: 19px 0;
  }

  #intro {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--hi);
    box-sizing: border-box;
  }
  #text-panel {
    display: none;
  }
  #zoom-box {
    display: none !important;
  }
}
