/* WordPress integration and keyboard/touch navigation. */
/* Preserve intrinsic proportions; cover and avatar rules keep their own heights. */
:where(img[src*="/assets/images/"]) {
    height: auto;
}

button.mil-menu-btn {
    border: 0;
}
button.mil-menu-btn:focus-visible {
    outline: 2px solid #f27457;
    outline-offset: 3px;
}
.mil-top-menu li:focus-within > ul {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
@media (max-width: 1200px) {
    .mil-top-menu {
        max-height: calc(100dvh - 90px);
        overflow-y: auto;
    }
    .mil-top-menu li.mil-submenu-open > ul,
    .mil-top-menu li:focus-within > ul {
        padding: 5px 0;
        max-height: 400px;
    }
    .mil-top-menu li.mil-submenu-open > ul li,
    .mil-top-menu li:focus-within > ul li {
        opacity: 1;
    }
}
/* Short pages keep the dark surface to the bottom of the viewport. */
body {
    background-color: #1b1717;
}
.mil-wrapper {
    min-height: 100dvh;
}
.cp-inner .mil-subscripe-form-footer button i {
    color: #f27457;
}

/* The More button replaces its arrow with a spinner while loading. */
[data-blog-more]:disabled {
    cursor: wait;
    opacity: 0.7;
}
.mil-btn[data-blog-more].is-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cp-blog-spin 0.7s linear infinite;
}
@keyframes cp-blog-spin {
    to {
        transform: rotate(360deg);
    }
}
@media (prefers-reduced-motion: reduce) {
    .mil-btn[data-blog-more].is-loading::after {
        animation: none;
    }
}

/* WordPress editor content follows the approved dark article design. */
.cp-post .mil-breadcrumbs li:last-child {
    opacity: 1;
    cursor: auto;
}
.cp-post .mil-breadcrumbs li:last-child a {
    pointer-events: auto;
}
.cp-post-title,
.cp-post-content {
    overflow-wrap: anywhere;
}
.cp-post-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    margin-top: 24px;
}
.cp-post-content {
    line-height: 1.8;
}
.cp-post-content > * + * {
    margin-top: 24px;
}
.cp-post-content :is(h1, h2, h3, h4, h5, h6) {
    color: #f2fafa;
    line-height: 1.3;
    margin-top: 40px;
    margin-bottom: 20px;
}
.cp-post-content > :first-child {
    margin-top: 0;
}
.cp-post-content a {
    color: #f27457;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cp-post-content :is(ul, ol) {
    padding-inline-start: 28px;
}
.cp-post-content li + li {
    margin-top: 8px;
}
.cp-post-content :is(img, video, iframe) {
    max-width: 100%;
}
.cp-post-content :is(img, video) {
    height: auto;
    border-radius: 20px;
}
.cp-post-content figure {
    max-width: 100%;
}
.cp-post-content figcaption {
    font-size: 14px;
    color: #b8b5b5;
    margin-top: 12px;
}
.cp-post-content blockquote {
    padding: 24px;
    border-inline-start: 3px solid #f27457;
    background: #272626;
    border-radius: 0 20px 20px 0;
    color: #f2fafa;
}
.cp-post-content :is(pre, .wp-block-table) {
    overflow-x: auto;
    max-width: 100%;
}
.cp-post-content pre {
    padding: 24px;
    background: #272626;
    border-radius: 20px;
    font-size: 14px;
}
.cp-post-content table {
    border-collapse: collapse;
    width: 100%;
}
.cp-post-content :is(th, td) {
    padding: 12px;
    border: 1px solid #ffffff26;
    text-align: start;
}
.cp-post-content th {
    background: #272626;
    color: #f2fafa;
}
.cp-post-content hr {
    border: 0;
    border-top: 1px solid #ffffff26;
}
.cp-post-content .wp-block-button__link {
    background: #f27457;
    color: #f2fafa;
    text-decoration: none;
}
.cp-post-content .post-password-form input {
    max-width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 10px;
    border: 1px solid #ffffff26;
    background: #272626;
    color: #f2fafa;
}
.cp-post :is(a, input):focus-visible {
    outline: 2px solid #f27457;
    outline-offset: 4px;
}
.cp-post-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}
.cp-post-pages > :is(a, span) {
    padding: 8px 14px;
    border: 1px solid #ffffff26;
    border-radius: 8px;
}
@media (max-width: 767px) {
    .cp-post-content :is(blockquote, pre) {
        padding: 18px;
    }
}

.cp-post-share {
    flex-wrap: wrap;
    gap: 16px;
}
.cp-post-share .mil-pup-share {
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}
.cp-post-share .mil-pup-share li {
    margin: 0;
}
.cp-post-share .cp-copy-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 15px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    line-height: inherit;
    background: #272626;
    color: #b8b5b5;
    cursor: pointer;
    transition: background-color 0.2s;
}
.cp-post-share .cp-copy-link:hover {
    background: #32302f;
    color: #f27457;
}
.cp-post-share .cp-copy-link:disabled {
    cursor: wait;
}
.cp-copy-link:focus-visible {
    outline: 2px solid #f27457;
    outline-offset: 4px;
}

/* Mobile navigation preview. Desktop and tablet retain the original header. */
.mil-top-menu > ul > .cp-mobile-pricing { display: none; }
@media (max-width: 767px) {
    html:has(.mil-top-menu.mil-active),
    body:has(.mil-top-menu.mil-active) { overflow: hidden; }
    .mil-top-panel.mil-dark-2,
    .mil-top-panel.mil-dark-2.mil-active {
        height: 68px;
        background: transparent;
        border: 0;
        box-shadow: none;
        isolation: isolate;
    }
    .mil-top-panel::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        background: rgba(27, 23, 23, .78);
        border: 0;
        box-shadow: none;
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        opacity: 0;
        transition: opacity .2s ease;
    }
    .mil-top-panel.cp-mobile-scrolled::before { opacity: 1; }
    .mil-top-panel:has(.mil-top-menu.mil-active)::before {
        background: #1b1717;
        opacity: 1;
    }
    .home #smooth-content > .mil-banner {
        margin-top: 0;
        padding-top: 160px;
    }
    .mil-top-panel > .container {
        width: 100%;
        max-width: none;
        padding-inline: 16px;
    }
    .mil-top-panel .mil-logo img { width: 83px; height: 32px; }
    .mil-top-panel .mil-menu-buttons { gap: 12px; }
    .mil-top-panel .mil-menu-btn {
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        background: #272626;
        border: 1px solid #ffffff12;
        border-radius: 10px;
    }
    .mil-top-panel .mil-top-menu {
        position: fixed;
        inset: 68px 0 0;
        width: 100%;
        height: calc(100dvh - 68px);
        max-height: none;
        padding: 20px 16px max(24px, env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #1b1717;
        box-shadow: none;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }
    .mil-top-panel .mil-top-menu.mil-active {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }
    .mil-top-panel .mil-top-menu > ul { padding: 0; gap: 0; }
    .mil-top-panel .mil-top-menu > ul > li { margin: 0; border-bottom: 1px solid #ffffff12; }
    .mil-top-panel .mil-top-menu > ul > li > a {
        display: flex;
        align-items: center;
        min-height: 56px;
        padding: 12px 8px;
        color: #f2fafa;
        opacity: 1;
        font-size: 18px;
        line-height: 1.5;
        background: transparent;
    }
    .mil-top-panel .mil-top-menu > ul > li > a::before { display: none; }
    .mil-top-panel .mil-top-menu > ul > li.mil-active > a { color: #f27457; }
    .mil-top-panel .mil-top-menu > ul > .cp-desktop-pages { display: none; }
    .mil-top-panel .mil-top-menu > ul > .cp-mobile-pricing { display: block; }
    .mil-top-panel .mil-top-menu a:focus-visible { outline: 2px solid #f27457; outline-offset: -2px; }
    @media (prefers-reduced-motion: reduce) {
        .mil-top-panel .mil-top-menu, .mil-top-panel::before { transition: none; }
    }
}

/* Compact footer layout for phones only. */
@media (max-width: 767px) {
    footer.mil-footer-dark-2 { padding-top: 40px; }
    footer.mil-footer-dark-2 > .container { padding-inline: 20px; }
    footer.mil-footer-dark-2 > .container > .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
        gap: 32px 20px;
        margin: 0;
    }
    footer.mil-footer-dark-2 > .container > .row > div {
        width: auto;
        min-width: 0;
        padding: 0;
        margin: 0;
    }
    footer.mil-footer-dark-2 > .container > .row > div:first-child,
    footer.mil-footer-dark-2 > .container > .row > div:nth-child(4) { grid-column: 1 / -1; }
    footer.mil-footer-dark-2 .mil-footer-logo { margin-bottom: 0; }
    footer.mil-footer-dark-2 h6 { margin-bottom: 16px; color: #f2fafa; }
    footer.mil-footer-dark-2 .mil-footer-list li {
        margin-bottom: 8px;
        font-size: 14px;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }
    footer.mil-footer-dark-2 .mil-footer-list li:last-child { margin-bottom: 0; }
    footer.mil-footer-dark-2 .mil-footer-list a {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        max-width: 100%;
        color: #b8b5b5;
        overflow-wrap: anywhere;
    }
    footer.mil-footer-dark-2 > .container > .row > div:nth-child(3) li:first-child a {
        display: flex;
    }
    footer.mil-footer-dark-2 .mil-subscripe-form-footer .mil-input {
        height: 56px;
        padding-inline: 18px 60px;
        font-size: 16px;
    }
    footer.mil-footer-dark-2 .mil-subscripe-form-footer button {
        top: 6px;
        right: 8px;
        width: 44px;
        height: 44px;
    }
    footer.mil-footer-dark-2 .mil-subscripe-form-footer button i { color: #f27457; }
    footer.mil-footer-dark-2 .mil-checkbox-frame { align-items: flex-start; }
    footer.mil-footer-dark-2 .mil-checkbox-frame p { line-height: 1.6; }
    footer.mil-footer-dark-2 .mil-footer-bottom {
        margin-top: 32px;
        padding-top: 24px;
        padding-bottom: 104px;
    }
    footer.mil-footer-dark-2 .mil-footer-bottom p {
        text-align: center;
        font-size: 12px;
        line-height: 1.8;
        overflow-wrap: anywhere;
    }
}

/* Home statistics: aligned, compact rows on phones. */
@media (max-width: 767px) {
    .cp-home-stats { margin-bottom: 48px; }
    .cp-home-stats > .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        margin-inline: 0;
    }
    .cp-home-stats > .row > div {
        display: grid;
        grid-template-columns: minmax(112px, .9fr) minmax(0, 1.3fr);
        align-items: center;
        gap: 20px;
        width: 100%;
        padding: 24px 0;
        margin-bottom: 0;
        border-bottom: 1px solid #ffffff14;
    }
    .cp-home-stats > .row > div:first-child { border-top: 1px solid #ffffff14; }
    .cp-home-stats .h1.mil-display {
        margin-bottom: 0;
        font-size: clamp(36px, 10vw, 44px);
        line-height: 1.15;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }
    .cp-home-stats h5 {
        font-size: 17px;
        line-height: 1.45;
        letter-spacing: -.02em;
        overflow-wrap: anywhere;
    }
}

/* Desktop header after scrolling; keep the original transparent hero state. */
@media (min-width: 1201px) {
    .mil-top-panel.mil-dark-2.mil-active {
        height: 84px;
        background-color: rgba(27, 23, 23, .84);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        box-shadow: none;
        border: 0;
    }
    .mil-top-panel.mil-dark-2.mil-active .mil-top-menu > ul > li > a {
        opacity: .85;
    }
    .mil-top-panel.mil-dark-2.mil-active .mil-top-menu > ul > li.mil-active > a,
    .mil-top-panel.mil-dark-2.mil-active .mil-top-menu > ul > li > a:hover {
        opacity: 1;
        color: #f27457;
    }
}
