/* ==========================================================================
   Component Styles - GEWEL
   ========================================================================== */

/* Import tokens */
@import url('./tokens.css');

/* ==========================================================================
   Header Component
   ========================================================================== */

/* Top Language Band */
.top-band {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-band-height);
    background: var(--olive-900);
    z-index: calc(var(--z-header) + 1);
    display: flex;
    align-items: center;
}

.top-band-content {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: flex-end;
}

.language-switcher {
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.language-switcher a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-base);
}

.language-switcher a:hover,
.language-switcher a.active {
    color: #fff;
}

.language-switcher span {
    color: rgba(255, 255, 255, 0.3);
}

/* Site Header - Transparent */
.site-header {
    position: fixed;
    inset: var(--top-band-height) 0 auto 0;
    z-index: var(--z-header);
    background: transparent;
    transition: background var(--transition-base), box-shadow var(--transition-base);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    position: relative;
}

/* Logo */
.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: var(--r-sm);
    padding: 8px 12px;
    position: relative;
}

.header-logo a:focus {
    outline: 2px solid var(--gold-500);
    outline-offset: 2px;
}

.header-logo img {
    height: 48px;
    width: auto;
    transition: filter var(--transition-base);
    /* Default state: white logo (inverted) */
    filter: brightness(0) invert(1);
}

/* Scrolled/force-white state: normal logo (black) */
.site-header.scrolled .header-logo img,
.site-header.force-white .header-logo img {
    filter: none;
}

/* Navigation */
.header-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.nav li {
    position: relative;
}

/* Cacher le sélecteur de langue sur desktop */
.nav .mobile-lang-switcher {
    display: none;
}

.nav a {
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: var(--r-md);
    transition: background var(--transition-fast), color var(--transition-fast);
    font-weight: var(--font-medium);
    font-size: 15px;
    display: block;
    white-space: nowrap;
}

.nav a:hover,
.nav a:focus {
    background: #fff !important; /* Force white background on hover always */
    color: var(--ink-900) !important;
}

.nav a:focus {
    outline: 2px solid var(--gold-500);
    outline-offset: 2px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: #fff;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-medium);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base);
    padding: 12px 0;
    margin-top: 8px;
    z-index: var(--z-dropdown);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    color: var(--ink-700);
    padding: 12px 20px;
    border-radius: 0;
    font-size: 14px;
    font-weight: var(--font-regular);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-menu a:hover {
    background: var(--paper);
    color: var(--gold-600);
}

/* Scrolled State */
.site-header.scrolled,
.site-header.force-white {
    background: #fff;
    box-shadow: var(--shadow-subtle);
}

.site-header.scrolled .header-logo a,
.site-header.force-white .header-logo a {
    color: var(--ink-900);
}

.site-header.scrolled .nav a,
.site-header.force-white .nav a {
    color: var(--ink-900);
}

/* Hover behavior is handled by the base nav styles with !important */

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-toggle span {
    display: block;
    height: 2px;
    width: 20px;
    background: #fff;
    border-radius: 2px;
    transition: all var(--transition-base);
    pointer-events: none;
}

.mobile-toggle span + span {
    margin-top: 5px;
}

.site-header.scrolled .mobile-toggle span,
.site-header.force-white .mobile-toggle span {
    background: var(--ink-900);
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .top-band {
        display: none;
    }

    .site-header {
        inset: 0 0 auto 0;
    }

    .header-nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        transform: none !important;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 9990;
        overflow-y: auto;
        padding: 80px 0 40px 0;
        box-sizing: border-box;
    }

    .header-nav.nav-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .header-nav .nav {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 0 24px;
        list-style: none;
        margin: 0;
    }

    .header-nav .nav li {
        width: 100%;
        text-align: center;
    }

    .header-nav .nav li a {
        font-size: 18px;
        color: var(--ink-900);
        padding: 10px 20px;
        display: block;
        text-align: center;
    }

    .header-nav .nav li a:hover {
        color: var(--gold-500);
    }

    /* Désactiver le hover dropdown sur mobile */
    .dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
    }

    /* Dropdown accordion sur mobile */
    .header-nav .dropdown > a {
        position: relative;
    }

    .header-nav .dropdown > a::after {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        margin-left: 8px;
        transition: transform 0.3s ease;
        vertical-align: middle;
    }

    .header-nav .dropdown.accordion-open > a::after {
        transform: rotate(-135deg);
    }

    .header-nav .dropdown-menu {
        position: static !important;
        max-height: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: none !important;
        box-shadow: none !important;
        background: var(--grey-100) !important;
        border-radius: var(--r-md);
        padding: 0 !important;
        min-width: auto !important;
        margin: 0 20px !important;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    }

    .header-nav .dropdown.accordion-open .dropdown-menu {
        max-height: 400px !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 8px 0 !important;
        margin-top: 8px !important;
    }

    .header-nav .dropdown-menu a {
        font-size: 14px;
        padding: 8px 16px;
        color: var(--ink-600);
        text-align: center;
        display: block;
    }

    .header-nav .dropdown-menu a:hover {
        color: var(--gold-500);
        background: transparent !important;
    }

    .mobile-toggle {
        display: flex;
        position: relative;
        z-index: 9999;
    }

    /* Quand menu ouvert, fixer le toggle */
    .mobile-toggle.active {
        position: fixed;
        top: 26px;
        right: 24px;
    }

    /* Hamburger animation */
    .mobile-toggle span {
        position: absolute;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .mobile-toggle span:nth-child(1) {
        transform: translateY(-6px);
    }

    .mobile-toggle span:nth-child(2) {
        transform: translateY(0);
    }

    .mobile-toggle span:nth-child(3) {
        transform: translateY(6px);
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: translateY(0) rotate(45deg);
    }

    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .mobile-toggle.active span:nth-child(3) {
        transform: translateY(0) rotate(-45deg);
    }

    /* Forcer couleur noire quand menu ouvert */
    .mobile-toggle.active span {
        background: var(--ink-900);
    }

    .header-logo img {
        height: 28px;
    }

    /* Mobile Language Switcher */
    .nav .mobile-lang-switcher {
        display: flex;
        justify-content: center;
        gap: 16px;
        margin-top: var(--g-md);
        padding-top: var(--g-md);
        border-top: 1px solid var(--grey-300);
        width: 100%;
    }

    .mobile-lang-switcher a {
        color: var(--ink-600);
        text-decoration: none;
        font-size: 14px;
        font-weight: var(--font-medium);
        padding: 8px 12px;
        border-radius: var(--r-md);
        transition: all var(--transition-fast);
    }

    .mobile-lang-switcher a:hover,
    .mobile-lang-switcher a.active {
        color: var(--gold-600);
        background: var(--gold-100);
    }

    .mobile-lang-switcher a.active {
        font-weight: var(--font-semibold);
    }
}

/* Body scroll lock quand menu ouvert */
body.menu-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .header-content {
        height: 70px;
    }

    .header-logo img {
        height: 24px;
    }

    .header-nav .nav li a {
        font-size: 20px;
    }

    .header-nav .dropdown-menu a {
        font-size: 14px;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 26px;
    border-radius: var(--r-xl);
    font-size: 16px;
    font-weight: var(--font-medium);
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gold-500);
    color: #111;
}

.btn-primary:hover {
    background: var(--gold-600);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(191, 161, 116, 0.35);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--gold-500);
    color: var(--gold-500);
    position: relative;
    overflow: hidden;
}

.btn-ghost::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gold-500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
    z-index: -1;
}

.btn-ghost:hover {
    color: #111;
    border-color: var(--gold-600);
}

.btn-ghost:hover::before {
    transform: scaleX(1);
}

.btn-ghost-small {
    background: transparent;
    border: 1px solid var(--gold-500);
    color: var(--gold-500);
    padding: 8px 16px;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: var(--font-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
}

.btn-ghost-small:hover {
    background: var(--gold-500);
    color: #111;
    border-color: var(--gold-600);
}

.btn-white {
    background: #fff;
    color: var(--ink-900);
}

.btn-white:hover {
    background: var(--paper);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: #fff;
    border-radius: var(--r-lg);
    padding: var(--g-md);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

/* Service Cards with Hover Overlay */
.service-card {
    position: relative;
    background: #fff;
    border-radius: var(--r-lg);
    padding: var(--g-md);
    height: 100%;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(191, 161, 116, 0.08);
}

.service-card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--g-sm);
    color: var(--gold-500);
}

.service-card-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
}

.service-card h3 {
    font-size: 22px;
    font-weight: var(--font-semibold);
    margin-bottom: var(--g-xs);
    color: var(--ink-900);
}

.service-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 243, 238, 0.98) 100%);
    padding: var(--g-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    backdrop-filter: blur(10px);
}

.service-card:hover .service-card-overlay {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Images and Media
   ========================================================================== */

.figure-gold {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
}

.figure-gold::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 10px;
    background: var(--gold-500);
}

/* Alternative gold corner accent */
.figure-gold-corner::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--gold-500);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    z-index: 1;
}

/* Video Background */
.video-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-bg iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    min-width: 177.78vh; /* 16:9 aspect ratio */
    min-height: 56.25vw; /* 16:9 aspect ratio */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.video-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 2;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

input,
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--grey-300);
    border-radius: var(--r-md);
    font-size: 16px;
    font-family: var(--font-body);
    background: #fff;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--gold-300);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(191, 161, 116, 0.1);
}

label {
    display: block;
    font-weight: var(--font-medium);
    margin-bottom: 8px;
    color: var(--ink-900);
}

.required {
    color: var(--gold-500);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
}

.text-center {
    text-align: center;
}

.text-gold {
    color: var(--gold-500);
}

.bg-grey {
    background: var(--grey-200);
}

.bg-paper {
    background: var(--paper);
}

/* ============================================
   8. FOOTER
   ============================================ */

.site-footer {
    background: var(--olive-900);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--g-lg) 0 var(--g-sm);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--g-md);
    margin-bottom: var(--g-md);
}

.footer-col h2 {
    color: var(--gold-500);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.footer-col h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-col p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.footer-col nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.footer-col nav a:hover {
    color: var(--gold-500);
}

.footer-col address {
    font-style: normal;
    font-size: 14px;
    line-height: 1.6;
}

.footer-col address a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-col address a:hover {
    color: var(--gold-500);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--g-sm);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 14px;
}

/* Simple footer fallback */
.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 0;
    font-size: 14px;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .top-band {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--g-sm);
    }

    .footer-col {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-col nav {
        align-items: center;
    }

    .footer-logo {
        display: block;
        width: 160px;
        max-width: 160px;
        margin: 0 auto 16px auto;
    }
}