/* Base styles */
:root {
    --elegant-dark: #282c34;
    --elegant-light: #f8f8f2;
    --elegant-gold: #bda17c;
    --elegant-grey: #cccccc;
    --body-font: 'Lato', sans-serif;
}

/* Utility Classes */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--elegant-dark); /* Use dark background */
    color: var(--elegant-light); /* Default text color for dark theme */
}

/* Header */
header {
    background-color: var(--elegant-dark);
    border-bottom: 1px solid rgba(248, 248, 242, 0.1);
    padding: 1.2rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(40, 44, 52, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 3rem;
    padding: 0 2rem;
    align-items: center;
}

header nav a {
    color: rgba(248, 248, 242, 0.8);
    text-decoration: none;
    font-weight: 400;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

header nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--elegant-gold);
    transition: width 0.3s ease;
}

header nav a:hover {
    color: var(--elegant-gold);
}

header nav a:hover::after {
    width: 100%;
}

header nav a.active {
    color: var(--elegant-gold);
}

header nav a.active::after {
    width: 100%;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 6rem; /* Increased space for fixed header */
}

/* Generic H1 - For non-hero pages */
h1:not(.hero h1) {
    font-size: 2.5rem;
    margin: 2rem 0;
    color: var(--elegant-light);
    padding-top: 4rem; /* Increased padding for header clearance */
}

/* Footer */
footer {
    background-color: var(--elegant-dark);
    color: rgba(248, 248, 242, 0.7); /* Lighter grey text */
    padding: 2.5rem 2rem; /* Adjust padding */
    margin-top: 5rem; /* More space above footer */
    border-top: 1px solid rgba(248, 248, 242, 0.1); /* Subtle top border */
    text-align: center; /* Center align content */
}

footer p {
    margin-bottom: 1rem; /* Space below copyright */
}

footer nav {
    display: flex;
    gap: 1.5rem; /* Adjust gap */
    justify-content: center;
    margin-top: 1rem;
}

footer nav a {
    color: rgba(248, 248, 242, 0.8); /* Lighter text */
    text-decoration: none;
    transition: color 0.3s ease;
}

footer nav a:hover {
    color: var(--elegant-gold); /* Gold on hover */
    text-decoration: none; /* Remove underline on hover */
}

/* Content Links */
main a {
    color: var(--elegant-gold);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

main a:hover {
    border-bottom-color: var(--elegant-gold);
}

main a:visited {
    color: var(--elegant-gold);
}

/* --- Combined and Simplified Styles --- */

/* Hero Section Styles */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), url('/assets/images/11064.jpg');
    background-size: cover;
    background-position: center;
    min-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--elegant-light);
    margin-bottom: 4rem;
    margin-top: -3rem;
    padding: 2rem 1rem;
}

.hero-content {
    max-width: 850px;
    padding: 2rem;
    width: 100%;
}

.hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 5.5rem;
    font-weight: 300;
    margin: 0 0 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--elegant-light);
    text-transform: uppercase;
    background: none;
}

.subtitle {
    font-family: var(--body-font);
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 3rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    color: var(--elegant-gold);
    letter-spacing: 0.5px;
}

/* Search Styles */
.search-label {
    text-align: left;
    margin-bottom: 10px;
    color: rgba(248, 248, 242, 0.85);
    font-family: var(--body-font);
    font-size: 0.9rem;
    font-weight: 300;
}

.search-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

#cocktail-search {
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-family: var(--body-font);
    font-size: 1.1rem;
    border-radius: 5px;
    border: 1px solid rgba(248, 248, 242, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: var(--elegant-light);
    box-shadow: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#cocktail-search::placeholder {
    color: rgba(248, 248, 242, 0.5);
    font-weight: 300;
}

#cocktail-search:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--elegant-gold);
    outline: none;
    box-shadow: 0 0 0 2px rgba(197, 165, 117, 0.3);
}

/* Category Filters Styles */
.category-filters {
    padding: 1rem 2rem 2rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
}

.category-button {
    padding: 0.4rem 0.8rem; /* Added horizontal padding */
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: 400;
    border: none;
    border-bottom: 2px solid transparent; 
    background-color: transparent;
    color: rgba(248, 248, 242, 0.7);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping within buttons */
}

.category-button:hover {
    color: var(--elegant-light);
    border-bottom-color: var(--elegant-grey);
}

.category-button.active {
    color: var(--elegant-gold);
    border-bottom-color: var(--elegant-gold);
    font-weight: 700;
}

/* Cocktail Grid */
.cocktail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: row;
    grid-auto-rows: 1fr;
    gap: 2rem;
    padding: 2rem;
    margin-top: 2rem;
}

/* Cocktail Card */
.cocktail-card {
    grid-column: auto;
    grid-row: auto;
    display: block;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);  /* Reduced shadow opacity */
    background-color: var(--elegant-dark);
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    border: none;
}

.cocktail-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    text-decoration: none; /* Ensure no underline on hover */
    border: none; /* Ensure no border appears on hover */
}

.cocktail-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.cocktail-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
                rgba(0,0,0,0.1) 0%, 
                rgba(0,0,0,0.4) 50%, 
                rgba(0,0,0,0.7) 100%);  /* Made gradient more subtle */
    border: none;
}

.cocktail-card-content { 
    position: relative;
    z-index: 1;
    padding: 15px;  /* Simplified padding */
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    justify-content: flex-end;
    border: none;
    background: none;  /* Ensure no background */
}

.cocktail-card h3 {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.cocktail-card .category {
    font-family: var(--body-font);
    color: #D4AF37;
    font-size: 1.1rem;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0.5rem 0 0;
}

/* Lazy Loading Background Styles */
.lazy-bg {
    background-color: var(--elegant-dark); /* Placeholder color */
    transition: background-image 0.3s ease;
}

.loaded-bg {
    background-size: cover;
    background-position: center;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 3rem 0;
}

.load-more-button {
    padding: 0.8rem 2rem;
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: 400;
    background-color: transparent;
    color: var(--elegant-light);
    border: 1px solid var(--elegant-gold);
    border-radius: 30px; 
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-button:hover {
    background-color: var(--elegant-gold);
    color: var(--elegant-dark);
    border-color: var(--elegant-gold);
}

/* Cocktail Detail Page Specifics */
.cocktail {
    max-width: 800px;
    margin: 0 auto;
}

.cocktail-image {
    margin: 2rem 0;
}

.cocktail-image img {
    max-width: 100%;
    border-radius: 8px;
}

.cocktail-image:not(.loaded) {
    background-color: transparent;
}

.cocktail-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(248, 248, 242, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(189, 161, 124, 0.1);
}

.cocktail-details > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(248, 248, 242, 0.03);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.cocktail-details > div:hover {
    background: rgba(248, 248, 242, 0.08);
    transform: translateY(-2px);
}

.cocktail-details strong {
    color: var(--elegant-gold);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.cocktail-details > div > span {
    color: var(--elegant-light);
    font-size: 1.1rem;
    font-weight: 300;
}

.ingredients ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.ingredients li {
    margin: 0;
    padding: 0.75rem 1rem;
    background: rgba(248, 248, 242, 0.1);
    color: var(--elegant-light);
    border-radius: 6px;
    border-left: 3px solid var(--elegant-gold);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.ingredients li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(189, 161, 124, 0.1);
    transition: width 0.3s ease;
    z-index: 0;
}

.ingredients li:hover {
    transform: translateX(5px);
    background: rgba(248, 248, 242, 0.15);
}

.ingredients li:hover::before {
    width: 100%;
}

.ingredients li span {
    position: relative;
    z-index: 1;
}

.related-cocktails {
    margin-top: 3rem;
}

.related-cocktails h3 {
    /* color: var(--secondary-color); - Original red, doesn't fit theme */
    color: var(--elegant-gold); /* Use gold? */
}

.related-cocktails ul {
    list-style: none;
    padding: 0;
}

.related-cocktails li {
    margin: 0.5rem 0;
}

.related-cocktails a {
    /* color: var(--link-color); - Original blue, doesn't fit theme */
    color: var(--elegant-gold); /* Use gold? */
    text-decoration: none;
}

.related-cocktails a:hover {
    text-decoration: underline;
}

/* Media Queries */
@media (max-width: 992px) {
    .cocktail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem 1rem;
    }

    header nav a {
        font-size: 1rem;
        padding: 0.3rem 0;
    }

    .hero {
        min-height: 50vh;
        margin-top: 0;
        padding: 4rem 1rem 2rem 1rem;
    }

    .hero-content {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2.8rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
        hyphens: auto;
    }

    .subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

    .search-container {
        padding: 0 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .search-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    #cocktail-search {
        font-size: 1rem;
        padding: 0.8rem 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .category-filters {
        padding: 1rem;
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }

    .category-button {
        width: 100%;
        max-width: 300px;
        text-align: center;
        padding: 0.6rem 1rem;
        border: 1px solid rgba(248, 248, 242, 0.2);
        border-radius: 4px;
    }

    .category-button:hover,
    .category-button.active {
        border-color: var(--elegant-gold);
        background-color: rgba(189, 161, 124, 0.1);
    }

    .cocktail-grid {
        padding: 1rem;
    }

    main {
        padding: 1rem;
        padding-top: 5rem; /* Increased padding for mobile */
    }

    h1:not(.hero h1) {
        font-size: 2rem;
        padding-top: 3.5rem; /* Increased padding for mobile */
        margin: 1rem 0 1.5rem;
    }
}

/* Specific adjustments for 360px width devices */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 2.2rem;
        letter-spacing: 0;
    }

    .subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    .hero-content {
        padding: 0.5rem;
    }

    .search-container {
        padding: 0 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    #cocktail-search {
        padding: 0.7rem 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .category-button {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }

    .cocktail-grid {
        padding: 0.5rem;
        gap: 1rem;
    }

    .cocktail-card h3 {
        font-size: 1.5rem;
    }

    .cocktail-card .category {
        font-size: 1rem;
    }

    main {
        padding: 0.8rem;
        padding-top: 5rem; /* Keep consistent with larger mobile view */
    }

    h1:not(.hero h1) {
        font-size: 1.8rem;
        padding-top: 3.5rem; /* Keep consistent with larger mobile view */
        margin: 1rem 0 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }
}