/* =========================================================
   PHUE COMPOSITES (Organisms)
   ---------------------------------------------------------
   RULES FOR EXPANSION:
   1. Purpose: High-level semantic blocks and complex patterns.
   2. Scope: Navbars, Footers, Hero sections, Feature Cards.
   3. Specificity: These classes define the implementation of specific
      UI deliverables rather than generic tools.
   4. Structure: May rely on nesting if strictly necessary for the pattern.
   ========================================================= */

/* =========================
   Feature Card
========================= */

.phue-featurecard {
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 2rem;
}

.phue-featurecard-background {
  background-color: var(--color-bg);
}

/* =========================
   Hero Section
========================= */

.phue-hero {
  padding-block: clamp(4rem, 10vh, 7rem);
}

.phue-hero-text {
  max-width: 36rem;
}

/* =========================
   Navbar
========================= */

.phue-navbar {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-muted);
  padding-block: 1rem;
  position: relative;
  /* Context for mobile drawer */
  z-index: 50;
}

/* Variant: Sticky */
.phue-navbar-sticky {
  position: sticky;
  top: 0;
}

.phue-navbar-brand {
  font-weight: 700;
  text-decoration: none;
  font-family: var(--heading-font, var(--font-family));
  color: var(--color-text);
  font-size: 1.25rem;
  margin-right: auto;
  /* Pushes nav to right */
}

/* Desktop Nav: Default Hidden on Mobile */
.phue-navbar-desktop {
  display: none;
}

/* Mobile Toggle: Default Visible on Mobile */
.phue-navbar-toggle {
  display: inline-flex;
}

/* Desktop Breakpoint (>768px) */
@media (min-width: 768px) {
  .phue-navbar-desktop {
    display: flex;
  }

  .phue-navbar-toggle {
    display: none;
  }
}

.phue-navbar-link {
  font-weight: 500;
  color: var(--color-text);
}

.phue-navbar-link:hover {
  color: var(--color-primary);
}

/* =========================
   Navbar (glass over hero)
========================= */
.phue-navbar-glass {
  background-color: color-mix(in oklab, var(--color-bg) 40%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in oklab, var(--color-muted) 65%, transparent);
  position: absolute;
  width: 100%;
}

/* Mobile full overlay */
.phue-navbar-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: color-mix(in oklab, var(--color-bg) 70%, transparent);
  backdrop-filter: blur(10px);
  padding: 1.25rem;
  display: grid;
  place-items: center;
}

.phue-navbar-overlay-panel {
  width: min(36rem, 100%);
  background-color: var(--color-surface);
  border: 1px solid var(--color-muted);
  border-radius: calc(var(--border-radius) + 0.25rem);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.phue-navbar-overlay-link {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid color-mix(in oklab, var(--color-muted) 70%, transparent);
  background-color: color-mix(in oklab, var(--color-bg) 35%, transparent);
  transition: background-color 150ms, border-color 150ms, transform 150ms;
}

.phue-navbar-overlay-link:hover {
  border-color: color-mix(in oklab, var(--color-accent) 60%, var(--color-muted));
  background-color: color-mix(in oklab, var(--color-surface) 75%, transparent);
  transform: translateY(-1px);
}

/* =========================
   Hero background image
========================= */
.phue-hero-bg {
  position: relative;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.phue-hero-bg::before {
  content: "";
  position: absolute;
  opacity: 0.8;
  inset: 0;
  background:
    radial-gradient(80% 80% at 20% 20%, color-mix(in oklab, var(--color-bg) 55%, transparent), transparent 60%),
    linear-gradient(to bottom, color-mix(in oklab, var(--color-bg) 65%, transparent), var(--color-bg));
}

.phue-hero-content {
  position: relative;
  z-index: 1;
  max-width: 56rem;
}

/* =========================
   Pricing cards
========================= */
.phue-pricing-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-muted);
  border-radius: var(--border-radius);
  padding: 2rem;
}

.phue-pricing-card-featured {
  background-color: color-mix(in oklab, var(--color-surface) 70%, var(--color-bg));
  border-color: color-mix(in oklab, var(--color-accent) 60%, var(--color-muted));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* =========================
   Notes
========================= */
.phue-note {
  border-radius: var(--border-radius);
  border: 1px solid var(--color-muted);
  background-color: color-mix(in oklab, var(--color-surface) 80%, transparent);
  padding: 1.25rem;
}

.phue-note-muted {
  background-color: color-mix(in oklab, var(--color-bg) 40%, var(--color-surface));
}

/* =========================
   Footer
========================= */

.phue-footer {
  margin-top: auto;
  padding-block: 2rem;
}

/* Footer sizes */

.phue-footer-sm {
  padding-block: 1rem;
}

.phue-footer-md {
  padding-block: 2rem;
}

.phue-footer-default {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-muted);
}

.phue-footer-surface {
  background-color: var(--color-surface);
  border-top: none;
}

.phue-footer-link {
  font-family: var(--font-family);
  font-size: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  transition: color 150ms;
}

.phue-footer-link:hover {
  color: var(--color-primary);
}

.phue-footer-copyright {
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* =========================
   Galery
========================= */

.phue-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  /* Slightly wider min-width for cards */
  gap: 1.5rem;
}

/* CARD CONTAINER */
.phue-gallery-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  /* Darker than surface for contrast */
  border: 1px solid var(--color-muted);
  /* Thin border */
  border-color: color-mix(in oklab, var(--color-muted) 30%, transparent);
  border-radius: var(--border-radius);
  overflow: hidden;
  /* Contains image zoom */
  transition: transform 0.2s, box-shadow 0.2s;
}

.phue-gallery-card:hover {
  box-shadow: var(--shadow-style);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* IMAGE MEDIA AREA */
.phue-gallery-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.phue-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.phue-gallery-card:hover .phue-gallery-img {
  transform: scale(1.05);
}

/* OVERLAY (Icon only now) */
.phue-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.phue-gallery-card-media:hover .phue-gallery-overlay {
  opacity: 1;
}

/* CARD BODY */
.phue-gallery-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Helper for small text spacing */
.phue-gallery-card-body .phue-paragraph-small {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ...existing lightbox styles... */
.phue-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phue-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phue-lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--border-radius);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--color-muted);
}

.phue-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 1rem;
  transition: color 0.2s, transform 0.2s;
}

.phue-lightbox-nav:hover {
  color: var(--color-brand);
  transform: translateY(-50%) scale(1.2);
}

.phue-lightbox-prev {
  left: 1rem;
}

.phue-lightbox-next {
  right: 1rem;
}

.phue-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  z-index: 110;
  transition: color 0.2s, transform 0.2s;
}

.phue-lightbox-close:hover {
  color: var(--color-primary);
  transform: rotate(90deg);
}

@media (max-width: 768px) {
  .phue-lightbox-nav {
    display: none;
  }
}