/* ============================================
   MINIMALIST PERSONAL WEBSITE STYLESHEET
   Based on jordienric.com design analysis
   ============================================ */

/* --------------------------------------------
   FONTS
   -------------------------------------------- */
@font-face {
    font-family: "Figtree";
    src: url("Figtree/Figtree-VariableFont_wght.ttf") format("truetype");
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("Figtree/Figtree-Italic-VariableFont_wght.ttf") format("truetype");
    font-weight: 300 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Urbanist";
    src: url("Urbanist/Urbanist-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Urbanist";
    src: url("Urbanist/Urbanist-Italic-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* Averia Serif Libre - loaded via Google Fonts in HTML for reliable online display;
   local @font-face kept as offline fallback */
@font-face {
    font-family: "Averia Serif Libre";
    src: url("/Averia_Serif_Libre/AveriaSerifLibre-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Averia Serif Libre";
    src: url("/Averia_Serif_Libre/AveriaSerifLibre-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Averia Serif Libre";
    src: url("/Averia_Serif_Libre/AveriaSerifLibre-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Averia Serif Libre";
    src: url("/Averia_Serif_Libre/AveriaSerifLibre-BoldItalic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* --------------------------------------------
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   -------------------------------------------- */
:root {
    /* Color Palette */
    --color-text-primary: #111827;      /* Very dark gray for headings */
    --color-text-body: #374151;         /* Medium-dark gray for body */
    --color-text-secondary: #6b7280;    /* Medium gray for subtitles */
    --color-text-tertiary: #9ca3af;     /* Light gray for metadata */
    --color-text-link: #c47222;         /* Horseman icon color - warm orange/terracotta */
    --color-text-link-hover: #c47222;   /* Same as link (horseman icon) */
    
    --color-bg-primary: #fbfcfd;       /* Subtle grey background */
    --color-bg-hover: #f9fafb;          /* Very subtle gray hover */
    --color-border: #e5e7eb;            /* Light gray borders */
    
    /* Typography */
    --font-family-heading: "Averia Serif Libre", Georgia, "Times New Roman", serif;
    --font-family-base: "Averia Serif Libre", Georgia, "Times New Roman", serif;
    
    --font-size-xlarge: 2.25rem;        /* 36px - Main name */
    --font-size-large: 1.5rem;          /* 24px - Section headers */
    --font-size-medium: 1.125rem;       /* 18px - Subtitles */
    --font-size-base: 1rem;             /* 16px - Body text */
    --font-size-small: 0.875rem;        /* 14px - Metadata */
    --font-size-xsmall: 0.8125rem;      /* 13px - Tiny text */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */
    
    /* Layout */
    --container-max-width: 50rem;       /* 800px */
    --container-padding: 1.5rem;        /* 24px */
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

/* --------------------------------------------
   RESET & BASE STYLES
   -------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-body);
    background-color: var(--color-bg-primary);
}

/* --------------------------------------------
   TYPOGRAPHY
   -------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

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

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-text-link-hover);
}

/* --------------------------------------------
   LAYOUT
   -------------------------------------------- */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--space-2xl) var(--container-padding);
}

/* --------------------------------------------
   SITE HEADER
   -------------------------------------------- */
.site-header {
    margin-bottom: var(--space-3xl);
}

.site-title {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xlarge);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
    line-height: var(--line-height-tight);
    transition: opacity 0.2s ease-in-out;
}

/* Prevent text selection during animation */
.site-title.animating {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.site-subtitle {
    font-size: var(--font-size-medium);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.site-subtitle .company-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35em;
    vertical-align: baseline;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.site-subtitle .company-link:hover {
    color: var(--color-text-link) !important;
}

.site-subtitle .farai-logo {
    height: 0.8em;
    width: auto;
    vertical-align: baseline;
}

/* Social Links - grid keeps vertical alignment in 2+1 layout */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
    padding-top: 1px; /* compensate for overlap so first row doesn’t move up */
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    
    /* Border and padding; negative margins so boxes stay flush when wrapping */
    border: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-lg) var(--space-xs) var(--space-sm);
    margin-left: -1px;
    margin-top: -1px;
    
    /* Set default background */
    background-color: #fbfcfd;
    
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    
    /* Transition for background color */
    transition: background-color var(--transition-normal), color var(--transition-normal);
    position: relative;
}

.social-link:first-child {
    margin-left: 0;
}

.social-link:hover {
    /* Brighten background on hover */
    background-color: #ffffff;
    color: var(--color-text-link);
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
}

.social-icon svg {
    width: 100%;
    height: 100%;
}

/* Scale X icon up 10% */
.social-link:first-child .social-icon {
    transform: scale(1.1);
}

/* Scale Substack logo down 10% */
.social-link:last-child .social-icon {
    transform: scale(0.9);
}

.social-username {
    font-size: var(--font-size-base);
}

/* --------------------------------------------
   CONTENT SECTION
   -------------------------------------------- */
.content {
    margin-bottom: var(--space-3xl);
}

/* --------------------------------------------
   BIO SECTION
   -------------------------------------------- */
.bio-section {
    margin-bottom: var(--space-xl);
}

.bio-header {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
    line-height: var(--line-height-normal);
}

.bio-text {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-body);
    line-height: var(--line-height-relaxed);
    margin-bottom: 0;
}

.bio-text + .bio-text {
    margin-top: var(--space-md);
}

.bio-text a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.bio-text a:hover {
    color: var(--color-text-link-hover);
    text-decoration: underline;
}

/* --------------------------------------------
   NAVIGATION MENU
   -------------------------------------------- */

/* Mobile Navigation - Horizontal scroll */
.nav-menu-mobile {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-menu-mobile::-webkit-scrollbar {
    display: none;
}

/* Desktop Navigation - Hidden on mobile */
.nav-menu-desktop {
    display: none;
}

/* Navigation Items */
.nav-item {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.nav-item:hover {
    color: var(--color-text-primary);
}

.nav-item.active {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-medium);
}

/* Content with Sidebar Layout */
.content-with-sidebar {
    display: flex;
    gap: var(--space-3xl);
    align-items: flex-start;
}

.posts-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Page Content (for non-homepage pages) */
.page-content {
    flex: 1;
    min-width: 0;
}

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

/* Desktop Layout (min-width: 900px) */
@media (min-width: 900px) {
    .nav-menu-mobile {
        display: none;
    }
    
    .nav-menu-desktop {
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
        flex-shrink: 0;
        width: 120px;
        position: sticky;
        top: var(--space-xl);
    }
    
    .content-with-sidebar {
        display: flex;
    }
}

/* Tablet adjustments */
@media (max-width: 899px) {
    .content-with-sidebar {
        display: block;
    }
}

/* --------------------------------------------
   POSTS LIST
   -------------------------------------------- */
.posts-list {
    display: flex;
    flex-direction: column;
}

.post-item {
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    
    /* Set default background to subtle off-white */
    background-color: #fbfcfd;
    
    /* Smooth transition for hover effect */
    transition: background-color var(--transition-normal);
}

.post-item:first-child {
    border-top: 1px solid var(--color-border);
}

.post-item:hover {
    /* Brighten to pure white on hover */
    background-color: #ffffff;
}

.post-link {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    /* Reduce vertical padding for tighter spacing (~12px instead of ~24px) */
    padding: 12px var(--space-md);
    color: inherit;
    text-decoration: none;
}

.post-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-text-tertiary);
    margin-top: 0.125rem;
}

.post-icon svg {
    width: 100%;
    height: 100%;
}

.post-content {
    flex: 1;
}

.post-title {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
    line-height: var(--line-height-normal);
}

.post-description {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-secondary);
    margin-bottom: 0;
    line-height: var(--line-height-normal);
}

.post-arrow {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    color: var(--color-text-link);
    opacity: 0;
    transform: translateX(-0.25rem);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    margin-top: 0.125rem;
}

.post-arrow svg {
    width: 100%;
    height: 100%;
}

.post-item:hover .post-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* --------------------------------------------
   PROJECTS LIST (no icons)
   -------------------------------------------- */
.projects-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.project-item {
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    background-color: #fbfcfd;
    transition: background-color var(--transition-normal);
}

.project-item:first-child {
    border-top: 1px solid var(--color-border);
}

.project-item:hover {
    background-color: #ffffff;
}

.project-item-inner {
    display: flex;
    align-items: flex-start;
    padding: 12px var(--space-md);
}

.project-title {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
    line-height: var(--line-height-normal);
}

/* --------------------------------------------
   BACK NAVIGATION
   -------------------------------------------- */
.back-nav {
    margin-bottom: var(--space-xl);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--color-text-primary);
}

.back-link svg {
    width: 1rem;
    height: 1rem;
}

/* --------------------------------------------
   ARTICLE STYLES
   -------------------------------------------- */
.article {
    margin-bottom: var(--space-3xl);
}

.article-meta {
    margin-bottom: var(--space-md);
}

.article-date {
    font-size: var(--font-size-small);
    color: var(--color-text-tertiary);
    font-weight: var(--font-weight-normal);
}

.article-title {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xlarge);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-xl);
    line-height: var(--line-height-tight);
}

.article-source {
    margin-bottom: var(--space-xl);
    font-size: var(--font-size-base);
}

.source-label {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-normal);
}

.source-link {
    color: var(--color-text-link);
    text-decoration: underline;
}

.source-link:hover {
    color: var(--color-text-link-hover);
}

/* Article Body Content */
.article-body {
    color: var(--color-text-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.article-body h3 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
}

.article-body p {
    margin-bottom: var(--space-lg);
}

.article-body a {
    color: var(--color-text-link);
    text-decoration: underline;
}

.article-body a:hover {
    color: var(--color-text-link-hover);
}

/* Blockquotes */
.article-body blockquote {
    margin: var(--space-xl) 0;
    padding-left: var(--space-lg);
    border-left: 3px solid var(--color-border);
    font-style: italic;
    color: var(--color-text-secondary);
}

.article-body blockquote p {
    margin-bottom: var(--space-md);
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Lists */
.article-body ul,
.article-body ol {
    margin: var(--space-lg) 0;
    padding-left: var(--space-xl);
}

.article-body li {
    margin-bottom: var(--space-sm);
}

.article-body li:last-child {
    margin-bottom: 0;
}

/* Code Blocks */
.article-body pre {
    background-color: #f3f4f6;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    padding: var(--space-md);
    margin: var(--space-lg) 0;
    overflow-x: auto;
}

.article-body code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: var(--line-height-relaxed);
}

.article-body p code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Article Footer */
.article-footer {
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
}

.back-to-all {
    display: inline-block;
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.back-to-all:hover {
    color: var(--color-text-primary);
}

/* --------------------------------------------
   ART GALLERY (Optimized for Smooth Resizing)
   -------------------------------------------- */

/* Container for the artwork */
.art-gallery {
    position: fixed;
    top: 0;
    left: 0;
    /* Transform moves from viewport origin to position left of title, flush with top */
    transform: translate(var(--gallery-x, 0px), var(--gallery-y, 0px));
    width: auto;
    height: auto;
    padding: var(--space-xl);
    z-index: 10;
    pointer-events: none; /* Allow clicks through container */
    
    /* Smooth transitions for all movements */
    transition: 
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease-in-out;
    
    /* Hint to browser that element will transform */
    will-change: transform;
    
    /* Initial opacity */
    opacity: 1;
}

/* The image itself */
.art-image {
    display: block;
    width: auto;
    height: auto;
    max-height: var(--gallery-max-height, 400px);
    max-width: var(--gallery-max-width, none);
    cursor: pointer;
    pointer-events: auto; /* Enable clicks on image */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    
    /* Smooth size transitions */
    transition: 
        opacity var(--transition-normal),
        max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Optimize for frequent updates */
    will-change: max-height;
}

/* Hover effect on desktop */
@media (hover: hover) {
    .art-image:hover {
        opacity: 0.85;
    }
}

/* Desktop layout: painting in left margin */
@media (min-width: 1200px) {
    .art-gallery {
        display: block;
    }
    
    .art-image {
        width: auto;
    }
}

/* Tablet/small desktop: painting at bottom (same as mobile) */
@media (min-width: 900px) and (max-width: 1199px) {
    .art-gallery {
        position: static;
        display: block;
        width: 100%;
        max-width: 100%;
        padding: var(--space-xl) var(--container-padding);
        margin-top: var(--space-3xl);
        transform: none;
        transition: opacity 0.2s ease-in-out;
    }
    
    .art-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
    }
}

/* Mobile layout: painting at bottom of page */
@media (max-width: 899px) {
    .art-gallery {
        position: static;
        display: block;
        width: 100%;
        max-width: 100%;
        padding: var(--space-xl) var(--container-padding);
        margin-top: var(--space-3xl);
        transform: none; /* No transform on mobile */
        transition: opacity 0.2s ease-in-out;
    }
    
    .art-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
    }
}

/* Hide on article pages */
body.article-page .art-gallery {
    display: none;
}

/* --------------------------------------------
   PAST PRESENT ICON (bottom-right, writing & projects only)
   -------------------------------------------- */
.pastpresent-icon {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 56px;
    max-width: 48px;
    max-height: 56px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
}

.pastpresent-icon img {
    width: 100%;
    height: 100%;
    max-width: 48px;
    max-height: 56px;
    object-fit: contain;
    transform: scaleX(-1); /* flip so figure faces left */
    transition: filter var(--transition-fast), opacity var(--transition-fast);
    display: block;
}

/* Hover: terracotta to match social links on hover */
.pastpresent-icon:hover img,
.pastpresent-icon:focus img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(2476%) hue-rotate(10deg);
}

.pastpresent-icon:active img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(2476%) hue-rotate(10deg);
}

/* When no left-margin space on desktop: show at bottom instead of hiding */
.art-gallery.gallery-at-bottom {
    position: static;
    display: block;
    width: 100%;
    max-width: 100%;
    padding: var(--space-xl) var(--container-padding);
    margin-top: var(--space-3xl);
    transform: none;
    transition: opacity 0.2s ease-in-out;
}

.art-gallery.gallery-at-bottom .art-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
}

/* --------------------------------------------
   SITE FOOTER
   -------------------------------------------- */
.site-footer {
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    text-align: center;
}

/* Signature styles - currently unused
.signature {
    font-family: 'Brush Script MT', cursive;
    font-size: 1.5rem;
    color: var(--color-text-primary);
}
*/

/* --------------------------------------------
   LIBRARY PAGE - ISOLATED LAYOUT
   -------------------------------------------- */

body.library-page {
    background-color: #ffffff;
}

.library-layout {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl) var(--container-padding);
    min-height: 100vh;
}

.library-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.back-arrow {
    font-size: 21.6px; /* 10% smaller than 24px */
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    line-height: 1;
    padding: var(--space-xs);
    display: inline-flex;
    align-items: center;
    transform: translateY(2px); /* optically center stick with title */
}

.back-arrow:hover {
    color: var(--color-text-link);
}

.library-header .site-title {
    margin: 0;
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    user-select: none;
}

.library-intro {
    margin: 0 0 var(--space-lg);
    font-size: var(--font-size-base);
    color: var(--color-text-body);
    line-height: var(--line-height-normal);
}

/* --------------------------------------------
   LIBRARY TABLE - MINIMAL DESIGN
   -------------------------------------------- */

.library-container {
    margin-top: 0;
}

.library-filters {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: nowrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-small);
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 0;
    background-color: #ffffff;
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-text-secondary);
}

.search-input::placeholder {
    color: var(--color-text-secondary);
}

.filter-select {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-small);
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 0;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    min-width: 120px;
    max-width: 150px;
    color: var(--color-text-primary);
}

.filter-select.placeholder-selected {
    color: var(--color-text-secondary);
}

.filter-select:hover {
    border-color: var(--color-text-secondary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-text-secondary);
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: var(--space-lg);
}

.library-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-base);
}

.library-table thead {
    border-bottom: 1px solid var(--color-border);
}

.library-table th {
    text-align: left;
    padding: var(--space-xs) var(--space-sm);
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    white-space: nowrap;
    user-select: none;
}

.library-table th.sortable {
    cursor: pointer;
    transition: color var(--transition-fast);
    position: relative;
    padding-right: var(--space-md);
}

.library-table th.sortable:hover {
    color: var(--color-text-primary);
}

.library-table th.sortable::after {
    content: '';
    position: absolute;
    right: var(--space-xs);
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    opacity: 0.3;
}

.library-table th.sortable.sorted-asc::after {
    border-bottom: 5px solid currentColor;
    opacity: 1;
}

.library-table th.sortable.sorted-desc::after {
    border-top: 5px solid currentColor;
    opacity: 1;
}

.library-table td {
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-body);
    line-height: 1.4;
}

.library-table tbody tr:last-child td {
    border-bottom: none;
}

.library-table th:first-child,
.library-table td:first-child {
    width: 30%;
}

.library-table th:last-child,
.library-table td:last-child {
    width: 70%;
}

.library-table .no-results,
.library-table .loading {
    text-align: center;
    color: var(--color-text-secondary);
    font-style: italic;
    padding: var(--space-xl);
}

.pagination {
    margin-top: var(--space-md);
}

.pagination-controls {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.page-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-small);
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 0;
    background-color: #ffffff;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
    min-width: 32px;
    text-align: center;
}

.page-btn:hover {
    border-color: var(--color-text-secondary);
}

.page-btn.active {
    background-color: var(--color-text-primary);
    color: #ffffff;
    border-color: var(--color-text-primary);
}

.page-ellipsis {
    padding: var(--space-xs);
    color: var(--color-text-secondary);
}

.error-message {
    color: #dc2626;
    text-align: center;
    padding: var(--space-xl);
}

/* Library Mobile Responsive */
@media (max-width: 768px) {
    .library-layout {
        padding: var(--space-lg) var(--container-padding);
    }
    
    .library-header {
        margin-bottom: var(--space-lg);
    }
    
    .library-filters {
        flex-wrap: wrap;
    }
    
    .search-input {
        width: 100%;
        flex-basis: 100%;
    }
    
    .filter-select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
    
    .library-table {
        font-size: var(--font-size-small);
    }
    
    .library-table th,
    .library-table td {
        padding: var(--space-xs);
    }
}

/* --------------------------------------------
   RESPONSIVE DESIGN
   -------------------------------------------- */

/* Tablet and smaller */
@media (max-width: 768px) {
    :root {
        --font-size-xlarge: 2rem;       /* 32px */
        --font-size-large: 1.375rem;    /* 22px */
        --container-padding: 1.25rem;   /* 20px */
    }
    
    .container {
        padding: var(--space-xl) var(--container-padding);
    }
    
    .site-header {
        margin-bottom: var(--space-xl);
    }
    
    .article-title {
        font-size: 1.75rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --font-size-xlarge: 1.75rem;    /* 28px */
        --font-size-large: 1.25rem;     /* 20px */
        --container-padding: 1rem;      /* 16px */
    }
    
    .site-title {
        font-size: 1.75rem;
    }
    
    .post-link {
        padding: var(--space-md);
    }
    
    .article-title {
        font-size: 1.5rem;
    }
}

/* --------------------------------------------
   UTILITY CLASSES
   -------------------------------------------- */

/* Accessibility: Screen reader only */
.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;
}

/* Print styles */
@media print {
    .social-links,
    .back-nav,
    .post-arrow,
    .article-footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .article-title {
        font-size: 24pt;
    }
}
