/* ==========================================================================
   Newspaper theme
   ========================================================================== */

:root {
    --paper: #f4f1e8;
    --paper-dark: #ece7d8;
    --ink: #1a1a1a;
    --ink-soft: #3a3a3a;
    --muted: #6b665c;
    --rule: #1a1a1a;
    --accent: #7a1f2b;
    --card: #fffdf7;
}

* {
    box-sizing: border-box;
}

p, h1, h2, h3, h4, h5, h6, button {
    font-family: "PT Serif", "Georgia", serif;
}

h1, h2, h3, h4, h5, h6,
.masthead-title,
.nav-link,
.skill-group-title {
    font-family: "Playfair Display", "Georgia", serif;
}

body {
    background-color: var(--paper);
    background-size: cover;
    width: auto;
    overflow-x: hidden;
    font-family: "PT Serif", "Georgia", serif;
    color: var(--ink);
    margin: 0px;
    line-height: 1.6;
}

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

/* --- Masthead --- */
.masthead {
    width: 100%;
    background-color: var(--paper);
    border-bottom: 4px double var(--rule);
    padding-top: 8px;
}

.masthead-utility {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 8px 20px;
    display: flex;
    justify-content: space-between;
    font-family: "PT Serif", serif;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--rule);
}

.masthead-kicker-right {
    text-align: right;
}

.masthead-brand {
    max-width: 1000px;
    margin: 0 auto;
    padding: 18px 20px 10px 20px;
    text-align: center;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-logo img {
    width: 60px;
}

.masthead-title {
    display: block;
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: 56px;
    letter-spacing: 0.02em;
    color: var(--ink);
    text-decoration: none;
    text-transform: uppercase;
}

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

.masthead-subtitle {
    margin: 6px 0 0 0;
    font-style: italic;
    font-size: 15px;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.masthead-byline {
    margin: 18px 0 0 0;
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--ink);
}

.masthead-tagline {
    margin: 4px 0 0 0;
    font-style: italic;
    font-size: 14px;
    color: var(--muted);
}

.masthead-dateline {
    max-width: 1000px;
    margin: 16px auto 0 auto;
    padding: 8px 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border-top: 1px solid var(--rule);
}

.dateline-sep {
    color: var(--muted);
}

/* --- Navigation --- */
.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    max-width: 1000px;
    margin: 8px auto 0 auto;
    border-bottom: 1px solid var(--rule);
    padding: 10px 20px;
}

.nav-link {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 16px;
    border-right: 1px solid var(--muted);
}

.nav-link:last-child {
    border-right: none;
}

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

.nav-link.active {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --- Profile / hero --- */
.profile {
    background-color: var(--paper-dark) !important;
    text-align: center;
    height: auto;
    padding: 40px 20px 30px 20px;
    margin-bottom: 50px;
    border-bottom: 1px solid var(--rule);
}

.profile h1 {
    font-size: 44px;
    font-weight: 900;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.profile img {
    border-radius: 50%;
    max-width: 100%;
    max-height: 100%;
    margin-left: auto;
    margin-right: auto;
    display: block;
    padding: 20px;
    filter: grayscale(35%) contrast(1.05);
    border: 3px solid var(--rule);
}

.profile .profile-picture {
    margin-bottom: 30px;
    height: 200px;
}

.profile .tagline {
    color: var(--ink-soft);
    font-style: italic;
    font-size: 18px;
    margin-top: -10px;
}

.banner {
    padding: 20px 0px 50px 0px;
    height: 150px;
    background-color: var(--paper-dark);
    border-bottom: 1px solid var(--rule);
}

.banner .logo {
    max-width: 180px;
    max-height: 60px;
    width: auto;
    height: auto;
}

.banner .title {
    color: var(--ink);
    font-family: "Playfair Display", serif;
    font-size: 50px;
    font-weight: 900;
}

/* --- Front page hero --- */
.front-page {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap-reverse;
    max-width: 1000px;
    margin: 0 auto 50px auto;
    padding: 48px 20px;
    border-bottom: 1px solid var(--rule);
}

.front-page-inner {
    flex: 1 1 480px;
    max-width: 560px;
}

.kicker {
    display: inline-block;
    font-family: "PT Serif", serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 4px;
    margin-bottom: 14px;
}

.headline {
    margin: 0 0 14px 0;
    font-size: 40px;
    line-height: 1.15;
    font-weight: 900;
    color: var(--ink);
}

.byline {
    margin: 0 0 16px 0;
    font-size: 15px;
    color: var(--ink-soft);
}

.byline-sep {
    color: var(--muted);
    margin: 0 4px;
}

.byline .tagline {
    font-style: italic;
    color: var(--muted);
}

.dek {
    margin: 0 0 26px 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.front-page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.front-page-photo {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.front-page-photo img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--rule);
    filter: grayscale(15%) contrast(1.05);
}

.photo-caption {
    margin: 0;
    font-family: "PT Serif", serif;
    font-size: 11px;
    font-style: italic;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
}

.page-title {
    margin: 6px 0 10px 0;
    font-size: 34px;
    font-weight: 900;
    color: var(--ink);
}

.section-intro {
    color: var(--ink-soft);
    margin-top: -6px;
    margin-bottom: 20px;
}

/* --- Layout --- */
.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1000px;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-top: 3px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 6px 0;
    color: var(--ink);
}

/* --- Skills --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.skill-group {
    background-color: var(--card);
    border: 1px solid var(--rule);
    border-radius: 0;
    padding: 16px 20px;
    box-shadow: none;
}

.skill-group-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background-color: var(--paper);
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 0;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Cards (experience / education) --- */
.card {
    background-color: var(--card);
    border: 1px solid var(--rule);
    border-radius: 0;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: none;
}

.card h3 {
    margin: 0 0 4px 0;
    font-weight: 700;
}

.card p {
    text-align: justify;
}

.card .meta {
    color: var(--muted);
    font-style: italic;
    font-size: 14px;
}

/* --- Travel map --- */
#map {
    height: 420px;
    width: 100%;
    border: 1px solid var(--rule);
    border-radius: 0;
    margin-bottom: 16px;
    box-shadow: none;
    z-index: 0;
}

/* --- Travel list (legend / no-JS fallback) --- */
.places {
    list-style: none;
    padding: 0;
}

.places li {
    background-color: var(--card);
    border: 1px solid var(--rule);
    border-radius: 0;
    padding: 10px 14px;
    margin-bottom: 8px;
    box-shadow: none;
}

/* --- Hobbies grid --- */
.hobby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.hobby-card {
    background-color: var(--card);
    border: 1px solid var(--rule);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.hobby-card img {
    width: 100%;
    height: 160px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    filter: grayscale(60%) contrast(1.05);
    border-bottom: 1px solid var(--rule);
}

.hobby-icon {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background-color: var(--paper-dark);
    border-bottom: 1px solid var(--rule);
}

.hobby-card h3,
.hobby-card p {
    margin: 10px 16px;
}

.hobby-card h3 {
    font-weight: 700;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 24px 20px;
    margin-top: 40px;
    color: var(--muted);
    font-style: italic;
    font-size: 14px;
    border-top: 3px double var(--rule);
}

/* --- Site footer --- */
.site-footer {
    margin-top: 60px;
    padding: 48px 20px 28px 20px;
    border-top: 3px double var(--rule);
    background: var(--paper-dark);
}

.site-footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-masthead {
    margin: 0;
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: 20px;
    color: var(--ink);
}

.footer-copyright {
    margin: 0;
    font-family: "Source Sans 3", sans-serif;
    font-size: 13px;
    color: var(--muted);
}

.footer-col-title {
    margin: 0 0 4px 0;
    font-family: "PT Serif", serif;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-bottom: 1px solid var(--rule);
    padding-bottom: 6px;
}

.footer-col a,
.footer-text {
    font-family: "Source Sans 3", sans-serif;
    font-size: 14px;
    color: var(--ink-soft);
    text-decoration: none;
}

.footer-text {
    margin: 0;
}

.footer-col a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.footer-fineprint {
    max-width: 1000px;
    margin: 32px auto 0 auto;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    text-align: center;
    font-family: "Source Sans 3", sans-serif;
    font-size: 12px;
    font-style: italic;
    color: var(--muted);
}

@media (max-width: 700px) {
    .site-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 450px) {
    .site-footer-inner {
        grid-template-columns: 1fr;
    }
}

.builder-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--rule);
    background-color: var(--card);
    padding: 12px;
}

.builder-card label {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.builder-card input,
.builder-card textarea {
    padding: 8px;
    border: 1px solid var(--muted);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}

.builder-card textarea {
    min-height: 60px;
    resize: vertical;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.builder-actions {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--rule);
    border-radius: 0;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--paper-dark);
}

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

.btn-primary:hover {
    background: #611722;
}

.output {
    padding: 14px;
    overflow-x: auto;
    border: 1px solid var(--rule);
    border-radius: 0;
    background: var(--ink);
    color: #f4f1e8;
    white-space: pre;
    font-family: "PT Serif", monospace;
}

#map {
    width: 100%;
    height: 400px;
    border-radius: 0;
}

/* --- Work experience / education cards with logos --- */
.job-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.job-logos {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.job-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    padding: 6px;
    background: var(--paper);
    border: 1px solid var(--rule);
}

.leadership-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: var(--paper);
    border: 1px solid var(--rule);
}

.job-details {
    flex: 1 1 auto;
}

.job-role {
    margin: 0;
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--ink);
}

.job-company {
    display: block;
    font-family: "PT Serif", serif;
    font-style: italic;
    font-size: 15px;
    color: var(--accent);
    margin: 2px 0 4px 0;
}

@media (max-width: 500px) {
    .job-card {
        flex-direction: column;
    }

    .job-logos {
        flex-direction: row;
    }
}

/* --- Contact --- */
.contact-email-link {
    display: inline-block;
}

/* --- Projects page --- */
.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 28px;
    align-items: start;
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 5px 5px 0 var(--ink);
}

.project-photo {
    width: 100%;
    height: 210px;
    border-bottom: 1px solid var(--rule);
    background: var(--paper-dark);
    overflow: hidden;
}

.project-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(var(--rule) 1px, transparent 1px) 0 0 / 14px 14px,
        var(--paper-dark);
}

.project-photo-placeholder span {
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: 56px;
    color: var(--ink);
    background: var(--paper);
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--rule);
}

.project-card-body {
    padding: 24px;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
}

.project-letter {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Playfair Display", serif;
    font-weight: 900;
    font-size: 20px;
    border: 2px solid var(--rule);
    color: var(--ink);
}

.project-card-header h3 {
    margin: 0 0 2px 0;
}

.project-links {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 700;
}

.project-links a {
    color: var(--accent);
    text-decoration: none;
}

.project-links a:hover {
    text-decoration: underline;
}

/* --- Career timeline --- */
.timeline-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.timeline-filter {
    padding: 6px 14px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.timeline-filter:hover {
    background: var(--paper-dark);
}

.timeline-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.timeline-list {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0 0 0 32px;
}

.timeline-list::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 5px;
    width: 2px;
    background: var(--rule);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    top: 22px;
    left: -32px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--accent);
}

.timeline-content {
    margin: 0;
}

.timeline-category-tag {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 8px;
    border: 1px solid var(--rule);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

/* --- Books --- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.book-card h3 {
    margin: 8px 0 4px 0;
}

.review-quote {
    margin: 14px 0 0 0;
    padding-left: 16px;
    border-left: 3px solid var(--accent);
    font-style: italic;
    color: var(--ink-soft);
    line-height: 1.6;
}

/* --- Comic strip (JokeAPI) --- */
.comic-strip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.comic-frame {
    position: relative;
    width: 100%;
    max-width: 640px;
    padding: 28px 24px;
    background:
        radial-gradient(var(--rule) 1px, transparent 1px) 0 0 / 14px 14px,
        var(--card);
    background-color: var(--card);
    border: 3px solid var(--rule);
    box-shadow: 6px 6px 0 var(--ink);
    transform: rotate(-0.4deg);
}

.comic-setup,
.comic-delivery {
    font-family: "Comic Neue", "PT Serif", serif;
    color: var(--ink);
}

.comic-setup {
    margin: 0 0 10px 0;
    font-weight: 700;
    font-size: 20px;
}

.comic-delivery {
    margin: 0;
    font-size: 22px;
    line-height: 1.4;
}

/* --- Work Experience: newspaper ledger --- */
.work-experience-section {
    --we-accent: #b5561a;
}

.we-header {
    margin-bottom: 36px;
}

.we-heading {
    margin: 8px 0 10px 0;
    font-size: 34px;
    font-weight: 900;
    color: var(--ink);
}

.we-intro {
    margin: 0 0 16px 0;
    max-width: 56ch;
    font-family: "Source Sans 3", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.we-header .we-pull-quote {
    margin: 0;
    max-width: 56ch;
    padding-left: 16px;
    border-left: 3px solid var(--we-accent);
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 19px;
    line-height: 1.4;
    color: var(--ink);
}

.we-rows {
    display: flex;
    flex-direction: column;
}

.we-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 24px;
    padding: 28px 0;
    border-top: 1px solid var(--rule);
}

.we-row:last-child {
    border-bottom: 1px solid var(--rule);
}

.we-row-date {
    font-family: "Source Sans 3", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--we-accent);
    padding-top: 3px;
}

.we-role {
    margin: 0 0 2px 0;
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 21px;
    color: var(--ink);
}

.we-company {
    font-family: "PT Serif", serif;
    font-style: italic;
    font-weight: 400;
    color: var(--we-accent);
    font-size: 17px;
}

.we-meta {
    display: block;
    font-family: "Source Sans 3", sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 10px;
}

.we-description {
    margin: 0 0 10px 0;
    max-width: 68ch;
    font-family: "Source Sans 3", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-soft);
}

.we-tools {
    margin: 0;
    font-family: "Source Sans 3", sans-serif;
    font-size: 13px;
    font-style: italic;
    color: var(--muted);
}

@media (max-width: 600px) {
    .we-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* --- Project problem hook + details dropdown --- */
.project-problem {
    margin: 0 0 14px 0;
    padding-left: 14px;
    border-left: 3px solid var(--accent);
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 19px;
    line-height: 1.4;
    color: var(--ink);
}

.project-details {
    margin: 16px 0;
    border: 1px solid var(--rule);
}

.project-details summary {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink);
    list-style: none;
}

.project-details summary::-webkit-details-marker {
    display: none;
}

.project-details summary::after {
    content: "+";
    float: right;
    font-family: "Playfair Display", serif;
    font-size: 16px;
    color: var(--accent);
}

.project-details[open] summary::after {
    content: "−";
}

.project-details summary:hover {
    background: var(--paper-dark);
}

.project-details-body {
    padding: 4px 16px 16px 16px;
    border-top: 1px solid var(--rule);
}

.project-details-body h4 {
    margin: 14px 0 4px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
}

.project-details-body h4:first-child {
    margin-top: 12px;
}

.project-details-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-soft);
}
