/* Swiftology.io inspired theme with Light/Dark Mode Support */

/* iA Writer Quattro Font Face Declarations */
@font-face {
    font-family: 'iA Writer Quattro';
    src: url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Regular.eot');
    src: url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Regular.eot?#iefix') format('embedded-opentype'),
         url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Regular.woff2') format('woff2'),
         url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'iA Writer Quattro';
    src: url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Italic.eot');
    src: url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Italic.eot?#iefix') format('embedded-opentype'),
         url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Italic.woff2') format('woff2'),
         url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Italic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'iA Writer Quattro';
    src: url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Bold.eot');
    src: url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Bold.eot?#iefix') format('embedded-opentype'),
         url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Bold.woff2') format('woff2'),
         url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'iA Writer Quattro';
    src: url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-BoldItalic.eot');
    src: url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-BoldItalic.eot?#iefix') format('embedded-opentype'),
         url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-BoldItalic.woff2') format('woff2'),
         url('/iA Writer Quattro/Webfonts/iAWriterQuattroS-BoldItalic.woff') format('woff');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* Light Mode (Default) CSS Custom Properties */
:root {
    /* Theme colors */
    --primary-accent: #8b6fb8;
    --secondary-purple: #7a5ba3;
    --dark-orange: #b8521a;
    --secondary-orange: #a04617;
    
    /* Light mode colors - sophisticated palette */
    --text-color: #2d3748;
    --heading-color: #1a202c;
    --background-color: #f7fafc;
    --header-background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --header-text-color: #ffffff;
    --border-color: #e2e8f0;
    --metadata-color: #718096;
    --card-background: #ffffff;
    --card-border: #e2e8f0;
    
    /* Light mode code colors */
    --code-background: #f8f9fa;
    --inline-code-background: rgba(139, 111, 184, 0.1);
    --inline-code-border: rgba(139, 111, 184, 0.2);
    --inline-code-text: #8b6fb8;
    
    /* Light mode syntax highlighting */
    --keyword-color: #d73a49;
    --type-color: #6f42c1;
    --string-color: #032f62;
    --number-color: #005cc5;
    --comment-color: #6a737d;
    --call-color: #22863a;
    --property-color: #005cc5;
}

/* Enhanced typography */
body {
    font-family: 'iA Writer Quattro', -apple-system, Helvetica, Arial, sans-serif !important;
    font-size: 1.05em !important;
    line-height: 1.5em !important;
    background-color: var(--background-color) !important;
    color: var(--text-color) !important;
}

/* Website description styling */
.description {
    font-size: 0.9em !important;
    color: var(--metadata-color) !important;
}

/* Headers styling */
.item-list h1 a,
.content h1,
h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color) !important;
}

/* Header styling */
header {
    background: var(--header-background) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.wrapper {
    max-width: 900px !important;
}

/* Header alignment */
header .wrapper {
    text-align: center !important;
    padding-bottom: 10px;
}

header nav {
    display: block;
    margin-top: 35px;
    margin-bottom: 0;
    text-align: center;
}

/* Header content container */
.header-content {
    text-align: center;
    margin-bottom: 20px;
}

/* Site name container styling */
.site-name-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    gap: 20px;
    margin-bottom: 12px;
}

.site-name-container:hover {
    text-decoration: none !important;
}

/* Site tagline styling */
.site-tagline {
    color: var(--header-text-color) !important;
    font-size: 1.1em;
    font-weight: 400;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

/* Profile image styling */
.profile-image {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-image:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Site name styling */
.site-name {
    color: var(--header-text-color) !important;
    font-weight: 700 !important;
    font-size: 3.6em !important;
    margin: 0 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    font-family: "SF Pro Display", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
    letter-spacing: -0.02em !important;
}

/* Enhanced navigation spacing and hover effects */
nav li {
    margin: 0 12px !important;
}

nav li a {
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--header-text-color) !important;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

nav li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--header-text-color) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

nav li a.selected {
    background-color: rgba(255, 255, 255, 0.25) !important;
    color: var(--header-text-color) !important;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Enhanced code styling - Swiftology inspired */
pre {
    background-color: var(--code-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
    font-family: 'Menlo', Monaco, 'SF Mono', SFMono-Regular, ui-monospace, 'Source Code Pro', Consolas, 'Courier New', monospace;
    font-size: 1em;
    line-height: 1.5;
    margin: 20px 0;
}

code {
    background-color: var(--inline-code-background);
    padding: 3px 6px;
    border-radius: 6px;
    font-family: 'Menlo', Monaco, 'SF Mono', SFMono-Regular, ui-monospace, 'Source Code Pro', Consolas, 'Courier New', monospace;
    font-size: 0.95em;
    color: var(--inline-code-text);
    border: 1px solid var(--inline-code-border);
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    font-size: 100%;
    color: var(--text-color);
}

/* Swiftology syntax highlighting */
pre code .keyword { 
    color: var(--keyword-color); 
    font-weight: bold; 
}

pre code .type { 
    color: var(--type-color); 
    font-weight: 500; 
}

pre code .string { 
    color: var(--string-color); 
}

pre code .number { 
    color: var(--number-color); 
}

pre code .comment { 
    color: var(--comment-color); 
    font-style: italic; 
}

pre code .property { 
    color: var(--property-color); 
    font-weight: 500; 
}

pre code .dotAccess { 
    color: var(--property-color); 
}

pre code .preprocessing { 
    color: var(--number-color); 
}

pre code .call { 
    color: var(--call-color); 
}

/* Enhanced headers */
h1 {
    font-size: 2em !important;
    font-weight: 800 !important;
    color: var(--heading-color) !important;
    margin-bottom: 24px !important;
}

/* Main page title - smaller to prevent line breaking */
.wrapper > h1:first-of-type {
    font-size: 1.7em !important;
}

h2 {
    font-size: 1.5em !important;
    font-weight: 700 !important;
    color: var(--heading-color) !important;
    margin: 32px 0 16px 0 !important;
}

h3 {
    font-size: 1.3em !important;
    font-weight: 600 !important;
    color: var(--heading-color) !important;
}

/* Enhanced links */
a {
    color: var(--primary-accent) !important;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-purple) !important;
}

/* Enhanced article styling */
.item-list > li {
    background-color: var(--card-background) !important;
    border-radius: 16px !important;
    padding: 28px !important;
    margin-bottom: 28px !important;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.item-list > li:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Post card link styling */
.post-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.post-card-link:hover {
    text-decoration: none !important;
    color: inherit !important;
}

.post-card-link h1 {
    color: var(--heading-color) !important;
}

.post-card-link:hover h1 {
    color: var(--primary-accent) !important;
    transition: color 0.2s ease;
}

/* Tag styling - override Foundation CSS */
.tag-list li {
    margin-right: 8px !important;
    margin-bottom: 4px !important;
    display: inline-block !important;
}

.tag-list .tag {
    background: var(--dark-orange) !important;
    color: #ffffff !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    font-size: 0.85em !important;
    text-decoration: none !important;
    opacity: 0.9;
    transition: all 0.2s ease;
    display: inline-block;
}

/* Dark Mode CSS Custom Properties */
@media (prefers-color-scheme: dark) {
    :root {
        /* Theme colors - slightly adjusted for dark mode */
        --primary-accent: #a28bc7;
        --secondary-purple: #9178b3;
        --dark-orange: #c85e1c;
        --secondary-orange: #b35419;
        
        /* Dark mode colors */
        --text-color: #ffffff;
        --heading-color: #ffffff;
        --background-color: #282c35;
        --header-background: #1f2329;
        --header-text-color: #ffffff;
        --border-color: rgba(126, 140, 152, 0.3);
        --metadata-color: #7e8c98;
        --card-background: #3a3e47;
        --card-border: rgba(126, 140, 152, 0.3);
        
        /* Dark mode code colors */
        --code-background: #292a2f;
        --inline-code-background: rgba(218, 186, 255, 0.15);
        --inline-code-border: rgba(218, 186, 255, 0.3);
        --inline-code-text: #dabaff;
        
        /* Dark mode syntax highlighting */
        --keyword-color: #ff79b2;
        --type-color: #dabaff;
        --string-color: #ff8170;
        --number-color: #d9c97c;
        --comment-color: #7e8c98;
        --call-color: #78c2b4;
        --property-color: #89c0b3;
    }
    
    /* Dark mode hover shadow */
    .item-list > li:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Dark mode header styling */
    header {
        background: var(--header-background) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Dark mode profile image */
    .profile-image {
        border: 2px solid var(--primary-accent) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    }
    
    .profile-image:hover {
        border-color: var(--primary-accent) !important;
        box-shadow: 0 4px 16px rgba(162, 139, 199, 0.4) !important;
    }
}

/* Comments Section Styling */
.comments-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.comments-section h2 {
    color: var(--heading-color) !important;
    font-size: 1.5em !important;
    font-weight: 700 !important;
    margin-bottom: 1.5rem !important;
}

/* Giscus theme integration */
.giscus {
    color-scheme: light;
}

.giscus-frame {
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

@media (prefers-color-scheme: dark) {
    .giscus {
        color-scheme: dark;
    }
}