/* ==========================================================================
   oui OntheSide - Public Styles
   Lightweight off-canvas sidebar menu
   ========================================================================== */

/* ---------- Reset & base ---------- */
#ots-sidebar {
    box-sizing: border-box;
}
#ots-sidebar *, #ots-sidebar *::before, #ots-sidebar *::after {
    box-sizing: border-box;
}

/* ---------- Sidebar panel ---------- */
#ots-sidebar {
    position: fixed;
    top: 0;
    height: 100%;
    z-index: 99999;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
#ots-sidebar.ots-pos-left  { left: 0; }
#ots-sidebar.ots-pos-right { right: 0; transform: translateX(100%); }
#ots-sidebar.ots-open { transform: translateX(0); }
#ots-sidebar a { color: inherit; }

/* Scroll wrapper */
.ots-scroll-wrap {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.ots-scroll {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 20px 0;
}

/* ---------- Close button ---------- */
.ots-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none !important;
    border: none !important;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    z-index: 2;
    padding: 4px 8px !important;
    color: inherit;
    width: auto;
    text-align: center;
}
.ots-close:hover { opacity: 1; }
.ots-pos-right .ots-close { right: auto; left: 12px; }

/* ---------- Header / Logo / Identity ---------- */
.ots-header {
    padding: 30px 24px 10px;
    text-align: center;
}
.ots-logo {
    display: inline-block;
    margin-bottom: 8px;
}
.ots-logo img {
    display: block;
    width: auto;
}
.ots-site-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 2px;
    color: inherit;
}
.ots-tagline {
    font-size: 13px;
    opacity: 0.6;
    margin: 0;
}
.ots-identity { color: inherit; }
.ots-widget-area { padding: 8px 0; }

/* ---------- Search ---------- */
.ots-search {
    padding: 8px 24px 16px;
}
.ots-search input[type="search"] {
    width: 100%;
    padding: 8px 0 !important;
    font-size: 14px;
    background: transparent;
    border: none !important;
    border-bottom: 1px solid;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    border-radius: 0 !important;
}
.ots-search input[type="search"]:focus {
    opacity: 1;
}

/* ---------- Navigation ---------- */
.ots-nav {
    flex: 1;
    padding: 0;
}
.ots-menu,
.ots-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ots-menu a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s, padding-left 0.2s;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    position: relative;
}
.ots-menu .sub-menu a {
    padding-left: 36px;
}
.ots-menu .sub-menu .sub-menu a {
    padding-left: 48px;
}

/* No-menu fallback */
.ots-no-menu {
    padding: 24px;
    opacity: 0.5;
    font-size: 14px;
    text-align: center;
}

/* ---------- Submenu behavior ---------- */
.ots-menu .sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.ots-menu .ots-submenu-open > .sub-menu {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

/* ---------- Submenu indicators ---------- */
.ots-indicators .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-left: auto;
    opacity: 0.5;
    transition: transform 0.25s;
    flex-shrink: 0;
}
.ots-indicators .ots-submenu-open > a::after {
    transform: rotate(45deg);
}

/* Indicator as separate clickable area when parent links are clickable */
.ots-sub-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none !important;
    border: none !important;
    color: inherit;
    padding: 0 !important;
    width: auto;
    text-align: center;
}
.ots-sub-toggle::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.5;
    transition: transform 0.25s;
}
.ots-submenu-open > a .ots-sub-toggle::after,
.ots-submenu-open > .ots-sub-toggle::after {
    transform: rotate(45deg);
}

/* When parent clickable, hide the CSS indicator */
.ots-parent-clickable .menu-item-has-children > a::after { display: none; }

/* ---------- Hover effects ---------- */
.ots-hover-shift .ots-menu > li > a:hover {
    padding-left: 30px;
}
.ots-pos-right.ots-hover-shift .ots-menu > li > a:hover {
    padding-left: 24px;
    padding-right: 30px;
}

/* Active highlight */
.ots-active-hl .current-menu-item > a,
.ots-active-hl .current-menu-ancestor > a {
    opacity: 1;
}

/* ---------- Social links ---------- */
.ots-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    flex-wrap: wrap;
}
.ots-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, opacity 0.2s;
    opacity: 0.7;
}
.ots-social-link:hover { opacity: 1; }

/* ---------- Footer ---------- */
.ots-footer {
    padding: 16px 24px;
    font-size: 12px;
    opacity: 0.5;
    margin-top: auto;
    text-align: center;
    color: inherit;
}

/* ---------- Overlay ---------- */
.ots-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s;
}
.ots-overlay.ots-visible {
    pointer-events: auto;
    opacity: 1;
}

/* ---------- Hamburger trigger ---------- */
.ots-trigger {
    position: fixed;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    width: auto;
    text-align: center;
    color: inherit;
}
.ots-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.ots-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}
.ots-hamburger span {
    display: block;
    width: 60%;
    position: relative;
    transition: background-color 0.2s;
    border-radius: 2px;
}
.ots-hamburger span::before,
.ots-hamburger span::after {
    content: '';
    display: block;
    width: 100%;
    position: absolute;
    left: 0;
    transition: transform 0.3s, top 0.3s;
    border-radius: 2px;
}

/* Hide trigger when sidebar is open (close button inside sidebar is sufficient) */
.ots-trigger.ots-active { display: none; }

/* Button styles */
.ots-btn-square .ots-hamburger {
    border-radius: 4px;
}
.ots-btn-circle .ots-hamburger {
    border-radius: 50%;
}

/* Custom SVG icon */
.ots-custom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.ots-custom-icon svg {
    width: 60%;
    height: 60%;
    display: block;
}

/* Button label */
.ots-btn-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ---------- Mobile navbar ---------- */
.ots-mobile-navbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    background: inherit;
    height: 56px;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background: #fff;
}
.ots-mob-logo { height: 32px; margin-left: 12px; }
.ots-mob-logo img { height: 100%; width: auto; }
.ots-mob-trigger {
    position: static !important;
    width: 36px !important;
    height: 36px !important;
}

/* ---------- Body pushed (slide mode) ---------- */
.ots-body-pushed {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

/* Blur effect */
.ots-body-blur > *:not(#ots-sidebar):not(.ots-overlay):not(.ots-trigger):not(.ots-mobile-navbar) {
    filter: blur(3px);
    transition: filter 0.35s;
}

/* Page transition */
.ots-page-transition {
    animation: otsFadeOut 0.3s ease forwards;
}
@keyframes otsFadeOut {
    to { opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .ots-mobile-navbar { display: flex; }
    #ots-sidebar { width: 85vw !important; max-width: 320px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    #ots-sidebar,
    .ots-overlay,
    .ots-body-pushed,
    .ots-hamburger span,
    .ots-hamburger span::before,
    .ots-hamburger span::after,
    .ots-menu .sub-menu {
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Print ---------- */
@media print {
    #ots-sidebar,
    .ots-trigger,
    .ots-overlay,
    .ots-mobile-navbar { display: none !important; }
}
