@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/DM-Sans-400.ttf') format('truetype');
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/DM-Sans-500.ttf') format('truetype');
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/DM-Sans-700.ttf') format('truetype');
}



/* CSS Variables for theme, font, and breakpoints */
:root {
    /* Colors */
    --color-bg: #eee;
    --color-text: #444;
    --color-link: #4fbf7b;
    /* Softer, lighter green for light mode */
    --color-link-hover: #2e8c57;
    /* Soft but still readable green for hover */
    --color-link-visited: #5b8ab8;
    --color-separator: #ccc;
    --color-footer-border: #bbb;
    --color-story-bg-hover: #fafafa;
    --color-footer-link: #333;
    --color-footer-link-hover: #2e8c57;
    --color-date: #888;
    --color-accent: #4fbf7b;
    /* Softer green accent for light mode */
    /* Fonts */
    --font-main: 'DM Sans', sans-serif;
    --font-mono: 'Courier New', monospace;
    /* Font sizes */
    --font-size-base: 18px;
    --font-size-mobile: 16px;
    --font-size-small: 15px;
    --font-size-story-title-mobile: 1.1rem;
    --font-size-story-title-small: 1rem;
    --font-size-header-mobile: 1.8rem;
    --font-size-header-small: 1.6rem;
    /* Breakpoints */
    --breakpoint-tablet: 768px;
    --breakpoint-mobile: 480px;
    /* Layout */
    --max-width: 650px;
    --body-width: 93%;
    --body-width-mobile: 95%;
    --body-margin: 20px auto;
    --body-margin-mobile: 10px auto;
    --body-margin-small: 5px auto;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #232326;
        --color-text: #e6e6e6;
        --color-link: #ff7a7a;
        --color-link-hover: #ffb3b3;
        --color-link-visited: #b8b8ff;
        --color-separator: #444;
        --color-footer-border: #444;
        --color-story-bg-hover: #2d2d31;
        --color-footer-link: #e6e6e6;
        --color-footer-link-hover: #ff7a7a;
        --color-date: #b8b8b8;
        --color-accent: #ff7a7a;
        /* Soft red accent for dark mode */
    }
}

body {
    margin: var(--body-margin);
    min-height: 100%;
    max-width: var(--max-width);
    width: var(--body-width);
    line-height: 1.6;
    font-size: var(--font-size-base);
    color: var(--color-text);
    padding: 0 10px;
    background-color: var(--color-bg);
    font-family: 'DM Sans', sans-serif;
    user-select: none;
}

main {
    min-height: calc(100vh - 80px);
}

h1,
h2,
h3 {
    line-height: 1.2
}

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

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

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

.stories-list {
    margin: 2rem 0;
}

.story-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    cursor: pointer;
}

.story-item>a {
    color: var(--color-link);
}

.story-item:hover,
.story-item:hover>a {
    background-color: var(--color-story-bg-hover);
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    color: var(--color-link-hover);
    text-decoration: none;
}

story-item>a:visited {
    color: var(--color-link-visited);
}


.story-date {
    color: var(--color-date);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    min-width: 80px;
    margin-right: 1rem;
}

.story-date-field {
    min-width: 100px;
    margin-right: 1rem;
}

.story-date-input {
    color: var(--color-date);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    background: none;
    border: none;
    padding: 0;
    cursor: default;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 110px;
}

.story-date-input:disabled {
    color: var(--color-date);
    opacity: 1;
}

.story-separator {
    color: var(--color-separator);
    margin-right: 1rem;
}

.story-title {
    color: var(--color-link);
    text-decoration: none;
    font-weight: 500;
    flex: 1;
}

/* Date field styles */
.date-field {
    display: inline-flex;
    align-items: center;
}

.date-input {
    font-family: var(--font-main);
    font-size: 0.9rem;
    background: none;
    border: none;
    padding: 0;
    cursor: default;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.date-input:disabled {
    color: inherit;
    color: var(--color-date);
    opacity: 1;
}

/* Footer styles */
.site-footer {
    position: relative;
    margin-top: 3rem;
    padding: 1rem;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, var(--color-footer-border) 30%, var(--color-footer-border) 70%, transparent 100%);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    margin-right: 1rem;
}

.footer-right a {
    color: var(--color-footer-link);
}

.footer-right a:hover {
    color: var(--color-footer-link-hover);
}

/* Header styles */
.site-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    position: relative;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, var(--color-footer-border) 30%, var(--color-footer-border) 70%, transparent 100%);
}

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

.prompt a {
    font-family: var(--font-mono);
    color: var(--color-text);
    font-weight: bold;
}

/* Header styles with command prompt */
.command-prompt {
    font-family: var(--font-mono);
    color: var(--color-text) !important;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: -0.03em;
    text-decoration-color: var(--color-link);
}

.command-prompt:hover {
    color: var(--color-text) !important;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--color-link);

}

.command-prompt .highlight {
    color: var(--color-link);
}

.cursor {
    color: #666;
    margin-left: 0.2em;
    animation: softBlink 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes softBlink {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

/* Mobile responsive styles */
@media (max-width: var(--breakpoint-tablet)) {
    body {
        margin: var(--body-margin-mobile);
        padding: 0 5px;
        font-size: var(--font-size-mobile);
    }

    .stories-list {
        margin: 1rem 0;
    }

    .story-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0.5rem;
        border-bottom: 1px solid #e0e0e0;
        cursor: pointer;
        margin: 0 -0.5rem;
        position: relative;
    }

    .story-item:last-child {
        border-bottom: none;
    }

    .story-item:hover {
        background-color: var(--color-story-bg-hover);
    }

    .story-item:hover .story-title {
        color: var(--color-link-hover);
        text-decoration: none;
    }

    .story-date-field {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 0.25rem;
        order: 2;
        pointer-events: none;
    }

    .story-date-input {
        width: auto;
        font-size: 0.8rem;
    }

    .story-separator {
        display: none;
    }

    .story-title {
        font-size: var(--font-size-story-title-mobile);
        line-height: 1.3;
        order: 1;
        margin-bottom: 0;
        flex: none;
        display: block;
        width: 100%;
        text-decoration: none;
    }

    .story-title::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
    }

    .page-header h1 {
        font-size: var(--font-size-header-mobile);
        margin-bottom: 1rem;
    }

    .site-footer {
        margin-top: 2rem;
        padding: 0.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: var(--breakpoint-mobile)) {
    body {
        width: var(--body-width-mobile);
        font-size: var(--font-size-small);
        margin: var(--body-margin-small);
    }

    .story-item {
        padding: 0.75rem 0.25rem;
        margin: 0 -0.25rem;
    }

    .story-title {
        font-size: var(--font-size-story-title-small);
    }

    .story-date-input {
        font-size: 0.75rem;
    }

    .page-header h1 {
        font-size: var(--font-size-header-small);
    }

    .site-header {
        margin-bottom: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}