/*
 * Field Journal Theme for BSSG
 * Warm paper, natural inks, and notebook-like details.
 */

:root {
    --bg-color: #f6f0e2;
    --paper-color: #fffaf0;
    --text-color: #2f3a2b;
    --heading-color: #273221;
    --muted-text: #68725f;
    --link-color: #365d3b;
    --link-hover: #234028;
    --border-color: #d5c9a8;
    --accent-color: #8d6f43;
    --accent-soft: #ede2cb;
    --tag-bg: #e8dcc2;
    --tag-text: #3f5133;
    --quote-bg: #f2e8d3;
    --code-bg: #efe6d2;
    --content-width: 860px;
    --radius: 8px;
    --shadow: 0 4px 12px rgba(68, 53, 24, 0.11);
    --font-body: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --font-heading: "Hoefler Text", Baskerville, "Times New Roman", serif;
    --font-ui: "Trebuchet MS", Verdana, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

body {
    margin: 0;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 2px 2px, rgba(92, 77, 46, 0.06) 0.6px, transparent 0.6px),
        linear-gradient(180deg, #f8f3e7 0%, #f2ead7 100%);
    background-size: 4px 4px, 100% 100%;
    font-family: var(--font-body);
    line-height: 1.75;
}

::selection {
    background: #d7c49a;
    color: #20261b;
}

.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1.3rem 2.8rem;
}

header {
    margin-bottom: 2rem;
    padding: 1.2rem 0 1rem;
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255, 252, 244, 0.82) 0%, rgba(246, 238, 221, 0.72) 100%);
}

.site-title,
header h1 {
    margin: 0;
    color: var(--heading-color);
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4.4vw, 2.9rem);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

header p {
    margin: 0.45rem 0 0;
    color: var(--muted-text);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

nav {
    margin-top: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

nav a {
    display: inline-block;
    text-decoration: none;
    color: var(--link-color);
    border: 1px solid #cfbf9b;
    border-radius: 999px;
    padding: 0.22rem 0.68rem;
    font-family: var(--font-ui);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 251, 239, 0.84);
}

nav a:hover,
nav a:focus {
    color: #1d3622;
    background: #e5d9bd;
}

main {
    min-height: 62vh;
}

article {
    margin-bottom: 1.5rem;
}

article.post,
article.page,
.posts-list article {
    background: var(--paper-color);
    border: 1px solid #d3c4a0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.35rem 1.15rem 1.15rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 1.25rem 0 0.75rem;
    color: var(--heading-color);
    font-family: var(--font-heading);
    line-height: 1.3;
}

h1 { font-size: clamp(1.8rem, 3.7vw, 2.4rem); }
h2 { font-size: clamp(1.45rem, 3.1vw, 1.9rem); }
h3 { font-size: clamp(1.18rem, 2.3vw, 1.45rem); }

p,
ul,
ol {
    margin-top: 0;
    margin-bottom: 1rem;
}

article.post > p:first-of-type::first-letter {
    float: left;
    font-size: 2.6em;
    line-height: 0.88;
    margin-right: 0.12em;
    margin-top: 0.06em;
    color: #4a633f;
}

a {
    color: var(--link-color);
    text-underline-offset: 0.16em;
}

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

.page-meta {
    margin-bottom: 0.85rem;
}

.meta {
    margin: 0;
    color: var(--muted-text);
    font-family: var(--font-ui);
    font-size: 0.77rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.reading-time {
    margin-top: 0.28rem;
}

.summary {
    margin-top: 0.75rem;
    color: #43533a;
}

.post-content {
    margin-top: 0.7rem;
}

.featured-image,
.index-image,
.tag-image,
.archive-image,
.author-image {
    margin: 1.05rem 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    border: 1px solid #bcae8c;
}

.image-caption,
figcaption {
    margin-top: 0.38rem;
    color: var(--muted-text);
    font-style: italic;
    font-size: 0.86rem;
}

blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 0.95rem;
    background: var(--quote-bg);
    border-left: 4px solid #9a8256;
    color: #3d4d34;
}

pre,
code {
    font-family: var(--font-mono);
    font-size: 0.87rem;
}

code {
    background: var(--code-bg);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

pre {
    background: var(--code-bg);
    border: 1px solid #cdbd99;
    border-radius: 6px;
    padding: 0.86rem;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}

hr {
    border: 0;
    border-top: 2px dashed #c7b792;
    margin: 1.3rem 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-top: 1rem;
}

.tags a,
.tags-list a {
    display: inline-block;
    padding: 0.22rem 0.62rem;
    border-radius: 999px;
    border: 1px solid #bea97d;
    background: var(--tag-bg);
    color: var(--tag-text);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.tags a:hover,
.tags a:focus,
.tags-list a:hover,
.tags-list a:focus {
    background: #ddcea9;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-count {
    color: #5e6b57;
}

.posts-list article + article {
    margin-top: 0.95rem;
}

.posts-list h2,
.posts-list h3 {
    margin-top: 0;
}

.pagination {
    margin-top: 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.pagination a {
    display: inline-block;
    padding: 0.26rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #baa778;
    background: #f0e5cd;
    color: #32452b;
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.pagination a:hover,
.pagination a:focus {
    background: #e3d2ab;
}

.page-info {
    color: var(--muted-text);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.related-posts {
    margin-top: 1.6rem;
    padding-top: 1rem;
    border-top: 2px dotted #bca779;
}

.related-posts h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.related-posts-list {
    display: grid;
    gap: 0.7rem;
}

.related-post {
    background: var(--accent-soft);
    border: 1px solid #ccb993;
    border-left: 4px solid #8f7448;
    border-radius: 5px;
    padding: 0.62rem 0.72rem;
}

.related-post h4 {
    margin: 0 0 0.3rem;
}

.related-post p {
    margin: 0;
    color: #495b3f;
}

footer {
    margin-top: 2rem;
    border-top: 2px solid var(--border-color);
    padding-top: 0.95rem;
    color: #62705d;
    font-family: var(--font-ui);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
}

footer p {
    margin: 0.38rem 0;
}

footer a {
    color: inherit;
}

footer a:hover,
footer a:focus {
    color: #2f4b35;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.95rem 0;
}

th,
td {
    border: 1px solid #c9ba96;
    padding: 0.42rem 0.58rem;
}

th {
    background: #efe3c9;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 780px) {
    html {
        font-size: 17px;
    }

    .container {
        padding: 1.3rem 0.9rem 2.2rem;
    }

    article.post,
    article.page,
    .posts-list article {
        padding: 1.05rem 0.9rem 0.95rem;
    }

    nav {
        gap: 0.38rem;
    }

    nav a,
    .meta,
    .pagination a,
    .page-info {
        letter-spacing: 0.04em;
    }
}
