/* ══════════════════════════════════════════════
   Tim Scudder — Shared Styles
   ══════════════════════════════════════════════ */

/* ── Variables ── */

:root {
    --off-white: #FAF9F6;
    --teal: #0A8080;
    --teal-dark: #065858;
    --teal-light: #E5F4F4;
    --charcoal: #2B2B2B;
    --grey-medium: #6B6B6B;
    --grey-light: #DEDEDE;
    --accent: #C85A54;
}

/* ── Reset ── */

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

/* ── Page decoration (shared) ── */

.page-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 100vh;
    background: linear-gradient(180deg, var(--teal) 0%, var(--teal-dark) 100%);
    z-index: 1000;
}


/* ══════════════════════════════════════════════
   Homepage  (body.page-home)
   ══════════════════════════════════════════════ */

.page-home {
    background: var(--off-white);
    color: var(--charcoal);
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    font-weight: 300;
    line-height: 1.7;
    font-size: 16px;
    padding-top: 72px;
}

/* ── Homepage header ── */

.page-home header {
    padding: 4rem 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.page-home .header-content {
    display: block;
    max-width: 900px;
}

.page-home h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 400;
    line-height: 1.05;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.title-accent {
    color: var(--teal);
}

.title-name {
    color: var(--charcoal);
}

.tagline {
    font-size: 1.25rem;
    color: var(--grey-medium);
    font-weight: 400;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.contact-links a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 400;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.contact-links a:hover {
    border-bottom-color: var(--teal);
    color: var(--teal-dark);
}

.cta-button {
    text-decoration: none !important;
    background: var(--teal) !important;
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 2px;
    border: none !important;
    border-bottom: none !important;
    font-weight: 500 !important;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--teal-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(10, 128, 128, 0.2);
    border-bottom: none !important;
}

.profile-summary {
    margin-top: 1.5rem;
    max-width: 700px;
}

.profile-summary p {
    color: var(--grey-medium);
    line-height: 1.8;
    font-size: 1.05rem;
}

.profile-summary p + p {
    margin-top: 1rem;
}

.header-cta {
    display: none;
}

/* ── Homepage navigation ── */

.page-home nav {
    background: white;
    border-top: 1px solid var(--grey-light);
    border-bottom: 1px solid var(--grey-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.page-home nav ul {
    list-style: none;
    display: flex;
    padding: 0;
}

.page-home nav li {
    margin: 0;
}

.page-home nav a {
    display: block;
    padding: 1.25rem 2rem;
    text-decoration: none;
    color: var(--charcoal);
    font-weight: 500;
    font-size: 1rem;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    letter-spacing: 0.02em;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.page-home nav a:hover,
.page-home nav a.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 1rem 2rem;
    margin-left: auto;
    gap: 0.5rem;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--charcoal);
}

.nav-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}

.nav-toggle-icon span {
    display: block;
    height: 2px;
    background: var(--charcoal);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

.nav-bar {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ── Homepage main content ── */

.page-home main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem;
}

.page-home section {
    margin-bottom: 3rem;
    scroll-margin-top: 96px;
}

h2.section-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    color: var(--charcoal);
    position: relative;
    padding-bottom: 1rem;
}

h2.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--teal);
}

/* ── Article cards (homepage grid) ── */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.article-card {
    background: white;
    border-left: 3px solid var(--teal-light);
    padding: 2rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    border-left-color: var(--teal);
    box-shadow: 0 4px 20px rgba(10, 128, 128, 0.12);
    transform: translateY(-2px);
}

.article-card .article-date {
    font-size: 0.85rem;
    color: var(--grey-medium);
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.article-card h3 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--charcoal);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-card h3 a {
    color: var(--charcoal);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-card h3 a:hover {
    color: var(--teal);
}

.article-excerpt {
    color: var(--grey-medium);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    gap: 0.75rem;
    color: var(--teal-dark);
}

.read-more::after {
    content: '→';
}

/* ── Contact form ── */

.contact-intro {
    max-width: 680px;
    color: var(--grey-medium);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.contact-card {
    padding: 0;
    max-width: 720px;
}

.contact-card p {
    margin-bottom: 2rem;
    color: var(--grey-medium);
}

.form-field {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
}

label.form-label {
    display: block;
    margin-bottom: 0.5rem;
}

input,
textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--grey-light);
    border-radius: 2px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--off-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--teal);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(10, 128, 128, 0.15);
}

input.is-invalid,
textarea.is-invalid {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200, 90, 84, 0.15);
}

textarea {
    min-height: 160px;
    resize: vertical;
}

.form-meta {
    color: var(--grey-medium);
    font-size: 0.9rem;
    margin-top: 0.4rem;
}

.field-error {
    display: block;
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 0.4rem;
}

.field-error[hidden] {
    display: none;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--grey-medium);
    margin-top: 0.4rem;
}

.char-count.limit {
    color: var(--accent);
}

.submit-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-submit {
    background: var(--teal);
    color: white;
    border: none;
    padding: 0.85rem 1.75rem;
    font-weight: 500;
    font-size: 1rem;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-submit:hover {
    background: var(--teal-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(10, 128, 128, 0.2);
}

.form-status {
    font-size: 0.95rem;
    color: var(--accent);
}

.form-status.success {
    color: var(--teal-dark);
}

.form-success-view {
    max-width: 720px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.form-success-view.visible {
    opacity: 1;
    transform: translateY(0);
}

.form-success-view .success-heading {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 0.85rem;
    color: var(--teal-dark);
}

.form-success-view .success-body {
    font-size: 1.1rem;
    color: var(--grey-medium);
    margin-bottom: 1.5rem;
}

.send-another-btn {
    background: none;
    border: none;
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0;
}

.send-another-btn:hover {
    gap: 0.75rem;
    color: var(--teal-dark);
}

.send-another-btn::after {
    content: '→';
}


/* ══════════════════════════════════════════════
   Article pages  (body.page-article)
   ══════════════════════════════════════════════ */

.page-article {
    background: var(--off-white);
    color: var(--charcoal);
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    font-weight: 300;
    line-height: 1.8;
    font-size: 17px;
}

/* ── Sticky article header ── */

.page-article header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: white;
    border-bottom: 1px solid var(--grey-light);
    padding: 1.25rem 0;
}

.page-article .header-content {
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-name {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.site-name::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--teal);
    border: 2px solid var(--off-white);
    display: inline-block;
}

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

.page-article .back-link {
    color: var(--teal);
    text-decoration: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.page-article .back-link::before {
    content: '←';
}

.page-article .back-link:hover {
    color: var(--teal-dark);
}

/* ── Article layout ── */

.page-article article {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem 4rem;
}

.article-meta {
    color: var(--grey-medium);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.page-article h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.2;
    color: var(--charcoal);
    margin-bottom: 1.5rem;
}

.page-article h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--teal);
    margin-top: 1rem;
}

/* ── Article body content ── */

.article-content h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    margin: 2.25rem 0 1.1rem;
    color: var(--charcoal);
}

.article-content h3 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 0.85rem;
    color: var(--teal-dark);
}

.article-content p {
    margin-bottom: 1.35rem;
    line-height: 1.8;
}

.article-content p:first-of-type {
    font-weight: 400;
}

.article-content .published-note {
    margin-top: 1.75rem;
}

.article-content ul,
.article-content ol {
    margin: 0 0 1.1rem 1.5rem;
    color: var(--grey-medium);
    font-weight: 300;
    font-size: 17px;
}

.article-content li {
    margin-bottom: 0.32rem;
    color: var(--grey-medium);
    font-weight: 300;
    font-size: 17px;
}

.article-content li::marker {
    color: var(--grey-medium);
}

.article-content a {
    color: var(--teal);
    text-decoration: none;
    border-bottom: 1px solid var(--teal-light);
    transition: all 0.3s ease;
}

.article-content a:hover {
    border-bottom-color: var(--teal);
    color: var(--teal-dark);
}

.article-content strong {
    font-weight: 500;
    color: var(--charcoal);
}

.article-content em {
    font-style: italic;
}

.article-content blockquote {
    border-left: 3px solid var(--teal);
    padding-left: 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--grey-medium);
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 2px;
}

.article-content code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    background: var(--teal-light);
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
}

.article-content pre {
    background: var(--charcoal);
    color: var(--off-white);
    padding: 1.25rem 1.5rem;
    border-radius: 2px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ── Article footer (prev/next navigation) ── */

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--grey-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-footer a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
}

.article-footer a:hover {
    color: var(--teal-dark);
}


/* ══════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Homepage responsive ── */

    .page-home .header-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .page-home h1 {
        font-size: 2.5rem;
    }

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

    .nav-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .page-home nav ul {
        display: none;
        flex-direction: column;
        padding: 0;
        border-top: 1px solid var(--grey-light);
    }

    .page-home nav ul.nav-open {
        display: flex;
    }

    .page-home nav a {
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--grey-light);
        border-left: 3px solid transparent;
    }

    .page-home nav a:hover,
    .page-home nav a.active {
        border-bottom: 1px solid var(--grey-light);
        border-left-color: var(--teal);
    }

    /* ── Article responsive ── */

    .page-article h1 {
        font-size: 2rem;
    }

    .page-article h1::after {
        content: '';
        display: block;
        width: 60px;
        height: 3px;
        background: var(--teal);
        margin-top: 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
