/* ============================================
   Global Pageantry & Cultural Elegance Showcase
   styles/main.css — Magazine-style Landing Page
   ============================================ */

/* === CSS Custom Properties === */
:root {
  --gold: #C8A96A;
  --gold-light: #d4bc85;
  --gold-dark: #b08f50;
  --black: #121215;
  --black-soft: #1a1a1f;
  --pearl: #FAF8F5;
  --pearl-dim: #f0ede8;
  --gray: #8A8A8F;
  --gray-light: #b5b5b8;
  --gray-dark: #5a5a5f;
  --font-serif: 'Playfair Display', 'Noto Serif SC', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 3px;
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--black);
  background: var(--pearl);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* === Navigation === */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding-top: var(--safe-top);
  background: rgba(18, 18, 21, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200, 169, 106, 0.15);
  transition: background var(--transition);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-brand-icon {
  font-size: 0.8rem;
  opacity: 0.8;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--pearl-dim);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}

.nav-link:hover {
  color: var(--gold);
}

.nav-link:hover::after {
  width: 100%;
}

/* Language Selector */
.lang-selector {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--pearl-dim);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(200, 169, 106, 0.3);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.lang-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lang-arrow {
  font-size: 0.6rem;
  transition: transform var(--transition);
}

.lang-selector.open .lang-arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--black-soft);
  border: 1px solid rgba(200, 169, 106, 0.2);
  border-radius: var(--radius);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  overflow: hidden;
}

.lang-selector.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--pearl-dim);
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.lang-option:hover {
  background: rgba(200, 169, 106, 0.1);
  color: var(--gold);
}

.lang-option.active {
  color: var(--gold);
  font-weight: 500;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--pearl-dim);
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -5px);
}

/* === Hero Section === */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  overflow: hidden;
  padding: 64px 2rem 2rem;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(200, 169, 106, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(200, 169, 106, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, rgba(18, 18, 21, 0.3) 0%, rgba(18, 18, 21, 0.8) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s 0.3s forwards;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--pearl);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s 0.5s forwards;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 400;
  font-style: italic;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s 0.7s forwards;
}

.hero-divider {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s 0.8s forwards;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--gray-light);
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s 0.9s forwards;
}

.hero-cta {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--gold);
  border-radius: var(--radius);
  transition: all var(--transition);
  opacity: 0;
  animation: fadeInUp 0.8s 1.1s forwards;
}

.hero-cta:hover {
  background: var(--gold-light);
  box-shadow: 0 4px 24px rgba(200, 169, 106, 0.3);
  transform: translateY(-1px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-line {
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2s infinite;
}

/* === Section Common === */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--black);
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* === Gallery Section === */
.gallery-section {
  padding: 6rem 0;
  background: var(--pearl);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.filter-tab {
  padding: 0.55rem 1.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
  border: 1px solid var(--pearl-dim);
  border-radius: var(--radius);
  transition: all var(--transition);
  background: transparent;
}

.filter-tab:hover {
  color: var(--gold-dark);
  border-color: var(--gold);
}

.filter-tab.active {
  color: var(--black);
  background: var(--gold);
  border-color: var(--gold);
}

/* Delegates Grid */
.delegates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

/* Delegate Card */
.delegate-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  opacity: 0;
  transform: translateY(24px);
}

.delegate-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.delegate-card:hover {
  border-color: rgba(200, 169, 106, 0.4);
  box-shadow: 0 8px 32px rgba(200, 169, 106, 0.12);
  transform: translateY(-4px);
}

.delegate-card.visible:hover {
  transform: translateY(-4px);
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--black-soft);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.delegate-card:hover .card-image {
  transform: scale(1.03);
}

.card-image-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--black-soft) 0%, #252528 100%);
  z-index: 0;
}

.card-image-fallback svg {
  width: 60%;
  height: 60%;
  opacity: 0.4;
}

.card-image-wrap .card-image {
  position: relative;
  z-index: 1;
}

.card-flag {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 2;
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

.card-body {
  padding: 1.2rem 1.4rem 1.4rem;
}

.card-country {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.card-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--black);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.card-title-text {
  font-size: 0.8rem;
  color: var(--gray);
  font-style: italic;
  margin-bottom: 0.8rem;
}

.card-advocacy {
  font-size: 0.82rem;
  color: var(--gray-dark);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-btn {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  position: relative;
  padding-bottom: 2px;
  transition: color var(--transition);
}

.card-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}

.card-btn:hover {
  color: var(--gold);
}

.card-btn:hover::after {
  width: 100%;
}

/* === Highlights Section === */
.highlights-section {
  padding: 6rem 0;
  background: var(--black);
}

.highlights-section .section-title {
  color: var(--pearl);
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.highlight-card {
  padding: 2.5rem 2rem;
  border: 1px solid rgba(200, 169, 106, 0.15);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.highlight-card:hover {
  border-color: rgba(200, 169, 106, 0.4);
  background: rgba(200, 169, 106, 0.04);
}

.highlight-icon {
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.highlight-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--pearl);
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

.highlight-text {
  font-size: 0.88rem;
  color: var(--gray-light);
  line-height: 1.8;
}

/* === Lightbox Modal === */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(18, 18, 21, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
  padding: 2rem;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  position: relative;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  background: var(--pearl);
  border-radius: var(--radius);
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.35s ease;
}

.lightbox-overlay.active .lightbox-container {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--gray);
  background: rgba(250, 248, 245, 0.9);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  color: var(--black);
  background: #fff;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gray);
  background: rgba(250, 248, 245, 0.9);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--black);
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.lightbox-content {
  display: grid;
  grid-template-columns: 2fr 3fr;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
}

.lightbox-image-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--black-soft);
  min-height: 300px;
}

.lightbox-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.lightbox-image-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--black-soft) 0%, #252528 100%);
  z-index: 0;
}

.lightbox-image-fallback svg {
  width: 50%;
  height: 50%;
  opacity: 0.35;
}

.lightbox-info {
  padding: 2.5rem;
  overflow-y: auto;
}

.lightbox-country {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.lightbox-name {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--black);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.lightbox-title-text {
  font-size: 0.9rem;
  color: var(--gray);
  font-style: italic;
  margin-bottom: 1.2rem;
}

.lightbox-divider {
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin-bottom: 1.5rem;
}

.lightbox-section {
  margin-bottom: 1.2rem;
}

.lightbox-section h4 {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.lightbox-section p {
  font-size: 0.85rem;
  color: var(--gray-dark);
  line-height: 1.7;
}

/* === Footer === */
.site-footer {
  background: var(--black);
  border-top: 1px solid rgba(200, 169, 106, 0.12);
  padding: 3rem 2rem calc(3rem + var(--safe-bottom));
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 0.8rem;
}

.footer-brand-icon {
  margin-right: 0.4rem;
  font-size: 0.8rem;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-link {
  font-size: 0.75rem;
  color: var(--gray-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition);
  position: relative;
  padding-bottom: 2px;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}

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

.footer-link:hover::after {
  width: 100%;
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--gray-dark);
  letter-spacing: 0.04em;
}

/* === Legal Modals === */
.legal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(18, 18, 21, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 2rem;
}

.legal-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.legal-modal {
  position: relative;
  max-width: 600px;
  width: 100%;
  background: var(--pearl);
  border-radius: var(--radius);
  padding: 2.5rem;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.legal-modal-overlay.active .legal-modal {
  transform: scale(1);
}

.legal-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--gray);
  transition: color 0.2s ease;
}

.legal-modal-close:hover {
  color: var(--black);
}

.legal-modal h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.legal-modal p {
  font-size: 0.88rem;
  color: var(--gray-dark);
  line-height: 1.8;
}

/* === Fade-up Animation === */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Keyframes === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* === Responsive === */
@media (max-width: 1024px) {
  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .lightbox-content {
    grid-template-columns: 1fr;
  }

  .lightbox-image-wrap {
    aspect-ratio: 16 / 10;
    min-height: 200px;
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(18, 18, 21, 0.98);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    border-bottom: 1px solid rgba(200, 169, 106, 0.15);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .delegates-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .gallery-section,
  .highlights-section {
    padding: 4rem 0;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .lightbox-info {
    padding: 1.5rem;
  }

  .lightbox-name {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    padding: 0 1rem;
  }

  .section-container {
    padding: 0 1rem;
  }

  .delegates-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .filter-bar {
    gap: 0.35rem;
  }

  .filter-tab {
    padding: 0.45rem 0.9rem;
    font-size: 0.7rem;
  }

  .hero {
    padding: 64px 1rem 2rem;
  }

  .lightbox-overlay {
    padding: 0;
  }

  .lightbox-container {
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}
