/* ==============================================================================
   Project:     Apparently True (apparentlytrue.com)
   File:        style.css
   Description: Shared stylesheet for the homepage, fact index, and every
                individual fact page. Published once to the domain root by
                publisher.pl and referenced everywhere via an absolute path
                (/style.css), so a single file stays in sync across the
                whole site rather than duplicating CSS into every page.
   ============================================================================== */

:root {
    --bg-color: #faf9f5;
    --card-bg: #ffffff;
    --text-primary: #1e1b18;
    --text-secondary: #6b655d;
    --accent-yellow: #fde047;
    --accent-pink: #f472b6;
    --accent-blue: #38bdf8;
    --border: #e7e5df;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 3rem 1rem;
}

.container {
    max-width: 750px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.badge {
    display: inline-block;
    background-color: var(--accent-yellow);
    color: #713f12;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 1rem;
    transform: rotate(-2deg);
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

/* Header logo/title links back to the site root everywhere it appears */
header h1 a {
    color: inherit;
    text-decoration: none;
}
header h1 a:hover {
    text-decoration: underline;
}

header p {
    color: var(--text-secondary);
    font-size: 1.15rem;
}

/* Small navigation "pills" shown on individual fact pages, linking back to
   the site root and to the full facts index. Styled to match the comic,
   hand-drawn feel of the cards rather than plain underlined text. */
.page-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}
.page-nav a {
    display: inline-block;
    background-color: var(--card-bg);
    border: 2px solid var(--text-primary);
    border-radius: 50px;
    padding: 0.35rem 1.1rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: 2px 2px 0px 0px var(--text-primary);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.page-nav a:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px 0px var(--text-primary);
}

main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background-color: var(--card-bg);
    border: 2px solid var(--text-primary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 4px 4px 0px 0px var(--text-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px var(--text-primary);
}

/* Cycle three accent colours indefinitely down a growing list, rather than
   only colouring the first three cards on the page. */
.card:nth-child(3n+1) {
    border-color: #0284c7;
    box-shadow: 4px 4px 0px 0px #0284c7;
}
.card:nth-child(3n+1):hover {
    box-shadow: 6px 6px 0px 0px #0284c7;
}

.card:nth-child(3n+2) {
    border-color: #db2777;
    box-shadow: 4px 4px 0px 0px #db2777;
}
.card:nth-child(3n+2):hover {
    box-shadow: 6px 6px 0px 0px #db2777;
}

.card:nth-child(3n+3) {
    border-color: #ca8a04;
    box-shadow: 4px 4px 0px 0px #ca8a04;
}
.card:nth-child(3n+3):hover {
    box-shadow: 6px 6px 0px 0px #ca8a04;
}

.card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.card h2 a {
    color: inherit;
    text-decoration: none;
}
.card h2 a:hover {
    text-decoration: underline;
}

.card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.card p.meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Elements the markdown converter can produce within a card's body content */
.card ul, .card ol {
    margin: 0.75rem 0 0.75rem 1.5rem;
    color: var(--text-secondary);
}
.card pre {
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-top: 0.75rem;
}
.card code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Bold call-to-action button - used on the root landing page to point
   visitors at the actual facts index. */
.cta-button {
    display: inline-block;
    background-color: var(--accent-blue);
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 0.9rem 1.75rem;
    border: 2px solid var(--text-primary);
    border-radius: 50px;
    box-shadow: 4px 4px 0px 0px var(--text-primary);
    transform: rotate(-1deg);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta-button:hover {
    transform: rotate(-1deg) translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px var(--text-primary);
}

.card.center {
    text-align: center;
}
.card.center p {
    margin-bottom: 1.25rem;
}

footer {
    text-align: center;
    margin-top: 4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
footer p {
    margin-bottom: 0.25rem;
}
footer a {
    color: var(--text-secondary);
    text-decoration: underline;
}
footer a:hover {
    color: var(--text-primary);
}
