/*
 * Copyright (c) 2025 Aleksander Alekseev https://eax.me/
 * Licensed under the MIT License: https://opensource.org/licenses/MIT
 *
 * You may reuse and modify this file, but you may not claim authorship.
 * This copyright notice must be preserved in all copies.
 */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
}

.container {
    max-width: 808px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.clear {
    clear: both;
}

.center {
    text-align: center;
}

.nowrap {
    white-space: nowrap;
}

header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0px;
    margin-bottom: 20px;
}

footer {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
    color: #555;
}

h1 {
    color: #333;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.6em;
}

h2 {
    color: #333;
    font-size: 1.25em;
}

header p.description {
    margin-top: 0;
    color: #666;
    font-size: 1.1em;
    font-style: italic;
}

section {
    margin-bottom: 30px;
}

section p {
    hyphens: auto;
    text-align: justify;
}

section ul {
    list-style: none;
    padding: 0;
}

section ul li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

section ul li:last-child {
    border-bottom: none;
}

/* Global link styles */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #0066cc;
}

/* Article styles */
article {
    line-height: 1.7;
    hyphens: auto;
    text-align: justify;
    margin-bottom: 15px;
}

article time {
    color: #666;
    font-size: 0.9em;
}

/* Image styles */
article img {
    height: auto;
    max-width: 100%;
    display: block;
    margin: 20px auto;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Aligned image styles */
article img.alignleft {
    float: left;
    margin: 8px 20px 20px 0;
    display: inline;
}

article img.alignright {
    float: right;
    margin: 8px 0 20px 20px;
    display: inline;
}

/* Years archive styles */
.years-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.years-list li {
    padding: 0;
    border-bottom: none;
}

.years-list li a {
    font-size: 1.1em;
}

/* Search form styles */
.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-container input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 1em;
    font-family: Arial, sans-serif;
}

.search-container input[type="text"]:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 3px rgba(136, 136, 136, 0.3);
}

.search-container input[type="submit"] {
    padding: 8px 16px;
    background-color: #006699;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 1em;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.search-container input[type="submit"]:hover {
    background-color: #0088cc;
}

/* Block code styles */
code {
    display: block;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 15px;
    margin: 20px 0;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.4;
    font-family: "Courier New", Courier, monospace;
}

/* Inline code styles */
code.inline {
    display: inline;
    background-color: #f0f0f0;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    padding: 2px 4px;
    margin: 0;
    font-family: "Courier New", Courier, monospace;
    white-space: normal;
}

/* Print styles */
@media print {
    body {
        background-color: white;
        padding: 0;
        margin: 0;
    }

    .container {
        max-width: none;
        margin: 0;
        padding: 0;
        background-color: white;
        box-shadow: none;
        border-radius: 0;
    }

    header {
        display: none;
    }

    footer {
        display: none;
    }

    /* Improve code readability */
    code {
        border: 1px solid #000;
        background-color: #f5f5f5;
    }

    code.inline {
        border: 1px solid #000;
        background-color: #f5f5f5;
    }

    img {
        /* Prevent images from being split across pages
           (doesn't really help in modern web-browsers) */
        page-break-inside: avoid;

        /* Little hack that *does work* in practice */
        display: inline-block !important;
    }
}
