:root {
    --mm-shell: 1400px;
    --mm-space: 12px;
    --cms-header-height: 64px;
    --spacing-sm: 12px;
    --spacing-md: 12px;
    --spacing-lg: 12px;
}

body.modernmag-body {
    padding-top: var(--cms-header-height);
}

body.cms-menu-locked {
    overflow: hidden;
}

.container {
    max-width: var(--mm-shell) !important;
}

.row {
    --bs-gutter-x: var(--mm-space);
    --bs-gutter-y: var(--mm-space);
}

.cms-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    min-height: var(--cms-header-height);
    background: #ffffff;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cms-header.is-scrolled {
    border-bottom-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.cms-header-shell {
    width: calc(100% - 24px);
    max-width: var(--mm-shell);
    min-height: var(--cms-header-height);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.cms-header-left,
.cms-header-right {
    flex: 0 0 auto;
}

.cms-header-center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cms-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cms-brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(64, 158, 255, 0.18);
    border-radius: 7px;
    background: rgba(64, 158, 255, 0.08);
    color: var(--theme);
    font-size: 15px;
    font-weight: 700;
    flex: 0 0 auto;
}

.cms-brand-mark.is-logo {
    width: auto;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
}

.cms-brand-mark.is-logo img {
    width: auto;
    height: 38px;
    max-width: none;
    object-fit: contain;
}

.cms-brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.cms-brand-copy strong,
.cms-brand-copy small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cms-brand-copy strong {
    font-size: 15px;
    line-height: 1.2;
    color: #1f2937;
}

.cms-brand-copy small {
    font-size: 10px;
    line-height: 1.2;
    color: #94a3b8;
}

.cms-nav-wrap {
    width: min(100%, 100%);
}

.cms-site-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--cms-header-height);
    margin: 0;
    padding: 0 8px;
    list-style: none;
}

.cms-site-nav-indicator {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--theme);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    transition: left 0.2s ease, width 0.2s ease, opacity 0.2s ease;
}

.cms-nav-item {
    position: relative;
    z-index: 1;
}

.cms-nav-item > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--cms-header-height);
    padding: 0 10px;
    color: #64748b;
    font-size: 14px;
    transition: color 0.2s ease;
}

.cms-nav-item > a:hover,
.cms-nav-item.is-active > a {
    color: var(--theme);
}

.cms-nav-arrow,
.cms-user-arrow {
    font-size: 12px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.cms-nav-item:hover > a .cms-nav-arrow,
.cms-user-menu:hover .cms-user-arrow,
.cms-user-menu:focus-within .cms-user-arrow {
    transform: rotate(180deg);
}

.cms-nav-dropdown,
.cms-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    min-width: 168px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    z-index: 24;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.cms-nav-dropdown::before,
.cms-user-dropdown::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.cms-nav-dropdown {
    left: 0;
}

.cms-user-dropdown {
    right: 0;
}

.cms-nav-item:hover > .cms-nav-dropdown,
.cms-nav-item:focus-within > .cms-nav-dropdown,
.cms-user-menu:hover .cms-user-dropdown,
.cms-user-menu:focus-within .cms-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cms-nav-item:hover,
.cms-nav-item:focus-within,
.cms-user-menu:hover,
.cms-user-menu:focus-within {
    z-index: 25;
}

.cms-nav-dropdown a,
.cms-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    color: #64748b;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cms-nav-dropdown a:hover,
.cms-nav-dropdown a.is-active,
.cms-user-dropdown a:hover {
    background: rgba(64, 158, 255, 0.08);
    color: var(--theme);
}

.cms-user-dropdown a.is-danger {
    color: #ef4444;
}

.cms-user-dropdown a.is-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.cms-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.cms-header-search,
.cms-mobile-search {
    position: relative;
    display: flex;
    align-items: center;
}

.cms-header-search {
    width: 200px;
    min-height: 36px;
    padding: 0 12px 0 36px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.92);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.cms-inline-search-button {
    position: absolute;
    left: 13px;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    transform: translateY(-50%);
}

.cms-inline-search-icon {
    font-size: 14px;
    line-height: 1;
}

.cms-header-search input,
.cms-mobile-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #334155;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: none;
    appearance: none;
}

.cms-header-search input::placeholder,
.cms-mobile-search input::placeholder {
    color: #94a3b8;
}

.cms-header-search input:focus,
.cms-mobile-search input:focus {
    outline: none;
}

.cms-header-search:focus-within,
.cms-mobile-search:focus-within {
    border-color: rgba(64, 158, 255, 0.34);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.08);
}

.cms-user-menu {
    position: relative;
}

.cms-user-trigger,
.cms-user-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 14px;
    min-height: 36px;
}

.cms-user-trigger:hover,
.cms-user-login:hover {
    color: var(--theme);
}

.cms-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cms-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
}

.cms-nav-toggle i {
    font-size: 18px;
    line-height: 1;
}

.cms-nav-toggle-close-icon {
    display: none;
}

.cms-header.is-menu-open .cms-nav-toggle-open-icon {
    display: none;
}

.cms-header.is-menu-open .cms-nav-toggle-close-icon {
    display: block;
}

.cms-mobile-panel,
.cms-mobile-backdrop {
    display: none;
}

.joe-banner,
.modernmag-main,
.footer-content {
    padding: var(--mm-space) 0;
}

.banner-content {
    padding: 0 var(--mm-space);
}

.banner-layout-row {
    align-items: stretch;
}

.banner-layout-row > [class*='col-'] {
    display: flex;
}

.banner-hero-card {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 248px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--card-shadow);
}

.banner-hero-card .banner-visual {
    position: relative;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 55%, #22c55e 100%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: flex-end;
}

.banner-hero-card .banner-overlay {
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.34), transparent 38%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.5) 58%, rgba(37, 99, 235, 0.22) 100%);
}

.banner-hero-card .banner-content {
    width: 100%;
    max-width: 560px;
    padding: 24px 26px;
    text-align: left;
}

.banner-hero-card .banner-title {
    margin-bottom: 10px;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
}

.banner-hero-card .banner-subtitle {
    margin: 0;
    max-width: 38ch;
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0;
    opacity: 0.92;
}

.banner-site-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--card-shadow);
    color: #0f172a;
}

.banner-site-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.banner-site-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    color: #0f172a;
}

.banner-site-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(248, 250, 252, 0.92);
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.banner-site-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.16);
}

.banner-site-status.is-loading {
    color: #64748b;
}

.banner-site-status.is-ok {
    border-color: rgba(134, 239, 172, 0.8);
    background: rgba(240, 253, 244, 0.92);
    color: #16a34a;
}

.banner-site-status.is-warn {
    border-color: rgba(253, 224, 71, 0.72);
    background: rgba(255, 251, 235, 0.94);
    color: #d97706;
}

.banner-site-wave {
    position: relative;
    height: 42px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background:
        linear-gradient(180deg, rgba(34, 197, 94, 0.08) 0%, rgba(255, 255, 255, 0.92) 100%),
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 13px,
            rgba(226, 232, 240, 0.65) 13px,
            rgba(226, 232, 240, 0.65) 14px
        );
    color: #22c55e;
}

.banner-site-wave-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.banner-site-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    flex: 1 1 auto;
}

.banner-site-metric-icon {
    position: absolute;
    right: 10px;
    bottom: 9px;
    font-size: 30px;
    color: rgba(148, 163, 184, 0.13);
    pointer-events: none;
}

.banner-site-metric .metric-label {
    position: relative;
    z-index: 1;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.banner-site-metric .metric-value {
    position: relative;
    z-index: 1;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    color: #0f172a;
}

.banner-site-metric {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 78px;
    padding: 10px 12px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.breadcrumb-nav {
    gap: var(--mm-space);
    padding: var(--mm-space);
    margin-bottom: var(--mm-space);
}

.post-content,
.article-single,
.sidebar-widget,
.comment-form-wrapper,
.search-header-wrapper {
    padding: var(--mm-space);
}

.post-card,
.article-single,
.sidebar-widget,
.comment-form-wrapper,
.no-posts,
.search-header-wrapper {
    margin-bottom: var(--mm-space);
}

.post-header,
.post-meta,
.article-meta-info,
.related-list,
.comment-item,
.comment-actions,
.hot-post-item,
.tag-cloud,
.social-links,
.page-search-form {
    gap: var(--mm-space);
}

.post-header,
.comment-content,
.article-nav-title,
.widget-title,
.comment-form-title {
    margin-bottom: var(--mm-space);
}

.post-meta {
    padding-top: var(--mm-space);
}

.article-content,
.comments-list,
.pagination-wrapper {
    margin: var(--mm-space) 0;
}

.comments-area {
    margin-top: var(--mm-space);
    padding-top: var(--mm-space);
}

.pagination-info {
    margin-top: var(--mm-space);
}

.widget-title {
    padding-bottom: var(--mm-space);
}

.footer-content {
    padding: var(--mm-space) 0;
}

.back-to-top {
    right: 12px;
    bottom: 12px;
}

.modernmag-sidebar {
    top: calc(var(--cms-header-height) + var(--mm-space));
}

@media (min-width: 1200px) {
    .modernmag-sidebar {
        max-width: 340px;
        margin-left: auto;
    }
}

@media (max-width: 1199px) {
    .banner-hero-card {
        min-height: 228px;
    }

    .banner-hero-card .banner-title {
        font-size: 30px;
    }
}

@media (max-width: 991px) {
    .banner-layout-row > [class*='col-'] {
        display: block;
    }

    .banner-hero-card {
        height: 220px;
        min-height: 220px;
    }

    .banner-hero-card .banner-content {
        max-width: none;
        padding: 22px;
    }

    .banner-site-panel {
        height: auto;
    }
}

@media (max-width: 767px) {
    .banner-hero-card {
        height: 196px;
        min-height: 196px;
    }

    .banner-hero-card .banner-content {
        padding: 18px;
    }

    .banner-hero-card .banner-title {
        font-size: 26px;
    }

    .banner-hero-card .banner-subtitle {
        font-size: 14px;
    }

    .banner-site-panel-header {
        align-items: center;
    }

    .banner-site-metric {
        min-height: 68px;
    }

    .banner-site-metric .metric-value {
        font-size: 20px;
    }
}

@media (max-width: 575px) {
    .banner-site-panel {
        padding: 14px;
    }

    .banner-site-title {
        font-size: 17px;
    }

    .banner-site-status {
        font-size: 12px;
    }

    .banner-site-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1199px) {
    :root {
        --cms-header-height: 60px;
    }

    .cms-header-shell {
        gap: 12px;
    }

    .cms-header-center,
    .cms-header-search,
    .cms-desktop-user {
        display: none;
    }

    .cms-nav-toggle {
        display: inline-flex;
    }

    .cms-brand-copy small {
        display: none;
    }

    .cms-mobile-panel {
        position: fixed;
        top: var(--cms-header-height);
        left: 0;
        right: 0;
        z-index: 1029;
        padding: 12px;
    }

    .cms-mobile-panel-inner {
        width: 100%;
        max-width: var(--mm-shell);
        margin: 0 auto;
        padding: 12px;
        border: 1px solid rgba(148, 163, 184, 0.16);
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    }

    .cms-header.is-menu-open .cms-mobile-panel {
        display: block;
    }

    .cms-mobile-backdrop {
        position: fixed;
        top: var(--cms-header-height);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1028;
        border: 0;
        background: rgba(241, 245, 249, 0.72);
        backdrop-filter: blur(4px);
    }

    .cms-header.is-menu-open .cms-mobile-backdrop {
        display: block;
    }

    .cms-mobile-list {
        margin: 0;
        padding: 0;
        list-style: none;
        border: 1px solid rgba(148, 163, 184, 0.14);
        border-radius: 8px;
        background: #ffffff;
        overflow: hidden;
    }

    .cms-mobile-list + .cms-mobile-search,
    .cms-mobile-search + .cms-mobile-user {
        margin-top: 12px;
    }

    .cms-mobile-item + .cms-mobile-item {
        border-top: 1px solid rgba(148, 163, 184, 0.12);
    }

    .cms-mobile-item-row {
        display: flex;
        align-items: center;
        min-height: 46px;
        background: #ffffff;
    }

    .cms-mobile-link,
    .cms-mobile-sublink {
        display: flex;
        align-items: center;
        width: 100%;
        min-width: 0;
        color: #334155;
        font-size: 15px;
    }

    .cms-mobile-link {
        flex: 1 1 auto;
        min-height: 46px;
        padding: 0 14px;
    }

    .cms-mobile-link.is-danger {
        color: #ef4444;
    }

    .cms-mobile-item.is-active > .cms-mobile-item-row .cms-mobile-link,
    .cms-mobile-subitem.is-active .cms-mobile-sublink {
        color: var(--theme);
        font-weight: 600;
    }

    .cms-mobile-expander {
        width: 46px;
        min-width: 46px;
        height: 46px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #64748b;
    }

    .cms-mobile-expander i {
        transition: transform 0.2s ease;
    }

    .cms-mobile-item.is-open > .cms-mobile-item-row .cms-mobile-expander i {
        transform: rotate(180deg);
    }

    .cms-mobile-submenu {
        display: none;
        margin: 0;
        padding: 0 0 6px;
        list-style: none;
        background: #f8fafc;
        border-top: 1px solid rgba(148, 163, 184, 0.1);
    }

    .cms-mobile-item.is-open > .cms-mobile-submenu {
        display: block;
    }

    .cms-mobile-sublink {
        min-height: 40px;
        padding: 0 14px 0 28px;
        font-size: 14px;
        color: #64748b;
    }

    .cms-mobile-search {
        min-height: 42px;
        padding: 0 12px 0 38px;
        border: 1px solid rgba(148, 163, 184, 0.16);
        border-radius: 8px;
        background: #ffffff;
    }
}

@media (max-width: 767px) {
    :root {
        --cms-header-height: 56px;
    }

    .cms-header-shell {
        width: calc(100% - 24px);
    }

    .cms-brand {
        gap: 10px;
    }

    .cms-brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 7px;
    }

    .cms-brand-mark.is-logo,
    .cms-brand-mark.is-logo img {
        height: 36px;
    }

    .cms-brand-copy strong {
        font-size: 15px;
    }
}

@media print {
    .cms-header {
        display: none !important;
    }
}
