/*
Theme Name: Loustalot Photography
Theme URI: https://loustalotphotography.co.uk
Author: Loustalot Photography
Description: Clean & minimal photography theme with manual masonry gallery and YouTube lightbox.
Version: 1.0.0
Text Domain: loustalot-photography
*/

/* --- CSS VARIABLES & THEME BASE --- */
:root {
    --color-bg: #ffffff;
    --color-text: #222222;
    --color-muted: #666666;
    --color-border: #eeeeee;
    --color-accent: #111111;

    /* Dark Mode Variables */
    --color-bg-dark: #111111;
    --color-text-dark: #f5f5f5;
    --color-border-dark: #333333;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- HEADER & NAVIGATION --- */
.lp-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    z-index: 1000;
}

.lp-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
}

/* Constrain Header Logo */
.lp-logo img,
.custom-logo {
    max-height: 45px !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

.lp-logo a {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

/* Desktop Menu Layout */
.lp-nav ul,
.lp-menu-list {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lp-nav a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 15px;
    transition: opacity 0.2s ease;
}

.lp-nav a:hover {
    opacity: 0.65;
}

/* --- HEADER UTILITIES (Inline Search & Dark Mode) --- */
.lp-header-utilities {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 18px;
}

/* Button & Form Resets */
.lp-header-utilities button,
.lp-header-utilities input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* --- EXPANDING INLINE SEARCH STYLING --- */
.lp-search-container {
    display: flex !important;
    align-items: center !important;
    position: relative !important;
}

.lp-search-icon {
    background: transparent !important;
    border: none !important;
    padding: 4px !important;
    cursor: pointer !important;
    color: var(--color-text, #222222) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
}

.lp-search-form {
    width: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    transition: width 0.3s ease, opacity 0.2s ease !important;
    margin-left: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* Expanded state when .active class is applied */
.lp-search-container.active .lp-search-form {
    width: 170px !important;
    opacity: 1 !important;
    margin-left: 8px !important;
}

.lp-search-input {
    width: 100% !important;
    border: none !important;
    border-bottom: 1px solid var(--color-text, #222222) !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 2px 4px !important;
    font-size: 13px !important;
    color: var(--color-text, #222222) !important;
    outline: none !important;
}

body.dark-mode .lp-search-icon,
body.lp-dark .lp-search-icon {
    color: #ffffff !important;
}

body.dark-mode .lp-search-input,
body.lp-dark .lp-search-input {
    border-color: #ffffff !important;
    color: #ffffff !important;
}

/* Dark Mode Toggle Icon Switcher */
.lp-dark-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.lp-dark-toggle:hover {
    opacity: 0.65;
}

/* Default (Light Mode): Show Moon, Hide Sun */
.lp-dark-toggle .icon-moon {
    display: block !important;
}
.lp-dark-toggle .icon-sun {
    display: none !important;
}

/* Active Dark Mode State */
body.dark-mode .lp-dark-toggle .icon-moon,
body.lp-dark .lp-dark-toggle .icon-moon {
    display: none !important;
}

body.dark-mode .lp-dark-toggle .icon-sun,
body.lp-dark .lp-dark-toggle .icon-sun {
    display: block !important;
    color: #ffffff;
}

/* --- DARK MODE STYLING OVERRIDES --- */
body.dark-mode,
body.lp-dark {
    background: var(--color-bg-dark);
    color: var(--color-text-dark);
}

body.dark-mode .lp-header,
body.lp-dark .lp-header,
body.dark-mode .lp-footer,
body.lp-dark .lp-footer {
    background: var(--color-bg-dark);
    border-color: var(--color-border-dark);
}

body.dark-mode .lp-nav a,
body.lp-dark .lp-nav a,
body.dark-mode .lp-logo a,
body.lp-dark .lp-logo a {
    color: var(--color-text-dark);
}

/* --- MASONRY GALLERY & LINKS --- */
.masonry-link {
    display: block;
    overflow: hidden;
    text-decoration: none;
}

.masonry-img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.masonry-link:hover .masonry-img {
    transform: scale(1.02);
    opacity: 0.95;
}

/* --- CONTACT FORM PAGE --- */
.lp-contact-inner {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
}

.lp-contact-form input,
.lp-contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text);
}

.lp-contact-form textarea {
    height: 150px;
}

/* --- FOOTER --- */
.lp-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 30px;
    text-align: center;
    color: var(--color-muted);
    font-size: 14px;
}

/* --- MOBILE STYLES --- */
.lp-mobile-menu-toggle {
    display: none;
}

@media screen and (max-width: 768px) {
    .lp-mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 5px;
    }

    .lp-hamburger-bar {
        display: block;
        width: 18px;
        height: 2px;
        background-color: var(--color-text);
    }

    body.dark-mode .lp-hamburger-bar,
    body.lp-dark .lp-hamburger-bar {
        background-color: #ffffff;
    }

    .lp-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 20px 0;
        text-align: center;
    }

    .lp-nav.is-active {
        display: block;
    }

    .lp-nav ul {
        flex-direction: column;
        gap: 15px;
    }
}

/* FORCE VISIBILITY FOR SEARCH TOGGLE */
#lp-search-container {
    display: flex !important;
    align-items: center !important;
    position: relative !important;
}

#lp-search-container .lp-search-form {
    width: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    display: flex !important;
}

#lp-search-container.active .lp-search-form {
    width: 180px !important;
    opacity: 1 !important;
    margin-left: 8px !important;
    overflow: visible !important;
}

#lp-search-container .lp-search-input {
    width: 100% !important;
    border: none !important;
    border-bottom: 1px solid #222 !important;
    background: transparent !important;
    padding: 2px 5px !important;
    font-size: 14px !important;
    outline: none !important;
}

body.dark-mode #lp-search-container .lp-search-input {
    border-color: #fff !important;
    color: #fff !important;
}

/* 3-Column Footer Styling */
.site-footer {
    background-color: transparent;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid #eee;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.footer-col {
    flex: 1;
    text-align: center;
}

.footer-heading {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.6;
}

/* Mobile Responsive adjustment */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        gap: 30px;
    }
}

/* Header Action Group Alignment */
.lp-header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Basket Icon Styling */
.lp-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111111;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.lp-cart-icon:hover {
    opacity: 0.6;
}

body.dark-mode .lp-cart-icon,
body.lp-dark .lp-cart-icon {
    color: #ffffff;
}

/* Item Counter Badge */
.lp-cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background-color: #111111;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

body.dark-mode .lp-cart-count,
body.lp-dark .lp-cart-count {
    background-color: #ffffff;
    color: #111111;
}

/* Featured Asymmetric Grid Layout */
.lp-featured-grid-container {
    max-width: 1280px;
    margin: 30px auto;
    padding: 0 20px;
}

.lp-promo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 15px;
}

/* First Item spans 2 rows on desktop (Large left feature) */
.lp-promo-card.lp-promo-large {
    grid-row: span 2;
    min-height: 550px;
}

.lp-promo-card.lp-promo-small {
    min-height: 265px;
}

.lp-promo-card {
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    background-color: #f5f5f5;
}

.lp-promo-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lp-promo-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.lp-promo-card:hover .lp-promo-bg img {
    transform: scale(1.04);
}

/* Overlay & Text Styles */
.lp-promo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 60%);
    display: flex;
    align-items: flex-end;
    padding: 30px;
}

.lp-promo-content {
    color: #ffffff;
    text-align: left;
}

.lp-promo-title {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    color: #ffffff !important;
}

.lp-promo-btn {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 4px;
    color: #ffffff;
    font-weight: 600;
}

/* Mobile: Automatically stacks top to bottom */
@media (max-width: 768px) {
    .lp-promo-grid {
        grid-template-columns: 1fr;
    }
    
    .lp-promo-card.lp-promo-large,
    .lp-promo-card.lp-promo-small {
        grid-row: auto;
        min-height: 350px;
    }
}