body:has(#post) {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    align-items: start;
    gap: 20px;
    min-height: 100dvh;
    padding: 24px;
    background: #f3f1ef;
    color: #302b27;
    font-family: "Alan Sans", Arial, sans-serif;
}

body:has(#post) *,
body:has(#comment) * {
    font-family: "Alan Sans", Arial, sans-serif;
    box-sizing: border-box;
}

body:has(#post) .material-symbols-outlined,
body:has(#comment) .material-symbols-outlined {
    font-family: "Material Symbols Outlined";
}

body:has(#post) #post {
    display: flex;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: calc(100dvh - 48px);
    align-items: stretch;
    overflow: visible;
    border: 1px solid #35261d18;
    border-radius: 16px;
    background: #fffdfa;
    box-shadow: 0 10px 32px #32261d12;
}

body:has(#post) #post #menu {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 76px;
    align-items: center;
    margin: 0;
    padding: 10px 20px;
    border: 0;
    border-bottom: 1px solid #39291d18;
    background: #f5f2ef;
}

body:has(#post) #post #menu .theme-toggle {
    flex: 0 0 auto;
    margin: 0 12px;
}

body:has(#post) #post #menu > a {
    flex: 0 0 auto;
    padding: 0;
    color: #754033;
    font-size: 0.9rem;
    text-transform: none;
}

body:has(#post) #post #menu > a span {
    margin: 0 8px 0 0;
    padding: 8px;
    background: #eee3dc;
    color: #754033;
}

body:has(#post) #post #menu hgroup {
    flex: 1 1 100px;
    width: auto;
    min-width: 0;
    justify-content: flex-end;
}

body:has(#post) #post #menu hgroup a {
    min-width: 0;
    display: flex;
    flex-direction: row;
    gap: 9px;
    margin: 0;
    color: #302b27;
}

body:has(#post) #post #menu hgroup a img {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    margin: 0;
    border: 2px solid #d9c7bb;
}

body:has(#post) #post #menu hgroup a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #302b27;
    font-size: 0.9rem;
    font-weight: 650;
}

body:has(#post) #post #ap_post {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: clamp(24px, 5vw, 64px);
    overflow: visible;
    background: #fffdfa;
}

body:has(#post) #post #ap_post #titulos {
    overflow-wrap: anywhere;
    padding: 0 0 18px;
    color: #292522;
    font-family: "Alan Sans", Arial, sans-serif;
    font-size: clamp(1.7rem, 4vw, 2.7rem);
    line-height: 1.2;
}

.post-breadcrumb, .publication-date { margin-bottom: 16px; color: #625b55; font-size: .9rem; }
.post-breadcrumb a { color: #754033; text-decoration: underline; }
html[data-theme="dark"] .post-breadcrumb,
html[data-theme="dark"] .post-breadcrumb span,
html[data-theme="dark"] .publication-date,
html[data-theme="dark"] .publication-date time { color: #d4cbc4; }
html[data-theme="dark"] .post-breadcrumb a { color: #f0b29a; }

body:has(#post) #post #ap_post #markdown {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 240px;
    padding: 0 0 64px;
    overflow: visible;
    color: #39332e;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

body:has(#post) #post #ap_post #markdown pre {
    max-width: 100%;
    overflow-x: auto;
}

body:has(#post) #post #ap_post #markdown h1,
body:has(#post) #post #ap_post #markdown h2,
body:has(#post) #post #ap_post #markdown h3,
body:has(#post) #post #ap_post #markdown p,
body:has(#post) #post #ap_post #markdown li,
body:has(#post) #post #ap_post #markdown strong,
body:has(#post) #post #ap_post #markdown em {
    color: #39332e;
    line-height: 1.8;
}

body:has(#post) #post #ap_post #markdown a {
    color: #754033;
    text-decoration: underline;
    text-underline-offset: 3px;
}

body:has(#post) #post #ap_post #info {
    right: 20px;
    bottom: 18px;
}

body:has(#post) #post #ap_post #info button {
    gap: 6px;
    padding: 9px 14px;
    background: #eee3dc;
    color: #754033;
}

body:has(#post) #post #ap_post #info button span {
    color: inherit;
}

body:has(#comment) #comment {
    position: sticky;
    top: 24px;
    width: 100%;
    min-width: 0;
    height: calc(100dvh - 48px);
    overflow: hidden;
    border: 1px solid #35261d18;
    border-radius: 16px;
    background: #fffdfa;
    box-shadow: 0 10px 32px #32261d12;
}

body:has(#comment) #comment * {
    color: #302b27;
}

body:has(#comment) #comment #textbar {
    flex: 0 0 auto;
    height: auto;
    min-height: 74px;
    gap: 0;
    padding: 12px;
    border-bottom: 1px solid #39291d18;
}

body:has(#comment) #comment #textbar input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    min-height: 42px;
    max-height: none;
    padding: 10px 13px;
    border: 1px solid #ddd4cd;
    border-right: 0;
    border-radius: 999px 0 0 999px;
    background: #fff;
    color: #302b27;
    font-size: 0.9rem;
}

body:has(#comment) #comment #textbar button {
    flex: 0 0 48px;
    padding: 0;
    width: 48px;
    height: 42px;
    border-radius: 0 999px 999px 0;
    background: #7a392b;
    color: #fff;
}

body:has(#comment) #comment #textbar button span {
    color: #fff;
}

body:has(#comment) #comment > ul {
    flex: 1 1 auto;
    margin: 0;
    min-height: 0;
    max-height: none;
    padding: 12px 16px;
    overflow-y: auto;
}

body:has(#comment) #comment > ul > li {
    width: 100%;
    padding: 6px 0 12px;
    border-bottom: 1px solid #eee8e3;
}

body:has(#comment) #comment > ul > li hgroup {
    height: 48px;
}

body:has(#comment) #comment > ul > li hgroup img {
    width: 34px;
    height: 34px;
    border: 1px solid #d9c7bb;
}

body:has(#comment) #comment > ul > li hgroup label a {
    color: #754033;
    font-size: 0.88rem;
    font-weight: 700;
}

body:has(#comment) #comment > ul > li p {
    overflow-wrap: anywhere;
    margin: 2px 0 8px;
    color: #625b55;
    font-size: 0.9rem;
    line-height: 1.55;
}

body:has(#comment) #comment > ul #popup {
    width: 100%;
    margin: 12px 0;
    padding: 16px;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
    animation: none;
    box-shadow: none;
}

body:has(#post) #post #menu .theme-toggle {
    border-color: #75403360;
    background: #75403310;
    color: #754033;
}

html[data-theme="dark"] body:has(#post) #post #menu .theme-toggle {
    border-color: #ffffff40;
    background: #ffffff12;
    color: #eee8e2;
}

@media (max-width: 760px) {
    body:has(#post) {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 12px;
    }

    body:has(#post) #post {
        width: 100%;
        min-height: 0;
    }

    body:has(#post) #post #menu .theme-toggle {
        margin: 0 8px;
    }

    body:has(#post) #post #menu hgroup {
        min-width: 0;
    }

    body:has(#post) #post #ap_post {
        padding: 25px 20px 68px;
    }

    body:has(#post) #post #ap_post #markdown {
        min-height: 160px;
    }

    body:has(#comment) #comment {
        position: static;
        width: 100%;
        height: auto;
        min-height: 180px;
    }

    body:has(#comment) #comment > ul {
        max-height: 55dvh;
        overflow-y: auto;
    }
}

@media (max-width: 420px) {
    body:has(#post) #post #menu {
        min-height: 64px;
        padding: 8px 12px;
    }

    body:has(#post) #post #menu hgroup a {
        gap: 6px;
    }

    body:has(#post) #post #menu hgroup a img {
        width: 34px;
        height: 34px;
    }

    body:has(#post) #post #menu hgroup a span {
        max-width: 76px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
