/**
 * Menu Panel Widget Styles
 * Off-canvas navigation panel with slide-in animation
 *
 * @package MarthomaChurch
 */

/* ==========================================
   TRIGGER BUTTON
   ========================================== */

.menu-panel-trigger-wrapper {
    display: flex;
}

.menu-panel-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: color 0.2s ease;
    line-height: 1;
}

.menu-panel-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Hamburger Icon */
.menu-panel-trigger .hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.menu-panel-trigger .hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ==========================================
   OVERLAY
   ========================================== */

.menu-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 20, 30, 0.85);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* ==========================================
   PANEL CONTAINER
   ========================================== */

.menu-panel {
    position: fixed;
    z-index: 999999;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-panel[hidden] {
    display: none !important;
}

.menu-panel.is-transitioning {
    display: flex !important;
}

/* Left slide */
.menu-panel[data-direction="left"] {
    top: 0;
    left: 0;
    height: 100%;
    width: 90%;
    max-width: 100%;
    transform: translateX(-100%);
}

.menu-panel[data-direction="left"].active {
    transform: translateX(0);
}

/* Right slide */
.menu-panel[data-direction="right"] {
    top: 0;
    right: 0;
    height: 100%;
    width: 90%;
    max-width: 100%;
    transform: translateX(100%);
}

.menu-panel[data-direction="right"].active {
    transform: translateX(0);
}

/* Top slide */
.menu-panel[data-direction="top"] {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateY(-100%);
}

.menu-panel[data-direction="top"].active {
    transform: translateY(0);
}

/* Bottom slide */
.menu-panel[data-direction="bottom"] {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateY(100%);
}

.menu-panel[data-direction="bottom"].active {
    transform: translateY(0);
}

/* ==========================================
   CLOSE BUTTON
   ========================================== */

.menu-panel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: inherit;
    opacity: 0.7;
    transition: background-color 0.3s ease, transform 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0;
}

.menu-panel-close:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
    opacity: 1;
}

.menu-panel-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.menu-panel-close svg {
    width: 20px;
    height: 20px;
}

/* ==========================================
   SCROLLABLE CONTENT AREA
   ========================================== */

.menu-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0;
    scrollbar-gutter: stable;
}

/* Ensure Elementor template elements don't break scroll */
.menu-panel-content > .elementor {
    min-height: auto !important;
}

.menu-panel-content > .elementor > .elementor-element {
    min-height: auto !important;
}

/* Placeholder */
.menu-panel-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #707070;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

/* ==========================================
   BODY SCROLL LOCK
   ========================================== */

body.menu-panel-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

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

@media (max-width: 768px) {
    .menu-panel-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }

    .menu-panel-content {
        padding: 25px 20px;
        padding-right: 30px !important;
    }
}

@media (max-width: 480px) {
    .menu-panel-close {
        top: 12px;
        right: 12px;
    }

    .menu-panel-content {
        padding: 20px 15px;
        padding-right: 26px !important;
    }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .menu-panel,
    .menu-panel-overlay,
    .menu-panel-trigger .hamburger-icon span {
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   CUSTOM SCROLLBAR (optional subtle style)
   ========================================== */

.menu-panel-content::-webkit-scrollbar {
    width: 8px;
}

.menu-panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.menu-panel-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.menu-panel-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}
