/*
Theme Name: Dunamis Child
Template: dunamis
Version: 1.0
*/

/* ====================================
   HIDE PARENT THEME HEADER COMPLETELY
   ==================================== */

/* Hide ALL parent theme header elements */
.cro_standardheader,
#pageheader,
.site-header .wrap,
.site-header .site-title,
.site-header .site-description,
.title-area,
header .title-area,
.site-header .genesis-nav-menu,
.nav-primary,
.nav-secondary {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Remove the blue background from parent theme but keep container */
.site-header {
    background: transparent !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* ===================================
   HAMBURGER HEADER STYLES
   Fixed Hamburger to Viewport Left Edge
   =================================== */

/* CSS Variables for Easy Customization */
:root {
    --header-height: 70px;
    --hamburger-size: 28px;
    --hamburger-edge-gap: 15px;  /* Distance from left edge */
    --header-bg: #ffffff;
    --menu-bg: #ffffff;
    --text-color: #333;
    --accent-color: #0066cc;
    --overlay-darkness: 0.6;
    --purple-bar: #8B4789;  /* Purple top bar */
    --blue-bar: #0066cc;    /* Blue bottom bar */
    --purple-bar-height: 8px;
    --blue-bar-height: 8px;
}

/* Header Container - Full Width, Fixed to Top */
.cclne-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--header-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

/* Purple bar at top of header */
.cclne-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--purple-bar-height);
    background: var(--purple-bar);
    z-index: 10002;
}

/* Blue bar at bottom of header */
.cclne-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--blue-bar-height);
    background: var(--blue-bar);
    z-index: 10002;
}

/* Inner Container - Centered Content */
.cclne-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 20px;
    /* Add left padding to prevent logo from going under hamburger */
    padding-left: calc(var(--hamburger-size) + var(--hamburger-edge-gap) + 40px);
    justify-content: space-between;
}

/* ===================================
   HAMBURGER BUTTON - FIXED TO VIEWPORT LEFT
   =================================== */
.cclne-hamburger {
    /* CRITICAL: Fixed positioning anchors to viewport, not container */
    position: fixed !important;
    
    /* Flush to left edge of viewport */
    left: var(--hamburger-edge-gap) !important;
    
    /* Vertically centered within the 70px header */
    top: calc(var(--header-height) / 2);
    transform: translateY(-50%);
    
    /* Button styling */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: 0;
    
    /* Layout for bars */
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    align-items: center;
    
    /* Layering */
    z-index: 10001;
    
    /* Smooth transitions */
    transition: all 0.3s ease;
    
    /* Touch-friendly size */
    min-width: 44px;
    min-height: 44px;
    
    /* Accessibility */
    outline: none;
}

/* Keyboard Focus Indicator */
.cclne-hamburger:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Hamburger Bars */
.cclne-hamburger .bar {
    width: var(--hamburger-size);
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
    display: block;
}

/* Hamburger Animation - Transform to X when Active */
.cclne-hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.cclne-hamburger.active .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.cclne-hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hover Effect */
.cclne-hamburger:hover .bar {
    background: var(--accent-color);
}

/* ===================================
   LOGO
   =================================== */
.cclne-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.cclne-logo:hover {
    opacity: 0.85;
}

/* Logo image (circular) */
.cclne-logo-image {
    width: 50px;
    height: 50px;
    display: block;
    object-fit: contain;
}

/* Logo text container */
.cclne-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

/* First line - CCLNE */
.cclne-logo-line1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

/* Second line - CHURCH */
.cclne-logo-line2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

/* ===================================
   SEARCH BAR
   =================================== */
.cclne-search-form {
    position: relative;
    flex: 2;
    max-width: 400px;
    display: flex;
    align-items: center;
    height: 112px;
    margin: 10px; /* Center the search bar */
}

.cclne-search-input {
    width: 100%;
    height: 42px;
    padding: 0 50px 0 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-color);
    background: #f8f9fa;
    transition: all 0.3s ease;
    outline: none;
}

.cclne-search-input:focus {
    border-color: var(--accent-color);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.cclne-search-input::placeholder {
    color: #99;
}

.cclne-search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.cclne-search-button:hover {
    background: #0052a3;
    transform: translateY(-50%) scale(1.05);
}

.cclne-search-button:active {
    transform: translateY(-50%) scale(0.95);
}

.cclne-search-icon {
    width: 18px;
    height: 18px;
    color: #ffffff;
}

/* ===================================
   HEADER NAVIGATION BUTTONS
   =================================== */
.cclne-header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cclne-nav-btn {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

/* Hover effect - underline animation */
.cclne-nav-btn::after {
    content: "";
    position: absolute;
    bottom: 8px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.cclne-nav-btn:hover {
    color: var(--accent-color);
}

.cclne-nav-btn:hover::after {
    transform: scaleX(1);
}

.cclne-nav-btn:active {
    transform: scale(0.97);
}

/* Focus state for keyboard navigation */
.cclne-nav-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ===================================
   SLIDE-OUT MENU
   =================================== */
.cclne-menu {
    position: fixed;
    top: 0;
    left: -350px; /* Hidden off-screen by default */
    width: 350px;
    max-width: 85%;
    height: 100vh;
    background: var(--menu-bg);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Menu Open State */
.cclne-menu.active {
    left: 0;
}

/* Menu Content Padding */
.cclne-menu-content {
    padding: calc(var(--header-height) + 20px) 30px 30px 30px;
    min-height: 100%;
}

/* ===================================
   MENU LIST STYLES
   =================================== */
.cclne-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cclne-nav-list li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eeeeee;
}

/* Remove border from last item */
.cclne-nav-list li:last-child {
    border-bottom: none;
}

.cclne-nav-list a {
    display: block;
    padding: 16px 10px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

/* Hover Effect with Slide Animation */
.cclne-nav-list a:hover {
    color: var(--accent-color);
    padding-left: 20px;
    background: #f8f9fa;
}

/* Active/Current Page Highlighting */
.cclne-nav-list .current-menu-item > a,
.cclne-nav-list .current_page_item > a {
    color: var(--accent-color);
    font-weight: 600;
    background: #f0f5ff;
}

/* ===================================
   SUBMENU STYLES (Dropdown Support)
   =================================== */
.cclne-nav-list .sub-menu {
    list-style: none;
    padding: 0 0 0 20px;
    margin: 0;
    background: #f9f9f9;
}

.cclne-nav-list .sub-menu li {
    border-bottom: 1px solid #e0e0e0;
}

.cclne-nav-list .sub-menu a {
    font-size: 14px;
    padding: 12px 10px;
    color: #666;
}

.cclne-nav-list .sub-menu a:hover {
    color: var(--accent-color);
    background: #ffffff;
}

/* Parent Menu Item Indicator */
.cclne-nav-list .menu-item-has-children > a::after {
    content: "›";
    float: right;
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

/* ===================================
   DARK OVERLAY
   =================================== */
.cclne-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, var(--overlay-darkness));
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    cursor: pointer;
}

.cclne-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   BODY SCROLL LOCK
   =================================== */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ===================================
   ADJUST PAGE CONTENT BELOW HEADER
   =================================== */
body {
    padding-top: var(--header-height);
}

/* ===================================
   WORDPRESS ADMIN BAR COMPATIBILITY
   =================================== */
.admin-bar .cclne-header {
    top: 32px;
}

.admin-bar .cclne-hamburger {
    top: calc(32px + var(--header-height) / 2);  /* Admin bar + half header */
    transform: translateY(-50%);
}

.admin-bar body {
    padding-top: calc(var(--header-height) + 32px);
}

/* Admin bar on mobile */
@media screen and (max-width: 782px) {
    .admin-bar .cclne-header {
        top: 46px;
    }
    
    .admin-bar .cclne-hamburger {
        top: calc(46px + var(--header-height) / 2);  /* Admin bar + half header */
        transform: translateY(-50%);
    }
    
    .admin-bar body {
        padding-top: calc(var(--header-height) + 46px);
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablets and below */
@media (max-width: 768px) {
    :root {
        --hamburger-edge-gap: 12px;
    }
    
    .cclne-menu {
        width: 300px;
        left: -300px;
    }
    
    .cclne-logo-image {
        width: 45px;
        height: 45px;
    }
    
    .cclne-logo-line1,
    .cclne-logo-line2 {
        font-size: 18px;
    }
    
    .cclne-container {
        padding-left: calc(var(--hamburger-size) + var(--hamburger-edge-gap) + 30px);
        padding-right: 15px;
    }
    
    /* Hide navigation buttons on tablet and mobile */
    .cclne-header-nav {
        display: none;
    }
    
    /* Search bar takes remaining space */
    .cclne-search-form {
        max-width: 300px;
    }
    
    /* Larger touch targets on mobile */
    .cclne-nav-list a {
        padding: 18px 15px;
        font-size: 17px;
    }
    
    .cclne-hamburger {
        min-width: 48px;
        min-height: 48px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    :root {
        --hamburger-edge-gap: 10px;
        --header-height: 60px;
    }
    
    .cclne-menu {
        width: 280px;
        left: -280px;
        max-width: 90%;
    }
    
    .cclne-logo-image {
        width: 38px;
        height: 38px;
    }
    
    .cclne-logo-line1,
    .cclne-logo-line2 {
        font-size: 16px;
    }
    
    .cclne-logo-text {
        display: none; /* Hide text on very small screens, keep only logo */
    }
    
    .cclne-container {
        padding-left: calc(var(--hamburger-size) + var(--hamburger-edge-gap) + 25px);
        padding-right: 10px;
        gap: 10px;
    }
    
    /* Smaller search bar on mobile */
    .cclne-search-form {
        max-width: 200px;
    }
    
    .cclne-search-input {
        height: 36px;
        font-size: 14px;
        padding: 0 42px 0 15px;
    }
    
    .cclne-search-button {
        width: 32px;
        height: 32px;
    }
    
    .cclne-search-icon {
        width: 16px;
        height: 16px;
    }
    
    .cclne-hamburger .bar {
        width: 24px;
    }
}

/* Large screens - maintain position */
@media (min-width: 1200px) {
    /* Hamburger stays at viewport edge even on large screens */
    .cclne-hamburger {
        left: var(--hamburger-edge-gap) !important;
    }
    
    /* Container can grow but hamburger remains fixed to viewport */
    .cclne-container {
        max-width: 1400px;
    }
}

/* Extra large screens */
@media (min-width: 1600px) {
    .cclne-container {
        max-width: 1600px;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .cclne-header,
    .cclne-hamburger,
    .cclne-menu,
    .cclne-overlay {
        display: none !important;
    }
    
    body {
        padding-top: 0 !important;
    }
}

/* ===================================
   SMOOTH SCROLLING FOR ANCHOR LINKS
   =================================== */
html {
    scroll-behavior: smooth;
}

/* Offset for fixed header when using anchor links */
:target::before {
    content: "";
    display: block;
    height: var(--header-height);
    margin-top: calc(var(--header-height) * -1);
    visibility: hidden;
}

/* ===================================
   ACCESSIBILITY ENHANCEMENTS
   =================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .cclne-hamburger,
    .cclne-hamburger .bar,
    .cclne-menu,
    .cclne-overlay,
    .cclne-nav-list a {
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cclne-header {
        border-bottom: 2px solid currentColor;
    }
    
    .cclne-hamburger .bar {
        background: currentColor;
    }
    
    .cclne-nav-list a {
        border: 1px solid transparent;
    }
    
    .cclne-nav-list a:hover,
    .cclne-nav-list a:focus {
        border-color: currentColor;
    }
}

/* Focus visible for keyboard navigation */
.cclne-nav-list a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
    background: #f0f5ff;
}

/* ===================================
   CUSTOM SCROLLBAR FOR MENU (Optional)
   =================================== */
.cclne-menu::-webkit-scrollbar {
    width: 8px;
}

.cclne-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cclne-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.cclne-menu::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}