:root {
    /* Moroccan Color Palette */
    --color-primary: #C15B34;
    /* Terracotta/Ochre */
    --color-secondary: #0F4C81;
    /* Majorelle Blue */
    --color-accent: #E8B923;
    /* Saffron Yellow */
    --color-bg: #F9F5F0;
    /* Sand/Off-white */
    --color-text: #333333;
    --color-text-light: #666666;
    --color-white: #FFFFFF;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/pattern.png');
    background-repeat: repeat;
    background-size: 400px;
    /* Adjust size as needed */
    opacity: 0.25;
    /* Darker visibility */
    z-index: -1;
    pointer-events: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.card-image {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

/* Unifying Aesthetic Filter */
.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(193, 122, 62, 0.2), rgba(0, 0, 0, 0.1));
    /* Warm Moroccan tint */
    mix-blend-mode: overlay;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Apply filter to the background image directly via a separate class or just on the div */
.card-image {
    filter: sepia(0.2) contrast(1.1) saturate(1.1);
    /* Subtle warm filter */
}

.card:hover .card-image::after {
    opacity: 0.8;
}

ul {
    list-style: none;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--color-primary);
    cursor: pointer;
}

.btn:hover {
    background-color: transparent;
    color: var(--color-primary);
}

.btn-secondary {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.btn-secondary:hover {
    color: var(--color-secondary);
}

/* Zellige Pattern Accent (CSS Gradient approximation) */
.zellige-accent {
    height: 10px;
    background-image:
        linear-gradient(45deg, var(--color-secondary) 25%, transparent 25%, transparent 75%, var(--color-secondary) 75%, var(--color-secondary)),
        linear-gradient(45deg, var(--color-secondary) 25%, transparent 25%, transparent 75%, var(--color-secondary) 75%, var(--color-secondary));
    background-position: 0 0, 10px 10px;
    background-size: 20px 20px;
    opacity: 0.8;
}

/* Navbar */
.navbar {
    background-color: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-links a {
    font-weight: 600;
    color: var(--color-text);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 5px;
    margin-left: 20px;
}

.lang-btn {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    filter: grayscale(100%);
    opacity: 0.7;
    touch-action: manipulation;
    /* Prevents double-tap zoom on mobile */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    /* Better tap feedback on iOS */
    min-width: 40px;
    /* Larger tap target for mobile */
    min-height: 40px;
    /* Larger tap target for mobile */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover,
.lang-btn:active,
.lang-btn.active {
    filter: grayscale(0%);
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-secondary);
}

.mobile-menu {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid #eee;
}

.mobile-menu a {
    padding: 0.5rem 0;
    color: var(--color-text);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .lang-switcher {
        margin-left: auto;
        margin-right: 15px;
    }
}

.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../assets/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    margin-bottom: var(--spacing-xl);
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--color-white);
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
}

/* Section Styling */
.section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--color-secondary);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    margin: var(--spacing-sm) auto 0;
}

/* Card Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
}

.card-image {
    height: 200px;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
}

.card-content {
    padding: var(--spacing-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.card-meta {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
    display: flex;
    gap: 10px;
}

.card-desc {
    margin-bottom: var(--spacing-md);
    flex-grow: 1;
}

/* Footer */
footer {
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/pattern.png');
    background-repeat: repeat;
    background-size: 300px;
    opacity: 0.1;
    pointer-events: none;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.footer-brand h3 {
    color: var(--color-accent);
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
}

.footer-brand p {
    opacity: 0.9;
    margin-bottom: var(--spacing-md);
    max-width: 300px;
}

.footer-contact h3 {
    color: var(--color-accent);
    font-size: 1.4rem;
    margin-bottom: var(--spacing-md);
}

.footer-contact ul li {
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact ul li i {
    color: var(--color-accent);
    width: 20px;
}

/* Social Icons Redesign */
.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--color-white);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    /* Ensure no underline */
}

.social-icon:hover {
    background-color: var(--color-accent);
    color: var(--color-secondary);
    transform: translateY(-3px);
    border-color: var(--color-accent);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Ensure FontAwesome icons are visible */
.fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    font-size: 0.9rem;
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
        /* Mobile menu to be implemented */
    }
}

/* Tour Header with Zellije Pattern */
.tour-header {
    background-color: var(--color-secondary);
    background-image: url('../assets/images/pattern.png');
    background-repeat: repeat;
    background-size: 400px;
    padding: var(--spacing-xl) 0;
    color: var(--color-white);
    text-align: center;
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.tour-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 76, 129, 0.85);
    /* Majorelle Blue with opacity */
    /* Overlay to ensure text readability and color */
    z-index: 0;
}

.tour-header .container {
    position: relative;
    z-index: 1;
}

.tour-header h1 {
    color: var(--color-white);
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tour-meta {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    font-size: 1.1rem;
    flex-wrap: wrap;
}

.tour-meta span {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 150px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.gallery-item:hover img {
    filter: brightness(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tour-header h1 {
        font-size: 2rem;
    }

    .tour-meta {
        gap: var(--spacing-sm);
        font-size: 0.9rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Anti-flicker */
body {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

body.loaded {
    opacity: 1;
}
