@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Base Styles */
@layer base {
  html {
    scroll-behavior: smooth;
  }

  body {
    @apply bg-white text-charcoal antialiased;
    font-feature-settings: 'liga' 1, 'kern' 1;
  }

  /* Typography - Roboto for headings */
  h1, h2, h3, h4, h5, h6 {
    @apply font-roboto;
    letter-spacing: -0.01em;
  }

  h1 {
    @apply leading-tight;
  }

  /* Selection */
  ::selection {
    @apply bg-accent text-white;
  }

  /* Focus styles */
  :focus-visible {
    @apply outline-none ring-2 ring-accent ring-offset-2;
  }
}

/* Custom Components */
@layer components {
  /* Portfolio Grid Item */
  .portfolio-item {
    @apply relative overflow-hidden cursor-pointer group;
    aspect-ratio: 1 / 1;
    @apply rounded-sm;
  }

  .portfolio-item img {
    @apply w-full h-full object-cover transition-transform duration-700;
  }

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

  /* Lightbox - Native HTML Dialog */
  dialog::backdrop {
    @apply bg-black/95;
  }

  dialog {
    @apply p-0 max-w-full max-h-full;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    inset: 0;
  }

  dialog::backdrop {
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(8px);
  }

  /* Solid black backdrop on mobile - completely opaque */
  @media (max-width: 768px) {
    dialog::backdrop {
      background: #000000;
    }
  }

  dialog[open] {
    @apply flex items-center justify-center;
  }

  .lightbox-content {
    @apply relative w-full h-full;
    margin: 0;
    max-height: 100vh;
    max-width: 100vw;
  }

  .lightbox-image {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .lightbox-image.loaded {
    @apply opacity-100;
  }

  .lightbox-image.loading {
    @apply opacity-0;
  }

  .lightbox-nav {
    /* Buttons are now fixed positioned via inline styles */
  }

  .lightbox-close {
    /* Close button is now fixed positioned via inline styles */
  }

  /* Loading spinner animation */
  @keyframes spin {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }

  .animate-spin {
    animation: spin 1s linear infinite;
  }
}

/* Custom Utilities */
@layer utilities {
  /* Slow zoom animation for hero */
  .animate-slow-zoom {
    animation: slowZoom 30s ease-in-out infinite alternate;
  }

  @keyframes slowZoom {
    0% {
      transform: scale(1);
    }
    100% {
      transform: scale(1.1);
    }
  }

  /* Fade transitions */
  .opacity-0 {
    opacity: 0;
  }

  .opacity-100 {
    opacity: 1;
  }

  .scale-95 {
    transform: scale(0.95);
  }

  .scale-100 {
    transform: scale(1);
  }
}

/* Accessibility Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
}
