/* Histropedia Blog design system.
   Loaded after Tachyons / custom.css so these tokens win on purpose. */

:root {
    --ink: #171d26;
    --ink-soft: #3d4754;
    --muted: #66707d;
    --paper: #faf9f6;
    --paper-deep: #ebe4d6;
    --card: #fffdf8;
    --line: #ddd4c4;
    --gold: #c9922a;
    --gold-bright: #e4b44a;
    --navy: #151c27;
    --navy-mid: #1e2836;
    --link: #1d4f78;
    --link-hover: #123550;
    --shadow: 0 1px 2px rgba(21, 28, 39, 0.04), 0 10px 28px -16px rgba(21, 28, 39, 0.18);
    --radius: 14px;
    --font-sans: "Source Sans 3", "Avenir Next", "Segoe UI", sans-serif;
    --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", serif;
    --measure: 42rem;
    --page: 72rem;
}

html {
    scroll-behavior: smooth;
}

.site-body,
body.site-body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.site-main {
    padding-bottom: 4.5rem;
}

a {
    color: var(--link);
}

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

/* -------------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------------- */

.site-nav {
    padding: 0.85rem 1.25rem;
}

@media screen and (min-width: 48em) {
    .site-nav {
        padding: 0.95rem 2rem;
    }
}

.site-nav-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    max-width: var(--page);
    margin: 0 auto;
}

.site-nav-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.histropedia-logo {
    display: block;
    height: 48px;
    width: auto;
}

@media screen and (min-width: 48em) {
    .histropedia-logo {
        height: 54px;
    }
}

.site-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.25rem;
}

.site-nav-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav-menu a,
.site-nav-link {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    border-radius: 999px;
}

.site-nav-menu a:hover,
.site-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.site-nav-social {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.35rem;
}

.site-nav-social a,
.site-footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: rgba(255, 255, 255, 0.72);
    fill: currentColor;
}

.site-nav-social a:hover,
.site-footer-social a:hover {
    color: var(--gold-bright);
    fill: currentColor;
}

.site-nav-social svg,
.site-footer-social svg {
    width: 18px;
    height: 18px;
}

.site-nav-social .new-window,
.site-footer-social .new-window,
.site-nav-social .link-transition,
.site-footer .pt3 {
    display: none;
}

.site-nav-social .link-transition,
.site-footer-social .link-transition {
    display: inline-flex;
    padding-top: 0;
    margin-right: 0;
}

/* -------------------------------------------------------------------------
   Banners
   ------------------------------------------------------------------------- */

header.cover.bg-top,
.page-hero {
    position: relative;
    background-position: center;
    background-size: cover;
}

.banner-gradient-overlay {
    background: linear-gradient(
        to bottom,
        rgba(10, 14, 20, 0.9) 0%,
        rgba(10, 14, 20, 0.48) 42%,
        rgba(10, 14, 20, 0.28) 100%
    );
}

.banner-heading {
    max-width: var(--page);
    margin: 0 auto;
    padding: 2.25rem 1.25rem 2.5rem;
    text-align: left;
}

@media screen and (min-width: 48em) {
    .banner-heading {
        padding: 3.25rem 2rem 3.5rem;
        text-align: center;
    }
}

.banner-title {
    margin: 0;
    color: #fff;
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.banner-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin: 1rem 0 0;
    background: var(--gold-bright);
    border-radius: 2px;
}

@media screen and (min-width: 48em) {
    .banner-title::after {
        margin-left: auto;
        margin-right: auto;
    }
}

.banner-subtitle {
    max-width: 38rem;
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.5;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

@media screen and (min-width: 48em) {
    .banner-subtitle {
        margin-left: auto;
        margin-right: auto;
        font-size: 1.3rem;
    }
}

.page-hero-spacer {
    height: 7.5rem;
}

@media screen and (min-width: 48em) {
    .page-hero-spacer {
        height: 11rem;
    }
}

.image-attribution {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 3px 8px;
    background: rgba(255, 253, 248, 0.72);
    border-top-left-radius: 6px;
}

.image-attribution a {
    color: #001229;
    font-size: 0.75rem;
}

/* -------------------------------------------------------------------------
   Listing pages
   ------------------------------------------------------------------------- */

.listing {
    width: min(var(--page), calc(100% - 2rem));
    margin: 2rem auto 0;
}

.listing-title {
    margin: 0 0 1.4rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.listing-title::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 0.65rem;
    background: var(--gold);
    border-radius: 2px;
}

.listing-grid {
    display: grid;
    gap: 1.15rem;
}

.post-card {
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    border-color: #d2c6b0;
    box-shadow: 0 1px 2px rgba(21, 28, 39, 0.05), 0 18px 36px -18px rgba(21, 28, 39, 0.28);
}

@media screen and (min-width: 48em) {
    .post-card--has-image {
        grid-template-columns: 15.5rem 1fr;
        min-height: 12.5rem;
    }

    .post-card-wrap--featured .post-card--has-image {
        grid-template-columns: 22rem 1fr;
        min-height: 16rem;
    }
}

.post-card-media {
    display: block;
    background: var(--paper-deep);
}

.post-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 12rem;
    object-fit: cover;
}

@media screen and (min-width: 48em) {
    .post-card-media img {
        min-height: 100%;
    }
}

.post-card-body {
    display: flex;
    flex-direction: column;
    padding: 1.15rem 1.25rem 1.25rem;
}

.post-card-wrap--featured .post-card-body {
    padding: 1.5rem 1.6rem 1.55rem;
}

.post-card-meta {
    margin: 0 0 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.post-card-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.post-card-wrap--featured .post-card-title {
    font-size: clamp(1.55rem, 2.4vw, 2rem);
}

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

.post-card-title a:hover {
    color: var(--link);
}

.post-card-excerpt {
    margin: 0 0 0.9rem;
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.55;
}

.post-card-more {
    margin-top: auto;
    color: var(--link);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.post-card-more::after {
    content: " →";
}

.post-card-more:hover {
    color: var(--gold);
}

.more-archive {
    margin-top: 2.25rem;
    padding-top: 0.5rem;
}

.more-archive-list {
    display: grid;
    gap: 0.65rem;
    margin: 0 0 1.35rem;
    padding: 0;
    list-style: none;
}

.more-archive-list a {
    display: block;
    padding: 0.85rem 1rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.more-archive-list a:hover {
    border-color: #d2c6b0;
    color: var(--link);
}

.site-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 10rem;
    padding: 0.7rem 1.15rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    background: var(--navy);
    border: 1px solid var(--navy);
    border-radius: 999px;
}

.site-button:hover {
    color: var(--navy);
    background: var(--gold-bright);
    border-color: var(--gold-bright);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 2.25rem 0 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link,
.pagination .page-item > a,
.pagination .page-item > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.4rem 0.7rem;
    color: var(--ink);
    font-size: 0.95rem;
    text-decoration: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.pagination .active .page-link,
.pagination .page-item.active > a,
.pagination .page-item.active > span {
    color: #fff;
    background: var(--navy);
    border-color: var(--navy);
}

.terms-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.terms-cloud a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    color: var(--ink);
    font-size: 0.95rem;
    text-decoration: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.terms-cloud a:hover {
    border-color: var(--gold);
    color: var(--link);
}

.terms-cloud-count {
    color: var(--muted);
    font-size: 0.8rem;
}

/* -------------------------------------------------------------------------
   Article
   ------------------------------------------------------------------------- */

.post {
    width: calc(100% - 2.5rem);
    max-width: 68rem;
    margin: 2rem auto 0;
}

@media screen and (min-width: 48em) {
    .post {
        width: calc(100% - 5rem);
    }
}

.post-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.post-kicker {
    margin: 0 0 0.55rem;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.post-title,
h1.post-title {
    margin: 0 0 0.75rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 2.85rem);
    font-weight: 650;
    letter-spacing: -0.025em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.post-byline,
.post-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.post-byline strong {
    color: var(--ink-soft);
    font-weight: 650;
}

.post-meta {
    margin-top: 0.35rem;
}

.post-content,
.post-content.serif,
article .serif,
.nested-copy-line-height p,
.nested-copy-line-height h2,
.nested-copy-line-height h3,
.nested-copy-line-height h4,
.nested-copy-line-height h5,
.nested-copy-line-height h6 {
    font-family: var(--font-sans);
}

.post-content {
    color: var(--ink-soft);
    font-size: 1.08rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.post-content > * {
    max-width: 100%;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--ink);
    font-family: var(--font-serif);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.post-content h2 {
    margin: 2.1rem 0 0.8rem;
    font-size: 1.65rem;
}

.post-content h3 {
    margin: 1.7rem 0 0.65rem;
    font-size: 1.3rem;
}

.post-content p {
    margin: 0 0 1.1rem;
}

.post-content a {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

.post-content ul,
.post-content ol {
    padding-left: 1.25rem;
}

.post-content li + li {
    margin-top: 0.35rem;
}

.post-content blockquote {
    margin: 1.5rem 0;
    padding: 0.15rem 0 0.15rem 1.1rem;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.12rem;
    border-left: 3px solid var(--gold);
}

.post-content hr {
    height: 1px;
    margin: 2rem 0;
    background: var(--line);
    border: 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.post-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.post-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-tags a {
    display: inline-block;
    padding: 0.28rem 0.75rem;
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--paper-deep);
    border: 1px solid transparent;
    border-radius: 999px;
}

.post-tags a:hover {
    border-color: var(--gold);
    color: var(--link);
}

.share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.85rem;
}

.share-row .twitter:hover,
.share-row .x:hover,
.site-nav-social .twitter:hover,
.site-footer-social .twitter:hover {
    color: var(--ink);
    fill: currentColor;
}

.share-row a {
    display: inline-flex;
    color: var(--muted);
    fill: currentColor;
}

.share-row a:hover {
    color: var(--link);
}

.share-row svg {
    width: 22px;
    height: 22px;
}

.post aside .bg-light-gray {
    margin-top: 2.5rem;
    padding: 1.35rem 1.4rem 1.45rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.post aside .bg-light-gray a {
    color: var(--ink);
    font-weight: 550;
    text-decoration: none;
}

.post aside .bg-light-gray a:hover {
    color: var(--link);
}

.related-block {
    margin-top: 2.5rem;
    padding: 1.35rem 1.4rem 1.45rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.related-title {
    margin: 0 0 0.85rem;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 650;
}

.related-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-list a {
    color: var(--ink);
    font-weight: 550;
    text-decoration: none;
}

.related-list a:hover {
    color: var(--link);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.site-footer {
    background: var(--navy);
    color: rgba(255, 255, 255, 0.78);
}

.site-footer-inner {
    display: grid;
    gap: 1.4rem;
    width: min(var(--page), calc(100% - 2.5rem));
    margin: 0 auto;
    padding: 2.25rem 0 2rem;
}

@media screen and (min-width: 48em) {
    .site-footer-inner {
        grid-template-columns: 1.4fr 1fr auto;
        align-items: center;
        gap: 2rem;
    }
}

.site-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    text-decoration: none;
    color: inherit;
}

.site-footer-brand img {
    height: 42px;
    width: auto;
}

.site-footer-copy {
    margin: 0;
    max-width: 22rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.site-footer-nav a {
    color: rgba(255, 255, 255, 0.86);
    font-weight: 550;
    text-decoration: none;
}

.site-footer-nav a:hover {
    color: var(--gold-bright);
}

.site-footer-meta {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.site-footer-legal {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
}

/* -------------------------------------------------------------------------
   Legacy / utility polish
   ------------------------------------------------------------------------- */

.btn-primary {
    color: #fff;
    background-color: var(--navy);
    border-color: var(--navy);
}

.btn-info,
.btn-link {
    color: #fff;
    background-color: var(--link);
    border-color: var(--link);
}

.btn-link {
    background: transparent;
    color: var(--link);
}

.image-card-container {
    gap: 1rem;
    padding: 0.75rem 0;
}

iframe {
    max-width: 100%;
}

@media screen and (max-width: 30em) {
    .post-content h1 {
        font-size: 1.7rem;
    }

    .post-content h2 {
        font-size: 1.4rem;
    }

    .post-content h3 {
        font-size: 1.2rem;
    }
}
