:root {
    color-scheme: light;
    --bg: #ffd8e8;
    --text: #111827;
    --muted: #4b5563;
    --border: #a73d84;
    --link: #298411;
    --link-hover: #5cb744;
    --header-bg: #86316a;
    --header-link: #8FB728;
    --header-link-hover: #9FD940;
    --header-link-current: #8FE928;
    --table-bg: #eec7d7;
    --table-header-color: #780f56;
    --focus-outline: #5cb744;
    --focus-bg: rgba(92, 183, 68, 0.1);
    --focus-bg-header: rgba(159, 217, 64, 0.1);
    --skip-link-bg: #fff;
    --max-width: 72rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.25rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1a0d14;
    --text: #ffffff;
    --muted: #9ca3af;
    --border: #a73d84;
    --link: #a8e05f;
    --link-hover: #c0f080;
    --header-bg: #86316a;
    --header-link: #8FB728;
    --header-link-hover: #9FD940;
    --header-link-current: #8FE928;
    --table-bg: #2d1a24;
    --table-header-color: #f472b6;
    --focus-outline: #a8e05f;
    --focus-bg: rgba(168, 224, 95, 0.15);
    --focus-bg-header: rgba(159, 217, 64, 0.15);
    --skip-link-bg: #2d1a24;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
}

a:any-link {
    border-style: none;
    color: var(--link);
    text-decoration: none;
}

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

/* Keyboard focus indicators for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus-outline);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Specific focus style for navigation links */
.site-header a:focus-visible {
    outline: 3px solid var(--header-link-hover);
    outline-offset: 2px;
    background: var(--focus-bg-header);
    border-radius: 4px;
}

/* Focus style for skip link */
.skip-link:focus {
    outline: 3px solid var(--focus-outline);
    outline-offset: 2px;
}

/* Ensure links in main content have good contrast when focused */
main a:focus-visible {
    outline: 3px solid var(--focus-outline);
    outline-offset: 2px;
    background: var(--focus-bg);
    border-radius: 2px;
}

/* Focus for table cells (used in about.html, contact.html, etc.) */
#about a:focus-visible,
#contact a:focus-visible,
#books a:focus-visible {
    outline: 3px solid var(--focus-outline);
    outline-offset: 2px;
}

table {
    border-style: none;
}

td {
    vertical-align: top;
}

.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-image: var(--icon-view);
}

[data-theme="dark"] .icon {
    filter: invert(1) brightness(1.2);
}

.icon-address {
    --icon-view: url('pictures/icon-address.svg#svgView(viewBox(90, 30, 350, 350))');
}

.icon-linkedin {
    --icon-view: url('pictures/icon-linkedin.svg#svgView(viewBox(200, 200, 700, 700))');
}

.icon-location {
    --icon-view: url('pictures/icon-location.svg#svgView(viewBox(90, 30, 350, 350))');
}

.icon-mail {
    --icon-view: url('pictures/icon-mail.svg#svgView(viewBox(90, 30, 350, 350))');
}

.icon-phone {
    --icon-view: url('pictures/icon-phone.svg#svgView(viewBox(90, 30, 350, 350))');
}

.icon-www {
    --icon-view: url('pictures/icon-www.svg#svgView(viewBox(90, 30, 350, 350))');
}

.avatar {
    display: inline-block;
    width: 75px;
    height: 100px;
    background-size: contain;
    background-image: var(--file);
}

[data-theme="dark"] .avatar {
    filter: brightness(0.9) contrast(1.1);
}


.avatar-henrik {
    --file: image-set(
        url('people/HenrikGöhle.webp') type('image/webp'),
        url('people/HenrikGöhle.jpg') type('image/jpeg')
    );
}

.avatar-judith {
    --file: image-set(
        url('people/JudithSägesserWyss.webp') type('image/webp'),
        url('people/JudithSägesserWyss.jpg') type('image/jpeg')
    );
}

.avatar-marijke {
    --file: image-set(
        url('people/MarijkeStein.webp') type('image/webp'),
        url('people/MarijkeStein.jpg') type('image/jpeg')
    );
}

.avatar-nina {
    --file: image-set(
        url('people/NinaKaufmannKern.webp') type('image/webp'),
        url('people/NinaKaufmannKern.jpg') type('image/jpeg')
    );
}

.avatar-sihna {
    --file: image-set(
        url('people/SihnaLind.webp') type('image/webp'),
        url('people/SihnaLind.jpg') type('image/jpeg')
    );
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    padding: 0.75rem var(--space-md);
    background: var(--skip-link-bg);
    border-style: none;
}

.skip-link:focus {
    left: var(--space-md);
    top: var(--space-md);
    z-index: 10;
}

header, main, footer {
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg);
}

.site-header {
    border-style: none;
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(6px);
    z-index: 100;
}

.site-header a:is(:link, :visited, :active) {
    color: var(--header-link);
    font-size: var(--text-xl);
    text-decoration: none;
}

.site-header a:hover {
    color: var(--header-link-hover);
    text-decoration: underline;
}

.site-header a[aria-current="page"] {
    color: var(--header-link-current);
    text-decoration: underline;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: inherit;
}

.brand img {
    height: 40px;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: var(--space-md);
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    row-gap: var(--space-sm);
}

@media (max-width: 768px) {
    .site-header .container {
        padding: var(--space-sm) var(--space-md);
    }

    .site-header a:is(:link, :visited, :active) {
        font-size: var(--text-base);
    }

    .brand img {
        height: 30px;
    }

    nav ul {
        gap: var(--space-sm);
    }

    #theme-toggle {
        font-size: 1.2rem;
        padding: var(--space-xs);
    }
}

.page-title {
    margin: var(--space-xl) 0 var(--space-md);
}

.lede {
    color: var(--muted);
    margin-top: var(--space-xs);
}

section {
    padding: var(--space-lg) 0;
}

section:first-of-type {
    border-top: 0;
}

ul.weblinks li {
    margin-bottom: var(--space-md);
}

h2 {
    margin: 0 0 var(--space-sm);
    font-size: var(--text-lg);
}

.meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 900px) {
    .grid {
        grid-template-columns: 1.2fr .8fr;
        align-items: start;
    }
}

address {
    font-style: normal;
}

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: var(--space-xl);
}

.footer-links {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
}

#about {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

#about td, #about th {
    background: var(--table-bg);
    padding: var(--space-md) var(--space-xl);
    text-align: left;
    vertical-align: top;
}

#about th {
    color: var(--table-header-color);
    font-weight: bold;
    text-align: left;
}

@media (max-width: 768px) {
    #about td, #about th {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
    }

    #about {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #about .icon {
        width: 2rem;
        height: 2rem;
    }
}

#books {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

#books td, #books th {
    background: var(--table-bg);
    padding: var(--space-md);
}

#books th {
    color: var(--table-header-color);
    font-weight: bold;
}

@media (max-width: 768px) {
    #books td, #books th {
        padding: var(--space-sm);
        font-size: 0.9rem;
    }

    #books {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

#assets {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

#assets td, #assets th {
    background: var(--table-bg);
    padding: var(--space-md);
}

#assets th {
    color: var(--table-header-color);
    font-weight: bold;
    text-align: left;
}

@media (max-width: 768px) {
    #assets td, #assets th {
        padding: var(--space-sm);
        font-size: 0.9rem;
    }

    #assets {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.booktitle {
    font-weight: bold;
    padding-bottom: var(--space-md);
}

#contact {
    margin: 0;
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

#contact img {
    width: 100%;  /* Fill the 30% width of the cell */
    height: 100%; /* Fill the total height of the 3 rows */
    display: block;
    object-fit: cover;
    object-position: center;
}

#contact td:nth-child(1) { width: 5rem; }  /* Icon column */
#contact td:nth-child(2) { width: auto; }  /* Address column */
#contact td:nth-child(3) { width: 50%; }   /* Image column */

#contact td, #contact th {
    background: var(--table-bg);
    padding: var(--space-md) var(--space-xl);
    text-align: left;
    vertical-align: middle;
}

#contact th {
    text-align: center;
}

@media (max-width: 768px) {
    #contact {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #contact td, #contact th {
        padding: 0.75rem var(--space-md);
    }

    #contact td:nth-child(1) { width: 3rem; }
    #contact td:nth-child(3) { width: 40%; }

    .contact-icon {
        width: 2rem;
        height: 2rem;
    }
}

@media (max-width: 480px) {
    /* On very small screens, stack the contact info vertically */
    #contact tbody, #contact tr, #contact td {
        display: block;
        width: 100%;
    }

    #contact td {
        padding: var(--space-sm) var(--space-md);
    }

    #contact td:nth-child(3) {
        width: 100%;
    }

    #contact img {
        max-height: 300px;
        width: 100%;
        object-fit: cover;
    }
}

.contact-icon {
    width: 3rem;
    height: 3rem;
}

#about .icon {
    width: 3rem;
    height: 3rem;
}

.legaltext {
    text-align: justify;
    margin-bottom: 1.5rem;
}

.legaltext + .legaltext {
    margin-top: 1.5rem;
}

.hero-image {
    width: 100%;
    height: auto;
    padding-top: var(--space-xl);
}

.full-width-image {
    width: 100%;
    height: auto;
}

.centered-content {
    text-align: center;
}

.centered-logo {
    width: 50%;
    height: auto;
}

.tasks-list {
    padding-left: 1em;
}

.map-iframe {
    border: none;
}

.lede-spaced {
    padding-top: var(--space-xl);
}

.news-section {
    margin-bottom: var(--space-xl);
}

.news-category {
    font-size: var(--text-base);
    margin-bottom: 0.75rem;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
}

.news-category.upcoming {
    color: var(--table-header-color);
}

.news-category.past {
    color: var(--muted);
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-item {
    display: flex;
    gap: var(--space-md);
    padding: 0.75rem 0;
}

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

.news-date {
    font-weight: bold;
    color: var(--table-header-color);
    white-space: nowrap;
    min-width: 180px;
}

.news-content {
    flex: 1;
}

.condolences {
    background-color: black;
    color: darkgrey;
    padding: 1rem;
}

@media (max-width: 600px) {
    .news-item {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .news-date {
        min-width: auto;
    }
}

.error-404 {
    padding: var(--space-xl) 0;
}

.error-404 h2 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    color: var(--table-header-color);
}

.error-404 ul {
    margin: var(--space-md) 0;
}

.helpful-links {
    list-style: none;
    padding: 0;
}

.helpful-links li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.helpful-links li:last-child {
    border-bottom: none;
}

.helpful-links a {
    font-size: var(--text-lg);
    font-weight: 500;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: var(--text-xl);
    cursor: pointer;
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    color: var(--header-link);
    transition: transform var(--transition-base);
}

#theme-toggle:hover {
    transform: scale(1.1);
    color: var(--header-link-hover);
}

#theme-toggle:focus-visible {
    outline: 3px solid var(--header-link-hover);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
