/*
Theme Name: LeatherMen Cymru
Description: Custom bilingual theme for LeatherMen Cymru.
Version: 1.8.3
*/

/* --- VARIABLES --- */
:root {
    --color-bg: #111111;
    --color-surface: #1a1e24;
    --color-border: #333333;
    --color-dragon-red: #D3202A;
    --color-royal-blue: #2B3990;
    --color-hardware-silver: #E0E0E0;
    --color-text-primary: #F0F0F0;
    --color-text-secondary: #9ba3af;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

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

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

a { 
    color: var(--color-hardware-silver); 
    text-decoration: none; 
    transition: 0.2s ease; 
}

a:hover { 
    color: var(--color-dragon-red); 
}

.site-container { 
    max-width: 1300px; 
    margin: 0 auto; 
    padding: 0 1.5rem; 
}

/* --- TYPOGRAPHY & CONTENT SPACING --- */
p {
    margin-bottom: 1.5rem;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

p:last-child, 
ul:last-child, 
ol:last-child {
    margin-bottom: 0;
}

/* --- HEADER & NAVIGATION --- */
.site-header { 
    background: #0a0a0a; 
    border-bottom: 2px solid var(--color-dragon-red); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    padding: 1.2rem 0; 
    text-transform: uppercase; 
}

/* Desktop Grid Layout */
.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto auto; /* Logo | Spacer | Links | Controls */
    grid-template-rows: auto auto; /* Top Row | Bottom Row */
    row-gap: 0.4rem; 
    align-items: center;
}

/* 1. Logo (Left, spans both rows) */
.site-logo { 
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    align-self: center;
}

.site-logo a {
    font-family: var(--font-heading); 
    font-size: 1.5rem; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem;
}

.site-logo img {
    max-height: 60px;
    width: auto;
    display: block;
}

/* 2. Pinned Navigation (Top Row, Right) */
.pinned-nav-container {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    justify-self: end;
    align-self: end;
}

.pinned-links {
    display: flex; 
    gap: 1.5rem; 
    list-style: none; 
    align-items: center;
    font-family: var(--font-heading); 
    font-size: 1.1rem; 
    letter-spacing: 1px;
    margin: 0; 
    padding: 0;
}

/* 3. Controls (Top Row, Far Right) */
.header-controls {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
    justify-self: end;
    align-self: end;
    display: flex;
    align-items: center;
    border-left: 1px solid var(--color-border);
    padding-left: 1.5rem;
    margin-left: 1.5rem;
}

.language-switcher ul { 
    display: flex; 
    gap: 0.5rem; 
    list-style: none; 
    margin: 0; 
    padding: 0; 
}

.language-switcher li.current-lang a { 
    color: var(--color-dragon-red); 
    font-weight: bold; 
}

/* 4. Main Navigation (Bottom Row, Right, Tucked under top links) */
.main-navigation {
    grid-column: 3 / 5; 
    grid-row: 2 / 3;
    justify-self: end;
    align-self: start;
    display: flex;
    align-items: center;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.nav-menu-wrapper, .nav-menu-wrapper div { 
    display: flex; 
    align-items: center; 
}

.nav-links {
    display: flex; 
    gap: 1.5rem; 
    list-style: none; 
    align-items: center;
    font-family: var(--font-heading); 
    font-size: 0.95rem; 
    letter-spacing: 1px;
    margin: 0; 
    padding: 0;
    color: var(--color-text-secondary);
}

/* --- DROPDOWN MENUS --- */
.nav-links li {
    position: relative; 
}

.nav-links .menu-item-has-children > a::after,
.nav-links .page_item_has_children > a::after {
    content: "";
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
    border-top: 5px solid currentColor;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    transition: transform 0.2s ease;
}

.nav-links ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #0a0a0a;
    border: 1px solid var(--color-border);
    border-top: 2px solid var(--color-dragon-red);
    min-width: 240px;
    padding: 0;
    margin: 0;
    z-index: 9999;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.8);
    border-radius: 0 0 4px 4px;
    list-style: none;
}

.nav-links li:hover > ul {
    display: block;
}

.nav-links li:hover > a::after {
    transform: rotate(180deg);
}

.nav-links ul li {
    display: block;
    width: 100%;
    margin-bottom: 0;
}

.nav-links ul a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    text-transform: capitalize; 
    border-bottom: 1px solid #1a1e24;
}

.nav-links ul li:last-child a {
    border-bottom: none;
}

.nav-links ul a:hover {
    background-color: #1a1e24;
    color: var(--color-dragon-red);
}

/* --- HERO SECTION --- */
.hero-banner { 
    position: relative; 
    width: 100%; 
    min-height: 500px; 
    background-size: cover; 
    background-position: center; 
    display: flex; 
    align-items: flex-end; 
    padding-bottom: 3rem; 
    border-bottom: 4px solid #000; 
}

.hero-overlay { 
    position: absolute; 
    inset: 0; 
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 100%); 
    z-index: 1; 
}

.hero-content { 
    position: relative; 
    z-index: 2; 
    text-align: center; 
    width: 100%; 
}

.hero-tagline { 
    font-family: var(--font-heading); 
    font-size: 2.5rem; 
    letter-spacing: 2px; 
    margin-bottom: 1.5rem; 
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8); 
}

.hero-tagline .divider { 
    color: var(--color-dragon-red); 
    margin: 0 0.5rem; 
}

.hero-tagline em { 
    font-style: normal; 
    color: var(--color-text-secondary); 
}

.btn-primary { 
    display: inline-block; 
    background-color: var(--color-dragon-red); 
    color: #fff; 
    font-family: var(--font-heading); 
    padding: 0.75rem 2rem; 
    font-size: 1.2rem; 
    font-weight: bold; 
    border-radius: 4px; 
    text-transform: uppercase; 
    transition: background 0.3s; 
}

.btn-primary:hover { 
    background-color: #a81921; 
    color: #fff; 
}

/* --- HOME LAYOUT & ABOUT BLOCK --- */
.home-layout { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 2rem; 
    margin-top: 3rem; 
    margin-bottom: 4rem; 
    align-items: flex-start; 
}

.about-block { 
    background-color: var(--color-surface); 
    border: 1px solid #2a303a; 
    border-radius: 8px; 
    padding: 2.5rem; 
    position: relative; 
    overflow: hidden; 
}

.section-title { 
    font-family: var(--font-heading); 
    font-size: 1.5rem; 
    margin-bottom: 1rem; 
}

.section-title span { 
    color: var(--color-text-secondary); 
    font-weight: 400; 
}

.about-content p { 
    color: #c4cad3; 
}

.text-link { 
    border-bottom: 1px solid var(--color-hardware-silver); 
    padding-bottom: 2px; 
}

/* --- EVENTS ARCHIVE GRID --- */
.events-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); 
    gap: 2rem; 
    margin: 2rem 0; 
}

/* --- EVENT CARDS --- */
.home-events-feed { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 1.5rem; 
}

.event-card { 
    background: #0f0f0f; 
    border: 1px solid #333; 
    border-radius: 8px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
}

.event-card::before, .event-card::after { 
    content: ''; 
    position: absolute; 
    width: 12px; 
    height: 12px; 
    border: 2px solid #555; 
    border-radius: 50%; 
    z-index: 10; 
}
.event-card::before { top: 10px; left: 10px; }
.event-card::after { top: 10px; right: 10px; }

.event-content { 
    padding: 1.2rem; 
}

.event-title { 
    font-family: var(--font-heading); 
    font-size: 1.2rem; 
    margin-bottom: 0.5rem; 
    text-transform: uppercase; 
}

.event-meta { 
    font-size: 0.9rem; 
    color: var(--color-text-secondary); 
    margin-bottom: 1rem; 
    display: flex; 
    flex-direction: column; 
    gap: 0.3rem; 
}

.dress-code-footer { 
    margin-top: auto; 
    padding-top: 0.8rem; 
    border-top: 1px dashed #333; 
    color: var(--color-dragon-red); 
    font-size: 0.85rem; 
    font-weight: bold; 
    text-transform: uppercase; 
}

/* --- FOOTER & SOCIALS --- */
.site-footer { 
    background: #0d0d0d; 
    border-top: 1px solid var(--color-border); 
    padding: 2rem 0; 
    margin-top: 4rem; 
}

.footer-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.25rem;
}

.footer-socials a {
    color: var(--color-hardware-silver);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-socials a:hover {
    color: var(--color-dragon-red);
    transform: translateY(-3px);
}

/* --- MOBILE RESPONSIVE --- */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-hardware-silver);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 900px) {
    .home-layout { grid-template-columns: 1fr; }
    .hero-tagline { font-size: 1.8rem; }
    
    /* Bulletproof Mobile Grid Header */
    .header-inner {
        display: grid !important;
        grid-template-columns: 1fr auto; /* Logo on left, Controls on right */
        grid-template-rows: auto auto; /* Explicitly define 2 rows */
        gap: 1rem 0;
        align-items: center;
    }

    /* Row 1, Left */
    .site-logo { 
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        justify-self: start;
    }

    /* Row 1, Right */
    .header-controls {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        justify-self: end;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        gap: 1rem;
    }

    /* Row 2, Full Width */
    .pinned-nav-container {
        grid-column: 1 / 3;
        grid-row: 2 / 3;
        width: 100%;
        display: flex;
        justify-content: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .pinned-nav-container::-webkit-scrollbar {
        display: none; 
    }

    .pinned-links {
        gap: 1.25rem;
        font-size: 0.9rem;
        white-space: nowrap; 
    }

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

    /* Row 3, Full Width (Hidden until opened) */
    .main-navigation {
        grid-column: 1 / 3;
        grid-row: 3 / 4;
        display: none; 
        width: 100%;
        flex-direction: column;
        background: #0a0a0a;
        border-top: 1px solid var(--color-border);
        border-bottom: 2px solid var(--color-dragon-red);
        padding: 2rem 0;
        margin-top: 1rem;
        margin-left: 0;
    }

    .main-navigation.is-open { 
        display: flex; 
    }

    .nav-menu-wrapper { 
        width: 100%; 
        justify-content: center; 
    }

    .nav-links { 
        flex-direction: column; 
        text-align: center; 
        gap: 1.5rem; 
        width: 100%; 
    }

    /* Mobile Dropdown Reset */
    .nav-links ul {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px dashed var(--color-border);
        margin-top: 1rem;
        background-color: transparent;
        display: none; 
    }
    
    .nav-links ul a {
        padding: 0.8rem;
        text-align: center;
        border-bottom: none;
    }

    /* Hamburger "X" Animation */
    .mobile-menu-toggle.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-menu-toggle.is-active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    
    /* Enforce Media & Text block stacking on mobile */
    .wp-block-media-text {
        grid-template-columns: 100% !important;
        gap: 1.5rem;
    }
    
    .wp-block-media-text .wp-block-media-text__media {
        grid-column: 1;
        grid-row: 1;
    }
    
    .wp-block-media-text .wp-block-media-text__content {
        grid-column: 1;
        grid-row: 2;
        padding: 0 !important; 
    }
}

/* --- CUSTOM FORM WIDGET / LOOKUP CARD --- */

.lookup-card {
    /* max-width: 440px; */
    margin: 2rem 0; /* Left-aligns the card instead of centering it */
    padding: 2rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    font-family: var(--font-body);
    color: var(--color-text-primary);
}

.lookup-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: left; /* Adjusted to match the left-aligned card */
    text-transform: uppercase;
    color: var(--color-text-primary);
}

.lookup-toggle-group {
    display: flex;
    background-color: #0a0a0a; 
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 4px;
    margin-bottom: 1.5rem;
}

.toggle-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    color: var(--color-hardware-silver);
}

.toggle-btn.active {
    background-color: var(--color-surface);
    color: var(--color-dragon-red);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background-color: #0a0a0a;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-dragon-red);
    box-shadow: 0 0 0 2px rgba(211, 32, 42, 0.2);
}

.form-group input::placeholder {
    color: #555555;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--color-dragon-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
}

.submit-btn:hover {
    background-color: #a81921;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-box {
    margin-top: 1.5rem;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

.result-box.success {
    background-color: rgba(22, 101, 52, 0.2);
    border: 1px solid #166534;
    color: #86efac;
}

.result-box.error {
    background-color: rgba(153, 27, 27, 0.2);
    border: 1px solid #991b1b;
    color: #fca5a5;
}

.result-box.warning {
    background-color: rgba(133, 77, 14, 0.2);
    border: 1px solid #854d0e;
    color: #fde047;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}