/* Import Custom Fonts */
@import url('./fonts.css');

/* Grain Texture */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Smooth fade ins */
.fade-in-up {
    animation: fadeInUp 1.2s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #8F5E38;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    font-weight: 500;
}

.skip-link:focus {
    top: 0;
}

/* Accessibility: Screen Reader Only */
.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;
}

.sr-only:focus-visible {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 16px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Accessibility: Focus States */
*:focus-visible {
    outline: 2px solid #8F5E38;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #8F5E38;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Mobile Menu Styles */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: #2C3E50;
    z-index: 50;
    transition: right 0.3s ease-in-out;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-content {
    padding: 80px 24px 24px;
}

.mobile-menu-content a {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid rgba(249, 248, 246, 0.1);
    text-decoration: none;
    color: #F9F8F6;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.mobile-menu-content a:hover,
.mobile-menu-content a:focus {
    color: #E8E6E1;
}

.mobile-menu-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #F9F8F6;
    padding: 8px;
    line-height: 1;
}

.mobile-menu-close:hover,
.mobile-menu-close:focus {
    color: #E8E6E1;
}

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

/* Form Inputs */
.form-input {
    background: transparent;
    border-bottom: 1px solid #E8E6E1;
    padding: 0.5rem 0;
    width: 100%;
    font-family: 'Lora', serif;
    font-size: 1.125rem;
    color: #2C3E50;
    transition: all 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-bottom-color: #8F5E38;
}
.form-input::placeholder {
    color: #A8ABA5;
    font-style: italic;
}

/* Custom Select */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235C5C5C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 1rem;
}

/* Category Component Styles */
category-badge a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}

category-filter nav a {
    text-decoration: none;
    white-space: nowrap;
}

/* Responsive Category Filter */
@media (max-width: 768px) {
    category-filter[layout="grid"] nav {
        grid-template-columns: 1fr;
    }
}
