/* ============================================================
   JUGO — Balkanska kuhinja · Custom Styles
   ============================================================ */

/* ─── CSS Custom Properties ────────────────────────────────── */
:root {
  --charcoal: #171614;
  --cream: #F2E9DB;
  --paprika: #A83D2C;
  --tobacco: #69483A;
  --cobalt: #263C67;
  --mustard: #C49A43;
  --olive: #4E5540;
  --stone: #B9A994;

  --font-display: 'Archivo Black', sans-serif;
  --font-body: 'Manrope', sans-serif;

  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease;
}

/* ─── Base ─────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--charcoal);
  overflow-x: hidden;
}

::selection {
  background-color: var(--paprika);
  color: var(--cream);
}

/* ─── Alpine.js FOUC ──────────────────────────────────────── */
[x-cloak] {
  display: none !important;
}

/* ─── Typography ──────────────────────────────────────────── */
.font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 0.95;
}

.font-body {
  font-family: var(--font-body);
}

.text-display-xl {
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.text-display-lg {
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.text-display-md {
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.text-display-sm {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.2;
}

/* ─── Stamp Label ─────────────────────────────────────────── */
.stamp-label {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
}

/* ─── Scroll Reveal Animations ────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-2rem);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(2rem);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* ─── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── Navigation ──────────────────────────────────────────── */
.nav-transparent {
  background: rgba(23, 22, 20, 1);
}

.nav-solid {
  background: rgba(23, 22, 20, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

/* ─── Hero Section ────────────────────────────────────────── */
.hero-bg {
  position: relative;
  background: var(--charcoal);
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center bottom, rgba(168, 61, 44, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse at top right, rgba(196, 154, 67, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  opacity: 0.03;
  pointer-events: none;
}

/* ─── Ember Glow (for dark sections) ──────────────────────── */
.ember-glow {
  position: relative;
}

.ember-glow::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 50%;
  background: radial-gradient(ellipse at center bottom, rgba(168, 61, 44, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Noise Overlay ───────────────────────────────────────── */
.noise-overlay {
  position: relative;
}

.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
}

/* ─── Image Placeholders ──────────────────────────────────── */
.img-placeholder {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
}

.img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background:
    radial-gradient(circle at 20% 50%, rgba(196, 154, 67, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(168, 61, 44, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(38, 60, 103, 0.15) 0%, transparent 45%);
}

.img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  opacity: 0.08;
}

.img-placeholder-warm {
  background: linear-gradient(135deg, var(--tobacco), rgba(168, 61, 44, 0.3), rgba(23, 22, 20, 0.8));
}

.img-placeholder-dark {
  background: linear-gradient(135deg, var(--charcoal), rgba(23, 22, 20, 0.9), rgba(38, 60, 103, 0.4));
}

.img-placeholder-light {
  background: linear-gradient(135deg, var(--stone), rgba(242, 233, 219, 0.6), rgba(78, 85, 64, 0.3));
}

/* ─── Card Styles ─────────────────────────────────────────── */
.card-hover {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* ─── Menu Tab Active ─────────────────────────────────────── */
.tab-active {
  background-color: var(--paprika);
  color: var(--cream);
}

.tab-inactive {
  background-color: var(--cream);
  color: var(--tobacco);
}

.tab-inactive:hover {
  background-color: rgba(242, 233, 219, 0.8);
}

/* ─── Form Styles ─────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(185, 169, 148, 0.4);
  background: white;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--charcoal);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(38, 60, 103, 0.1);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 0.25rem;
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 22, 20, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: var(--cream);
  border-radius: 0.75rem;
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ─── Gallery Grid ────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 220px;
    gap: 1rem;
  }

  .gallery-grid > :nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .gallery-grid > :nth-child(4) {
    grid-row: span 2;
  }

  .gallery-grid > :nth-child(6) {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
  }
}

.gallery-item {
  cursor: pointer;
  transition: transform var(--transition-base), opacity var(--transition-base);
  overflow: hidden;
  border-radius: 0.5rem;
}

.gallery-item:hover {
  transform: scale(0.98);
  opacity: 0.9;
}

/* ─── Lightbox ────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(23, 22, 20, 0.95);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Mobile Action Bar ───────────────────────────────────── */
.mobile-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--charcoal);
  border-top: 1px solid rgba(242, 233, 219, 0.1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── Presentation Mode ───────────────────────────────────── */
.presentation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--cobalt);
  color: var(--cream);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(38, 60, 103, 0.4);
  border: 2px solid rgba(242, 233, 219, 0.2);
}

.presentation-panel {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 55;
  background: var(--cobalt);
  color: var(--cream);
  border-radius: 0.75rem;
  padding: 1rem;
  width: 16rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cream);
}

::-webkit-scrollbar-thumb {
  background: var(--stone);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--tobacco);
}

/* ─── Focus Styles ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

/* ─── Divider ─────────────────────────────────────────────── */
.divider {
  width: 3rem;
  height: 1px;
  background: rgba(185, 169, 148, 0.4);
}

/* ─── Geometric Decoration ────────────────────────────────── */
.geo-diamond {
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(242, 233, 219, 0.1);
  transform: rotate(45deg);
}

/* ─── Button Styles ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--paprika);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  min-height: 44px;
  transition: background var(--transition-base), transform var(--transition-base);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: #933525;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: 2px solid var(--cream);
  min-height: 44px;
  transition: background var(--transition-base), transform var(--transition-base);
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(242, 233, 219, 0.1);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color var(--transition-base);
  text-decoration: none;
}

.btn-ghost:hover {
  color: var(--mustard);
}