/* ========================================
   Retro Newspaper Theme - REDESIGNED
   Classic broadsheet layout
   Old Standard TT + Lora + Source Serif 4
   ======================================== */

:root {
    --paper: #f5f0e1;
    --paper-alt: #ede8d6;
    --ink: #1a1a1a;
    --ink-dim: #4a4538;
    --ink-muted: #7a7464;
    --red: #8b0000;
    --rule: #1a1a1a;
    --rule-light: #c4bda8;
    --font-display: 'Old Standard TT', Georgia, serif;
    --font-sub: 'Lora', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, serif;
}
/* ---- Global Resets ---- */
* { -webkit-tap-highlight-color: transparent; }
[data-theme="dark"] { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
::selection { background: var(--red); color: #fff; }


[data-theme="dark"] {
    --paper: #1a1815;
    --paper-alt: #22201b;
    --ink: #d4cfc0;
    --ink-dim: #b0a990;
    --ink-muted: #8a8370;
    --red: #c05050;
    --rule: #5a5445;
    --rule-light: #3d3930;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--paper-alt);
    color: var(--ink);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    padding: 24px;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
em { color: var(--red); font-style: italic; }
strong { color: var(--ink); }

/* ---- Broadsheet Container ---- */

.broadsheet {
    width: 100%;
    max-width: 960px;
    background: var(--paper);
    padding: 32px 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

/* ---- Masthead ---- */

.masthead { text-align: center; margin-bottom: 24px; }

.masthead-rule {
    height: 3px;
    background: var(--rule);
    margin: 8px 0;
}

.masthead-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-align: center;
    padding: 8px 0;
    color: var(--ink);
}

.edition-btn {
    font-family: var(--font-sub);
    font-size: 0.7rem;
    background: none;
    border: 1px solid var(--rule-light);
    color: var(--ink-muted);
    padding: 3px 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.edition-btn:hover { border-color: var(--red); color: var(--red); }

/* ---- Section Nav ---- */

.section-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    font-family: var(--font-sub);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
}

.section-toggle { position: absolute; right: 0; }

.section-nav a { color: var(--ink-dim); }
.section-nav a:hover { color: var(--red); text-decoration: none; }
.nav-dot { color: var(--ink-muted); }

/* ---- Rules ---- */

.section-rule {
    height: 1px;
    background: var(--rule-light);
    margin: 0;
}

/* ---- Front Page ---- */

.hero-photo {
    width: 135px;
    height: 135px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--rule);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper-alt);
    margin: 0 auto 12px;
    flex-shrink: 0;
    cursor: pointer;
}

.hero-photo svg {
    width: 36px;
    height: 36px;
    color: var(--ink-muted);
    opacity: 0.4;
}

.hero-photo .profile-photo {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    border-radius: 50%;

    transition:
        opacity 0.45s ease,
        transform 0.45s ease;
}

.hero-photo .cartoon-photo {
    opacity: 1;
    transform: scale(1);
}

.hero-photo .real-photo {
    opacity: 0;
    transform: scale(1.05);
}

@media (hover: hover) {
    .hero-photo:hover .cartoon-photo {
        opacity: 0;
        transform: scale(0.97);
    }

    .hero-photo:hover .real-photo {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-photo.show-real .cartoon-photo {
    opacity: 0;
    transform: scale(0.97);
}

.hero-photo.show-real .real-photo {
    opacity: 1;
    transform: scale(1);
}

.front-columns {
    /* Two layout modes only:
       desktop/tablet = three columns with fixed row height;
       mobile = one natural-height column (see Responsive section). */
    --front-row-height: 260px;

    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 200px;
    gap: 24px;
    align-items: stretch;

    height: var(--front-row-height);
    min-height: 0;
}

.col-photo {
    display: flex;
    flex-direction: column;
    align-items: center;

    min-width: 0;
    min-height: 0;
    height: 100%;

    border-right: 1px solid var(--rule-light);
    padding-right: 24px;
}

.photo-info {
    margin-top: 10px;
    text-align: center;
    width: 100%;
}

.photo-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 2px;
}

.photo-role {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--ink-dim);
    margin-bottom: 1px;
}

.photo-place {
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.photo-contact {
    border-top: 1px solid var(--rule-light);
    padding-top: 8px;
    font-size: 0.7rem;
    color: var(--ink-muted);
    line-height: 1.8;
}

.col-main {
    min-width: 0;
    min-height: 0;
    height: 100%;

    border-right: 1px solid var(--rule-light);
    padding-right: 16px;

    font-size: 0.92rem;
    text-align: justify;
    hyphens: auto;

    /* Three-column mode: the center column scrolls instead of
       increasing the height of the whole front-page grid. */
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: var(--rule) transparent;
    scrollbar-gutter: stable;
}

.col-main p {
    margin-bottom: 12px;
}

/* Safari / Chrome scrollbar */
.col-main::-webkit-scrollbar {
    width: 4px;
}

.col-main::-webkit-scrollbar-track {
    background: transparent;
}

.col-main::-webkit-scrollbar-thumb {
    background: var(--rule);
    border-radius: 2px;
}


/* ---- Sidebar Boxes ---- */

.col-side {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 0;
    height: 100%;
}

.sidebar-box {
    border: none;
    padding: 0;

    min-height: 0;
    height: 100%;

    display: flex;
    flex-direction: column;
}

/* Latest News fills the remaining height of the right column.
   Additional items scroll inside this area in three-column mode. */
#latestNews {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 6px;

    scrollbar-width: thin;
    scrollbar-color: var(--rule) transparent;
}

#latestNews::-webkit-scrollbar {
    width: 4px;
}

#latestNews::-webkit-scrollbar-track {
    background: transparent;
}

#latestNews::-webkit-scrollbar-thumb {
    background: var(--rule);
    border-radius: 2px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--ink);
    margin: 0 0 10px 0;
}

.sidebar-header-rule {
    height: 1px;
    background: var(--rule);
    opacity: 0.8;
    margin-bottom: 14px;
}

.sidebar-stat {
    font-size: 0.8rem;
    color: var(--ink-dim);
    padding: 2px 0;
}

.stat-num {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--red);
    margin-right: 4px;
}

.sidebar-news {
    padding: 8px 0 9px 12px;
    border-bottom: 1px solid var(--rule-light);
    border-left: 3px solid #8b2e2e;
}

.sidebar-news:last-child {
    border-bottom: none;
}

.sidebar-news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.news-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: #8b2e2e;
    border-radius: 2px;
}

.sidebar-news-date {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
}

.sidebar-news-text {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--ink);
}

[data-config="intro"] {
    color: #8c8576;
    font-size: 0.88em;
    line-height: 1.55;
}

[data-config="intro"] em {
    color: inherit;
    font-weight: 400;
}

.research-interests {
    margin-top: 28px;
    padding-top: 0;
    border-top: none;
}

.research-interests-title {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    color: #817968;
    margin-bottom: 10px;
}

.research-interest-tags {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.research-tag {
    display: inline-block;

    padding: 5px 9px;

    border: 1px solid #bcb39f;

    font-size: 0.76rem;
    line-height: 1.2;

    color: #4f4a40;

    background: rgba(255, 255, 255, 0.10);
}

/* Current / primary research direction */
.research-tag-primary {
    border-color: #746d5f;
    color: #332f29;
    background: rgba(100, 90, 70, 0.08);
}

/* ---- Section Banner ---- */

.paper-section { padding: 20px 0; }

.section-banner {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-align: center;
    padding: 6px 0;
    border-top: 2px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    margin-bottom: 16px;
}

/* ---- Articles (Publications) ---- */

.articles-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    column-count: unset;
    column-rule: none;

    gap: 28px 0;
}

.news-article {
    margin: 0;
    padding: 10px 24px 10px 0;

    border-bottom: none;

    min-width: 0;
}

.news-article:nth-child(even) {
    padding-left: 24px;
    padding-right: 0;

    border-left: 1px solid var(--rule-light);
}

.news-article:nth-child(-n+2)::after {
    content: "";
    display: block;

    width: 42px;
    height: 1px;

    margin-top: 20px;

    background: var(--rule-light);
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    margin: 7px 0 10px;
}

.pub-venue {
    display: inline-block;

    padding: 1px 6px;
    border: 1px solid #aaa18e;

    font-family: var(--font-sub);
    font-size: 0.62rem;
    font-weight: 700;

    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--ink-muted);
}

.article-links {
    font-family: var(--font-sub);
    font-size: 0.68rem;
}

.article-links a {
    color: var(--red);
}

.article-headline {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.22;

    margin-bottom: 6px;

    min-height: 2.44em;
}

@media (max-width: 768px) {
    .article-headline {
        min-height: 0;
    }
}

.article-byline {
    font-size: 0.8rem;
    color: var(--ink-dim);
    font-style: italic;
    margin-bottom: 2px;
}


.article-body {
    font-size: 0.88rem;
    text-align: justify;
    hyphens: auto;
    margin-bottom: 6px;
}

.publications-more {
    margin-top: 26px;
    padding-top: 0;
    text-align: center;
}

.publications-more-link {
    font-family: var(--font-sub);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--red);
}

.publications-more-link:hover {
    text-decoration: underline;
}


/* ---- Classifieds (Projects) ---- */

.classifieds {
    column-count: 2;
    column-gap: 20px;
    column-rule: 1px solid var(--rule-light);
}

.classified-ad {
    break-inside: avoid;
    border: 1px solid var(--rule-light);
    padding: 10px;
    margin-bottom: 12px;
}

.ad-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.ad-body {
    font-size: 0.82rem;
    color: var(--ink-dim);
    margin-bottom: 4px;
}

.ad-tags {
    font-size: 0.7rem;
    color: var(--ink-muted);
    font-style: italic;
}

/* ---- Bulletin (News) ---- */

#cfg-news {
    max-height: 300px;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 8px;

    scrollbar-width: thin;
    scrollbar-color: var(--rule-light) transparent;
}

/* Safari / Chrome */
#cfg-news::-webkit-scrollbar {
    width: 4px;
}

#cfg-news::-webkit-scrollbar-track {
    background: transparent;
}

#cfg-news::-webkit-scrollbar-thumb {
    background: var(--rule-light);
    border-radius: 2px;
}


/* Each bulletin entry */
.bulletin-item {
    display: grid;

    grid-template-columns: 72px 92px minmax(0, 1fr);
    column-gap: 6px;

    /* Vertically center date and badge with the news text */
    align-items: center;

    padding: 14px 0;

    border-bottom: 1px solid var(--rule-light);

    font-size: 0.88rem;
}

.bulletin-item:last-child {
    border-bottom: none;
}


/* Date */
.bulletin-date {
    font-family: var(--font-sub);
    font-size: 0.75rem;
    color: var(--ink-muted);

    white-space: nowrap;
}


/* NEW / MILESTONE badge */
.bulletin-badge {
    justify-self: start;

    font-family: var(--font-sub);
    font-size: 0.6rem;
    font-weight: 700;

    background: var(--red);
    color: var(--paper);

    padding: 2px 7px;

    letter-spacing: 0.08em;
    line-height: 1.4;

    white-space: nowrap;
}


/* Detailed news text */
.bulletin-text {
    min-width: 0;

    color: var(--ink-dim);
    line-height: 1.5;
}

/* ---- Career (Experience) ---- */

.career-block {
    margin-bottom: 22px;
}

.career-block:last-child {
    margin-bottom: 0;
}

.career-cat {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.14em;

    color: var(--red);

    padding-bottom: 6px;
    margin-bottom: 4px;

    border-bottom: 1px solid var(--rule-light);
}

.career-entry {
    display: grid;

    grid-template-columns:
        110px
        minmax(180px, 0.9fr)
        minmax(0, 1.4fr);

    gap: 16px;

    align-items: baseline;

    padding: 9px 0;

    border-bottom: 1px dotted var(--rule-light);
}

.career-entry:last-child {
    border-bottom: none;
}

.career-period {
    font-family: var(--font-sub);
    font-size: 0.74rem;
    font-weight: 600;

    color: var(--ink-muted);

    white-space: nowrap;
}

.career-title {
    font-size: 0.86rem;
    font-weight: 700;

    color: var(--ink);
}

.career-place {
    font-size: 0.82rem;
    font-style: italic;

    color: var(--ink-dim);
}

/* ---- Letters (Contact) ---- */

.letters-box {
    text-align: center;
    border: 1px solid var(--rule);
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.letters-text {
    font-size: 0.88rem;
    color: var(--ink-dim);
    font-style: italic;
    margin-bottom: 8px;
}

.letters-email {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--red);
}

.letters-addr {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-top: 4px;
}

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

.paper-footer {
    text-align: center;
    padding: 16px 0 0;
    font-family: var(--font-sub);
    font-size: 0.7rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.footer-rule {
    height: 2px;
    background: var(--rule);
    margin-bottom: 12px;
}

/* ---- Responsive ---- */

/* Single-column mode: remove all fixed heights and internal scrolling.
   Everything expands naturally in document flow. */
@media (max-width: 768px) {
    body { padding: 8px; }
    .broadsheet { padding: 16px; }
    .section-nav { flex-wrap: wrap; justify-content: center; }

    .front-columns {
        grid-template-columns: 1fr;
        gap: 32px;
        height: auto;
        min-height: 0;
        align-items: start;
    }

    .col-photo,
    .col-main,
    .col-side {
        width: 100%;
        height: auto;
        min-height: 0;
    }

    .col-photo {
        border-right: none;
        padding-right: 0;
    }

    .col-main {
        max-height: none;
        overflow: visible;
        border-right: none;
        padding-right: 0;
        scrollbar-gutter: auto;
    }

    .col-side {
        display: block;
        border-right: none;
        padding-right: 0;
    }

    .sidebar-box {
        display: block;
        height: auto;
        min-height: 0;
    }

    #latestNews {
        flex: none;
        height: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .articles-columns { column-count: 1; }
    .classifieds { column-count: 1; }
    .bulletin-item { flex-wrap: wrap; }

    #cfg-news {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .bulletin-item {
        grid-template-columns: 70px auto;
        gap: 6px 10px;
    }

    .bulletin-text {
        grid-column: 1 / -1;
    }
}

@media (max-width: 375px) {
    body { padding: 4px; }
    .broadsheet { padding: 12px; }
    .masthead-title { font-size: 1.6rem; }
    .lead-para { font-size: 0.85rem; }
    .sidebar-box { padding: 12px; }
    .news-article { padding: 16px 0; }
    .career-entry { flex-direction: column; gap: 4px; }
}

/* ---- Focus Styles ---- */
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

/* ---- Skip Link ---- */
.skip-link { position: absolute; top: -40px; left: 0; background: var(--red); color: #fff; padding: 8px 16px; z-index: 9999; font-size: 0.875rem; transition: top 0.2s; }
.skip-link:focus { top: 0; }


/* ---- Photo Notes ---- */

.photo-strip {
    display: flex;

    gap: 16px;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 14px 2px 16px;

    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;

    scrollbar-width: thin;
    scrollbar-color: var(--rule-light) transparent;
}

.photo-strip::-webkit-scrollbar {
    height: 4px;
}

.photo-strip::-webkit-scrollbar-track {
    background: transparent;
}

.photo-strip::-webkit-scrollbar-thumb {
    background: var(--rule-light);
    border-radius: 2px;
}


/* Individual photo */

.photo-card {
    flex: 0 0 220px;

    margin: 0;

    scroll-snap-align: start;
}

.photo-card img {
    display: block;

    width: 100%;
    height: 145px;

    object-fit: cover;

    border: 1px solid var(--rule-light);

    filter: saturate(0.9);
}


/* Caption */

.photo-card figcaption {
    padding-top: 7px;

    display: flex;
    justify-content: space-between;
    gap: 10px;

    font-family: var(--font-sub);
}

.photo-caption {
    font-size: 0.72rem;
    font-style: italic;

    color: var(--ink-dim);

    line-height: 1.35;
}

.photo-date {
    flex-shrink: 0;

    font-size: 0.65rem;
    color: var(--ink-muted);

    letter-spacing: 0.04em;
}

@media (hover: hover) {
    .photo-card img {
        transition:
            filter 0.25s ease,
            transform 0.25s ease;
    }

    .photo-card:hover img {
        filter: saturate(1);
        transform: translateY(-2px);
    }
}