/* Allia Blog - Terminal/Developer Theme */

/* ===================
   ACCESSIBILITY
   =================== */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: #e07850;
    color: #272822;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 500;
    z-index: 1000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

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

/* Focus indicators */
*:focus-visible {
    outline: 2px solid #e07850;
    outline-offset: 2px;
}

a:focus-visible {
    outline: 2px solid #e07850;
    outline-offset: 3px;
}

button:focus-visible,
.hero-button:focus-visible {
    outline: 3px solid #ff8a65;
    outline-offset: 2px;
}

.post-card:focus-within {
    border-color: #e07850;
}

:root {
    --color-bg: #272822;
    --color-bg-alt: #2d2e27;
    --color-bg-card: #323330;
    --color-text: #f8f8f2;
    --color-text-muted: #75715e;
    --color-accent: #e07850;
    --color-accent-hover: #ff8a65;
    --color-border: #3e3d32;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
    --max-width: 900px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.7;
    color: #f8f8f2;
    background-color: #272822;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

a {
    color: #e07850;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #ff8a65;
}

/* ===================
   HEADER
   =================== */
.site-header {
    border-bottom: 1px solid #3e3d32;
    padding: 1.25rem 0;
    background-color: #1e1e1e;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.1rem;
    font-weight: 500;
    color: #f8f8f2;
    text-decoration: none;
}

.site-logo:hover {
    color: #f8f8f2;
}

.site-logo .accent {
    color: #e07850;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav a {
    color: #888888;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: #e07850;
}

.site-nav .external {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #e07850;
}

/* ===================
   MAIN CONTENT
   =================== */
.site-main {
    flex: 1;
    padding: 3rem 0;
}

/* ===================
   HERO (HOME)
   =================== */
.hero {
    text-align: center;
    padding: 4rem 0;
    border-bottom: 1px solid #3e3d32;
    margin-bottom: 3rem;
}

.hero-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #e07850;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 400;
    color: #f8f8f2;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero h1 .accent {
    color: #e07850;
}

.hero p {
    color: #888888;
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #e07850;
    color: #272822;
    padding: 0.85rem 1.75rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.hero-button:hover {
    background-color: #ff8a65;
    color: #272822;
    transform: translateY(-2px);
}

/* ===================
   SECTION HEADER
   =================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0;
}

.section-title {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #888888;
    font-weight: 500;
}

.section-counter {
    font-size: 0.8rem;
    color: #888888;
}

/* ===================
   POST LIST (COMPACT - HOME)
   =================== */
.post-list-compact {
    display: flex;
    flex-direction: column;
}

.post-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.25rem;
    margin: 0 -1.25rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.post-item:hover {
    background-color: #1e1e1e;
    border-left-color: #e07850;
}

.post-item-category {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #e07850;
    min-width: 70px;
    padding-top: 0.15rem;
}

.post-item-content {
    flex: 1;
    min-width: 0;
}

.post-item-title {
    font-size: 1rem;
    font-weight: 500;
    color: #f8f8f2;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.post-item-title a {
    color: inherit;
    text-decoration: none;
}

.post-item-title a:hover {
    color: #e07850;
}

.post-item-meta {
    font-size: 0.8rem;
    color: #888888;
}

.post-item-meta a {
    color: #e07850;
}

.post-item-arrow {
    flex-shrink: 0;
    color: #888888;
    font-size: 1rem;
    padding-top: 0.15rem;
    transition: all 0.15s ease;
}

.post-item:hover .post-item-arrow {
    color: #e07850;
    transform: translateX(4px);
}

/* ===================
   BREADCRUMB
   =================== */
.breadcrumb {
    font-size: 0.85rem;
    color: #e07850;
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: #e07850;
}

.breadcrumb .accent {
    color: #e07850;
}

/* ===================
   PAGE HEADER
   =================== */
.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 500;
    color: #f8f8f2;
    margin-bottom: 0.75rem;
}

.page-header p,
.page-description {
    color: #888888;
    font-size: 0.95rem;
}

/* ===================
   POST GRID (LIST PAGE)
   =================== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.post-card {
    background-color: #323330;
    border: 1px solid #3e3d32;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.post-card:hover {
    border-color: #e07850;
    background-color: #1e1e1e;
}

.post-card:hover::before {
    background-color: #e07850;
}

.post-card-image {
    background-color: #2d2e27;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888888;
    font-size: 0.8rem;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-content {
    padding: 1.25rem;
}

.post-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 1.25rem 0;
}

.tag {
    font-size: 0.7rem;
    color: #e07850;
    text-transform: lowercase;
    padding: 0.2rem 0.5rem;
    background-color: rgba(224, 120, 80, 0.1);
    border: 1px solid rgba(224, 120, 80, 0.3);
}

.post-card h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0.75rem 1.25rem 0.5rem;
    line-height: 1.4;
}

.post-card h2 a {
    color: #f8f8f2;
}

.post-card h2 a:hover {
    color: #e07850;
}

.post-card-excerpt {
    font-size: 0.85rem;
    color: #888888;
    margin: 0 1.25rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    font-size: 0.75rem;
    color: #888888;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.post-card-meta a {
    color: #e07850;
}

/* ===================
   SINGLE POST
   =================== */
.post-header {
    margin-bottom: 2rem;
}

.post-header-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.post-header h1 {
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 1rem;
    color: #f8f8f2;
}

.post-header .post-meta {
    font-size: 0.85rem;
    color: #888888;
}

.post-header .post-meta a {
    color: #e07850;
}

.post-featured-image {
    background-color: #2d2e27;
    height: 320px;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888888;
    font-size: 0.85rem;
    overflow: hidden;
}

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

/* ===================
   POST CONTENT
   =================== */
.post-content {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #f8f8f2;
}

.post-content h2 {
    font-size: 1.4rem;
    margin: 2.5rem 0 1rem;
    font-weight: 500;
    color: #f8f8f2;
}

.post-content h2::before {
    content: '## ';
    color: #e07850;
    opacity: 0.7;
}

.post-content h3 {
    font-size: 1.15rem;
    margin: 2rem 0 0.75rem;
    font-weight: 500;
    color: #f8f8f2;
}

.post-content h3::before {
    content: '### ';
    color: #e07850;
    opacity: 0.7;
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content strong {
    font-weight: 600;
    color: #ffffff;
}

.post-content blockquote {
    border-left: 3px solid #e07850;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: #2d2e27;
    color: #888888;
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content code {
    background-color: #2d2e27;
    padding: 0.2rem 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: #e07850;
    border: 1px solid #3e3d32;
}

.post-content pre {
    position: relative;
    background-color: #2d2e27;
    border: 1px solid #3e3d32;
    margin: 1.5rem 0;
    overflow: hidden;
}

.post-content pre code {
    display: block;
    padding: 1.25rem;
    overflow-x: auto;
    background: none;
    border: none;
    color: #f8f8f2;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #3e3d32;
    font-size: 0.75rem;
    color: #888888;
}

.copy-button {
    background: none;
    border: none;
    color: #e07850;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    transition: opacity 0.2s ease;
}

.copy-button:hover {
    opacity: 0.7;
}

.post-content a {
    color: #e07850;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content img {
    max-width: 100%;
    margin: 1.5rem 0;
    border: 1px solid #3e3d32;
}

/* ===================
   POST FOOTER
   =================== */
.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #3e3d32;
}

.post-footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===================
   POST NAVIGATION
   =================== */
.post-navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #3e3d32;
    gap: 1rem;
}

.post-nav-link {
    flex: 1;
    padding: 1rem 1.25rem;
    background-color: #323330;
    border: 1px solid #3e3d32;
    transition: all 0.2s ease;
    text-decoration: none;
}

.post-nav-link:hover {
    border-color: #e07850;
}

.post-nav-link.prev {
    text-align: left;
}

.post-nav-link.next {
    text-align: right;
}

.post-nav-label {
    display: block;
    font-size: 0.7rem;
    color: #888888;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.post-nav-title {
    color: #f8f8f2;
    font-size: 0.9rem;
}

.post-nav-link:hover .post-nav-title {
    color: #e07850;
}

/* ===================
   PAGINATION
   =================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: 1px solid #3e3d32;
    background-color: #323330;
    color: #888888;
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: #e07850;
    color: #e07850;
}

.pagination .active {
    background-color: #e07850;
    border-color: #e07850;
    color: #272822;
}

/* ===================
   FOOTER
   =================== */
.site-footer {
    border-top: 3px solid #e07850;
    padding: 2rem 0;
    margin-top: auto;
    background-color: #1e1e1e;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #888888;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #888888;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #e07850;
}

/* ===================
   ABOUT PAGE
   =================== */
.about-content {
    max-width: 700px;
}

.about-content h2 {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
    font-weight: 500;
}

.about-content h2::before {
    content: '## ';
    color: #e07850;
    opacity: 0.7;
}

.about-content p {
    margin-bottom: 1rem;
    color: #f8f8f2;
}

.about-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.about-content li {
    margin-bottom: 0.5rem;
    color: #f8f8f2;
}

.about-content strong {
    color: #e07850;
}

/* ===================
   EMPTY STATE
   =================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #888888;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* ===================
   RESPONSIVE
   =================== */
@media (max-width: 768px) {
    .post-grid {
        grid-template-columns: 1fr;
    }

    .site-footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .site-nav {
        gap: 1.25rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .post-header h1 {
        font-size: 1.75rem;
    }

    .post-item {
        flex-wrap: wrap;
    }

    .post-item-category {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .post-navigation {
        flex-direction: column;
    }

    .post-nav-link.next {
        text-align: left;
    }

    .post-featured-image {
        height: 200px;
    }
}
