/* Main stylesheet -- consolidated from layout.css + blog-posts.css */

/* ==========================================================================
   CSS RESET & BASE
   ========================================================================== */

/* Box sizing reset */
html {
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}

/* Typography baseline */
html {
    font-size: 18px;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    font-weight: 400;
    margin: 0;
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */

/* Main site container */
.container {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: var(--space-lg) var(--space-md);
}

/* Homepage specific container */
.index {
    max-width: var(--max-width) !important;
    margin-left: auto;
    margin-right: auto;
    padding: var(--space-lg) var(--space-md);
}

/* ==========================================================================
   HEADER LAYOUT
   ========================================================================== */

.site-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-xl);
}

/* Consistent gap: header margin-bottom is the sole source of spacing */
main > :first-child {
    margin-top: 0;
    padding-top: 0;
}

/* Branding: name + tagline */
.site-branding {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.site-name {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1.1;
    margin: 0;
}

.site-name a {
    color: var(--color-text);
    text-decoration: none;
}

.site-name a:hover {
    color: var(--color-accent);
}

.site-tagline {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin: 0;
    font-weight: 400;
}

/* Navigation */
.site-nav ul {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: var(--space-md);
}

.site-nav a, .site-nav a:visited {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.site-nav a:hover {
    color: var(--color-accent);
}

.site-nav a.active,
.site-nav a[aria-current="page"] {
    color: var(--color-accent);
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 2px;
}

/* ==========================================================================
   HOMEPAGE LAYOUT
   ========================================================================== */

div.index main {
    display: block;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: 0 0 var(--space-2xl);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-lg);
}

.hero-content {
    flex: 1;
}

.hero-photo {
    width: 400px;
    height: auto;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.hero-heading {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 var(--space-sm);
    color: var(--color-text);
}

.hero-body {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    max-width: 38em;
    margin: 0 0 var(--space-md);
}

.hero-cta {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
    font-size: 1.05rem;
}

.hero-cta:hover {
    text-decoration: underline;
}

/* ==========================================================================
   BLOG LISTING CARDS
   ========================================================================== */

.section-heading {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.post-card {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.post-card:last-child {
    border-bottom: none;
}

.post-card-title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin: 0 0 var(--space-xs);
}

.post-card-date {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.post-card-excerpt {
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Featured card elevated style */
.post-card--featured {
    background: var(--color-bg-card, rgba(255,255,255,0.5));
    padding: var(--space-md);
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border-bottom: none;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
}

.post-card--featured .post-card-title {
    font-size: 1.65rem;
}

.post-card--featured:last-child {
    border-bottom: none;
}

/* View all writing link */
.section-footer {
    margin-top: var(--space-md);
}

.view-all-link {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
    font-size: 1.05rem;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   TYPOGRAPHY SYSTEM
   ========================================================================== */

/* Main content headings */
main h1 {
    font-size: 2.25rem;
    line-height: 1.2;
}

main h2 {
    font-size: 1.51572rem;
    line-height: 1.1;
}

main h3 {
    font-size: 1.31951rem;
    line-height: 1.1;
}

/* Links */
h1 a, h3 a {
    color: var(--color-text);
    text-decoration: none;
}

h3 a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   CONTENT ELEMENTS
   ========================================================================== */

/* Articles */
article {
    margin-bottom: 3em;
}

/* Publication details */
p.pub-details {
    font-weight: 600;
    text-transform: uppercase;
    font-size: .725rem;
    letter-spacing: .1rem;
    margin: 0;
}

/* Callouts and CTAs */
.mc-cta {
    width: 14em;
    margin: var(--space-sm) auto;
    text-align: center;
    padding: .25em;
    display: block;
    font-size: 1.5em;
    border: 1px solid var(--color-border);
    border-radius: .5em;
    background-color: var(--color-accent);
    color: white;
    text-decoration: none;
}

div.callout {
    border: 1px dotted var(--color-border);
    padding: var(--space-sm) var(--space-sm) 0 var(--space-sm);
    background-color: var(--color-accent-light);
    margin-bottom: var(--space-md);
    font-size: .85em;
    font-style: italic;
}

/* Images */
img.bodyshot {
    width: 180px;
    margin-left: var(--space-lg);
    margin-bottom: var(--space-sm);
    float: right;
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Horizontal rules in main content */
main hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-lg) 0;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-lg);
    padding: var(--space-lg) 0 var(--space-lg);
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
}

.footer-feather {
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding-top: var(--space-xs);
}

.footer-signoff {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-md);
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-legal {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Mobile header adjustments */
@media screen and (max-width: 800px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-name {
        font-size: 1.2rem;
    }

    .site-nav ul {
        gap: var(--space-sm);
    }

    .site-nav a, .site-nav a:visited {
        font-size: 0.8rem;
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-photo {
        width: 250px;
    }

    .hero-heading {
        font-size: 1.8rem;
    }
}

/* Responsive images */
@media screen and (min-width: 10em) and (max-width: 1200px) {
    img.bodyshot {
        width: 180px;
    }
}

@media screen and (min-width: 2em) and (max-width: 500px) {
    img.bodyshot {
        width: 150px;
    }

    .mc-cta {
        width: 10em;
    }
}

/* ==========================================================================
   BLOG POST SPECIFIC STYLES
   ========================================================================== */

/* Post title */
h1.p-name {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: var(--space-xs);
}

/* Remove decorative hanger on post titles */
main h1.p-name::before {
    content: none;
}

/* Post date */
.post-date {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

/* General heading margin (kept from original) */
h1 {
    margin-bottom: 0.25rem;
}

main h1 {
    line-height: 1.1;
}

/* ==========================================================================
   PROSE TYPOGRAPHY -- Scoped to .prose wrapper
   Polished reading typography for blog post content elements.
   All selectors MUST be prefixed with .prose to prevent style leaking.
   ========================================================================== */

/* === HEADINGS === */

.prose h2 {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xs);
}

.prose h3,
.prose h4 {
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

/* === PARAGRAPHS === */

.prose p {
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

/* === LINKS === */

.prose a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.prose a:hover {
    color: var(--color-accent-hover);
}

/* === LISTS === */

.prose ul,
.prose ol {
    margin-bottom: var(--space-sm);
    padding-left: var(--space-md);
}

.prose li {
    line-height: 1.6;
    margin-bottom: var(--space-xs);
}

/* === BLOCKQUOTES === */

.prose blockquote {
    position: relative;
    font-style: italic;
    font-size: 1.1rem;
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-md) 0 var(--space-lg);
    color: var(--color-text-secondary);
    background-color: var(--color-accent-light);
    border-radius: 0.375rem;
}

/* Large decorative opening quotation mark */
.prose blockquote::before {
    content: "\201C";
    position: absolute;
    top: -0.15em;
    left: 0.15em;
    font-size: 5rem;
    line-height: 1;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--color-accent);
    opacity: 0.15;
    pointer-events: none;
}

/* === CODE: INLINE === */

.prose code {
    font-size: 0.9em;
    background-color: var(--color-accent-light);
    padding: 0.125em 0.25em;
    border-radius: 0.25rem;
}

/* === CODE: BLOCKS === */

.prose pre {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    padding: var(--space-sm);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: var(--space-sm);
}

/* Reset inline code styling inside pre blocks */
.prose pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    border-radius: 0;
}

/* === IMAGES === */

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* === FIGURES === */

.prose figure {
    margin: var(--space-md) 0;
}

.prose figcaption {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

/* === TABLES === */

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-sm);
}

.prose th,
.prose td {
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.prose th {
    font-weight: 600;
}

/* === HORIZONTAL RULES === */

.prose hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-lg) 0;
}

/* === CALLOUT BOXES === */

.prose .callout {
    border: 1px dotted var(--color-border);
    padding: var(--space-sm);
    background-color: var(--color-accent-light);
    margin-bottom: var(--space-md);
    font-size: 0.85em;
    font-style: italic;
    border-radius: 0.25rem;
}

/* === EMBEDDED MEDIA === */

.prose iframe,
.prose .twitter-tweet {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: block;
    margin-bottom: var(--space-sm);
}
