/* ==========================================================================
   TKR Painting — Unified Portfolio Stylesheet (our-work.css)
   Mobile-First Architecture (Base: 320px–359px, Enhanced via min-width)
   Scoped strictly to Our Work page components without modifying styles.css
   ========================================================================== */

/* 1. Document Scroll & Anchor Clearance Fixes */
body.our-work-page {
  height: auto;
}

.our-work-page #main,
.our-work-page .page-hero {
  scroll-margin-top: 5.5rem;
}

/* 2. Mobile-First Page Hero (Base: 320px+) */
.our-work-page .page-hero {
  padding: 1.75rem 0 1rem;
}

.our-work-page .page-hero-copy {
  max-width: 42rem;
}

.our-work-page .page-hero-copy .eyebrow {
  margin-bottom: 0.5rem;
}

.our-work-page .page-hero-copy h1 {
  margin-bottom: 0.45rem;
}

.our-work-page .hero-tagline {
  font-size: 1.02rem;
  color: var(--text);
  margin-top: 0.45rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* 3. Edge-to-Edge Non-Interactive Infinite Moving Hero Banner (Base: 320px–359px) */
.hero-banner {
  --banner-height: 175px;
  --banner-gap: 0.65rem;
  width: 100%;
  height: var(--banner-height);
  margin-top: 1.15rem;
  overflow: hidden;
  position: relative;
  pointer-events: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.hero-banner-track {
  display: flex;
  align-items: center;
  width: max-content;
  height: 100%;
  will-change: transform;
  animation: tkr-marquee var(--marquee-duration, 36s) linear infinite;
  pointer-events: none;
}

.hero-banner-group {
  display: flex;
  align-items: center;
  height: 100%;
  flex-shrink: 0;
  pointer-events: none;
}

.hero-banner-item {
  height: 100%;
  flex: 0 0 auto;
  margin-right: var(--banner-gap);
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #020617;
  pointer-events: none;
}

.hero-banner-item img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

@keyframes tkr-marquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/* 4. Mobile-First Portfolio Section & Empty State (Base: 320px+) */
.portfolio-section {
  padding: 0.5rem 0 1.5rem;
  min-height: 0;
}

.portfolio-section .gallery-fallback {
  max-width: var(--max-width);
  margin: 0.75rem auto;
  padding: 1.25rem 1.15rem;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(2, 6, 23, 0.4);
  font-size: 0.92rem;
}

.portfolio-empty {
  max-width: 620px;
  margin: 0.5rem auto 1rem;
  padding: 1.5rem 1.15rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.3);
}

.portfolio-empty-icon {
  font-size: 2.25rem;
  margin-bottom: 0.6rem;
}

.portfolio-empty-heading {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.65rem;
  font-weight: 700;
}

.portfolio-empty-text {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.4rem;
}

.portfolio-empty-action {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* 5. Mobile-First Editorial Portfolio Grid (Base: 1-Column Phone Layout) */
.portfolio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
  margin: 0.75rem 0 1.5rem;
}

.portfolio-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.7);
  overflow: hidden;
  cursor: zoom-in;
  outline: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: block;
}

.portfolio-card.is-wide,
.portfolio-card.is-standard {
  grid-column: 1 / -1;
}

.portfolio-image-wrap {
  position: relative;
  width: 100%;
  background: #020617;
  overflow: hidden;
}

.portfolio-card img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  transition: transform 0.35s ease;
}

/* Signature TKR Gold-Orange Underline Hover Effect */
.portfolio-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(to right, var(--accent), #fde047);
  transition: height 0.22s ease;
  pointer-events: none;
  z-index: 2;
}

.portfolio-card:hover,
.portfolio-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.08), 0 16px 36px rgba(2, 6, 23, 0.35);
}

.portfolio-card:hover img,
.portfolio-card:focus-visible img {
  transform: scale(1.02);
}

.portfolio-card:hover::after,
.portfolio-card:focus-visible::after {
  height: 3px;
}

.portfolio-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* 6. Page CTA Spacing (Mobile-First) */
.our-work-page .page-cta {
  padding: 0.75rem 0 1.75rem;
}

/* 7. Clean Accessible Lightbox Modal (Mobile-First, Zero Visible Photo Text) */
.p-lb {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
}

.p-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.p-lb-panel {
  position: relative;
  max-width: min(1160px, 96vw);
  max-height: 92vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.p-lb-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 82vh;
}

.p-lb-media-wrap img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.p-lb-close {
  position: absolute;
  top: -0.25rem;
  right: 0.25rem;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.p-lb-close:hover,
.p-lb-close:focus-visible {
  background: rgba(249, 115, 22, 0.65);
  transform: scale(1.05);
  outline: 2px solid var(--accent);
}

.p-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.p-lb-nav:hover,
.p-lb-nav:focus-visible {
  background: rgba(249, 115, 22, 0.65);
  transform: translateY(-50%) scale(1.08);
  outline: 2px solid var(--accent);
}

.p-lb-prev {
  left: 0.25rem;
}

.p-lb-next {
  right: 0.25rem;
}

/* ==========================================================================
   8. Progressive Mobile-First Enhancements (min-width Media Queries)
   ========================================================================== */

/* Typical & Large Phones (360px+: 375px, 390px, 430px) */
@media (min-width: 360px) {
  .our-work-page .page-hero {
    padding: 2rem 0 1.15rem;
  }

  .hero-banner {
    --banner-height: 198px;
    --banner-gap: 0.75rem;
    margin-top: 1.25rem;
  }
}

/* Tablet Viewports (768px+) */
@media (min-width: 768px) {
  .our-work-page .page-hero {
    padding: 2.5rem 0 1.25rem;
  }

  .our-work-page .hero-tagline {
    font-size: 1.1rem;
  }

  .hero-banner {
    --banner-height: 260px;
    --banner-gap: 1rem;
    margin-top: 1.5rem;
  }

  .portfolio-section {
    padding: 0.75rem 0 1.75rem;
  }

  .portfolio-empty {
    padding: 2rem 1.75rem;
  }

  .portfolio-empty-heading {
    font-size: 1.35rem;
  }

  .portfolio-empty-text {
    font-size: 0.95rem;
  }

  .portfolio-grid {
    gap: 1.35rem;
    margin: 0.9rem 0 1.75rem;
  }

  .our-work-page .page-cta {
    padding: 1rem 0 2.25rem;
  }

  .p-lb {
    padding: 1.5rem;
  }

  .p-lb-media-wrap,
  .p-lb-media-wrap img {
    max-height: 85vh;
  }

  .p-lb-nav {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.25rem;
  }

  .p-lb-prev {
    left: 0.5rem;
  }

  .p-lb-next {
    right: 0.5rem;
  }

  .p-lb-close {
    top: -0.5rem;
    right: 0.5rem;
  }
}

/* Two-Column Editorial Gallery Threshold (901px+) */
@media (min-width: 901px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.6rem;
    margin: 1rem 0 2rem;
  }

  .portfolio-card.is-wide {
    grid-column: 1 / -1;
  }

  .portfolio-card.is-standard {
    grid-column: span 1;
  }
}

/* Desktop Viewports (1024px+: 1280px+) */
@media (min-width: 1024px) {
  .our-work-page .page-hero {
    padding: 3.25rem 0 1.25rem;
  }

  .our-work-page .hero-tagline {
    font-size: 1.15rem;
  }

  .hero-banner {
    --banner-height: 320px;
    --banner-gap: 1.15rem;
    margin-top: 1.65rem;
  }

  .portfolio-grid {
    gap: 1.75rem;
  }
}

/* Reduced Motion Accessibility Support */
@media (prefers-reduced-motion: reduce) {
  .hero-banner-track {
    animation: none !important;
    transform: translate3d(0, 0, 0) !important;
  }

  .portfolio-card,
  .portfolio-card img,
  .portfolio-card::after {
    transition: none !important;
  }
}
