/* =====================================================================
   Beit Bottarga · Portfolio page overrides
   Inherits variables and base styles from ../css/style.css
   ===================================================================== */

/* Nav on portfolio always has solid background */
.nav.is-solid {
  background: rgba(14, 13, 11, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav__mark-tag {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 2px 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--f-body);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  vertical-align: middle;
}

/* ---------- portfolio hero (shorter than homepage) ---------- */
.p-hero {
  position: relative;
  height: 62vh;
  min-height: 460px;
  max-height: 640px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--gutter) 3rem;
  color: var(--text);
}
.p-hero__media {
  position: absolute; inset: 0; overflow: hidden;
}
.p-hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  animation: hero-zoom 20s ease-out forwards;
}
.p-hero__content {
  position: relative; z-index: 2;
  max-width: 900px;
}
.p-hero__content .display--hero { font-size: clamp(3rem, 8vw, 6rem); margin-bottom: 1rem; }
.p-hero__meta {
  color: var(--text-2);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  max-width: 46ch;
}

/* ---------- Tabs bar ---------- */
.tabs-bar {
  position: sticky;
  top: 66px;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}
.tabs {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}
@media (max-width: 640px) {
  .tabs { gap: 1.5rem; }
  .tab { font-size: 0.9rem; letter-spacing: 0.12em; }
}
.tab {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.6rem 0;
  cursor: pointer;
  position: relative;
  transition: color .2s var(--ease);
}
.tab:hover { color: var(--accent); }
.tab.is-active { color: var(--accent); }
.tab.is-active::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: 0; right: 0;
  height: 1px;
  background: var(--accent);
}

/* ---------- tab panels ---------- */
.tab-panel {
  display: none;
  padding: 4rem 0 5rem;
}
.tab-panel.is-active { display: block; }

/* ---------- Summary tab ---------- */

.numbers__grid--dense {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) { .numbers__grid--dense { grid-template-columns: repeat(2, 1fr); } }

.highlights {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  margin: 3rem 0 4rem;
}
.highlight {
  position: relative;
  grid-column: span 2;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-2);
}
.highlight--wide {
  grid-column: span 3;
  aspect-ratio: 16 / 10;
}
.highlight img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.4s var(--ease);
}
.highlight:hover img { transform: scale(1.03); }
.highlight figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1rem 1.1rem;
  background: linear-gradient(to top, rgba(14,13,11,0.75), rgba(14,13,11,0));
  color: var(--text);
  font-family: var(--f-body);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  display: flex; align-items: baseline; gap: 0.6rem;
}
.highlight figcaption span {
  font-family: var(--f-display);
  font-style: italic;
  color: var(--accent);
  font-size: 0.95rem;
}
@media (max-width: 900px) {
  .highlights { grid-template-columns: repeat(2, 1fr); }
  .highlight, .highlight--wide { grid-column: span 1; aspect-ratio: 3 / 4; }
}

.quicksheet {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 3rem 0 4rem;
}
.quicksheet__head {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.quicksheet ul { list-style: none; padding: 0; margin: 0; }
.quicksheet li {
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 0.15rem 0;
}
@media (max-width: 900px) {
  .quicksheet { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1.25rem; }
}
@media (max-width: 520px) {
  .quicksheet { grid-template-columns: 1fr; }
}

.p-cta {
  padding: 4rem 0 2rem;
  text-align: center;
}
.p-cta .display--section { margin: 0.5rem 0 1.25rem; }
.p-cta__lead {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 52ch;
  margin: 0 auto 2rem;
}

/* ---------- Full tour tab ---------- */

.tour-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4rem;
  padding-top: 2rem;
}
.tour-index {
  position: sticky;
  top: 148px;
  align-self: start;
  border-left: 1px solid var(--line);
  padding-left: 1.25rem;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}
.tour-index__label {
  font-family: var(--f-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.tour-index ol { list-style: none; padding: 0; margin: 0; counter-reset: sec; }
.tour-index li {
  counter-increment: sec;
  padding: 0.35rem 0;
}
.tour-index a {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  color: var(--text-2);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color .2s var(--ease);
}
.tour-index a::before {
  content: counter(sec, decimal-leading-zero);
  font-family: var(--f-display);
  font-style: italic;
  color: var(--text-3);
  font-size: 0.85rem;
  min-width: 1.75rem;
}
.tour-index a:hover, .tour-index a.is-current {
  color: var(--accent);
}
.tour-index a.is-current::before { color: var(--accent); }

.tour-content { min-width: 0; }

.tour-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 148px;
}
.tour-section:first-child { padding-top: 0; }
.tour-section:last-child { border-bottom: none; }

.tour-section__head { max-width: 62ch; margin-bottom: 2.5rem; }
.tour-section__num {
  font-family: var(--f-display);
  font-style: italic;
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}
.tour-section__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 1rem;
}
.tour-section__lead {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.65;
}

.tour-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.tour-fig {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  aspect-ratio: 4 / 3;
}
.tour-fig--wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}
.tour-fig--tall {
  aspect-ratio: 3 / 4;
}
.tour-fig img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.4s var(--ease);
}
.tour-fig:hover img { transform: scale(1.03); }
.tour-fig figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.9rem 1rem;
  background: linear-gradient(to top, rgba(14,13,11,0.7), rgba(14,13,11,0));
  color: var(--text-2);
  font-family: var(--f-body);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.tour-end {
  text-align: center;
  padding: 4rem 0 2rem;
}
.tour-end p {
  font-family: var(--f-display);
  font-style: italic;
  color: var(--text-2);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .tour-layout { grid-template-columns: 1fr; gap: 0; }
  .tour-index {
    position: static;
    max-height: none;
    padding: 0;
    border-left: none;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
  }
  .tour-index ol {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem 1.25rem;
  }
  .tour-grid { grid-template-columns: 1fr; }
  .tour-fig, .tour-fig--wide { grid-column: span 1; aspect-ratio: 4/3; }
}

/* ---------- Specifications tab ---------- */

.specs-full {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 3rem;
  margin: 3rem 0;
}
.specs-full__group {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.specs-full__head {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.specs-table {
  width: 100%;
  border-collapse: collapse;
}
.specs-table tr {
  border-bottom: 1px solid var(--line);
}
.specs-table th, .specs-table td {
  text-align: left;
  padding: 0.75rem 0.5rem 0.75rem 0;
  font-family: var(--f-body);
  font-size: 0.9rem;
  vertical-align: top;
}
.specs-table th {
  color: var(--text-3);
  font-weight: 400;
  letter-spacing: 0.02em;
  width: 42%;
}
.specs-table td {
  color: var(--text);
  line-height: 1.55;
}
@media (max-width: 720px) {
  .specs-full { grid-template-columns: 1fr; }
}

/* =============================================================== */
/* ROOMS GRID                                                      */
/* =============================================================== */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
@media (max-width: 960px) {
  .rooms-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .rooms-grid { grid-template-columns: 1fr; }
}

.room-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
  display: block;
}
.room-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
}
.room-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.room-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
}
.room-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms ease, opacity 400ms ease;
}
.room-card:hover .room-card__media img {
  transform: scale(1.04);
}
.room-card__body {
  padding: 1.25rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.room-card__num {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.room-card__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--text);
  margin: 0;
}
.room-card__count {
  font-family: var(--f-body);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* =============================================================== */
/* LIGHTBOX                                                        */
/* =============================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 6, 0.92);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.lightbox__frame {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: auto;
  padding: 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 1;
}
.lightbox__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}
.lightbox__eyebrow {
  display: block;
  font-family: var(--f-body);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.lightbox__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
  color: var(--text);
  margin: 0;
}
.lightbox__controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.lightbox__counter {
  font-family: var(--f-body);
  font-size: 0.85rem;
  color: var(--text-2);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.lightbox__close {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
}
.lightbox__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lightbox__stage {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;
}
.lightbox__nav {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  width: 48px;
  height: 64px;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}
.lightbox__nav:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(201, 167, 106, 0.08);
}
.lightbox__img-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.lightbox__img {
  max-width: 100%;
  max-height: 68vh;
  height: auto;
  width: auto;
  display: block;
  border-radius: 2px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.lightbox__caption {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-2);
  margin: 0;
  text-align: center;
  min-height: 1.2em;
}
.lightbox__thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  justify-content: center;
  flex-wrap: nowrap;
}
.lightbox__thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 60px;
  padding: 0;
  border: 1px solid var(--line);
  background: #000;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 200ms ease, border-color 200ms ease;
  overflow: hidden;
}
.lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lightbox__thumb:hover { opacity: 0.85; }
.lightbox__thumb.is-active {
  opacity: 1;
  border-color: var(--accent);
}

@media (max-width: 720px) {
  .lightbox__frame { padding: 1rem 1rem 1rem; gap: 1rem; }
  .lightbox__header { flex-direction: column; align-items: flex-start; }
  .lightbox__stage { grid-template-columns: 36px 1fr 36px; gap: 0.5rem; }
  .lightbox__nav { width: 36px; height: 56px; font-size: 1.3rem; }
  .lightbox__img { max-height: 55vh; }
  .lightbox__thumb { width: 64px; height: 48px; }
}
