@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@400;600;700&display=swap');

/* ── Theme variables ── */
:root {
    --ff-font-serif: 'Libre Baskerville', Georgia, serif;
    --ff-font-sans: 'Source Sans 3', 'Segoe UI', sans-serif;
    --ff-radius: 12px;
    --ff-radius-lg: 18px;
    --ff-max-width: 1100px;
    --ff-article-width: 760px;

    --ff-bg: #f6f1e8;
    --ff-surface: #fffdf8;
    --ff-text: #1e1a16;
    --ff-text-muted: #5c5348;
    --ff-border: rgba(30, 26, 22, 0.12);
    --ff-accent: #9a3412;
    --ff-accent-soft: #fef3e8;
    --ff-header-bg: #1e1a16;
    --ff-header-text: #f6f1e8;
    --ff-footer-bg: #14110f;
    --ff-footer-text: #c9bfb0;
    --ff-card-shadow: 0 4px 24px rgba(30, 26, 22, 0.08);
    --ff-card-hover: 0 8px 32px rgba(30, 26, 22, 0.14);
}

body.dark-mode {
    --ff-bg: #12100e;
    --ff-surface: #1c1814;
    --ff-text: #ebe3d6;
    --ff-text-muted: #a89f92;
    --ff-border: rgba(235, 227, 214, 0.12);
    --ff-accent: #e07a3a;
    --ff-accent-soft: #2a2218;
    --ff-header-bg: #ebe3d6;
    --ff-header-text: #1e1a16;
    --ff-footer-bg: #0a0908;
    --ff-footer-text: #8a8074;
    --ff-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --ff-card-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── Base ── */
body.light-mode,
body.dark-mode {
    background-color: var(--ff-bg);
    color: var(--ff-text);
    font-family: var(--ff-font-sans);
    line-height: 1.6;
    margin: 0;
    overflow-x: clip;
}

.home-wrapper,
.home-wrapper.knowledge-content,
.home-wrapper.facts-content {
    background: var(--ff-bg);
    background-image: none;
    max-width: var(--ff-max-width);
    margin: 0 auto;
    padding: 88px 24px 48px;
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
}

/* ── Header (fheader) ── */
.ff-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--ff-header-bg);
    color: var(--ff-header-text);
    height: 60px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.ff-header .nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--ff-max-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    gap: 16px;
}

.ff-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ff-header-text);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

.ff-brand i {
    font-size: 1.25rem;
    color: var(--ff-accent);
}

body.dark-mode .ff-brand i {
    color: #c45e28;
}

.ff-brand span {
    font-family: var(--ff-font-serif);
}

.ff-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ff-menu > li > a {
    color: var(--ff-header-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.ff-menu > li > a:hover,
.ff-menu > li > a.active {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .ff-menu > li > a:hover,
body.dark-mode .ff-menu > li > a.active {
    background: rgba(0, 0, 0, 0.08);
}

.ff-dropdown {
    position: relative;
}

.ff-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--ff-header-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--ff-radius);
    padding: 8px 0;
    margin: 4px 0 0;
    list-style: none;
    box-shadow: var(--ff-card-shadow);
}

body.dark-mode .ff-dropdown-menu {
    border-color: rgba(0, 0, 0, 0.1);
}

.ff-dropdown:hover .ff-dropdown-menu {
    display: block;
}

.ff-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--ff-header-text);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.2s;
}

.ff-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ff-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--ff-header-text);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px;
}

/* ── Footer (ffooter) ── */
.ff-footer {
    background: var(--ff-footer-bg);
    color: var(--ff-footer-text);
    padding: 28px 24px;
    margin-top: auto;
}

.ff-footer-inner {
    max-width: var(--ff-max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.ff-footer-about {
    flex: 1;
    min-width: 240px;
}

.ff-footer-about strong {
    font-family: var(--ff-font-serif);
    color: #ebe3d6;
    font-size: 1.05rem;
}

.ff-footer-about p {
    margin: 8px 0 0;
    font-size: 0.88rem;
    line-height: 1.55;
    max-width: 360px;
}

.ff-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.ff-footer-nav a {
    color: var(--ff-footer-text);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.ff-footer-nav a:hover {
    color: #ebe3d6;
}

.ff-footer-legal {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
}

.ff-footer-legal a {
    color: var(--ff-footer-text);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.ff-footer-legal a:hover {
    color: #ebe3d6;
}

.ff-footer-copy {
    width: 100%;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    text-align: center;
}

.ff-attribution-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.95rem;
}

.ff-attribution-table th,
.ff-attribution-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--ff-border);
    vertical-align: top;
}

.ff-attribution-table th {
    font-family: var(--ff-font-serif);
    color: var(--ff-text);
    border-bottom: 2px solid var(--ff-accent-soft);
}

.ff-attribution-table a {
    color: var(--ff-accent);
    text-decoration: none;
}

.ff-attribution-table a:hover {
    text-decoration: underline;
}

.ff-site-link {
    color: var(--ff-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s, opacity 0.2s;
}

.ff-site-link:hover {
    color: #d4a574;
    text-decoration: underline;
}

body.dark-mode .ff-site-link {
    color: #c45e28;
}

body.dark-mode .ff-site-link:hover {
    color: #e07840;
}

.ff-footer-about .ff-site-link {
    color: #d4a574;
}

.ff-footer-about .ff-site-link:hover {
    color: #ebe3d6;
}

/* ── Mode toggle ── */
.mode-toggle {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--ff-surface);
    color: var(--ff-text);
    border: 1px solid var(--ff-border);
    border-radius: 999px;
    font-family: var(--ff-font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--ff-card-shadow);
    transition: background 0.2s, transform 0.2s;
}

.mode-toggle:hover {
    transform: translateY(-1px);
}

/* ── Hub hero ── */
.ff-hero {
    text-align: center;
    padding: 16px 0 40px;
}

.ff-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ff-accent);
    margin-bottom: 12px;
}

.ff-hero h1,
h1.title {
    font-family: var(--ff-font-serif);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--ff-text);
    margin: 0 0 16px;
    line-height: 1.25;
}

.ff-lead,
.intro-text {
    font-size: 1.1rem;
    color: var(--ff-text-muted);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.7;
}

.ff-hub-intro {
    max-width: 720px;
    margin: 0 auto 32px;
    text-align: center;
    color: var(--ff-text-muted);
    line-height: 1.7;
}

/* ── Breadcrumbs ── */
.ff-breadcrumb {
    font-size: 0.85rem;
    color: var(--ff-text-muted);
    margin-bottom: 20px;
}

.ff-breadcrumb a {
    color: var(--ff-accent);
    text-decoration: none;
}

.ff-breadcrumb a:hover {
    text-decoration: underline;
}

.ff-breadcrumb span {
    margin: 0 6px;
    opacity: 0.5;
}

/* ── Category cards ── */
.ff-category-grid,
.categories-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.ff-card,
.category-card {
    background: var(--ff-surface);
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--ff-card-shadow);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    margin-bottom: 0;
    text-align: left;
}

.ff-card:hover,
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ff-card-hover);
    border-color: var(--ff-accent);
}

.ff-card > a,
.category-card > a {
    text-decoration: none;
    color: inherit;
}

.ff-card-icon,
.category-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ff-font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ff-text);
    margin-bottom: 0;
}

.ff-card-icon i,
.category-heading i {
    color: var(--ff-accent);
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ff-accent-soft);
    border-radius: 10px;
}

.category-heading span {
    color: var(--ff-text);
}

.ff-card p,
.category-card p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--ff-text-muted);
    line-height: 1.55;
}

.ff-card-meta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ff-accent);
    margin-top: auto;
}

/* ── Featured / timeline sections ── */
.ff-section {
    margin: 48px 0;
    padding: 32px;
    background: var(--ff-surface);
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius-lg);
}

.ff-section h2 {
    font-family: var(--ff-font-serif);
    font-size: 1.35rem;
    margin: 0 0 16px;
    color: var(--ff-text);
}

.ff-featured-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.ff-featured-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ff-bg);
    border-radius: var(--ff-radius);
    text-decoration: none;
    color: var(--ff-text);
    font-weight: 600;
    transition: background 0.2s;
}

.ff-featured-list a:hover {
    background: var(--ff-accent-soft);
}

.ff-featured-list .ff-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ff-accent);
    white-space: nowrap;
}

.ff-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.ff-timeline-item {
    padding: 16px;
    background: var(--ff-bg);
    border-radius: var(--ff-radius);
    border-left: 3px solid var(--ff-accent);
}

.ff-timeline-item strong {
    display: block;
    font-size: 0.8rem;
    color: var(--ff-accent);
    margin-bottom: 4px;
}

.ff-timeline-item span {
    font-size: 0.88rem;
    color: var(--ff-text-muted);
}

/* ── Article prose ── */
.knowledge-content article,
.facts-content article,
.berlin-key-content article {
    max-width: var(--ff-article-width);
    margin: 0 auto;
}

.berlin-key-content .content-section,
.facts-content .content-section,
.facts-content .intro-section {
    margin: 36px 0;
}

.content-section {
    margin: 36px 0;
}

h2.subtitle {
    font-family: var(--ff-font-serif);
    font-size: 1.45rem;
    color: var(--ff-text);
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ff-accent-soft);
}

.knowledge-content article p,
.content-section p {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--ff-text);
    margin-bottom: 16px;
}

.knowledge-content article li {
    margin-bottom: 8px;
    line-height: 1.65;
}

.intro-section {
    text-align: left;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--ff-border);
    margin-bottom: 8px;
}

.intro-section .intro-text {
    font-family: var(--ff-font-serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ff-text-muted);
    text-align: left;
    margin: 0 0 16px;
}

.knowledge-content h4 {
    font-family: var(--ff-font-serif);
    font-size: 1.1rem;
    color: var(--ff-accent);
    margin: 24px 0 10px;
}

.knowledge-content .ff-callout {
    padding: 20px 24px;
    background: var(--ff-accent-soft);
    border-radius: var(--ff-radius);
    border-left: 4px solid var(--ff-accent);
}

/* ── Images in articles ── */
.knowledge-content .image-left,
.knowledge-content .image-right,
.knowledge-content .image-center,
.knowledge-content .ff-figure,
.facts-content .image-left,
.facts-content .image-right,
.facts-content .image-center,
.facts-content .ff-figure,
.berlin-key-content .image-left,
.berlin-key-content .image-right,
.berlin-key-content .image-center,
.berlin-key-content .ff-figure {
    margin: 0 0 20px;
    padding: 0;
    background: transparent;
}

.knowledge-content .image-left,
.knowledge-content .ff-figure.image-left,
.facts-content .image-left,
.facts-content .ff-figure.image-left,
.berlin-key-content .image-left,
.berlin-key-content .ff-figure.image-left {
    float: left;
    margin: 0 24px 16px 0;
    max-width: 42%;
}

.knowledge-content .image-right,
.knowledge-content .ff-figure.image-right,
.facts-content .image-right,
.facts-content .ff-figure.image-right,
.berlin-key-content .image-right,
.berlin-key-content .ff-figure.image-right {
    float: right;
    margin: 0 0 16px 24px;
    max-width: 42%;
}

.knowledge-content .image-center,
.knowledge-content .ff-figure.image-center,
.facts-content .image-center,
.facts-content .ff-figure.image-center,
.berlin-key-content .image-center,
.berlin-key-content .ff-figure.image-center {
    display: block;
    float: none;
    margin: 24px auto;
    max-width: 72%;
    clear: both;
}

.knowledge-content .ff-figure img,
.knowledge-content .image-left img,
.knowledge-content .image-right img,
.knowledge-content .image-center img,
.facts-content .ff-figure img,
.facts-content .image-left img,
.facts-content .image-right img,
.facts-content .image-center img,
.berlin-key-content .ff-figure img,
.berlin-key-content .image-left img,
.berlin-key-content .image-right img,
.berlin-key-content .image-center img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--ff-radius);
    box-shadow: var(--ff-card-shadow);
}

.knowledge-content .content-section,
.knowledge-content .intro-section,
.knowledge-content article,
.facts-content .content-section,
.facts-content .intro-section,
.facts-content article,
.berlin-key-content .content-section,
.berlin-key-content article {
    overflow: hidden;
}

.knowledge-content article::after,
.facts-content article::after,
.berlin-key-content article::after {
    content: "";
    display: table;
    clear: both;
}

.ff-figure figcaption {
    margin-top: 8px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ff-text-muted);
    font-style: italic;
    overflow-wrap: anywhere;
}

.ff-credit {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    font-style: normal;
    opacity: 0.85;
}

.ff-hero-banner {
    margin: -8px 0 28px;
    border-radius: var(--ff-radius);
    overflow: hidden;
    box-shadow: var(--ff-card-shadow);
    border: 1px solid var(--ff-border);
}

.ff-hero-banner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: cover;
}

/* ── Back link ── */
.back-to-home-container {
    text-align: center;
    margin: 48px 0 24px;
    padding: 0;
    clear: both;
}

.back-to-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ff-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border: 2px solid var(--ff-accent);
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
}

.back-to-home-link:hover {
    background: var(--ff-accent);
    color: #fff;
}

/* ── Glossary ── */
.glossary-title {
    font-family: var(--ff-font-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    text-align: center;
    margin: 0 0 12px;
    color: var(--ff-text);
}

.glossary-intro {
    text-align: center;
    color: var(--ff-text-muted);
    max-width: 640px;
    margin: 0 auto 24px;
    line-height: 1.65;
}

.glossary-jump {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 720px;
    margin: 0 auto 32px;
    padding: 0;
    list-style: none;
}

.glossary-jump a,
.glossary-jump span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 8px;
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ff-accent);
    background: var(--ff-surface);
}

.glossary-jump a:hover,
.glossary-jump a:focus {
    background: var(--ff-accent);
    color: #fff;
    border-color: var(--ff-accent);
}

.glossary-jump span {
    color: var(--ff-text-muted);
    opacity: 0.45;
    cursor: default;
}

.glossary-letter {
    scroll-margin-top: 96px;
}

.glossary-letter-heading {
    font-family: var(--ff-font-serif);
    font-size: 1.45rem;
    color: var(--ff-text);
    margin: 36px 0 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ff-accent-soft);
}

.glossary-see-also {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: var(--ff-text-muted);
    line-height: 1.5;
}

.glossary-see-also a {
    color: var(--ff-accent);
    text-decoration: none;
}

.glossary-see-also a:hover,
.glossary-see-also a:focus {
    text-decoration: underline;
}

.glossary-section {
    column-count: 1;
    column-gap: 32px;
    margin: 24px 0;
}

.glossary-entry {
    break-inside: avoid;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: var(--ff-surface);
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius);
}

.glossary-term {
    font-weight: 700;
    font-size: 1rem;
    color: var(--ff-accent);
    margin: 0 0 6px;
}

.glossary-definition {
    margin: 0;
    font-size: 0.92rem;
    color: var(--ff-text-muted);
    line-height: 1.6;
}

@media (min-width: 700px) {
    .glossary-section {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .glossary-section {
        column-count: 3;
    }
}

/* ── Legacy header/footer class hooks (loaded into placeholder) ── */
body.light-mode .header,
body.dark-mode .header {
    background: var(--ff-header-bg);
}

body.light-mode .footer,
body.dark-mode .footer {
    background: var(--ff-footer-bg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .home-wrapper,
    .home-wrapper.knowledge-content,
    .home-wrapper.facts-content,
    .home-wrapper.berlin-key-content {
        padding: 76px 16px 32px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .ff-hamburger {
        display: block;
    }

    .ff-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--ff-header-bg);
        padding: 8px 12px 12px;
        gap: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ff-menu.open {
        display: flex;
    }

    .ff-menu > li {
        width: 100%;
    }

    .ff-menu > li > a {
        display: block;
        padding: 12px 16px;
    }

    .ff-dropdown-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        padding: 0 0 4px 12px;
        margin: 0;
        background: transparent;
    }

    .ff-dropdown:hover .ff-dropdown-menu {
        display: block;
    }

    .ff-hero {
        padding: 8px 0 28px;
    }

    .ff-hero h1,
    h1.title {
        font-size: clamp(1.45rem, 6vw, 2rem);
        word-wrap: break-word;
    }

    .ff-lead,
    .intro-text,
    .ff-hub-intro {
        font-size: 1rem;
        max-width: 100%;
    }

    .ff-breadcrumb {
        font-size: 0.8rem;
        line-height: 1.5;
        word-break: break-word;
    }

    .ff-category-grid,
    .categories-wrapper {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 24px 0;
    }

    .ff-card,
    .category-card {
        padding: 20px;
    }

    h2.subtitle {
        font-size: 1.2rem;
    }

    .knowledge-content .image-left,
    .knowledge-content .image-right,
    .knowledge-content .image-center,
    .knowledge-content .ff-figure,
    .knowledge-content .ff-figure.image-left,
    .knowledge-content .ff-figure.image-right,
    .knowledge-content .ff-figure.image-center,
    .facts-content .image-left,
    .facts-content .image-right,
    .facts-content .image-center,
    .facts-content .ff-figure,
    .facts-content .ff-figure.image-left,
    .facts-content .ff-figure.image-right,
    .facts-content .ff-figure.image-center,
    .berlin-key-content .image-left,
    .berlin-key-content .image-right,
    .berlin-key-content .image-center,
    .berlin-key-content .ff-figure,
    .berlin-key-content .ff-figure.image-left,
    .berlin-key-content .ff-figure.image-right,
    .berlin-key-content .ff-figure.image-center {
        float: none;
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 20px 0;
        clear: both;
    }

    .knowledge-content .content-section,
    .knowledge-content .intro-section,
    .facts-content .content-section,
    .facts-content .intro-section,
    .berlin-key-content .content-section {
        overflow: visible;
    }

    .knowledge-content article p,
    .facts-content article p,
    .berlin-key-content article p,
    .content-section p,
    .knowledge-content article li,
    .facts-content article li {
        overflow-wrap: anywhere;
    }

    .knowledge-content blockquote {
        margin: 16px 0;
        padding: 12px 16px;
        border-left: 3px solid var(--ff-accent);
        overflow-wrap: anywhere;
    }

    .ff-hero-banner {
        margin: 0 0 20px;
    }

    .ff-hero-banner img {
        max-height: 220px;
    }

    .mode-toggle {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: auto;
        max-width: calc(100vw - 32px);
    }

    .ff-section {
        padding: 20px 16px;
        margin: 32px 0;
    }

    .ff-timeline {
        grid-template-columns: 1fr;
    }

    .ff-brand span {
        font-size: 0.82rem;
        line-height: 1.2;
    }

    .back-to-home-link {
        width: 100%;
        max-width: 320px;
        justify-content: center;
        box-sizing: border-box;
    }

    .ff-footer {
        padding: 24px 16px 20px;
    }

    .ff-footer-inner {
        flex-direction: column;
        gap: 20px;
    }

    .ff-footer-about {
        min-width: 0;
        width: 100%;
    }

    .ff-footer-about p {
        max-width: none;
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .ff-footer-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 16px;
    }

    .ff-footer-nav a {
        font-size: 0.9rem;
        padding: 4px 0;
        min-height: 36px;
        display: flex;
        align-items: center;
    }

    .ff-footer-copy {
        font-size: 0.8rem;
        line-height: 1.6;
        padding-top: 20px;
        margin-top: 4px;
        word-break: break-word;
    }

    .ff-footer-about .ff-site-link,
    .ff-footer-copy .ff-site-link {
        text-decoration: underline;
        text-underline-offset: 2px;
        -webkit-tap-highlight-color: rgba(212, 165, 116, 0.35);
    }
}

@media (max-width: 400px) {
    .ff-brand span {
        display: inline-block;
        max-width: calc(100vw - 88px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }

    .ff-footer-nav {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .ff-footer-nav a {
        min-height: 40px;
        padding: 8px 0;
    }
}