/**
 * KPC Header & Footer - Mobile First Styles
 * Optimized for touch devices and mobile viewing
 */

/* ===========================
   HEADER STYLES - MOBILE FIRST
   =========================== */

.kpc-header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.kpc-header-sticky {
    position: sticky;
    top: 0;
    left: 0;
}

.kpc-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.kpc-header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding-top: 5px;
    padding-bottom: 5px;
}


.kpc-header-logo a {
    display: inline-block;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.3s ease;
}

.kpc-header-logo a:active {
    opacity: 0.7;
}

.kpc-header-logo img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .kpc-header-logo a:hover {
        opacity: 0.8;
    }
}

/* ===========================
   FOOTER STYLES - MOBILE FIRST
   =========================== */

/* Ensure body and html take full height */
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Make main content area grow to push footer down */
#page,
#content,
.site,
.site-content {
    flex: 1 0 auto;
}

.kpc-footer {
    width: 100%;
    background-color: #f8f9fa;
    margin-top: auto;
    flex-shrink: 0;
}

.kpc-footer-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 998;
}

.kpc-footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Default footer content styles */
.kpc-footer-container a {
    -webkit-tap-highlight-color: rgba(114, 144, 168, 0.2);
    transition: color 0.3s ease;
}

.kpc-footer-container a:active {
    opacity: 0.7;
}

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

.kpc-header-logo a:focus,
.kpc-footer-container a:focus {
    outline: 2px solid #7290A8;
    outline-offset: 4px;
}

/* ===========================
   TOUCH OPTIMIZATION
   =========================== */

@media (hover: none) and (pointer: coarse) {
    .kpc-header-logo a,
    .kpc-footer-container a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */

@media print {
    .kpc-header-sticky {
        position: relative;
    }
    
    .kpc-footer-sticky {
        position: relative;
    }
    
    .kpc-header,
    .kpc-footer {
        box-shadow: none;
    }
}

/* ===========================
   LOADING STATES
   =========================== */

.kpc-header-logo img {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===========================
   SAFE AREA (iOS Notch Support)
   =========================== */

@supports (padding: max(0px)) {
    .kpc-header {
        /* padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right)); */
    }
    
    .kpc-header-sticky {
        padding-top: max(0px, env(safe-area-inset-top));
    }
    
    .kpc-footer {
        /* padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right)); */
    }
    
    .kpc-footer-sticky {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}
