:root {
    --aec-navy: #244b73;
    --aec-navy-dark: #0d1c2d;
    --aec-red: #c91f27;
    --aec-bg: #f4f7fb;
    --aec-surface: #ffffff;
    --aec-text: #152235;
    --aec-muted: #607184;
    --aec-border: #e1e8ef;
    --aec-radius: 18px;
    --aec-shadow: 0 18px 45px rgba(13, 28, 45, .08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--aec-text);
    background: var(--aec-bg);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
}

body.admin-bar .aec-site-header {
    top: 32px;
}

a {
    color: var(--aec-navy);
    text-decoration-thickness: .08em;
    text-underline-offset: .16em;
}

a:hover {
    color: var(--aec-red);
}

img,
video,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus,
.aec-skip-link:focus {
    position: fixed !important;
    z-index: 99999;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
    clip: auto;
    padding: 12px 16px;
    margin: 0;
    color: #fff;
    background: var(--aec-navy-dark);
    border-radius: 8px;
}

.aec-site-header {
    position: sticky;
    z-index: 100;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--aec-border);
    backdrop-filter: blur(14px);
}

.aec-site-header.is-scrolled {
    box-shadow: 0 12px 32px rgba(13, 28, 45, .08);
}

.aec-site-header-inner {
    width: min(1440px, calc(100% - 40px));
    min-height: 82px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.aec-site-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--aec-text);
    text-decoration: none;
}

.aec-site-logo {
    width: auto;
    max-width: min(390px, 37vw);
    max-height: 60px;
    object-fit: contain;
}

.aec-site-brand-text {
    display: none;
    min-width: 0;
}

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

.aec-site-brand-text small {
    color: var(--aec-muted);
    font-size: 12px;
}

.aec-site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.aec-menu,
.aec-footer-menu {
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.aec-menu li {
    position: relative;
}

.aec-menu a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    color: #43566a;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.aec-menu a:hover,
.aec-menu .current-menu-item > a,
.aec-menu .current_page_item > a {
    color: var(--aec-red);
}

.aec-menu .sub-menu {
    position: absolute;
    z-index: 120;
    top: calc(100% - 2px);
    left: -14px;
    min-width: 220px;
    padding: 9px;
    margin: 0;
    visibility: hidden;
    opacity: 0;
    list-style: none;
    border: 1px solid var(--aec-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--aec-shadow);
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.aec-menu li:hover > .sub-menu,
.aec-menu li:focus-within > .sub-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.aec-menu .sub-menu a {
    width: 100%;
    min-height: 38px;
    padding: 4px 9px;
}

.aec-panel-button,
.aec-primary-action {
    display: inline-flex;
    min-height: 46px;
    padding: 0 19px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--aec-navy);
    border: 1px solid var(--aec-navy);
    border-radius: 11px;
    box-shadow: 0 12px 26px rgba(36, 75, 115, .16);
    font-weight: 800;
    text-decoration: none;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.aec-panel-button:hover,
.aec-primary-action:hover {
    color: #fff;
    background: var(--aec-red);
    border-color: var(--aec-red);
    transform: translateY(-1px);
}

.aec-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--aec-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.aec-menu-toggle > span:not(.screen-reader-text) {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: var(--aec-navy-dark);
    border-radius: 4px;
    transition: transform .18s ease, opacity .18s ease;
}

.aec-menu-toggle[aria-expanded="true"] > span:nth-of-type(2) {
    transform: translateY(7px) rotate(45deg);
}

.aec-menu-toggle[aria-expanded="true"] > span:nth-of-type(3) {
    opacity: 0;
}

.aec-menu-toggle[aria-expanded="true"] > span:nth-of-type(4) {
    transform: translateY(-7px) rotate(-45deg);
}

.aec-main-content {
    width: min(1180px, calc(100% - 40px));
    min-height: 70vh;
    margin: 0 auto;
    padding: 64px 0 88px;
}

.aec-front-entry {
    width: 100%;
}

.aec-entry,
.aec-archive-header,
.aec-empty-state,
.aec-comments {
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--aec-border);
    border-radius: var(--aec-radius);
    background: var(--aec-surface);
    box-shadow: 0 10px 34px rgba(13, 28, 45, .045);
}

.aec-entry-header h1,
.aec-archive-header h1 {
    margin: 0;
    color: var(--aec-navy-dark);
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.08;
}

.aec-entry-content {
    min-width: 0;
}

.aec-entry-header + .aec-entry-content {
    margin-top: 28px;
}

.aec-entry-content > :first-child {
    margin-top: 0;
}

.aec-entry-content > :last-child {
    margin-bottom: 0;
}

.aec-entry-content .alignwide {
    width: min(1320px, calc(100vw - 40px));
    max-width: none;
    margin-right: 50%;
    margin-left: 50%;
    transform: translateX(-50%);
}

.aec-entry-content .alignfull {
    width: 100vw;
    max-width: none;
    margin-right: 50%;
    margin-left: 50%;
    transform: translateX(-50%);
}

.aec-entry-content table {
    width: 100%;
    border-collapse: collapse;
}

.aec-entry-content th,
.aec-entry-content td {
    padding: 11px;
    border: 1px solid var(--aec-border);
    text-align: left;
}

.aec-entry-content pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 18px;
    border-radius: 12px;
    color: #d8e7f3;
    background: #101d2b;
}

.aec-entry-content blockquote {
    margin-right: 0;
    margin-left: 0;
    padding: 10px 20px;
    border-left: 4px solid var(--aec-red);
    color: #43566a;
}

.aec-home-hero {
    min-height: 640px;
    padding: clamp(34px, 7vw, 90px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    align-items: center;
    gap: 54px;
    border: 1px solid var(--aec-border);
    border-radius: 26px;
    background:
        radial-gradient(circle at 85% 18%, rgba(201, 31, 39, .13), transparent 28%),
        linear-gradient(135deg, #fff, #edf3f8);
    box-shadow: var(--aec-shadow);
    overflow: hidden;
}

.aec-home-copy h1 {
    margin: 14px 0 22px;
    color: var(--aec-navy-dark);
    font-size: clamp(48px, 7vw, 92px);
    line-height: .98;
}

.aec-home-copy p {
    max-width: 720px;
    margin: 0;
    color: #536578;
    font-size: clamp(19px, 2.1vw, 28px);
    line-height: 1.48;
}

.aec-eyebrow {
    color: var(--aec-red);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.aec-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.aec-home-visual {
    display: grid;
    place-items: center;
    filter: drop-shadow(0 30px 48px rgba(13, 28, 45, .14));
}

.aec-post-list {
    display: grid;
    gap: 18px;
}

.aec-post-card {
    display: grid;
    grid-template-columns: minmax(220px, .34fr) minmax(0, .66fr);
    overflow: hidden;
    border: 1px solid var(--aec-border);
    border-radius: var(--aec-radius);
    background: #fff;
}

.aec-post-card:not(:has(.aec-post-thumbnail)) {
    grid-template-columns: 1fr;
}

.aec-post-thumbnail {
    min-height: 230px;
    display: block;
    background: #e8eef4;
}

.aec-post-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.aec-post-body {
    padding: 28px;
}

.aec-post-title {
    margin: 0;
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.15;
}

.aec-post-title a {
    color: var(--aec-navy-dark);
    text-decoration: none;
}

.aec-post-title a:hover {
    color: var(--aec-red);
}

.aec-post-meta {
    margin-top: 9px;
    color: var(--aec-muted);
    font-size: 13px;
}

.aec-post-excerpt {
    margin-top: 17px;
    color: #4e6174;
}

.aec-single-thumbnail {
    margin: 28px 0;
    overflow: hidden;
    border-radius: 14px;
}

.aec-archive-header {
    margin-bottom: 22px;
}

.aec-archive-description {
    margin-top: 13px;
    color: var(--aec-muted);
}

.pagination,
.navigation.pagination {
    margin-top: 28px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.page-numbers {
    min-width: 40px;
    min-height: 40px;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--aec-border);
    border-radius: 9px;
    background: #fff;
    text-decoration: none;
}

.page-numbers.current,
.page-numbers:hover {
    color: #fff;
    background: var(--aec-navy);
    border-color: var(--aec-navy);
}

.post-navigation {
    margin: 22px 0;
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-navigation a {
    min-height: 92px;
    padding: 17px;
    display: grid;
    gap: 5px;
    border: 1px solid var(--aec-border);
    border-radius: 13px;
    background: #fff;
    text-decoration: none;
}

.post-navigation span {
    color: var(--aec-muted);
    font-size: 12px;
}

.aec-comments {
    margin-top: 22px;
}

.aec-comment-list {
    padding-left: 24px;
}

.aec-empty-state {
    min-height: 390px;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
}

.aec-error-code {
    color: rgba(36, 75, 115, .13);
    font-size: clamp(80px, 16vw, 190px);
    font-weight: 950;
    line-height: .8;
}

.aec-empty-state h1 {
    margin: 22px 0 8px;
    font-size: clamp(35px, 5vw, 62px);
}

.aec-empty-state p {
    max-width: 580px;
    margin: 0;
    color: var(--aec-muted);
}

.aec-empty-actions {
    margin-top: 24px;
    display: grid;
    gap: 16px;
    justify-items: center;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-field,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
    max-width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    color: var(--aec-text);
    background: #fff;
    border: 1px solid #cbd6e1;
    border-radius: 9px;
}

textarea {
    min-height: 130px;
}

.search-submit,
input[type="submit"],
button[type="submit"] {
    min-height: 44px;
    padding: 0 16px;
    color: #fff;
    background: var(--aec-navy);
    border: 1px solid var(--aec-navy);
    border-radius: 9px;
    font-weight: 800;
    cursor: pointer;
}

.aec-site-footer {
    color: #dbe6ef;
    background: var(--aec-navy-dark);
}

.aec-site-footer-inner {
    width: min(1440px, calc(100% - 40px));
    min-height: 112px;
    margin: 0 auto;
    padding: 26px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.aec-footer-brand {
    display: grid;
    gap: 3px;
}

.aec-footer-brand span,
.aec-copyright {
    color: #9fb1c2;
    font-size: 13px;
}

.aec-footer-menu a {
    color: #dbe6ef;
    text-decoration: none;
}

.aec-footer-menu a:hover {
    color: #fff;
}

@media (max-width: 960px) {
    body.admin-bar .aec-site-header {
        top: 46px;
    }

    .aec-menu-toggle {
        display: block;
    }

    .aec-site-header-inner {
        position: relative;
        min-height: 74px;
    }

    .aec-site-logo {
        max-width: min(400px, 65vw);
        max-height: 52px;
    }

    .aec-site-nav {
        position: absolute;
        top: calc(100% + 1px);
        right: 0;
        left: 0;
        padding: 18px 20px 22px;
        visibility: hidden;
        opacity: 0;
        flex-direction: column;
        align-items: stretch;
        background: #fff;
        border: 1px solid var(--aec-border);
        border-top: 0;
        border-radius: 0 0 15px 15px;
        box-shadow: var(--aec-shadow);
        transform: translateY(-7px);
        transition: opacity .18s ease, transform .18s ease, visibility .18s;
    }

    .aec-site-nav.is-open {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }

    .aec-menu {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        gap: 2px;
    }

    .aec-menu a {
        width: 100%;
        padding: 5px 8px;
    }

    .aec-menu .sub-menu {
        position: static;
        min-width: 0;
        padding: 0 0 0 16px;
        visibility: visible;
        opacity: 1;
        border: 0;
        box-shadow: none;
        transform: none;
    }

    .aec-panel-button {
        width: 100%;
    }

    .aec-home-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .aec-home-visual {
        order: -1;
        max-width: 600px;
        margin: 0 auto;
    }

    .aec-post-card {
        grid-template-columns: 1fr;
    }

    .aec-post-thumbnail {
        min-height: 250px;
    }
}

@media (max-width: 680px) {
    .aec-site-header-inner,
    .aec-main-content,
    .aec-site-footer-inner {
        width: min(100% - 28px, 1180px);
    }

    .aec-main-content {
        padding-top: 34px;
        padding-bottom: 56px;
    }

    .aec-entry,
    .aec-archive-header,
    .aec-empty-state,
    .aec-comments {
        padding: 22px;
        border-radius: 14px;
    }

    .aec-home-hero {
        padding: 28px 22px;
        border-radius: 16px;
    }

    .aec-entry-content .alignwide,
    .aec-entry-content .alignfull {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
        transform: none;
    }

    .post-navigation .nav-links {
        grid-template-columns: 1fr;
    }

    .aec-site-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .aec-footer-menu {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .search-form {
        width: 100%;
        flex-direction: column;
    }
}

@media (max-width: 782px) {
    body.admin-bar .aec-site-header {
        top: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
