/* Hover guard — the `@media (hover: hover)` blocks below.
 *
 * A touch screen has no pointer to hover with, so the browser synthesises a
 * hover on the first tap. Every :hover rule then fires on that tap, the
 * browser counts it as "the page changed", and the click that would have
 * followed the link is swallowed: the button plays its animation and you have
 * to tap a second time to actually go anywhere. `hover: hover` matches only
 * devices with a real hovering pointer, so these rules are skipped entirely on
 * phones and tablets and one tap is enough. Desktop is unaffected — a
 * conditional group rule changes neither specificity nor source order.
 */

/* ============================================================
   ViDiPiXs — Portfolio (editorial, paired w/ home.css tokens)
   ============================================================ */

:root {
  --tg-gold: #FFCC01;
  --tg-bg: #0a0a0a;
  --tg-bg-soft: #070707;
  --tg-fg: #ecebe6;
  --tg-fg-soft: #cfcdc6;
  --tg-muted: #8b8a85;
  --tg-line: #1a1a1a;
  --tg-line-strong: #2a2620;
  --tg-border: #3a3830;
}

.tg-pf {
  font-family: 'Inter', sans-serif;
  background: var(--tg-bg);
  color: var(--tg-fg);
  line-height: 1.55;
}
.tg-pf * { box-sizing: border-box; }

.tg-pf .tg-serif {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.tg-pf .tg-gold,
.tg-pf em.tg-gold {
  color: var(--tg-gold);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
}
.tg-pf .tg-muted { color: var(--tg-muted); font-size: 14px; }
.tg-pf .tg-eyebrow {
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--tg-gold);
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}
@property --tg-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.tg-pf .tg-btn {
  display: inline-block;
  padding: 14px 28px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: 0;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.tg-pf .tg-btn-gold {
  position: relative;
  border: 2px solid transparent;
  color: #0a0a0a;
  /* Solid gold interior with a WHITE highlight flowing around the border (same
     rotating --tg-angle as .tg-btn-ghost, white-on-gold). Paid pages only. */
  background:
    linear-gradient(var(--tg-gold), var(--tg-gold)) padding-box,
    repeating-conic-gradient(from var(--tg-angle),
      #B37E00 0deg, #ffffff 45deg, #B37E00 90deg) border-box;
  box-shadow:
    0 0 18px 1px rgba(255, 255, 255, 0.45),
    0 0 40px 7px rgba(255, 204, 1, 0.28);
  animation: tg-btn-spin 2.6s linear infinite;
}
@media (hover: hover) {
  .tg-pf .tg-btn-gold:hover {
    color: #0a0a0a;
    text-decoration: none;
    background:
      linear-gradient(#fff, #fff) padding-box,
      repeating-conic-gradient(from var(--tg-angle),
        #B37E00 0deg, #ffffff 45deg, #B37E00 90deg) border-box;
  }
}
.tg-pf .tg-btn-ghost {
  position: relative;
  border: 2px solid transparent;
  color: var(--tg-fg);
  /* Gold flows around the border via rotating --tg-angle; four highlights
     (90deg repeat) + strong contrast keep the flow clearly visible on the long
     flat edges of wide pills, not just the rounded ends. */
  background:
    linear-gradient(#0a0a0a, #0a0a0a) padding-box,
    repeating-conic-gradient(from var(--tg-angle),
      #6E4E00 0deg, #FFF3B0 45deg, #6E4E00 90deg) border-box;
  box-shadow:
    0 0 18px 1px rgba(255, 204, 1, 0.40),
    0 0 40px 6px rgba(255, 204, 1, 0.18);
  animation: tg-btn-spin 2.5s linear infinite;
  transition: color 0.2s ease;
}
@media (hover: hover) {
  .tg-pf .tg-btn-ghost:hover {
    color: var(--tg-fg);
    text-decoration: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tg-pf .tg-btn-ghost,
  .tg-pf .tg-btn-gold { animation: none; }
}
@keyframes tg-btn-spin { to { --tg-angle: 360deg; } }

/* ============ HERO (compact editorial cover) ============ */
.tg-pf-hero {
  position: relative;
  min-height: 520px;
  height: 62vh;
  overflow: hidden;
  border-bottom: 0.5px solid var(--tg-line);
}
.tg-pf-hero-bg {
  position: absolute; inset: 0; z-index: 1;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  filter: grayscale(0.2) brightness(0.55);
}
.tg-pf-hero .video-background {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background: #0a0a0a;
}
.tg-pf-hero .hero-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.75s ease;
  filter: grayscale(0.2) brightness(0.55);
}
.tg-pf-hero .hero-bg-video.is-ready { opacity: 1; }
.tg-pf-hero-overlay {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0.85) 100%);
}
.tg-pf-hero-inner {
  position: relative; z-index: 3;
  height: 100%;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: end;
  gap: 36px;
  padding: 0 clamp(24px, 6vw, 96px) clamp(50px, 8vw, 90px);
}
.tg-pf-hero-meta {
  display: flex; flex-direction: column; gap: 14px;
}
.tg-pf-issue {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--tg-gold);
}
.tg-pf-issue::before {
  content: ''; width: 28px; height: 1px; background: var(--tg-gold);
}
.tg-pf-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(48px, 8vw, 108px);
  line-height: 0.95;
  color: #f5f3ec;
  letter-spacing: -0.03em;
  margin: 0;
}
.tg-pf-hero-title em { font-style: italic; color: var(--tg-gold); }
.tg-pf-hero-side {
  align-self: end;
  text-align: right;
  padding-bottom: 8px;
}
.tg-pf-hero-side p {
  font-size: 13px;
  color: var(--tg-fg-soft);
  max-width: 340px;
  margin: 0 0 0 auto;
  font-weight: 300;
  line-height: 1.7;
}

.tg-pf-hero-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px clamp(24px, 6vw, 96px);
  border-top: 0.5px solid rgba(255, 204, 1, 0.18);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--tg-fg-soft);
}
.tg-pf-hero-bar span {
  display: block;
  color: var(--tg-gold);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ============ INTRO BAND ============ */
.tg-pf-intro {
  padding: clamp(60px, 9vw, 110px) clamp(20px, 6vw, 64px);
  text-align: center;
  background: var(--tg-bg-soft);
  border-bottom: 0.5px solid var(--tg-line);
}
.tg-pf-intro .tg-divider-gold {
  width: 32px; height: 1px; background: var(--tg-gold);
  margin: 0 auto 20px;
}
.tg-pf-intro h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.25;
  max-width: 760px;
  margin: 0 auto 14px;
  color: var(--tg-fg);
  font-weight: 400;
  font-style: italic;
}
.tg-pf-intro p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--tg-muted);
  font-size: 14px;
}

/* ============ ARTIST CHAPTER ============ */
.tg-pf-artist {
  padding: clamp(70px, 10vw, 120px) clamp(20px, 6vw, 72px);
  border-bottom: 0.5px solid var(--tg-line);
}
.tg-pf-artist-head {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
  max-width: 1500px;
  margin: 0 auto 64px;
}
.tg-pf-artist.reverse .tg-pf-artist-head {
  grid-template-columns: 1fr 1.05fr;
}
.tg-pf-artist.reverse .tg-pf-artist-portrait { order: 2; }
.tg-pf-artist.reverse .tg-pf-artist-body { order: 1; }

.tg-pf-artist-portrait {
  position: relative;
  aspect-ratio: 4/5;
  background-size: cover;
  background-position: center;
  background-color: #111;
  overflow: hidden;
}
.tg-pf-artist-portrait::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.tg-pf-artist-num {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(64px, 9vw, 120px);
  line-height: 0.9;
  color: var(--tg-gold);
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}
.tg-pf-artist-role {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--tg-muted);
  margin-bottom: 16px;
}
.tg-pf-artist-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--tg-fg);
  margin: 0 0 10px;
}
.tg-pf-artist-name em { font-style: italic; color: var(--tg-gold); }
.tg-pf-artist-name a,
.tg-pf-artist-name a:link,
.tg-pf-artist-name a:visited {
  color: var(--tg-fg) !important;
  text-decoration: none !important;
  font: inherit;
  transition: color 0.2s ease;
}
@media (hover: hover) {
  .tg-pf-artist-name a:hover { color: var(--tg-gold) !important; }
}
a.tg-pf-artist-portrait { display: block; cursor: pointer; }
.tg-pf-artist-fullname {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tg-fg-soft);
  margin-bottom: 26px;
}
.tg-pf-artist-desc {
  font-size: 15px;
  color: var(--tg-fg-soft);
  max-width: 480px;
  line-height: 1.75;
  margin: 0 0 30px;
  /* Keep the line breaks and spacing typed in the admin. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tg-pf-artist-rule {
  width: 60px; height: 1px;
  background: var(--tg-gold);
  margin-bottom: 28px;
}

/* CTA sits below the selected-works grid (all breakpoints) */
.tg-pf-artist-cta {
  max-width: 1500px;
  margin: 44px auto 0;
  text-align: center;
}

/* Works grid (masonry-style 4 col) */
.tg-pf-works-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1500px;
  margin: 0 auto 24px;
}
.tg-pf-works-eyebrow .line {
  flex: 1;
  height: 1px;
  background: var(--tg-line-strong);
}
.tg-pf-works-eyebrow .label {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--tg-gold);
}

.tg-pf-works {
  max-width: 1500px;
  margin: 0 auto;
  column-count: 4;
  column-gap: 14px;
}
.tg-pf-works .tg-work {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  break-inside: avoid;
  position: relative;
  overflow: hidden;
  background: #111;
  text-decoration: none;
}
.tg-pf-works .tg-work img {
  width: 100%; height: auto; display: block;
  transition: transform 0.6s ease, filter 0.4s ease;
  filter: brightness(0.92);
}
@media (hover: hover) {
  .tg-pf-works .tg-work:hover img {
    transform: scale(1.04);
    filter: brightness(1);
  }
}
.tg-pf-works .tg-work-tag {
  position: absolute;
  left: 12px; bottom: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: #f5f3ec;
  background: rgba(0,0,0,0.55);
  padding: 4px 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
@media (hover: hover) {
  .tg-pf-works .tg-work:hover .tg-work-tag { opacity: 1; }
}

.tg-pf-works .tg-work.video {
  background: #000;
}
/* An uploaded clip renders as <video>, a pasted link as <iframe> — both fill
   the same tile. */
.tg-pf-works .tg-work.video iframe,
.tg-pf-works .tg-work.video video {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
  object-fit: cover;
  background: #000;
}

/* ============ LAZY REVEAL ============ */
.tg-pf-artist.tg-pf-pending {
  display: none;
}
.tg-pf-artist.tg-pf-revealed {
  animation: tgPfFadeUp 0.6s ease both;
}
@keyframes tgPfFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tg-pf-sentinel {
  height: 1px;
  width: 100%;
}
.tg-pf-status {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--tg-muted);
  padding: 24px 16px 48px;
}
.tg-pf-loader {
  display: flex;
  justify-content: center;
  padding: 30px 16px 60px;
}
.tg-pf-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tg-gold);
  margin: 0 4px;
  opacity: 0.4;
  animation: tgPfBounce 1.2s infinite ease-in-out;
}
.tg-pf-loader span:nth-child(2) { animation-delay: 0.15s; }
.tg-pf-loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tgPfBounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.15); }
}

/* ============ EMPTY STATE ============ */
.tg-pf-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--tg-muted);
  font-size: 14px;
}

/* ============ END CTA (reused look) ============ */
.tg-pf-end {
  padding: clamp(80px, 12vw, 130px) clamp(24px, 7vw, 96px);
  background: var(--tg-bg-soft);
  text-align: center;
}
.tg-pf-end h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 14px 0 30px;
  color: var(--tg-fg);
}
.tg-pf-end h2 em { font-style: italic; color: var(--tg-gold); }
.tg-pf-end-ctas {
  display: inline-flex; gap: 12px; flex-wrap: wrap;
  justify-content: center;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .tg-pf-works { column-count: 3; }
}
@media (max-width: 900px) {
  .tg-pf-hero-inner { grid-template-columns: 1fr; align-items: end; padding-top: 120px; padding-bottom: 110px; }
  .tg-pf-hero-side { text-align: left; }
  .tg-pf-hero-side p { margin-left: 0; }
  .tg-pf-hero-bar { grid-template-columns: 1fr 1fr; gap: 12px 24px; }
  /* Mobile order: number, role, portrait, name, then the rest.
     The section itself becomes the flex column and both the head and body use
     display:contents, so every leaf (including the works grid and the CTA)
     shares one flex flow and can be freely ordered. */
  .tg-pf-artist {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .tg-pf-artist-head,
  .tg-pf-artist.reverse .tg-pf-artist-head,
  .tg-pf-artist-body { display: contents; }
  .tg-pf-artist .tg-pf-artist-portrait,
  .tg-pf-artist.reverse .tg-pf-artist-portrait { width: 100%; }
  .tg-pf-artist .tg-pf-artist-num,
  .tg-pf-artist.reverse .tg-pf-artist-num { order: 1; }
  .tg-pf-artist .tg-pf-artist-role,
  .tg-pf-artist.reverse .tg-pf-artist-role { order: 2; }
  .tg-pf-artist .tg-pf-artist-portrait,
  .tg-pf-artist.reverse .tg-pf-artist-portrait { order: 3; margin: 6px 0 30px; }
  .tg-pf-artist .tg-pf-artist-name,
  .tg-pf-artist.reverse .tg-pf-artist-name { order: 4; }
  .tg-pf-artist .tg-pf-artist-fullname,
  .tg-pf-artist.reverse .tg-pf-artist-fullname { order: 5; }
  .tg-pf-artist .tg-pf-artist-rule,
  .tg-pf-artist.reverse .tg-pf-artist-rule { order: 6; }
  .tg-pf-artist .tg-pf-artist-desc,
  .tg-pf-artist.reverse .tg-pf-artist-desc { order: 7; }
  .tg-pf-works-eyebrow { order: 8; }
  .tg-pf-works { order: 9; column-count: 2; }
  /* CTA drops below the works grid, full-width with centered text */
  .tg-pf-artist-cta { order: 10; margin-top: 36px; text-align: center; }
}
@media (max-width: 600px) {
  .tg-pf-hero { min-height: 480px; }
  .tg-pf-hero-title { font-size: 56px !important; }
  /* Small multi-column thumbnails on mobile (not one image per row). */
  .tg-pf-works { column-count: 3; column-gap: 8px; }
  .tg-pf-works .tg-work { margin-bottom: 8px; }
  .tg-pf-artist-num { font-size: 56px; }
  .tg-pf-artist-name { font-size: 40px; }
}
