:root {
    --dark: #020617;
    --mid: #090909;
    --light: #f6f7f9;
    --border: #e5e7eb;
    --blue: #2563eb;
    --green: #16a34a;
    --text: #111;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--light);
    color: var(--text);
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

/* ✅ Safe word-break everywhere */
h1,
h2,
h3,
p,
li,
a,
code {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ================= HEADER ================= */
header {
    background: var(--mid);
    color: #fff;
    padding: 18px 5%;
    text-align: center;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .2px;
}

/* ================= SCROLL MENU ================= */
.scroll-menu {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    text-align: center;
    border-top: 1px solid #1f2933;
    border-bottom: 1px solid #1f2933;
    padding: 8px 0;
    background: #000;
}

.scroll-menu::-webkit-scrollbar {
    display: none;
}

.scroll-menu .inner {
    display: inline-flex;
    width: max-content;
}

.scroll-menu a {
    padding: 8px 18px;
    flex-shrink: 0;
    color: #fff;
    opacity: 0.85;
    font-weight: 600;
}

@media (max-width: 640px) {
    .scroll-menu a {
        padding: 8px 14px;
        font-size: 13px;
    }
}

.scroll-menu a:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ================= PAGE HERO ================= */
.page-hero {
    background: linear-gradient(135deg, #0f172a, #020617);
    color: #fff;
    padding: 64px 5% 44px;
}

.hero-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

/* ✅ Desktop layout */
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 28px;
    align-items: center;
}

/* ✅ Responsive stack */
@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.hero-left {
    text-align: left;
    min-width: 0;
}

@media (max-width: 900px) {
    .hero-left {
        text-align: center;
    }
}

.page-hero h1 {
    font-size: clamp(28px, 3.2vw, 42px);
    line-height: 1.15;
    font-weight: 900;
    margin-bottom: 10px;
}

.page-hero p {
    font-size: 15px;
    opacity: .92;
    max-width: 62ch;
}

.breadcrumbs {
    margin-bottom: 18px;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    list-style: none;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    line-height: 1.5;
}

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

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    color: rgba(255, 255, 255, .4);
}

.breadcrumbs a:hover {
    color: #fff;
}

.breadcrumbs [aria-current="page"] {
    color: #fff;
    font-weight: 700;
}

.post-meta {
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, .75);
    line-height: 1.7;
}

@media (max-width: 900px) {
    .page-hero p {
        margin: 0 auto;
    }
}

/* ✅ Featured image (16:9) */
.featured-wrap {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .05);
    aspect-ratio: 16 / 9;
    min-width: 0;
}

.featured-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ✅ Buttons */
.hero-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: stretch;
}

@media (max-width: 900px) {
    .hero-actions {
        justify-content: center;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 800;
    border: 1px solid transparent;
    min-width: 170px;
    cursor: pointer;
    min-height: 48px;
    text-align: center;
}

.btn-primary {
    background: #fff;
    color: #000;
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .25);
}

@media (max-width: 460px) {
    .btn {
        width: 100%;
        min-width: 0;
    }
}

/* ================= PAGE CONTENT ================= */
.page-content {
    padding: 72px 5%;
    background: #ffffff;
}

.content-wrap {
    max-width: 900px;
    margin: auto;
}

.content-wrap>*:first-child {
    margin-top: 0;
}

.page-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
    margin-top: 34px;
    color: #0b1220;
    line-height: 1.25;
}

.page-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    margin-top: 26px;
    color: #0b1220;
    line-height: 1.35;
}

.page-content p {
    font-size: 15px;
    color: #444;
    margin-bottom: 16px;
    line-height: 1.8;
}

.page-content ul,
.page-content ol {
    padding-left: 20px;
    margin-bottom: 18px;
}

.page-content li {
    font-size: 15px;
    color: #444;
    margin-bottom: 8px;
    line-height: 1.75;
}

/* Extra content tags */
.page-content img {
    margin: 18px 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.page-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 30px 0;
}

.page-content blockquote {
    background: #f8fafc;
    border-left: 4px solid var(--blue);
    padding: 14px 18px;
    margin: 22px 0;
    font-size: 15px;
    color: #444;
    border-radius: 6px;
}

.page-content code {
    background: #f1f5f9;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #0f172a;
}

.page-content pre {
    background: #020617;
    color: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 13px;
    margin: 20px 0;
    max-width: 100%;
}

.page-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.page-content strong {
    color: #000;
}

.page-content em {
    font-style: italic;
}

.page-content mark {
    background: #fde68a;
    padding: 2px 6px;
    border-radius: 4px;
}

.page-content small {
    font-size: 12px;
    color: #666;
}

.page-content kbd {
    background: #020617;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.page-content dl {
    margin: 20px 0;
}

.page-content dt {
    font-weight: 800;
    margin-bottom: 6px;
}

.page-content dd {
    margin-bottom: 16px;
    font-size: 14px;
    color: #444;
}

/* ✅ Responsive tables */
.page-content .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 1.5rem 0;
}

.page-content .table-responsive::-webkit-scrollbar {
    display: none;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
    min-width: 620px;
}

.page-content th,
.page-content td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.page-content thead {
    background: var(--mid);
    color: #fff;
}

/* ================= COMMENTS ================= */
.comments-section {
    padding: 0 5% 64px;
    background: #ffffff;
}

.comments-wrap {
    max-width: 900px;
    margin: 0 auto;
}

.comments-header {
    margin-bottom: 18px;
}

.comments-header h2 {
    font-size: 24px;
    line-height: 1.25;
    color: #0b1220;
}

.comments-header p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.75;
    color: #555;
}

.comments-embed {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.comments-embed iframe,
.comments-embed .giscus,
.comments-embed .giscus-frame {
    max-width: 100%;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
    .page-hero {
        padding: 54px 5% 34px;
    }

    .page-content {
        padding: 56px 5%;
    }

    .comments-section {
        padding: 0 5% 52px;
    }

    .page-hero p,
    .page-content p,
    .page-content li,
    .page-content blockquote {
        font-size: 14px;
    }

    .page-content h2 {
        font-size: 22px;
        margin-top: 30px;
    }

    .page-content h3 {
        font-size: 17px;
    }

}

@media (max-width: 560px) {
    header {
        padding: 16px 14px;
    }

    .logo {
        font-size: 20px;
    }

    .page-hero {
        padding: 44px 14px 28px;
    }

    .page-content {
        padding: 42px 14px;
    }

    .comments-section {
        padding: 0 14px 42px;
    }

    .comments-header h2 {
        font-size: 22px;
    }

    .comments-header p {
        font-size: 13px;
    }

    .breadcrumbs ol {
        font-size: 12px;
        gap: 6px 8px;
    }

    .hero-actions {
        width: 100%;
    }

    .btn {
        width: 100%;
        min-width: 0;
    }

    .featured-wrap {
        border-radius: 12px;
    }

    .page-content pre {
        padding: 14px;
        font-size: 12px;
    }

    .page-content th,
    .page-content td {
        padding: 10px;
    }

}

/* ================= UX ================= */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-thumb {
    background: #b5b5b5;
    border-radius: 2px;
}

::-webkit-scrollbar-track {
    background: transparent;
}
