/* EB Garamond – lokale Font-Faces */
@font-face { font-family: 'EB Garamond'; src: url('../fonts/EBGaramond-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/EBGaramond-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/EBGaramond-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/EBGaramond-MediumItalic.ttf') format('truetype'); font-weight: 500; font-style: italic; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/EBGaramond-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/EBGaramond-SemiBoldItalic.ttf') format('truetype'); font-weight: 600; font-style: italic; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/EBGaramond-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'EB Garamond'; src: url('../fonts/EBGaramond-BoldItalic.ttf') format('truetype'); font-weight: 700; font-style: italic; }

/* === Variablen === */
:root {
    --fhe: #003B79;
    --fhe-dark: #002a5a;
    --fhe-light: #e8eef5;
    --bg: #f5f7fa;
    --panel: #ffffff;
    --ink: #1a2a3a;
    --muted: #5a6a7a;
    --line: #d5dce6;
    --accent: #003B79;
    --head: #e8eef5;
}

/* === Basis === */
html { font-size: 120%; }
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--ink);
    border-bottom: 2px solid var(--fhe);
    padding-bottom: 8px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

p { line-height: 1.6; margin: 0 0 8px; }

h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fhe);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--line);
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    margin: 20px 0 8px;
}

code {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.82rem;
}

ol { padding-left: 24px; }
ol li { margin-bottom: 12px; }
ul { padding-left: 20px; }
ul li { margin-bottom: 6px; }

/* === Header === */
header {
    background: var(--fhe);
    color: #fff;
    padding: 20px 24px;
}

header .inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo { height: 40px; }
header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
header h1 { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: 0.01em; }
header .header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}
header .header-photo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
}
header .header-identity {
    display: flex;
    flex-direction: column;
}
header .header-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}
header .header-sub {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    margin-top: 1px;
}
header a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 1rem; }
header a:hover { color: #fff; text-decoration: none; }

.breadcrumb { max-width: 1100px; margin: 0 auto; padding: 10px 24px 0; font-size: 0.85rem; color: var(--muted); }
.breadcrumb a { color: var(--fhe); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
header .header-sub a { font-size: 0.8rem; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.3); }
header .header-sub a:hover { text-decoration-color: #fff; }

header p {
    margin: 0;
    font-size: 1.05rem;
    opacity: 0.85;
}

/* Bookmark-Liste */
.bookmark-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.bookmark-list li {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
}

.bookmark-list li p {
    color: var(--muted);
}

/* === Navigation-Grid (Landing Page) === */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}

/* Hauptseite: Content + News-Seitenleiste */
.main-with-aside {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 32px;
    align-items: start;
}
.main-content { min-width: 0; }

.news-aside h2 {
    font-size: 1rem;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--line);
}
.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.news-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.news-list li:last-child { border-bottom: none; }
.news-list time {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 2px;
}
.news-list a {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.35;
}
.news-link2 {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--muted);
    margin-left: 4px;
}
.news-list p {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 4px 0 0;
    line-height: 1.4;
}

.nav-card {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px 18px;
    text-decoration: none;
    color: var(--ink);
}

.nav-card:hover {
    border-color: var(--fhe);
    text-decoration: none;
}

.nav-label {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--fhe);
    margin-bottom: 4px;
}

.nav-desc {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.4;
}

/* === Aktuelles Semester === */
.semester-group.current h3 {
    color: var(--fhe);
}

/* === Semester-Archiv (Accordion) === */
.semester-archive {
    margin-top: 4px;
}

.semester-archive > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--muted);
    padding: 8px 0;
}

.semester-archive > summary:hover {
    color: var(--fhe);
}

/* === Main === */
main {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 24px 32px;
    overflow-wrap: break-word;
}

/* === Karten (index, detail, bookmarks) === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.card-grid a {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px 18px;
    text-decoration: none;
    color: var(--ink);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.card-grid a:hover {
    border-color: var(--fhe);
    box-shadow: 0 4px 16px rgba(0, 59, 121, 0.10);
}

.card-grid a .label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--fhe);
}

.card-grid a .desc {
    font-size: 0.95rem;
    color: var(--muted);
    margin-top: 4px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,59,121,.06);
    padding: 20px 24px;
}

.card > h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    color: var(--fhe);
}

/* === Meta-Zeilen === */
.meta {
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.5;
    margin: 2px 0;
}

/* === Zusammenfassung === */
.summary {
    background: var(--head);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
    line-height: 1.55;
}

/* === Detail-Sektionen === */
.card section {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 12px;
}

/* Landing-Sektionen */
main > section {
    margin-bottom: 36px;
}

figure { margin: 10px 0 0; }
main img { width: 100%; max-height: 540px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
figcaption { color: var(--muted); font-size: .9rem; margin-top: 6px; }

.project-logo { max-height: 130px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto 12px; display: block; }
.team-photo { max-height: 220px; width: auto; max-width: 100%; object-fit: cover; margin: 0 auto 12px; display: block; border-radius: 8px; }

/* === Sperrvermerk === */
.notice {
    background: #fdf0f0;
    border: 1px solid #e0b0b0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.notice h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #8b2020;
    border: none;
    padding: 0;
}

.notice p { line-height: 1.6; margin: 4px 0; }

.action { margin-top: 20px; }
.action a { display: inline-block; padding: 10px 20px; background: var(--fhe); color: #fff; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: .95rem; }
.action a:hover { background: var(--fhe-dark); }

/* === Hervorhebungsbox (FAQ) === */
.emphasis-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 4px solid var(--fhe);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 20px 0;
    font-weight: 600;
}

/* === TOC (FAQ) === */
#toc {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

#toc h2 {
    font-size: 1.2rem;
    margin: 0 0 12px;
    border: none;
    padding: 0;
}

#toc p { margin: 0 0 6px; }

/* === Semester-Gruppen (index) === */
.semester-group { margin-bottom: 24px; }
.semester-group h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
}

/* === Tags & Badges (Übersicht) === */
.tag-badges { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 6px; vertical-align: middle; }
.tag-badge { display: inline-block; background: #dce8f5; color: var(--fhe); font-size: 0.7rem; padding: 1px 6px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.restricted-badge { display: inline-block; background: #e8c4c4; color: #8b2020; font-size: 0.7rem; padding: 1px 6px; border-radius: 8px; font-weight: 600; white-space: nowrap; margin-left: 4px; }

/* === Tabelle (Übersicht) === */
.table-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: auto;
    background: var(--panel);
    box-shadow: 0 4px 16px rgba(0, 59, 121, 0.06);
}

table { border-collapse: collapse; width: 100%; }
thead th { position: sticky; top: 0; z-index: 1; background: var(--head); color: var(--fhe); text-align: left; font-weight: 700; font-size: 0.9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; vertical-align: top; font-size: 0.9rem; line-height: 1.35; }
tbody tr:nth-child(even) { background: #f8f9fc; }
.semester-group-row td { background: #dce4ee; color: var(--fhe); font-weight: 700; border-top: 2px solid #a8b8cc; border-bottom: 2px solid #b8c4d4; padding-top: 8px; padding-bottom: 8px; }
.count { margin: 6px 0 10px; color: var(--muted); font-size: 0.9rem; }

td details { margin: 0; }
td details summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; line-height: 1.35; }
td details summary:hover { color: var(--accent); }
td details[open] summary { margin-bottom: 6px; font-weight: 600; }
td details[open] summary ~ * { font-size: 0.85rem; line-height: 1.45; }

/* === Filter (Übersicht) === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--head);
    border-radius: 10px;
    border: 1px solid var(--line);
}

.filter-label { font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.semester-filter { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.85rem; background: var(--panel); color: var(--ink); }
.tag-filter-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 10px; }
.tag-filter-btn { padding: 3px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.tag-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.tag-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === Publikationsliste === */
.publication-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.publication-list li {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 18px;
    line-height: 1.55;
}

/* Kooperationspartner-Liste */
.partner-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    column-count: 3;
    column-gap: 24px;
}
.partner-list li {
    break-inside: avoid;
    padding: 3px 0;
    font-size: 0.78rem;
    overflow-wrap: break-word;
}
.partner-count {
    color: var(--muted);
    font-size: 0.72rem;
}

.pub-note {
    display: inline-block;
    background: #dce8f5;
    color: var(--fhe);
    font-size: 0.8rem;
    padding: 1px 8px;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 4px;
}

/* === Footer === */
footer {
    background: var(--fhe);
    color: rgba(255,255,255,0.7);
    padding: 16px 24px;
    font-size: 0.85rem;
    margin-top: 40px;
}

footer .inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

footer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

footer .footer-links {
    display: flex;
    gap: 20px;
}

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

/* --- Tablet (≤ 900px) --- */
@media (max-width: 900px) {
    html { font-size: 110%; }

    header { padding: 16px 16px; }
    header .inner { flex-wrap: wrap; gap: 8px; }
    header h1 { font-size: 1.25rem; }
    header .header-photo { width: 46px; height: 46px; }

    .main-with-aside { grid-template-columns: 1fr; gap: 20px; }
    .nav-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    main { padding: 0 16px 24px; margin-top: 16px; }

    .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

    .card { padding: 16px; }
    .card > h1 { font-size: 1.35rem; }

    #toc { padding: 16px; }

    .filter-bar { gap: 8px; padding: 8px 10px; }
    .tag-filter-bar { margin-left: 0; }

    .publication-list li { padding: 12px 14px; }
    .partner-list { column-count: 2; }
}

/* --- Mobile (≤ 600px) --- */
@media (max-width: 600px) {
    html { font-size: 100%; }

    /* Header: stack vertically */
    header { padding: 14px 12px; }
    header .inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    header .header-left { gap: 10px; }
    header .logo { height: 32px; }
    header h1 { font-size: 1.1rem; }
    header .header-photo { width: 40px; height: 40px; }
    header .header-profile { gap: 8px; }
    header .header-name { font-size: 0.85rem; }
    header .header-sub { font-size: 0.75rem; }
    .nav-grid { grid-template-columns: 1fr; gap: 10px; }
    main { padding: 0 12px 20px; margin-top: 12px; }

    h2 { font-size: 1.15rem; margin: 18px 0 8px; }
    h3 { font-size: 1.05rem; }

    /* Cards */
    .card-grid { grid-template-columns: 1fr; gap: 10px; }
    .card-grid a { padding: 12px 14px; }
    .card-grid a .label { font-size: 1rem; }

    .card { padding: 14px 12px; border-radius: 8px; }
    .card > h1 { font-size: 1.2rem; }

    /* Meta */
    .meta { font-size: 0.88rem; word-break: break-word; }
    .meta a { word-break: break-all; }

    /* Summary */
    .summary { padding: 8px 10px; font-size: 0.92rem; }

    /* Images */
    main img { max-height: 360px; border-radius: 6px; }

    /* Sections */
    main > section { margin-bottom: 24px; }
    .semester-group { margin-bottom: 16px; }

    /* Table: hint for horizontal scroll */
    .table-wrap { border-radius: 8px; -webkit-overflow-scrolling: touch; }

    /* Thesis tables → card layout */
    .thesis-cards {
        border: none;
        box-shadow: none;
        background: none;
        overflow: visible;
    }
    .thesis-cards table,
    .thesis-cards tbody { display: block; }
    .thesis-cards thead { display: none; }
    .thesis-cards tbody tr:nth-child(even) { background: none; }
    .thesis-cards tbody tr:not(.semester-group-row) {
        display: flex;
        flex-direction: column;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    .thesis-cards tbody td {
        display: block;
        border: none;
        padding: 2px 0;
        font-size: 0.88rem;
        line-height: 1.45;
    }
    .thesis-cards tbody tr:not(.semester-group-row) td:not([data-label]) { display: none; }
    .thesis-cards tbody td[data-label]::before {
        content: attr(data-label) ":\00a0";
        font-weight: 700;
        color: var(--muted);
    }
    .thesis-cards tbody td[data-label="Titel"] {
        order: -1;
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    .thesis-cards tbody td[data-label="Titel"]::before { display: none; }
    .thesis-cards tbody td[data-label="Titel"] .tag-badges {
        display: flex;
        margin: 4px 0 0;
        margin-left: 0;
    }
    .thesis-cards tbody td[data-label="Zusammenfassung"] { margin-top: 4px; }
    .thesis-cards tbody td[data-label="Zusammenfassung"]::before { display: none; }
    .thesis-cards .semester-group-row { display: block; }
    .thesis-cards .semester-group-row td {
        display: block;
        background: none;
        border: none;
        padding: 16px 0 6px;
    }

    /* Filter bar: stack vertically */
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .tag-filter-bar { margin-left: 0; }
    .tag-filter-btn { padding: 4px 10px; font-size: 0.75rem; }
    .semester-filter { width: 100%; }

    /* Notice (Sperrvermerk) */
    .notice { padding: 12px; }

    /* FAQ */
    #toc { padding: 14px 12px; margin-bottom: 20px; }
    .emphasis-box { padding: 12px 14px; }
    ol { padding-left: 18px; }

    /* Publications */
    .publication-list li { padding: 10px 12px; font-size: 0.92rem; }
    .partner-list { column-count: 1; }

    /* Action buttons: full width */
    .action a { display: block; text-align: center; padding: 12px 16px; }

    /* Footer */
    footer { padding: 14px 12px; margin-top: 24px; }
    footer .inner { flex-direction: column; align-items: flex-start; gap: 6px; }
    footer .footer-links { gap: 16px; }

    /* Bookmark list */
    .bookmark-list li { padding: 10px 12px; border-radius: 8px; }

    /* Code blocks: scroll instead of break */
    code { font-size: 0.78rem; word-break: break-all; }
}

/* --- Small phones (≤ 380px) --- */
@media (max-width: 380px) {
    html { font-size: 95%; }
    header h1 { font-size: 1rem; }
    .card > h1 { font-size: 1.1rem; }
    main { padding: 0 8px 16px; }
}
