/*
Theme Name: Artisans Plus
Author: Tycoon Concept
Description: A sophisticated directory platform theme for Worker.ng.
Version: 5.2.1
Text Domain: artisans-plus
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@500;600;700;800&display=swap');

:root {
    /* --- Brand Colors --- */
    --primary-color: #007021; /* Worker.ng Green */
    --primary-dark: #005619;
    --primary-light: #e6f0e9; /* Light Green Tint */
    --accent-color: #f1c30c;  /* Worker.ng Yellow/Gold */
    --accent-hover: #dcb30a;
    --dark-bg: #0a2912;       
    
    /* --- Typography & UI --- */
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --border-color: #e5e7eb;
    
    /* --- Dimensions --- */
    --header-height: 80px;
    --container-width: 1280px;
    
    /* --- Animations --- */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-green: 0 10px 25px -5px rgba(0, 112, 33, 0.25);
    
    /* --- Radius --- */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
}

/* =========================================
   1. Reset & Base Styles
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    padding-top: env(safe-area-inset-top);
}

a { text-decoration: none; color: inherit; transition: color var(--transition-fast); }
a:hover { color: var(--primary-color); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, textarea, select { font-family: inherit; }

h1, h2, h3, h4, h5, h6 { 
    font-family: 'Poppins', sans-serif; 
    font-weight: 700; 
    color: var(--dark-bg); 
    margin-bottom: 1rem; 
    line-height: 1.25; 
}

/* =========================================
   2. Layout & Grid
   ========================================= */
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }
.container-fluid { width: 100%; padding: 0; }
.row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.col { padding: 0 12px; }

/* Grid Columns */
.col-12 { width: 100%; }
.col-8 { width: 70%; } 
.col-4 { width: 30%; } 
.col-6 { width: 50%; }

@media (max-width: 992px) {
    .col-8, .col-4 { width: 100%; }
}
@media (max-width: 768px) {
    .col-6 { width: 100%; margin-bottom: 24px; }
}

/* =========================================
   3. Header & Navigation
   ========================================= */
.site-header {
    background: var(--white);
    height: var(--header-height);
    display: flex; align-items: center;
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}
.site-header.is-sticky {
    height: 70px;
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }

/* Logo */
.site-logo { z-index: 1200; display: flex; align-items: center; }
.site-logo img { max-height: 48px; width: auto; }
.site-title { font-size: 1.75rem; margin: 0; color: var(--primary-color); letter-spacing: -0.02em; }
.site-title span { color: var(--accent-color); }

/* Desktop Menu */
.main-navigation.desktop-only { margin-left: auto; margin-right: 30px; }
.main-navigation.desktop-only ul { display: flex; align-items: center; gap: 20px; }
.main-navigation.desktop-only ul li { position: relative; }

.main-navigation.desktop-only ul li a {
    font-weight: 500; font-size: 0.95rem; padding: 8px 0; 
    color: var(--text-color); position: relative;
}

/* Hover Line Animation */
.main-navigation.desktop-only > ul > li:not(:nth-last-child(-n+2)) > a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary-color); transition: width 0.3s ease;
}
.main-navigation.desktop-only > ul > li:not(:nth-last-child(-n+2)) > a:hover { color: var(--primary-color); }
.main-navigation.desktop-only > ul > li:not(:nth-last-child(-n+2)) > a:hover::after { width: 100%; }

/* --- Special Desktop Buttons --- */
/* Login Button */
.main-navigation.desktop-only ul li:nth-last-child(2) a {
    color: var(--primary-color) !important;
    font-weight: 600;
    padding: 10px 24px;
    background: var(--primary-light);
    border-radius: var(--radius-pill);
    transition: var(--transition-fast);
}
.main-navigation.desktop-only ul li:nth-last-child(2) a:hover {
    background: #d4e6db; transform: translateY(-1px);
}

/* Add Artisan Button */
.main-navigation.desktop-only ul li:last-child a {
    background: var(--primary-color);
    color: var(--white) !important;
    padding: 10px 28px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    box-shadow: var(--shadow-green);
    transition: var(--transition-fast);
}
.main-navigation.desktop-only ul li:last-child a:hover {
    background: var(--primary-dark);
    color: var(--accent-color) !important; /* Yellow text on hover */
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(0, 112, 33, 0.3);
}

/* Dropdown Submenus */
.main-navigation ul li ul {
    position: absolute; top: 100%; left: 0;
    background: var(--white); min-width: 240px;
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: var(--transition-smooth);
    border-radius: var(--radius-md); padding: 8px;
    z-index: 999; border: 1px solid var(--border-color);
}
.main-navigation ul li:hover > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.main-navigation ul li ul li a { 
    padding: 10px 16px; border-radius: var(--radius-sm); 
    display: block; width: 100%; 
}
.main-navigation ul li ul li a:hover { background: var(--bg-light); color: var(--primary-color); }

@media (max-width: 1100px) { .main-navigation.desktop-only { display: none; } }

/* --- Header Actions --- */
.header-actions { display: flex; align-items: center; gap: 16px; }

.search-trigger-btn {
    cursor: pointer; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-color); font-size: 1.1rem;
    transition: var(--transition-fast);
    background: transparent;
}
.search-trigger-btn:hover { background: var(--bg-light); color: var(--primary-color); }

/* --- Header Search Overlay --- */
.search-overlay {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: var(--white); padding: 24px 0;
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: var(--transition-smooth); z-index: 900; 
    border-top: 1px solid var(--border-color);
}
.search-overlay.active { opacity: 1; visibility: visible; transform: translateY(0); }
.search-overlay-inner { max-width: 720px; margin: 0 auto; padding: 0 20px; }

.search-form-flex { position: relative; display: flex; align-items: center; width: 100%; }
.search-field-main {
    width: 100%; height: 56px; padding: 0 56px 0 24px;
    border: 2px solid var(--border-color); background: var(--white); 
    font-size: 1.05rem; outline: none; border-radius: var(--radius-pill);
    transition: border-color var(--transition-fast);
}
.search-field-main:focus { border-color: var(--primary-color); }
.search-submit-main {
    position: absolute; right: 6px; top: 6px; width: 44px; height: 44px;
    background: var(--primary-color); color: var(--white); border: none; padding: 0;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 2; transition: var(--transition-fast);
}
.search-submit-main:hover { background: var(--accent-color); color: var(--dark-bg); }

/* =========================================
   4. Mobile Menu
   ========================================= */
.mobile-toggle {
    display: none; cursor: pointer; z-index: 1200; margin-left: 8px;
    width: 48px; height: 48px; align-items: center; justify-content: center;
    background: var(--primary-color); /* Bold Green BG */
    border-radius: 12px; 
    color: var(--white);
    border: 1px solid transparent; 
    box-shadow: 0 4px 10px rgba(0, 112, 33, 0.2);
    transition: all 0.2s;
}
.mobile-toggle:hover { background: var(--primary-dark); }
.mobile-toggle:active { transform: scale(0.95); }

/* Hamburger Icon */
.hamburger { width: 22px; height: 16px; position: relative; }
.hamburger span {
    display: block; position: absolute; height: 2px; width: 100%;
    background: var(--white); border-radius: 4px; left: 0;
    transition: 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.hamburger span:nth-child(1) { top: 0px; }
.hamburger span:nth-child(2) { top: 7px; width: 70%; margin-left: 30%; }
.hamburger span:nth-child(3) { top: 14px; }

/* Active State */
.mobile-toggle.active {
    background: var(--white); color: var(--text-color);
    border-color: var(--border-color); box-shadow: none;
}
.mobile-toggle.active .hamburger span { background: var(--text-color); }
.mobile-toggle.active .hamburger span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.mobile-toggle.active .hamburger span:nth-child(2) { opacity: 0; left: -20px; }
.mobile-toggle.active .hamburger span:nth-child(3) { top: 7px; transform: rotate(-45deg); width: 100%; margin-left: 0; }

@media (max-width: 1100px) { .mobile-toggle { display: flex; } }

/* Mobile Drawer */
.full-screen-menu {
    position: fixed; top: 0; right: -100%; width: 320px; height: 100%;
    background: var(--white); z-index: 2000;
    display: flex; flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    overflow-y: auto; overflow-x: hidden;
    opacity: 1; visibility: visible;
}
.full-screen-menu.open { right: 0; }

.mobile-overlay-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
    z-index: 1999; opacity: 0; visibility: hidden; 
    transition: opacity 0.3s ease;
}
.mobile-overlay-bg.active { opacity: 1; visibility: visible; }

.mobile-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid var(--border-color);
    background: var(--white); position: sticky; top: 0; z-index: 10;
}
.mobile-brand { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--primary-color); font-size: 1.3rem; }

.mobile-menu-close {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-light); border: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-color); font-size: 1.2rem; cursor: pointer;
    transition: all 0.2s;
}
.mobile-menu-close:hover { background: #fee2e2; color: #ef4444; }

.mobile-menu-inner { padding: 24px; flex-grow: 1; display: flex; flex-direction: column; }

/* Mobile Search */
.mobile-drawer-search { 
    margin-bottom: 30px; order: 1; padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}
.mobile-drawer-search .search-field-main { 
    height: 48px; background: var(--bg-light); border: 1px solid transparent; 
}
.mobile-drawer-search .search-field-main:focus { background: var(--white); border-color: var(--primary-color); }
.mobile-drawer-search .search-submit-main { width: 36px; height: 36px; top: 6px; right: 6px; }

/* Mobile Nav Items */
.mobile-nav { order: 3; }
.mobile-nav ul { padding: 0; margin: 0; }
.mobile-nav li { margin-bottom: 0; }
.mobile-nav a {
    font-size: 1rem; font-weight: 500; color: var(--text-color);
    display: block; padding: 14px 0; border-bottom: 1px solid var(--border-color);
    transition: padding 0.2s;
}
.mobile-nav a:hover { color: var(--primary-color); padding-left: 8px; }

/* Hide Desktop Buttons in Mobile List */
.mobile-nav li:last-child, .mobile-nav li:nth-last-child(2) { display: none; }

/* Mobile Drawer Footer (Buttons moved here) */
.mobile-drawer-footer {
    order: 2; margin-bottom: 30px;
    display: flex; flex-direction: column; gap: 12px;
}
.btn-mobile-action {
    display: block; width: 100%; text-align: center; padding: 14px;
    border-radius: var(--radius-md); font-weight: 600; font-size: 1rem;
    transition: transform 0.1s, color 0.1s;
}
.btn-mobile-login {
    background: transparent; border: 2px solid var(--border-color); color: var(--text-color);
}
.btn-mobile-primary {
    background: var(--primary-color); color: var(--white); 
    box-shadow: 0 4px 12px rgba(0, 112, 33, 0.2); border: none;
}
.btn-mobile-primary:active { transform: scale(0.98); }
.btn-mobile-primary:hover { 
    color: var(--accent-color) !important; 
    background: var(--primary-dark);
}

/* =========================================
   5. Standard Search Form (Widgets, 404, No Results)
   ========================================= */
.search-form {
    position: relative; display: flex; width: 100%; max-width: 100%; margin-top: 20px;
}
.search-form .search-field {
    width: 100%; height: 50px; padding: 0 110px 0 20px; /* Space for "Search" button */
    border: 1px solid var(--border-color); border-radius: var(--radius-pill);
    font-family: 'Inter', sans-serif; font-size: 1rem; background: #fff;
    transition: border-color 0.2s;
}
.search-form .search-field:focus { border-color: var(--primary-color); outline: none; }

/* Text Button "Search" */
.search-form .search-submit {
    position: absolute; right: 4px; top: 4px; height: 42px; width: auto;
    padding: 0 24px;
    border-radius: var(--radius-pill); border: none; 
    background: var(--primary-color); 
    color: var(--white); 
    font-weight: 600; font-size: 0.9rem; letter-spacing: 0.5px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}
/* Ensure the button says "Search" if value attribute isn't set, 
   or override appearance if it is an input type=submit */
.search-form .search-submit::before {
    content: none; /* Remove any icon */
}
.search-form .search-submit:hover { 
    background: var(--accent-color); 
    color: var(--dark-bg); /* Dark text on yellow bg */
}

/* =========================================
   6. Sidebar & Content
   ========================================= */
.sidebar-area {
    background: var(--white); padding: 32px;
    border-radius: var(--radius-lg);
    position: -webkit-sticky; position: sticky; top: 100px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
}
.widget { margin-bottom: 40px; }
.widget-title { 
    font-size: 1.1rem; color: var(--dark-bg);
    padding-bottom: 12px; border-bottom: 2px solid var(--bg-light);
    margin-bottom: 20px; display: block; position: relative;
}
.widget-title::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 40px; height: 2px; background: var(--accent-color);
}
.widget ul li { padding: 12px 0; border-bottom: 1px dashed var(--border-color); font-size: 0.95rem; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a:hover { color: var(--primary-color); text-decoration: underline; }

/* Directory Cards */
.search-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 24px;
}
.directory-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    transition: all 0.3s ease;
}
.directory-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}
.card-image {
    height: 180px; background: #f3f4f6; position: relative; overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-avatar {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #e6f0e9; color: var(--primary-color);
    font-size: 3rem; font-weight: 700; text-transform: uppercase;
}
.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.25rem; margin-bottom: 8px; color: var(--dark-bg); }
.card-title a:hover { color: var(--primary-color); }
.card-excerpt { 
    font-size: 0.95rem; color: var(--text-light); margin-bottom: 20px; 
    flex-grow: 1; line-height: 1.5;
}
.card-footer {
    margin-top: auto; padding-top: 16px; border-top: 1px solid var(--bg-light);
    display: flex; justify-content: space-between; align-items: center;
}
.btn-view-profile {
    font-size: 0.85rem; font-weight: 600; color: var(--primary-color);
    background: var(--primary-light); padding: 8px 16px; border-radius: 6px;
    transition: background 0.2s;
}
.btn-view-profile:hover { background: var(--primary-color); color: var(--white); }

/* =========================================
   7. Footer & Utils
   ========================================= */
.site-footer { background: var(--dark-bg); color: #d1d5db; font-size: 0.95rem; margin-top: 80px; }
.footer-widgets { padding: 64px 0 32px; }
.footer-widgets .widget-title { color: var(--white); margin-bottom: 24px; font-size: 1.1rem; }
.footer-widgets ul li { border-bottom: 1px solid rgba(255,255,255,0.1); padding: 8px 0; }

.footer-socket { background: rgba(0,0,0,0.2); padding: 24px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.socket-inner { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.socket-menu ul { display: flex; gap: 24px; }
.socket-menu a:hover { color: var(--accent-color); }

@media (max-width: 768px) {
    .socket-inner { flex-direction: column; gap: 16px; text-align: center; }
    .socket-menu ul { flex-wrap: wrap; justify-content: center; }
}

/* Back to Top */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--white); color: var(--primary-color);
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; visibility: hidden;
    transition: all 0.3s; z-index: 999; box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { background: var(--primary-color); color: var(--white); transform: translateY(-4px); }

/* Pages: No Results / 404 */
.no-results, .error-404-content {
    text-align: center; padding: 80px 20px; max-width: 600px; margin: 0 auto;
}
.no-results h2, .error-title {
    font-size: 2rem; font-weight: 700; color: var(--dark-bg); margin-bottom: 1rem;
}
.no-results p, .error-text {
    font-size: 1.1rem; color: var(--text-light); margin-bottom: 2rem;
}