:root {
    color-scheme: light;
    --ink: #101623;
    --muted: #5e6b7a;
    --soft: #eef3f6;
    --paper: #ffffff;
    --paper-2: #f8fafc;
    --line: #dce4ea;
    --teal: #0f766e;
    --navy: #123c69;
    --coral: #e25544;
    --gold: #d98921;
    --focus: rgba(15, 118, 110, 0.16);
    --shadow-sm: 0 1px 2px rgba(16, 22, 35, 0.06);
    --shadow-md: 0 18px 44px -32px rgba(16, 22, 35, 0.55);
    --shadow-lg: 0 30px 70px -42px rgba(16, 22, 35, 0.68);
    --radius: 8px;
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-serif: "Merriweather", Georgia, serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    background:
        linear-gradient(180deg, #eef5f6 0%, #f8fafc 40%, #ffffff 100%);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

a:hover {
    color: var(--navy);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--ink);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 1rem;
}

p {
    color: var(--muted);
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.page-stack {
    display: grid;
    gap: 1.5rem;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(220, 228, 234, 0.78);
    backdrop-filter: blur(18px);
}

.navbar-container {
    width: min(1240px, calc(100% - 32px));
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
}

.navbar-brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 900;
    white-space: nowrap;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--teal), var(--navy));
    border-radius: var(--radius);
    box-shadow: 0 16px 28px -20px rgba(15, 118, 110, 0.95);
    color: #fff;
    font-size: 0.92rem;
    line-height: 1;
}

.navbar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #536171;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 0.38rem 0.6rem;
}

.nav-link:hover {
    background: #f1f7f6;
    border-color: #d6ebe7;
    color: var(--teal);
}

.nav-link--strong {
    background: var(--ink);
    color: #fff;
}

.nav-link--strong:hover {
    background: var(--teal);
    color: #fff;
}

.nav-link--quiet {
    color: var(--muted);
}

.hero-header {
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    background-position: center;
    background-size: cover;
    margin-bottom: 2rem;
    padding: 6rem 0 3.4rem;
}

.hero-header--compact {
    min-height: 260px;
    padding: 3.8rem 0 2.25rem;
}

.hero-content {
    max-width: 780px;
}

.hero-kicker,
.section-kicker,
.post-kicker {
    color: var(--gold);
    font-size: 0.68rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.hero-title {
    color: #fff;
    font-size: clamp(1.9rem, 4.8vw, 4.2rem);
    margin-bottom: 0.8rem;
}

.hero-header--compact .hero-title {
    max-width: 760px;
    font-size: clamp(1.65rem, 3.4vw, 2.75rem);
    line-height: 1.04;
}

.hero-subtitle {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(0.92rem, 1.5vw, 1.08rem);
}

.hero-header--compact .hero-subtitle {
    max-width: 560px;
    font-size: clamp(0.88rem, 1.25vw, 1rem);
}

.overview-strip,
.admin-command,
.content-toolbar,
.split-panel,
.editor-shell,
.form-shell,
.article-shell,
.feature-panel,
.side-panel,
.empty-state {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.overview-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
}

.overview-item {
    padding: 0.45rem 0.7rem;
    border-right: 1px solid var(--line);
}

.overview-item:last-child {
    border-right: 0;
}

.overview-item span {
    display: block;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.overview-item p {
    font-size: 0.48rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-command,
.content-toolbar,
.split-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
    align-items: center;
    gap: 1.25rem;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.content-toolbar {
    grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-heading h2,
.admin-command h2,
.content-toolbar h2,
.split-panel h2,
.form-shell h2,
.side-panel h2 {
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    margin-bottom: 0;
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.6rem;
}

.search-panel input,
.form-control {
    width: 100%;
    min-height: 50px;
    appearance: none;
    background: #fbfdff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
    padding: 0.85rem 0.95rem;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-panel input:focus,
.form-control:focus {
    background: #fff;
    border-color: var(--teal);
    box-shadow: 0 0 0 4px var(--focus);
    outline: none;
}

.form-control::placeholder {
    color: #94a3b8;
}

.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 900;
    font-size: 0.88rem;
    padding: 0.62rem 0.95rem;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--teal), var(--navy));
    box-shadow: 0 18px 34px -22px rgba(15, 118, 110, 0.95);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0d665f, #0e3258);
    color: #fff;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.btn-secondary:hover {
    background: var(--paper-2);
    color: var(--teal);
    transform: translateY(-2px);
}

.btn-danger {
    background: #fff5f5;
    border-color: #fecaca;
    color: #b42318;
}

.btn-danger:hover {
    background: #fee2e2;
    color: #991b1b;
    transform: translateY(-2px);
}

.button-row,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.featured-post {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.featured-media {
    min-height: 380px;
    background: var(--soft);
}

.featured-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.featured-media img[src*="/generated-cover/"],
.post-image[src*="/generated-cover/"] {
    background: #101623;
    object-fit: contain;
}

.featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.featured-content h2 {
    font-size: clamp(1.45rem, 3vw, 2.45rem);
}

.featured-content h2 a,
.post-title a {
    color: var(--ink);
}

.featured-content h2 a:hover,
.post-title a:hover {
    color: var(--teal);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.25rem;
}

.post-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.post-card:hover {
    border-color: #b7d8d2;
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.post-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: block;
    background: var(--soft);
    object-fit: cover;
}

.post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}

.post-title {
    font-size: 1.1rem;
}

.post-subtitle {
    flex: 1;
    margin-bottom: 1rem;
}

.post-meta,
.post-stats,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.post-meta {
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 0.85rem;
}

.post-stats {
    margin-top: 0.8rem;
}

.post-stats span {
    background: #eef8f6;
    border-radius: var(--radius);
    color: var(--teal);
    padding: 0.3rem 0.55rem;
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-delete {
    color: #b42318;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.empty-state {
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
}

.empty-state-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    background: #eef8f6;
    border-radius: 50%;
    color: var(--teal);
    font-size: 1.25rem;
    margin: 0 auto 1rem;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
    gap: 1.25rem;
    align-items: start;
}

.form-shell,
.side-panel,
.feature-panel,
.article-shell {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.side-panel {
    position: sticky;
    top: 96px;
}

.form-group,
.field-block {
    margin-bottom: 1rem;
}

.field-block label,
.form-group label,
form label {
    display: inline-block;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 900;
    margin-bottom: 0.45rem;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field-block--wide {
    grid-column: 1 / -1;
}

.field-hint {
    color: var(--muted);
    font-size: 0.86rem;
}

.field-error,
.help-block,
.text-danger {
    color: #b42318;
    font-size: 0.86rem;
    font-weight: 800;
    margin-top: 0.3rem;
}

.checkbox-field {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--teal);
}

.checkbox-field span {
    font-weight: 900;
}

.editor-shell {
    overflow: hidden;
}

.editor-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: clamp(1.25rem, 3vw, 2rem);
}

.editor-form {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.status-pill {
    flex: 0 0 auto;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: var(--radius);
    color: #9a3412;
    font-size: 0.78rem;
    font-weight: 900;
    padding: 0.45rem 0.65rem;
    text-transform: uppercase;
}

.editor-body-field,
.comments-area {
    border-top: 1px solid var(--line);
    margin-top: 1.25rem;
    padding-top: 1.5rem;
}

.editor-textarea {
    min-height: 360px;
}

.form-actions {
    border-top: 1px solid var(--line);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.form-actions--compact {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 800;
    margin: 1rem 0;
    padding: 0.95rem 1rem;
}

.alert p {
    margin: 0;
}

.alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.alert-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.article-shell {
    max-width: 900px;
    margin: 0 auto 3rem;
}

.article-meta {
    justify-content: center;
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.engagement-panel {
    max-width: 520px;
    display: grid;
    grid-template-columns: repeat(3, minmax(54px, 1fr)) repeat(3, auto);
    align-items: center;
    gap: 0.25rem;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 0 auto 1.35rem;
    padding: 0.38rem;
}

.engagement-stat {
    border-right: 1px solid var(--line);
    padding: 0.18rem 0.38rem;
}

.engagement-stat strong {
    display: block;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.1rem;
}

.engagement-stat span {
    color: var(--muted);
    font-size: 0.5rem;
    font-weight: 900;
    text-transform: uppercase;
}

.engagement-actions {
    margin: 0;
}

.reaction-btn {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.24rem;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.58rem;
    font-weight: 900;
    padding: 0.25rem 0.36rem;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.reaction-btn:hover {
    background: #eef8f6;
    border-color: #b7d8d2;
    color: var(--teal);
    transform: translateY(-1px);
}

.reaction-btn--muted:hover {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.post-body {
    max-width: 720px;
    margin: 0 auto 2rem;
    color: #253044;
    font-family: var(--font-serif);
    font-size: 0.94rem;
    line-height: 1.72;
}

.post-body h2,
.post-body h3 {
    font-family: var(--font-sans);
    margin-top: 2rem;
}

.post-body p,
.post-body ul,
.post-body ol {
    margin-bottom: 1.25rem;
}

.post-body ul,
.post-body ol {
    padding-left: 1.35rem;
}

.article-author-card {
    align-items: center;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 1rem;
    grid-template-columns: 76px 1fr;
    margin-top: 2.5rem;
    padding-top: 1.4rem;
}

.article-author-card img {
    aspect-ratio: 1;
    background: #05070a;
    border: 2px solid #05070a;
    border-radius: 999px;
    box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
    display: block;
    height: 76px;
    object-fit: cover;
    object-position: center top;
    width: 76px;
}

.article-author-card h2 {
    font-family: var(--font-sans);
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.article-author-card p {
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0;
}

.article-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
    padding-top: 1.5rem;
}

.comment-form {
    background:
        linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.comment-form .field-block {
    margin-bottom: 0.75rem;
}

.comment-textarea {
    min-height: 132px;
    resize: vertical;
}

.comment-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.comment {
    display: flex;
    gap: 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
}

.commenter-image img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
}

.comment-text p {
    color: var(--ink);
}

.comment-text .sub-text {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.split-panel .prose-block p {
    margin-bottom: 1rem;
}

.value-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.value-grid article {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
}

.value-grid i {
    color: var(--teal);
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.iframe-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.iframe-shell iframe {
    width: 100%;
    min-height: 72vh;
    border: 0;
    display: block;
}

.cke_chrome {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden;
}

.cke_top,
.cke_bottom {
    background: #f8fafc !important;
    border-color: var(--line) !important;
}

.cke_wysiwyg_frame,
.cke_wysiwyg_div {
    background: #fff !important;
}

.cke_notification,
.cke_notifications_area {
    display: none !important;
}

.sr-only {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

footer {
    background: #101623;
    color: rgba(255, 255, 255, 0.78);
    margin-top: 3rem;
    padding: 2.5rem 0 1.25rem;
}

footer p,
footer a {
    color: rgba(255, 255, 255, 0.72);
}

footer a:hover {
    color: #fff;
}

.footer-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
    text-align: center;
}

.footer-brand {
    justify-content: center;
    color: #fff;
    margin-bottom: 0.8rem;
}

.footer-actions,
.footer-links,
.social-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.footer-actions {
    justify-content: center;
    gap: 1rem;
}

.footer-links {
    justify-content: center;
    gap: 0.35rem;
}

.footer-links a {
    border-radius: var(--radius);
    font-weight: 800;
    padding: 0.45rem 0.65rem;
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.social-links {
    justify-content: center;
    gap: 0.55rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.32);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
}

@media (max-width: 860px) {
    .navbar-container {
        align-items: flex-start;
        flex-direction: column;
        padding: 0.9rem 0;
    }

    .navbar-nav {
        justify-content: flex-start;
        width: 100%;
    }

    .hero-header,
    .hero-header--compact {
        min-height: 300px;
        padding: 3.4rem 0 2.35rem;
    }

    .overview-strip,
    .admin-command,
    .content-toolbar,
    .split-panel,
    .featured-post,
    .auth-layout,
    .value-grid {
        grid-template-columns: 1fr;
    }

    .overview-item {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .overview-item:last-child {
        border-bottom: 0;
    }

    .search-panel,
    .engagement-panel,
    .field-grid {
        grid-template-columns: 1fr;
    }

    .engagement-stat {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .engagement-actions,
    .reaction-btn {
        width: 100%;
    }

    .article-author-card {
        grid-template-columns: 64px 1fr;
    }

    .article-author-card img {
        height: 64px;
        width: 64px;
    }

    .button-row,
    .form-actions,
    .article-actions {
        justify-content: stretch;
    }

    .btn,
    .button-row .btn,
    .form-actions .btn {
        width: 100%;
    }

    .side-panel {
        position: static;
    }
}

@media (max-width: 520px) {
    .container,
    .navbar-container {
        width: min(100% - 24px, 1180px);
    }

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

    .comment {
        flex-direction: column;
    }
}
