/*
 * Main Stylesheet for nattapon.io
 */

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #10b981;
    --text-color: #333333;
    --bg-color: #ffffff;
}

body {
    font-family: "Outfit", "Kanit", "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-variation-settings: "wdth" 100;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.site-header {
    background: #f1f1f1;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    margin: 0;
}

.site-title a {
    color: var(--text-color);
    text-decoration: none;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

.main-navigation a {
    color: var(--text-color);
    text-decoration: none;
}

.main-navigation a:hover {
    text-decoration: underline;
}

.site-footer {
    background: #f1f1f1;
    padding: 2rem;
    text-align: center;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* Custom Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Outfit", "Kanit", "Roboto", sans-serif;
    letter-spacing: -0.025em;
    color: inherit;
}

/* Post Content Typography Refined */
.entry-content {
    line-height: 1.8;
    font-family: "Outfit", "Kanit", "Roboto", sans-serif;
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    scroll-margin-top: 150px;
    /* Increased for better landing below navigation */
}

.entry-content h2 {
    font-size: 2.5rem;
}

.entry-content h3 {
    font-size: 2rem;
}

.entry-content h4 {
    font-size: 1.6rem;
}

.entry-content h5 {
    font-size: 1.25rem;
}

.entry-content h6 {
    font-size: 1.125rem;
}

.entry-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.entry-content a:hover {
    opacity: 0.8;
}

.entry-content p {
    margin-bottom: 1.75rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content ul {
    list-style-type: disc;
}

.entry-content ol {
    list-style-type: decimal;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content strong,
.entry-content b {
    font-weight: 700;
}

.entry-content blockquote {
    border-left: 2px solid var(--primary-color);
    padding: 1rem 0 1rem 2.5rem;
    font-style: italic;
    margin: 3rem 0;
    font-size: 1.5rem;
    line-height: 1.6;
    color: #475569;
    /* slate-600 */
    position: relative;
}

.dark .entry-content blockquote {
    color: rgba(255, 255, 255, 0.7);
}

/* Ensure headings in entry-content respect mode-based colors if not explicitly set */
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    color: #1e293b;
    /* slate-800 equivalent */
}

.dark .entry-content h2,
.dark .entry-content h3,
.dark .entry-content h4,
.dark .entry-content h5,
.dark .entry-content h6 {
    color: #f1f5f9;
    /* slate-100 equivalent */
}

/* Glass Card moved to Tailwind @utility in src/input.css */

/* Key Insight Box - More Vibrant Green */
.key-insight {
    background: rgba(16, 185, 129, 0.08);
    border-left: 4px solid var(--primary-color);
    padding: 2.5rem;
    border-radius: 0 2rem 2rem 0;
    margin: 4rem 0;
}

.key-insight h5 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

/* TOC Styling */
.toc-container {
    position: -webkit-sticky;
    position: sticky;
    top: 120px;
    z-index: 10;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

#toc a {
    position: relative;
    padding-left: 0;
    transition: all 0.3s ease;
}

#toc a:hover {
    padding-left: 8px;
    color: var(--primary-color);
}

#toc a.active {
    color: var(--primary-color);
    font-weight: 700;
}


/* Stat Cards (Benchmarks) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.stat-card {
    background: rgba(16, 185, 129, 0.08);
    /* Match key-insight */
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2.5rem;
    border-radius: 2rem;
    text-align: left;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(16, 185, 129, 0.12);
    transform: translateY(-5px);
}

.stat-card .stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-family: "Outfit", "Kanit", "Roboto", sans-serif;
}

.stat-card .stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

/* Responsive Hide Sidebar */
@media (max-width: 1023px) {
    aside {
        display: none;
    }
}