/* ============================================================
   Layout — Software Pendula (Warm Editorial)
   ============================================================ */

* { box-sizing: border-box; }

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    counter-reset: heading;
    margin: 0;
    line-height: 1.75;
}

.main {
    margin: auto;
    max-width: 58rem;
}

img {
    max-width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

figure { margin: 0; }

figcaption {
    text-align: center;
    font-size: 0.9em;
    font-weight: bold;
}

iframe {
    max-width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

li { margin-top: 0.5em; }
p  { line-height: 1.75em; }

h1 { font-size: 2em;    font-weight: normal; }
h2 { font-size: 1.5em;  font-weight: normal; }
h3 { font-size: 1.17em; font-weight: normal; }
h4 { font-size: 1.12em; font-weight: normal; }
h5 { font-size: .83em;  font-weight: normal; }
h6 { font-size: .75em;  font-weight: normal; }

a:active, a:focus {
    outline-style: solid;
    outline-width: thin;
}

pre {
    margin: 1em 0;
    padding: 0.75em 1em;
    overflow-x: auto;
}

code {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5em;
    font-size: 0.9em;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

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

blockquote {
    padding: 0.5em 0.5em 0.5em 1em;
    margin: 1em 0;
}

th, td { padding: 0.5em; }

/* ── Header ──────────────────────────────────────── */

header { width: 100%; }

/* Top utility bar */
.header-top {
    padding: 0.45rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top-date {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.header-social {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.72rem;
    margin-left: 1.25rem;
    letter-spacing: 0.03em;
}

/* Masthead */
.header-masthead {
    padding: 1.5rem 2rem 1.25rem;
    text-align: center;
}

.siteTitle {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.siteTitle a { text-decoration: none; }

.site-tagline {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Nav bar */
.header-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0 2rem;
}

.nav-item {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    display: block;
    transition: color 0.15s;
}

.nav-item-title { display: inline; }

/* ── Main content wrapper ────────────────────────── */

main {
    padding: 0 2rem;
    margin: 2rem auto 3rem;
}

/* ── Home page ───────────────────────────────────── */

.featured-post-card {
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.card-label {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.6rem;
}

.featured-title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 0.7rem;
}

.featured-summary {
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.78rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid;
}

.post-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.post-card {
    border-radius: 4px;
    padding: 1.4rem 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card-label-sm {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
}

.card-summary {
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.card-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid;
}

/* ── Tags ────────────────────────────────────────── */

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

.tag {
    display: inline-block;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.68rem;
    padding: 0.18rem 0.5rem;
    border-radius: 3px;
    border: 1px solid;
    text-decoration: none;
}

.tag a { text-decoration: none; }

/* ── Post (single article) ───────────────────────── */

.post {
    margin: 1.5em 0;
}

.post .title {
    text-align: center;
    padding: 1.25rem 1rem 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.post .content {
    padding: 1em 1.75em;
}

.post .date { text-align: center; }

.post .content h1,
.post .content h2,
.post .content h3,
.post .content h4,
.post .content h5 { margin: 1em 0 0.4em; }

.post-footer-data {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1em 1.75em;
}

.post-footer-data .date {
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.2em 0;
}

.post-footer-data .tag { font-weight: bold; }
.post-footer-data .categories { padding-top: 0.5em; }
.post-footer-data .category { font-weight: bold; display: inline-block; }
.post-footer-data .category a { text-decoration: none; }
.post-footer-data .series { padding: 0.5em 0; }
.post-footer-data .series-name { display: inline-block; }
.post-footer-data .series-name a { font-weight: bold; text-decoration: none; }

.post-footer hr { width: 100%; }

/* ── Post preview (taxonomy pages) ──────────────── */

.post-preview {
    padding: 0.5em 0.5em 1em;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-radius: 4px;
}

.post-preview .title {
    font-size: 1.3rem;
    margin: 0.3em 0;
}

.post-preview a { text-decoration: none; }

.post-preview .summary {
    padding: 0.5em;
    line-height: 1.7;
}

.post-preview .summary p {
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    line-height: 1.7;
}

.post-preview .meta {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8em;
    font-weight: bold;
    padding: 0.3em 1em 0.5em;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.post-preview .date { font-weight: bold; }
.post-preview .tags { font-weight: bold; }

.rmore {
    margin-top: 0.5em;
    white-space: nowrap;
    text-align: right;
}

.rmore a {
    border-radius: 3px;
    padding: 0.3em 0.8em;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
}

/* ── Content list (archive/tag pages) ────────────── */

.content-list { font-size: 1.1em; }

.content-item {
    margin-top: 0.75em;
    padding: 0.4em 0.75em 0.6em;
    border-radius: 4px;
}

.content-item .meta {
    margin-top: 0.5em;
    padding-top: 0.5em;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    font-size: 0.7em;
}

.content-item .tags        { margin-bottom: 0.3em; font-weight: bold; }
.content-item .categories  { margin: 0.3em 0; }
.content-item .category    { font-weight: bold; display: inline-block; }
.content-item .series      { margin: 0.3em 0; }
.content-item .series-name { font-weight: bold; display: inline-block; }
.content-item .date        { font-size: 0.7em; font-weight: bold; white-space: nowrap; text-align: right; }
.content-item a            { text-decoration: none; }

.post-list {
    display: flex;
    justify-content: space-between;
    margin: 0.5em 0;
}

.post-list .title { margin: 0; }
.post-list .date  { margin: 0; font-size: 0.9em; }

/* ── Terms (tags index) ───────────────────────────── */

.terms {
    border-radius: 4px;
    width: 50%;
    margin: 0 auto 1em;
}

.terms a        { font-size: 1.1em; text-decoration: none; }
.terms .term    { padding: 0.5em; }

.content-list-title    { text-align: center; margin-bottom: 0; }
.content-list-title a  { text-decoration: none; }
.term-list-title       { text-align: center; }
.term-list-title a     { text-decoration: none; }

/* ── Social links ─────────────────────────────────── */

.social-links-header {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.social-links-footer {
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    margin: 0.2em 0.4em;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ── Footer ───────────────────────────────────────── */

footer {
    padding: 1.5rem 2rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.copyright {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.78rem;
}

.poweredby {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.75rem;
}

/* ── Pagination ───────────────────────────────────── */

.page-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1.5em 1em;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: bold;
}

.page-nav a    { text-decoration: none; }
.page-num      { text-align: center; margin: 0 1em; }

/* ── Post nav (prev/next) ─────────────────────────── */

.post-footer-menu {
    display: flex;
    justify-content: space-between;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8em;
    margin: 0.5em 4em;
}

.post-prev a,
.post-next a,
.post-home a { text-decoration: none; font-weight: bold; }

/* ── Misc ─────────────────────────────────────────── */

.err-404       { margin: 3em; text-align: center; }
.sitemap       { margin: auto; width: 50%; font-size: 1.4em; }

/* ── Responsive ───────────────────────────────────── */

@media only screen and (max-width: 640px) {
    .main { max-width: 100%; }

    main { padding: 0 1rem; }

    .header-top       { padding: 0.4rem 1rem; }
    .header-masthead  { padding: 1.25rem 1rem 1rem; }
    .siteTitle        { font-size: 1.6rem; }
    .header-nav       { padding: 0 0.5rem; }
    .nav-item         { padding: 0.5rem 0.7rem; font-size: 0.68rem; }

    .featured-post-card {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 1.25rem;
    }

    .featured-title { font-size: 1.3rem; }

    .post-grid { grid-template-columns: 1fr; }

    .terms   { width: 90%; }
    .sitemap { width: 90%; }

    .post-footer-menu { margin: 0.5em; }
}
