/* ============================================================
   KRB GRAPHICS — portfolio.css
   Shared styles for all portfolio subpages
============================================================ */

/* Page hero */
.page-hero {
  min-height: 40vh;
  display: flex;
  align-items: flex-end;
  padding: 8rem 2rem 3.5rem;
  background: var(--black);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 10% 80%, rgba(73,255,3,0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 10%, rgba(73,255,3,0.05) 0%, transparent 50%);
}
.page-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}
.page-hero-inner .section-eyebrow {
  color: var(--accent);
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.page-hero-inner h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1rem;
}
.page-hero-inner p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.55);
  max-width: 520px;
  line-height: 1.7;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--accent); }
.back-link svg { width: 16px; height: 16px; }

/* Filter tabs */
.filter-bar {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 2rem;
}
.filter-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-bar-inner::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Gallery grid */
.gallery-section {
  padding: 4rem 0 7rem;
  background: var(--white);
}
.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.gallery-grid {
  columns: 3;
  column-gap: 1rem;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
  cursor: zoom-in;
}
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 8px;
  cursor: zoom-in;
  pointer-events: none;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-overlay .zoom-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item-overlay .zoom-icon svg {
  width: 18px;
  height: 18px;
  color: var(--black);
}
.gallery-item-overlay span {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: lb-fade-in 0.2s ease;
}
@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: lb-scale-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes lb-scale-in {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.lightbox-close {
  position: fixed;
  top: 1.25rem; right: 1.25rem;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 2001;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: var(--accent); color: var(--black); border-color: var(--accent); }

/* CTA strip at bottom of each page */
.page-cta {
  background: var(--black);
  padding: 5rem 0;
  text-align: center;
}
.page-cta h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 900;
  color: var(--white);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.page-cta p {
  color: rgba(255,255,255,0.5);
  margin-bottom: 2rem;
  font-size: 1.0625rem;
}

/* ---- Portfolio nav dropdown ---- */
.nav-has-dropdown { position: relative; }
/* Invisible bridge fills the gap so hover doesn't break mid-travel */
.nav-has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 20px;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  transition: color 0.2s ease;
  line-height: 1;
}
.nav-dropdown-btn:hover { color: var(--white); }

.dropdown-chevron { transition: transform 0.22s ease; flex-shrink: 0; }
.nav-has-dropdown.open .dropdown-chevron { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
  min-width: 190px;
  padding: 6px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.22s ease, visibility 0.2s;
  z-index: 300;
}
.nav-has-dropdown:hover .nav-dropdown-menu,
.nav-has-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu li a {
  display: block;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-dropdown-menu li a:hover { background: #f5f5f5; color: var(--accent); }
.nav-dropdown-menu li a.dd-active {
  background: var(--black);
  color: var(--accent);
  font-weight: 600;
}

/* Arrow pip on dropdown */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top: 0;
  border-bottom-color: var(--white);
}

/* ---- Services strip ---- */
.pss-section {
  background: var(--accent);
  padding: 4rem 2rem;
}
.pss-container {
  max-width: 1200px;
  margin: 0 auto;
}
.pss-container > h2 {
  text-align: center;
  font-size: clamp(1.4rem, 2.5vw, 1.875rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 2.5rem;
}
.pss-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.pss-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.75rem 1rem 1.5rem;
  border-radius: 12px;
  background: var(--white);
  border: 2px solid transparent;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.pss-card:hover {
  border-color: var(--black);
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  transform: translateY(-4px);
}
.pss-card.pss-active {
  border-color: var(--black);
  background: var(--black);
}
.pss-icon {
  width: 48px; height: 48px;
  background: var(--black);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
.pss-card.pss-active .pss-icon { background: var(--accent); }
.pss-icon svg { width: 22px; height: 22px; color: var(--accent); }
.pss-card.pss-active .pss-icon svg { color: var(--black); }
.pss-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 0.3rem;
}
.pss-card.pss-active .pss-name { color: var(--white); }
.pss-desc {
  font-size: 0.8rem;
  color: var(--gray-500);
  display: block;
  line-height: 1.4;
}
.pss-card.pss-active .pss-desc { color: rgba(255,255,255,0.5); }

/* Responsive */
@media (max-width: 900px) {
  .gallery-grid { columns: 2; }
  .pss-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .pss-grid { grid-template-columns: repeat(2, 1fr); }
  /* Mobile dropdown — inline expansion */
  .nav-has-dropdown { position: static; }
  .nav-dropdown-menu {
    position: static;
    transform: none !important;
    box-shadow: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    min-width: 0;
    width: 100%;
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.2s, max-height 0.3s ease, visibility 0.2s;
  }
  .nav-dropdown-menu::before { display: none; }
  .nav-has-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    max-height: 300px;
  }
  .nav-dropdown-menu li a { color: rgba(255,255,255,0.75); padding: 10px 24px; font-size: 1rem; }
  .nav-dropdown-menu li a:hover { background: rgba(73,255,3,0.08); color: var(--accent); }
  .nav-dropdown-btn { color: rgba(255,255,255,0.75); font-size: 1.25rem; font-weight: 600; padding: 0.625rem 0; width: 100%; justify-content: flex-start; }
}
@media (max-width: 540px) {
  .gallery-grid { columns: 1; }
  .page-hero { padding: 7rem 1.5rem 2.5rem; }
  .pss-grid { grid-template-columns: repeat(2, 1fr); }
}
