/* ============================================
   MONTRASIO.DE - Custom Styles
   Fonts & Base Styles (Tailwind handles the rest)
   ============================================ */

/* Font Definitions */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/PlayfairDisplay-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/PlayfairDisplay-SemiBold.woff2') format('woff2');
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Page Transition Overlay */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* Gallery Grid - Horizontal Flow (row by row, not column by column) */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .masonry-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .masonry-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.masonry-item {
  /* No break-inside needed for grid */
}

/* Lightbox Styles */
.lightbox-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

::-webkit-scrollbar-track {
  background: #f8f7f4;
}

::-webkit-scrollbar-thumb {
  background: #c4b5a0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a89880;
}

/* Selection Color */
::selection {
  background: oklch(0.85 0.05 80);
  color: oklch(0.25 0.02 80);
}

/* Focus States */
:focus-visible {
  outline: 2px solid oklch(0.65 0.08 80);
  outline-offset: 2px;
}

/* Image Loading Animation */
.img-loading {
  background: linear-gradient(
    90deg,
    oklch(0.95 0.01 80) 0%,
    oklch(0.92 0.02 80) 50%,
    oklch(0.95 0.01 80) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Magnetic Button Effect */
.magnetic-btn {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hero Parallax Container */
.parallax-container {
  will-change: transform;
  transform: translateZ(0);
}

/* Text Reveal Animation Base */
.text-reveal {
  clip-path: inset(0 0 100% 0);
}

.text-reveal.revealed {
  clip-path: inset(0 0 0% 0);
}

/* Smooth Image Hover */
.img-hover-zoom {
  overflow: hidden;
}

.img-hover-zoom img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.img-hover-zoom:hover img {
  transform: scale(1.05);
}

/* Navigation Active State */
.nav-link-active {
  position: relative;
}

.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
}

/* Timeline Connector */
.timeline-connector {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    oklch(0.75 0.05 80),
    transparent
  );
  transform: translateX(-50%);
}

/* Form Input Focus */
input:focus,
textarea:focus {
  border-color: oklch(0.65 0.08 80);
  box-shadow: 0 0 0 3px oklch(0.65 0.08 80 / 0.1);
}

/* Prevent Layout Shift on Images */
img {
  height: auto;
  max-width: 100%;
}

/* GPU Acceleration for Animations */
.gpu-accelerate {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Hero Section Text Contrast - Strong shadow for readability on all backgrounds */
.hero-section .hero-content {
  position: relative;
}

.hero-section .hero-content h1,
.hero-section .hero-content p,
.hero-section .hero-content span {
  text-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-section .hero-content h1 {
  text-shadow: 
    0 1px 4px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Mobile Hero adjustments - Carousel arrows positioning */
@media (max-width: 640px) {
  .hero-section button[aria-label="Vorheriges Bild"],
  .hero-section button[aria-label="Nächstes Bild"] {
    top: auto;
    bottom: 5rem;
    transform: translateY(0);
  }
}
