/* Junkpost Common Styles */

/* Custom Fonts */
@font-face {
    font-family: 'Maple Mono';
    src: url('../fonts/MapleMono[wght]-VF.woff2') format('woff2');
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Maple Mono';
    src: url('../fonts/MapleMono-Italic[wght]-VF.woff2') format('woff2');
    font-weight: 100 800;
    font-style: italic;
    font-display: swap;
}

:root {
    --background-color: #f8f8f8;
    --text-color: #333;
    --card-background: white;
    --heading-color: #0070f3;
    --link-color: #0070f3;
    --link-hover-color: #0051b3;
    --nav-hover-bg: rgba(0, 112, 243, 0.1);
    --border-color: #eee;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --footer-color: #666;
    --container-width: 800px;
    --spacing-unit: 1rem;
    --font-family: 'Maple Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --text-color: #e0e0e0;
        --card-background: #1e1e1e;
        --heading-color: #60a5fa;
        --link-color: #60a5fa;
        --link-hover-color: #93c5fd;
        --nav-hover-bg: rgba(96, 165, 250, 0.1);
        --border-color: #333;
        --shadow-color: rgba(0, 0, 0, 0.2);
        --footer-color: #999;
    }
}

/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 16px;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 2);
    position: relative;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.site-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-color);
    text-decoration: none;
    text-align: center;
    transition: transform 0.3s ease, color 0.2s ease;
}

.site-brand:hover {
    transform: translateY(-1px);
    color: var(--link-hover-color);
}

.site-brand-name {
    color: var(--heading-color);
    font-size: clamp(2rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 0.95;
}

.site-brand-tagline {
    color: var(--footer-color);
    font-size: 1rem;
    line-height: 1.3;
}

h1, h2, h3, h4 {
    color: var(--heading-color);
    margin: 1.5rem 0 1rem;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

/* Navigation */
.site-nav-shell {
    width: 100%;
    display: flex;
    justify-content: center;
}

.site-nav {
    display: block;
}

.site-nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.site-nav-link {
    display: inline-block;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid transparent;
    text-decoration: none;
    color: var(--footer-color);
    font-weight: 500;
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.site-nav-link:hover {
    color: var(--link-hover-color);
    border-bottom-color: currentColor;
}

.site-nav-link.is-active {
    color: var(--text-color);
    border-bottom-color: currentColor;
}

/* Card styling */
.card {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px var(--shadow-color);
}

/* Blog post list */
.post-list {
    margin-bottom: 2rem;
}

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

.post-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-list li:last-child {
    border-bottom: none;
}

.post-list a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Individual blog post styling */
.post-content {
    margin-bottom: 2rem;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
    transition: transform 0.3s ease;
}

.post-content img:hover {
    transform: scale(1.02);
}

.post-content a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid var(--link-color);
    transition: all 0.2s ease;
}

.post-content a:hover {
    color: var(--link-hover-color);
    border-bottom-color: var(--link-hover-color);
}

.post-metadata {
    color: var(--footer-color);
    font-style: italic;
    margin-bottom: 1rem;
}

.welcome-message {
    font-style: italic;
    color: var(--footer-color);
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Code blocks */
pre {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: var(--font-family);
    font-size: 0.9rem;
}

code {
    font-family: var(--font-family);
    font-size: 0.9rem;
}

/* Lists and sections */
section {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px var(--shadow-color);
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

.profile-link {
    display: inline-block;
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    transition: transform 0.2s ease;
}

.profile-link:hover {
    transform: translateY(-1px);
}

.profile-link span span {
    display: inline-block;
}

.profile-link:hover span span {
    animation: appleRainbow 0.9s linear infinite;
}

.profile-link:hover span span:nth-child(2) {
    animation-delay: 0.08s;
}

.profile-link:hover span span:nth-child(3) {
    animation-delay: 0.16s;
}

.profile-link:hover span span:nth-child(4) {
    animation-delay: 0.24s;
}

.profile-link:hover span span:nth-child(5) {
    animation-delay: 0.32s;
}

@keyframes appleRainbow {
    0%,
    100% {
        color: #61bb46;
    }
    16.67% {
        color: #fdb827;
    }
    33.33% {
        color: #f5821f;
    }
    50% {
        color: #e03a3e;
    }
    66.67% {
        color: #963d97;
    }
    83.33% {
        color: #009ddc;
    }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--footer-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    :root {
        --spacing-unit: 0.75rem;
    }
    
    .container {
        padding: var(--spacing-unit);
    }
    
    header {
        padding-top: 1.5rem;
    }

    .post-content, section {
        padding: var(--spacing-unit);
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    body {
        font-size: 15px;
    }
    
    .site-nav-link {
        padding-bottom: 0.1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    :root {
        --spacing-unit: 0.5rem;
    }
    
    .container {
        padding: var(--spacing-unit);
    }

    header {
        padding-top: 1.25rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    body {
        font-size: 14px;
    }
    
    .site-brand-name {
        font-size: 2.25rem;
    }

    pre {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    code {
        font-size: 0.8rem;
    }
}
