/*
 * YSTRICKLER INDICE THEME
 * A minimal Indexhibit-inspired Ghost theme
 * All black text, sticky sidebar, clean typography
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Colors - All black text */
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-link: #000000;
    --color-muted: #666666;
    --color-border: #e0e0e0;

    /* Typography */
    --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", Consolas, monospace;

    /* Layout */
    --sidebar-width: 260px;
    --content-max-width: 680px;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Type Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;

    --line-height: 1.6;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
    color: var(--color-text);
}

h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); margin-bottom: var(--space-md); }
h3, h4, h5, h6 { font-size: var(--text-base); }

p {
    margin: 0 0 var(--space-md) 0;
}

/* ============================================
   LINKS - All black with underline
   ============================================ */
a {
    color: var(--color-link);
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
}

/* ============================================
   LAYOUT: SIDEBAR + MAIN
   ============================================ */

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    z-index: 100;
}

.sidebar-inner {
    padding: var(--space-xl);
}

.sidebar-header {
    margin-bottom: var(--space-xl);
}

.sidebar-title {
    font-size: var(--text-lg);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.sidebar-title a {
    text-decoration: none;
}

/* Hamburger - hidden on desktop */
.hamburger {
    display: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-md) 0;
}

.sidebar-nav li {
    margin-bottom: 0.125rem;
}

.sidebar-nav a {
    font-size: var(--text-sm);
    line-height: 1.8;
    text-decoration: none;
    display: block;
}

.sidebar-nav a:hover {
    text-decoration: underline;
}

.sidebar-nav-bottom {
    margin-top: var(--space-xl);
}

.sidebar-subscribe {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-link);
    cursor: pointer;
    text-decoration: none;
    line-height: 1.8;
}

.sidebar-subscribe:hover {
    text-decoration: underline;
}

/* Nav Section Titles */
.nav-section-title {
    font-size: var(--text-xs);
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    font-weight: 400;
}

/* Main Content */
.main {
    margin-left: var(--sidebar-width);
    max-width: var(--content-max-width);
    padding: var(--space-xl);
    min-height: calc(100vh - 100px);
}

/* Footer */
.footer {
    margin-left: var(--sidebar-width);
    max-width: var(--content-max-width);
    padding: var(--space-xl);
    font-size: var(--text-sm);
    color: var(--color-muted);
    border-top: 1px solid var(--color-border);
}

/* ============================================
   POST LIST (Index & Tag pages)
   ============================================ */
.post-feed h2 {
    margin-top: 0;
}

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list li {
    margin-bottom: var(--space-xs);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-md);
}

.post-list a {
    font-size: var(--text-base);
    line-height: 1.8;
}

.post-list .post-date {
    font-size: var(--text-sm);
    color: var(--color-muted);
    flex-shrink: 0;
    text-decoration: none;
}

/* ============================================
   SINGLE POST
   ============================================ */
.post-header {
    margin-bottom: var(--space-xl);
}

.post-title {
    font-size: var(--text-xl);
    font-weight: 400;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.post-date {
    font-size: var(--text-sm);
    color: var(--color-muted);
}

/* Post Content */
.post-content {
    font-size: var(--text-base);
    line-height: var(--line-height);
}

.post-content h2 {
    font-size: var(--text-lg);
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
}

.post-content h3 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}

.post-content p {
    margin-bottom: var(--space-md);
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: var(--space-lg) 0;
}

.post-content figure {
    margin: var(--space-lg) 0;
}

.post-content figcaption {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-top: var(--space-sm);
}

/* Blockquotes */
.post-content blockquote {
    margin: var(--space-lg) 0;
    padding-left: var(--space-md);
    border-left: 2px solid var(--color-border);
    font-style: italic;
    color: var(--color-muted);
}

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

/* Code */
.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: #f5f5f5;
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

.post-content pre {
    background: #f5f5f5;
    padding: var(--space-md);
    overflow-x: auto;
    border-radius: 2px;
    margin: var(--space-lg) 0;
}

.post-content pre code {
    background: transparent;
    padding: 0;
}

/* Lists in content */
.post-content ul,
.post-content ol {
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

.post-content li {
    margin-bottom: var(--space-xs);
}

/* Post Footer / Tags */
.post-footer {
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.post-tags a {
    margin-right: var(--space-sm);
}

/* Feature Images */
.post-feature-image,
.page-feature-image {
    margin: 0 0 var(--space-xl) 0;
}

.post-feature-image img,
.page-feature-image img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   HOMEPAGE
   ============================================ */
.home-intro {
    margin-bottom: var(--space-2xl);
    font-size: var(--text-base);
    line-height: var(--line-height);
}

.home-intro p {
    margin: 0;
}

.home-section {
    margin-bottom: var(--space-2xl);
}

.home-section h2 {
    font-size: var(--text-lg);
    font-weight: 400;
    margin: 0 0 var(--space-md) 0;
}

.view-all {
    margin-top: var(--space-md);
    font-size: var(--text-sm);
}

/* Newsletter */
.newsletter-section p {
    margin-bottom: var(--space-md);
    color: var(--color-muted);
}

.newsletter-button {
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    cursor: pointer;
    text-decoration: none;
}

.newsletter-button:hover {
    opacity: 0.8;
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.page-header {
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: var(--text-xl);
    font-weight: 400;
}

.page-content {
    font-size: var(--text-base);
    line-height: var(--line-height);
}

/* ============================================
   TAG ARCHIVE
   ============================================ */
.tag-header {
    margin-bottom: var(--space-xl);
}

.tag-title {
    font-size: var(--text-xl);
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

.tag-description {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin: 0;
}

/* ============================================
   AUTHOR ARCHIVE
   ============================================ */
.author-header {
    margin-bottom: var(--space-xl);
}

.author-name {
    font-size: var(--text-xl);
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

.author-bio {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin: 0;
}

/* ============================================
   ERROR PAGE
   ============================================ */
.error-page {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.error-code {
    font-size: 4rem;
    font-weight: 400;
    margin-bottom: var(--space-md);
}

.error-message {
    color: var(--color-muted);
    margin-bottom: var(--space-xl);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
}

.pagination-prev,
.pagination-next {
    text-decoration: none;
}

.pagination-prev:hover,
.pagination-next:hover {
    text-decoration: underline;
}

/* ============================================
   GHOST-SPECIFIC: CARDS & EMBEDS
   ============================================ */

/* Width classes - REQUIRED by Ghost */
.kg-width-wide {
    max-width: 100%;
}

.kg-width-full {
    max-width: 100%;
    margin-left: calc(-1 * var(--space-xl));
    margin-right: calc(-1 * var(--space-xl));
    width: calc(100% + (2 * var(--space-xl)));
}

/* Bookmark cards */
.kg-bookmark-card {
    border: 1px solid var(--color-border);
    margin: var(--space-lg) 0;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
}

.kg-bookmark-content {
    padding: var(--space-md);
    flex: 1;
}

.kg-bookmark-title {
    font-weight: 400;
    margin-bottom: var(--space-xs);
}

.kg-bookmark-description {
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.kg-bookmark-thumbnail {
    width: 150px;
    flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Image cards */
.kg-image-card {
    margin: var(--space-lg) 0;
}

.kg-image-card img {
    max-width: 100%;
    height: auto;
}

.kg-image-card figcaption {
    font-size: var(--text-sm);
    color: var(--color-muted);
    text-align: center;
    margin-top: var(--space-sm);
}

/* Gallery */
.kg-gallery-card {
    margin: var(--space-lg) 0;
}

.kg-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.kg-gallery-image img {
    width: 100%;
    height: auto;
}

/* Embeds */
.kg-embed-card {
    margin: var(--space-lg) 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 220px;
    }
}

@media (max-width: 768px) {
    /* Sidebar becomes top bar on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        z-index: 1000;
        background: var(--color-bg);
        overflow: visible;
    }

    .sidebar-inner {
        padding: 0;
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-md);
        margin-bottom: 0;
    }

    .sidebar-title {
        margin-bottom: 0;
    }

    /* Hamburger button - visible on mobile */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--color-text);
        transition: all 0.3s ease;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Menu hidden by default on mobile */
    .sidebar-menu {
        display: none;
        padding: 0 var(--space-md) var(--space-md);
        background: var(--color-bg);
    }

    .sidebar.menu-open .sidebar-menu {
        display: block;
    }

    .sidebar-nav {
        flex-direction: column;
        gap: 0;
    }

    .sidebar-nav li {
        margin-bottom: var(--space-xs);
    }

    .nav-section-title {
        margin-top: var(--space-md);
    }

    .sidebar-nav-bottom {
        margin-top: var(--space-md);
    }

    /* Main content push down for fixed header */
    .main {
        margin-left: 0;
        margin-top: 60px;
        padding: var(--space-md);
    }

    .footer {
        margin-left: 0;
        padding: var(--space-md);
    }

    .post-list li {
        flex-direction: column;
        gap: 0;
    }

    .post-list .post-date {
        margin-top: 0;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .hamburger {
        display: none !important;
    }

    .sidebar-menu {
        display: block !important;
    }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .sidebar {
        display: none;
    }

    .main,
    .footer {
        margin-left: 0;
    }
}
