/* ==========================================================================
   Herbert Fritsche – Frische Version
   Modern, minimal design inspired by db.herbert-fritsche.de
   ========================================================================== */

/* Home icon */
.home-icon {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    text-decoration: none !important;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s;
}
.home-icon:hover { background: var(--accent); color: #fff; }

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #000044;
    --accent: #8b0000;
    --bg: #fafaf8;
    --white: #ffffff;
    --text: #1a1a1a;
    --text-light: #555555;
    --border: #e0ddd8;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 6px;
    --max-width: 960px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* --- Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Info Tooltip (i) --- */
.info-tooltip {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.info-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-style: italic;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.info-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.tooltip-text {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    width: 320px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-light);
    box-shadow: var(--shadow-hover);
}

.info-tooltip:hover .tooltip-text,
.info-tooltip:focus-within .tooltip-text {
    display: block;
}

/* --- Site Header / Navigation --- */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 900;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.site-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.site-logo:hover {
    color: var(--accent);
}

.site-nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.site-nav a {
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active {
    background: var(--primary);
    color: var(--white);
}

/* --- Sub-Navigation (dropdown) --- */
.nav-item {
    position: relative;
}

.nav-item > a {
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-block;
}

.nav-item > a:hover,
.nav-item > a.active {
    background: var(--primary);
    color: var(--white);
}

.sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    min-width: 280px;
    z-index: 950;
    padding: 0.5rem 0;
    max-height: 70vh;
    overflow-y: auto;
}

.nav-item:hover .sub-nav,
.nav-item.sub-open .sub-nav {
    display: block;
}

.sub-nav a {
    display: block;
    padding: 0.4rem 1rem;
    font-size: 0.78rem;
    color: var(--text);
    border-radius: 0;
    white-space: normal;
    line-height: 1.4;
    transition: all 0.15s ease;
}

.sub-nav a:hover {
    background: var(--bg);
    color: var(--accent);
}

.sub-nav a.active {
    background: var(--primary);
    color: var(--white);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.3rem 0.6rem;
    font-size: 1.2rem;
    color: var(--primary);
    cursor: pointer;
    line-height: 1;
}

/* --- Hero Section (Index) --- */
.hero {
    background: var(--primary);
    color: var(--white);
    padding: 4rem 0 3.5rem;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.hero-portrait {
    flex: 0 0 220px;
    width: 220px;
}

.hero-portrait img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.hero-text .subtitle {
    font-size: 1.15rem;
    opacity: 0.85;
    font-weight: 300;
    margin-bottom: 1rem;
}

.hero-text .hero-desc {
    font-size: 0.95rem;
    opacity: 0.75;
    line-height: 1.6;
    max-width: 480px;
}

/* --- Section Spacing --- */
.section {
    padding: 3rem 0;
}

.section + .section {
    padding-top: 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

/* --- Content Box (for text sections) --- */
.content-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.content-box h2 {
    font-size: 1.35rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.content-box h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.content-box p {
    margin-bottom: 1rem;
    color: var(--text);
}

.content-box p:last-child {
    margin-bottom: 0;
}

.content-box .author {
    font-weight: 600;
    margin-top: 1.5rem;
    color: var(--text);
}

.content-box hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* --- Card Grid (Navigation) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--text);
}

.card-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.card h3 {
    font-size: 1.05rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card:hover h3 {
    color: var(--accent);
}

.card p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.55;
    flex: 1;
}

.card .card-arrow {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
}

.card:hover .card-arrow {
    color: var(--accent);
}

/* --- Subpage Layout --- */
.page-header {
    background: var(--primary);
    color: var(--white);
    padding: 2.5rem 0 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.page-header .page-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 300;
}

.breadcrumb {
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.breadcrumb a {
    color: var(--white);
    opacity: 0.85;
}

.breadcrumb a:hover {
    opacity: 1;
}

.breadcrumb .sep {
    margin: 0 0.4rem;
}

/* --- Image float within content --- */
.content-image-right {
    float: right;
    margin: 0 0 1.5rem 2rem;
    max-width: 260px;
}

.content-image-right img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.content-image-center {
    text-align: center;
    margin: 1.5rem 0;
}

.content-image-center img {
    display: inline-block;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 100%;
}

/* --- Product Info Box --- */
.product-info {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    display: inline-block;
}

.product-info p {
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.product-info .price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 0.5rem;
}

.product-info a {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: underline;
}

.product-info a:hover {
    color: var(--accent);
}

/* --- Blockquote --- */
blockquote {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: rgba(139, 0, 0, 0.03);
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text);
    line-height: 1.7;
}

blockquote footer {
    font-size: 0.88rem;
    font-style: normal;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* --- Book List (Gesamtausgabe) --- */
.book-list {
    list-style: none;
    padding: 0;
}

.book-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.book-list li:last-child {
    border-bottom: none;
}

/* --- Brief Bands --- */
.brief-band {
    margin-bottom: 0.5rem;
}

.brief-band strong {
    color: var(--primary);
}

/* --- Footer --- */
.site-footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 1.5rem 0;
    margin-top: 3rem;
    font-size: 0.85rem;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
    color: var(--white);
}

/* --- Clearfix --- */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* --- Small text --- */
.small-text {
    font-size: 0.82rem;
    color: var(--text-light);
}

/* --- Impressum special --- */
.impressum-section {
    margin-bottom: 1.5rem;
}

.impressum-section h3 {
    margin-top: 0;
}

.impressum-section ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.impressum-section ul li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .hero-portrait {
        flex: 0 0 160px;
        width: 160px;
    }

    .hero-text h1 {
        font-size: 1.85rem;
    }

    .hero-text .hero-desc {
        max-width: none;
    }

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

    .content-box {
        padding: 1.5rem 1.25rem;
    }

    .content-image-right {
        float: none;
        margin: 0 0 1.5rem 0;
        max-width: 100%;
        text-align: center;
    }

    .content-image-right img {
        display: inline-block;
        max-width: 260px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .site-footer .container {
        flex-direction: column;
        text-align: center;
    }

    /* Mobile nav */
    .menu-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
        margin-top: 0.75rem;
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        width: 100%;
        text-align: left;
        padding: 0.5rem 0.65rem;
    }

    .site-nav .nav-item > a {
        width: 100%;
        text-align: left;
        padding: 0.5rem 0.65rem;
    }

    .sub-nav {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--primary);
        margin-left: 0.65rem;
        min-width: auto;
        max-height: none;
        padding: 0.25rem 0;
    }

    .nav-item:hover .sub-nav {
        display: none;
    }

    .nav-item.sub-open .sub-nav {
        display: block;
    }

    .site-header .container {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero-text h1 {
        font-size: 1.5rem;
    }

    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .content-box {
        padding: 1.25rem 1rem;
    }
}
