/* ============================================================
   COLOR PALETTE — edit here to retheme the entire site
   ============================================================ */

:root {
  --clr-bg:           #000000;  /* page / stage background        */
  --clr-surface:      #000000;  /* card / banner fill              */
  --clr-border:       #6d5a2d;  /* primary gold border             */
  --clr-border-soft:  #453a1e;  /* softer gold border              */
  --clr-gold:         #d2b982;  /* primary gold text               */
  --clr-gold-nav:     #c8b87a;  /* nav links / secondary gold      */
  --clr-gold-sub:     #7f6e38;  /* subtitle / dim gold             */
  --clr-gold-hover:   #f0e4bb;  /* hover state                     */
  --clr-ooi-bg:       #f0e4bb;  /* OOI card background (swap to revert)   */
  --clr-card-bg:      #000000;  /* flip card background */
  --clr-card-text:    #111111;  /* flip card text (revert: see original)  */
  --clr-text-warm:    #e8dfc8;  /* warm light body text on dark    */
}

/* ============================================================
   BASE
   ============================================================ */

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

html {
  overflow-y: scroll; /* always show scrollbar — prevents fixed elements shifting */
}

body {
  min-height: 100%;
  font-family: 'tonos', sans-serif;
  font-weight: 300;
  background-color: var(--clr-bg);
}

/* ============================================================
   FIXED BACKGROUND
   Drop artwork into images/bg.jpg — it shows immediately.
   ============================================================ */

.bg {
  position: fixed;
  inset: 0 0 50px 0; /* stops at top of the 50px bottom banner */
  z-index: -1;
  background-image: url('../images/bg.jpg');
  background-size: cover;
  background-position: right bottom; /* signature anchored to element's bottom-right */
  background-repeat: no-repeat;
  background-color: var(--clr-bg);
}

/* ============================================================
   LANDING — fixed full-screen stage
   ============================================================ */

.landing {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 50px; /* shift center up to clear bottom banner */
}

/* ============================================================
   OOI ITEMS
   ============================================================ */

/* Hidden until JS positions them — prevents flash at center */
.ooi-item {
  position: absolute;
  cursor: pointer;
  z-index: 5;
  visibility: hidden; /* JS sets visible after layout */
}

/* Image state: black card, gold border */
.ooi-card {
  background: var(--clr-ooi-bg);
  padding: 12px;
  border: 1px solid var(--clr-border);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: background 0.3s ease;
}

.ooi-card img {
  display: block;
  max-width: 120px;
  max-height: 140px;
  width: auto;
  height: auto;
  flex-shrink: 0;
}

/* Text state: dark surface, image hidden (mobile tap) */
.ooi-item.is-open .ooi-card {
  background: var(--clr-surface);
}
.ooi-item.is-open .ooi-card img {
  display: none;
}

.ooi-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 0 6px;
  opacity: 0;
  max-height: 0;
  max-width: 0;
  min-width: 0;
  overflow: hidden;
  /* Collapse: shrink + fade together (reflow hidden by fading opacity) */
  transition: opacity    0.3s ease,
              max-height 0.3s ease,
              max-width  0.3s ease,
              padding    0.3s ease;
}

/* Mobile tap: reveal info */
.ooi-item.is-open .ooi-info {
  opacity: 1;
  max-height: 80px;
  max-width: 200px;
  padding: 8px 6px;
}

/* Desktop hover: width snaps, height grows, text fades in */
@media (hover: hover) {
  .ooi-item:hover .ooi-info {
    opacity: 1;
    max-height: 80px;
    max-width: 200px;
    padding: 8px 6px;
    transition: max-height 0.25s ease,
                padding    0.25s ease,
                opacity    0.2s ease;
  }
}

.ooi-title {
  display: none;
}

.ooi-rule {
  font-family: 'tonos', sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--clr-gold-sub);
  letter-spacing: 0.05em;
}

/* ============================================================
   FLIP CARD
   ============================================================ */

.card-wrap {
  perspective: 1000px;
  width: 320px;
  height: 180px;
  display: block;
  text-decoration: none;
  z-index: 6; /* above OOI items */
  position: relative;
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  cursor: pointer;
}

.card-wrap:hover .card,
.card-wrap:focus .card {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--clr-border);
  background: var(--clr-card-bg);
  padding: 24px 32px;
}

.card-back {
  transform: rotateY(180deg);
}

.card-front {
  flex-direction: column;
  gap: 10px;
}

.name {
  font-family: 'tonos', sans-serif;
  font-weight: 300;
  font-size: 1.45rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-gold);
  text-align: center;
}

.subtitle {
  font-family: 'tonos', sans-serif;
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--clr-gold-sub);
  text-align: center;
}

.card-back blockquote {
  font-family: 'tonos', sans-serif;
  font-weight: 300;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--clr-text-warm);
  line-height: 1.7;
  text-align: center;
}

/* ============================================================
   BOTTOM BANNER
   ============================================================ */

.bottom-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border-soft);
  z-index: 10;
}

.bottom-banner a {
  font-family: 'tonos', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-gold-nav);
  text-decoration: none;
  transition: color 0.2s;
}

.bottom-banner a:hover {
  color: var(--clr-gold-hover);
}

/* ============================================================
   SIGNATURE ZONE & PAINTING INFO POPUP
   Invisible hover target over the painting's signature.
   ============================================================ */

.signature-zone {
  position: fixed;
  bottom: 58px; /* clears the 50px bottom-banner */
  right: 24px;
  width: 90px;
  height: 56px;
  z-index: 5;
  cursor: default;
}

.painting-info-card {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 260px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  padding: 18px 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: translateY(6px);
}

.signature-zone:hover .painting-info-card {
  opacity: 1;
  transform: translateY(0);
}

.painting-info-title {
  font-family: 'tonos', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-gold);
  margin-bottom: 10px;
}

.painting-info-meta {
  font-family: 'tonos', sans-serif;
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--clr-gold-sub);
  line-height: 2;
}

/* ============================================================
   MOBILE — bottom banner equal thirds
   ============================================================ */

@media (max-width: 700px) {
  /* Disable double-tap zoom; pinch zoom still works */
  html, body {
    touch-action: manipulation;
  }

  .bottom-banner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    justify-items: center;
    /* Force own compositing layer so nav stays fixed during zoom */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .bottom-banner a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    letter-spacing: 0.1em;
    padding: 0 4px;
  }

  /* Smaller OOI cards on mobile — fixed size prevents resize on flip */
  .ooi-card {
    padding: 6px;
    width: 84px;
    height: 104px;
    justify-content: center;
  }
  .ooi-card img {
    max-width: 72px;
    max-height: 92px;
  }
  .ooi-item.is-open {
    z-index: 20; /* bring tapped item above others */
  }

}

/* ============================================================
   TOUCH DEVICES — disable card flip, tap goes straight to link
   ============================================================ */

@media (hover: none) {
  .card {
    transition: none;
    transform-style: flat;
  }
  .card-back {
    display: none;
  }
  .card-wrap:hover .card,
  .card-wrap:focus .card {
    transform: none;
  }
}
