/* ============================================
   PHINOLOGY COFFEE - CUSTOM STYLES
   Supplementary styles for Tailwind CSS
   ============================================ */

/* ============================================
   ROOT VARIABLES
   These can be easily modified for theming
   ============================================ */
:root {
    --scroll-offset: 80px;
}

/* ============================================
   CUSTOM SCROLLBAR (Webkit browsers)
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #b08968;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8b6f47;
}

/* ============================================
   SMOOTH SCROLL OFFSET
   Accounts for fixed navbar when jumping to sections
   ============================================ */
html {
    scroll-padding-top: var(--scroll-offset);
}

/* ============================================
   FONT SMOOTHING
   Ensures crisp text rendering across browsers
   ============================================ */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   FOCUS STYLES
   Accessibility-friendly focus indicators
   ============================================ */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #8b6f47;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   IMAGE OPTIMIZATION
   Prevents layout shift and ensures smooth loading
   ============================================ */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ============================================
   CUSTOM ANIMATIONS
   Subtle entrance animations for better UX
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply fade-in animation to sections as they come into view */
/* This can be enhanced with Intersection Observer API for better performance */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* ============================================
   HERO SECTION ENHANCEMENTS
   ============================================ */
#home {
    position: relative;
    isolation: isolate;
}

/* Ensure hero image doesn't cause layout shift */
#home img {
    object-position: center;
    min-height: 100vh;
}

/* ============================================
   NAVIGATION ENHANCEMENTS
   ============================================ */
#navbar {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* ============================================
   BUTTON HOVER EFFECTS
   Additional refinement for interactive elements
   ============================================ */
a[class*="bg-coffee"],
button[class*="bg-coffee"] {
    position: relative;
    overflow: hidden;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   Fine-tuning for optimal reading experience
   ============================================ */
@media (max-width: 640px) {
    h1 {
        line-height: 1.2;
    }
    
    p {
        line-height: 1.7;
    }
}

/* ============================================
   MAP CONTAINER
   Ensures iframe doesn't cause issues
   ============================================ */
iframe {
    display: block;
    border: none;
}

/* ============================================
   PRINT STYLES
   Basic print optimization
   ============================================ */
@media print {
    nav,
    footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ============================================
   LOADING STATE (Optional)
   Can be used for lazy-loaded images
   ============================================ */
.loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

/* ============================================
   REDUCED MOTION SUPPORT
   Respects user preferences for reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE SUPPORT
   Better accessibility for high contrast mode users
   ============================================ */
@media (prefers-contrast: high) {
    a,
    button {
        text-decoration: underline;
    }
}
