/* ================================================================
   Blue palette
   ================================================================ */

:root {
    color-scheme: light;
    --color-primary: #245f87;
    --color-accent: #64acd4;
    --color-section: #d9eaf5;
    --color-subtle-background: #f1f6fa;
    --color-border: #d8e3eb;
    --color-text: #172631;
    --color-white: #ffffff;
}

/* ================================================================
   Base styles and keyboard access
   ================================================================ */

* {
    box-sizing: border-box;
}

html {
    font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-white);
    scrollbar-gutter: stable;
}

body {
    display: flex;
    flex-direction: column;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--color-primary);
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

.skip-link {
    position: absolute;
    z-index: 10;
    top: 8px;
    left: 16px;
    padding: 8px 14px;
    color: var(--color-primary);
    background: var(--color-white);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ================================================================
   Name and main navigation
   ================================================================ */

.site-header {
    z-index: 1;
    border-bottom: 4px solid var(--color-accent);
    color: var(--color-white);
    background: var(--color-primary);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 72px;
    padding: 12px 32px;
}

.site-name {
    flex-shrink: 0;
    color: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
    text-decoration: none;
}

.site-navigation {
    margin-left: auto;
}

.site-navigation ul {
    display: flex;
    align-items: center;
    gap: 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navigation-item {
    display: block;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1.4;
    text-decoration: none;
}

a.navigation-item:hover {
    border-bottom-color: var(--color-accent);
}

.navigation-item[aria-current="page"] {
    border-bottom-color: var(--color-white);
    font-weight: 700;
}

/* ================================================================
   Responsive photographic banner
   ================================================================ */

.header-image {
    height: clamp(20rem, 28vw, 30rem);
    overflow: hidden;
    background: var(--color-subtle-background);
}

.header-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 48% 62%;
}

/* ================================================================
   Profile and readable biography column
   ================================================================ */

.profile-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 76px;
}

.profile-column {
    position: relative;
    margin-top: -96px;
}

.profile-photo {
    display: block;
    width: 210px;
    height: 210px;
    border: 5px solid var(--color-white);
    object-fit: cover;
    object-position: center;
}

.profile-description {
    margin: 22px 5px 0;
    color: var(--color-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.6;
}

.profile-place {
    margin: 14px 5px 0;
    font-size: 0.875rem;
}

/* ================================================================
   Shared profile links beneath the portrait
   ================================================================ */

.profile-links {
    display: grid;
    gap: 6px;
    margin: 20px 5px 0;
    padding: 12px;
    list-style: none;
    text-align: left;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}

.profile-link-icon {
    display: block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    background-color: var(--color-primary);
    -webkit-mask-image: var(--profile-icon);
    mask-image: var(--profile-icon);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.profile-link-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.language-selection .profile-links {
    max-width: 240px;
    margin-right: auto;
    margin-left: auto;
}

.biography {
    min-width: 0;
    padding-top: 50px;
}

.biography h1 {
    margin: 0 0 24px;
    color: var(--color-primary);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.biography p {
    margin: 0 0 24px;
    font-size: 1rem;
    line-height: 1.75;
}

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

/* ================================================================
   Footer
   ================================================================ */

.site-footer {
    margin-top: auto;
    padding: 22px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-subtle-background);
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.875rem;
}

/* ================================================================
   Tablet and phone layouts
   ================================================================ */

@media (max-width: 1000px) {
    .header-inner {
        gap: 20px;
        padding-right: 24px;
        padding-left: 24px;
    }

    .site-navigation ul {
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px 20px 8px;
    }

    .site-name {
        font-size: 2.0rem;
    }

    .site-navigation {
        width: 100%;
        margin-left: 0;
    }

    .site-navigation ul {
        justify-content: space-between;
        gap: 8px;
    }

    .navigation-item {
        padding: 10px 0;
        font-size: 0.875rem;
    }

    .header-image {
        height: 240px;
    }

    .profile-layout {
        display: block;
        padding-right: 24px;
        padding-bottom: 48px;
        padding-left: 24px;
    }

    .profile-column {
        margin-top: -50px;
        text-align: center;
    }

    .profile-photo {
        width: 100%;
        height: auto;
        margin: 0 auto;
    }

    .profile-description {
        max-width: 240px;
        margin: 14px auto 0;
    }

    .profile-links {
        justify-content: start;
        width: 100%;
        max-width: none;
        margin-right: auto;
        margin-left: auto;
        padding: 0 0 0 24px;
    }

    .profile-link {
        font-size: 16pt;
    }

    .profile-link-icon {
        flex-basis: 25px;
        width: 25px;
        height: 25px;
    }

    .profile-place {
        margin-top: 8px;
    }

    .biography {
        padding-top: 36px;
    }

    .biography h1 {
        margin-bottom: 22px;
        font-size: 2.75rem;
    }
}

@media (max-width: 359px) {
    .header-inner {
        padding-right: 16px;
        padding-left: 16px;
    }

    .site-name {
        font-size: 1.125rem;
    }
}

/* ================================================================
   Language-selection entrance
   ================================================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.language-selection {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 24px 72px;
}

.language-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 16px;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    color: var(--color-primary);
    background: var(--color-white);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.language-option:hover {
    background: var(--color-section);
}

/* ================================================================
   Opposite-language link and translated page introduction
   ================================================================ */

.language-switch {
    flex-shrink: 0;
    margin-left: 8px;
    padding: 10px 0;
    color: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    text-underline-offset: 4px;
}

.language-switch:hover {
    text-decoration-thickness: 2px;
}

.biography .page-introduction {
    font-size: 1.125rem;
    line-height: 1.65;
}

/* ================================================================
   Mobile page text: separate intro_text and body_text sizes
   ================================================================ */

@media (max-width: 767px) {
    /* Paragraphs loaded from pages.intro_text. */
    .biography .page-introduction {
        font-size: 16pt;
    }

    /* Paragraphs loaded from pages.body_text. */
    .biography > p:not(.page-introduction) {
        font-size: 14pt;
    }
}

@media (max-width: 1000px) {
    .header-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px 20px;
    }

    .site-navigation {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .site-navigation ul {
        justify-content: space-between;
    }

    .language-switch {
        margin-left: auto;
    }
}

@media (max-width: 767px) {
    .language-selection {
        padding-top: 36px;
        padding-bottom: 48px;
    }

    .language-options {
        gap: 16px;
    }

    .language-option {
        padding-right: 10px;
        padding-left: 10px;
        font-size: 1rem;
    }

    .site-navigation ul {
        gap: 8px;
    }
}

@media (max-width: 359px) {
    .site-navigation ul {
        flex-wrap: wrap;
        justify-content: flex-start;
        column-gap: 18px;
    }

    .language-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ================================================================
   Media entries: linked image followed by left-aligned details
   ================================================================ */

.media-list {
    margin-top: 24px;
    text-align: left;
}

.media-entry + .media-entry {
    margin-top: 32px;
}

.media-image-link {
    display: block;
    width: 300px;
    max-width: 100%;
}

.media-image {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
}

.media-details {
    margin-top: 6pt;
    font-size: 12pt;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
}

.biography .media-details p {
    margin: 0;
    font-size: 12pt;
    line-height: 1.5;
    text-align: left;
}

.media-entry--no-image .media-details {
    margin-top: 0;
}

/* ================================================================
   Projects entries: optional image followed by left-aligned details
   ================================================================ */

.project-list {
    margin-top: 24px;
    font-size: 12pt;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
}

.project-entry + .project-entry {
    margin-top: 32px;
}

.project-image-link {
    display: block;
    width: 300px;
    max-width: 100%;
}

.project-image {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
}

.project-details {
    margin-top: 6pt;
}

.project-entry--no-image .project-details {
    margin-top: 0;
}

.biography .project-entry p {
    margin: 0;
    font-size: 12pt;
    line-height: 1.5;
    text-align: left;
}

/* ================================================================
   Entry typography: title, description, and link
   ================================================================ */

.biography .entry-title {
    margin: 0 0 4pt;
    color: var(--color-primary);
    font-size: 16pt;
    font-weight: 700;
    line-height: 1.4;
}

.biography .media-details .entry-description,
.biography .project-details .entry-description {
    margin: 0 0 6pt;
    color: #000000;
    font-size: 14pt;
    font-weight: 400;
    line-height: 1.5;
}

.biography .media-details .entry-link,
.biography .project-details .entry-link,
.biography .media-details .entry-metadata {
    font-size: 12pt;
    font-weight: 400;
    line-height: 1.5;
}

/* ================================================================
   Short language-switch labels for phones
   ================================================================ */

.language-switch .language-label-short {
    display: none;
}

@media (max-width: 767px) {
    .language-switch .language-label-full {
        display: none;
    }

    .language-switch .language-label-short {
        display: inline;
    }
}

/* ================================================================
   Mobile navigation: current page and expandable 14pt menu
   ================================================================ */

.mobile-navigation {
    display: none;
}

@media (max-width: 767px) {
    .site-navigation {
        display: none;
    }

    .mobile-navigation {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        order: 3;
        gap: 12px;
        width: 100%;
        min-width: 0;
    }

    .mobile-current-page {
        min-width: 0;
        font-size: 14pt;
        font-weight: 700;
        line-height: 1.4;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .mobile-menu {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .mobile-menu-toggle {
        position: relative;
        z-index: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        border: 0;
        color: inherit;
        background: transparent;
        font: inherit;
        appearance: none;
        cursor: pointer;
        touch-action: manipulation;
    }

    .mobile-menu-toggle svg {
        pointer-events: none;
    }

    .mobile-menu-toggle:focus-visible {
        outline: 3px solid var(--color-accent);
        outline-offset: 2px;
    }

    .mobile-menu-items {
        position: absolute;
        z-index: 2;
        top: 100%;
        right: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        width: min(100%, 20rem);
        max-height: 60vh;
        margin: 8px 0 0;
        padding: 8px 0;
        overflow-y: auto;
        border: 1px solid var(--color-border);
        border-radius: 4px;
        color: var(--color-primary);
        background: var(--color-white);
        list-style: none;
        text-align: left;
    }

    .mobile-menu-items[hidden] {
        display: none;
    }

    .mobile-menu-items .navigation-item {
        padding: 10px 16px;
        border-bottom: 0;
        font-size: 14pt;
        line-height: 1.4;
    }

    .mobile-menu-items a.navigation-item:hover,
    .mobile-menu-items .navigation-item[aria-current="page"] {
        background: var(--color-section);
    }

    .mobile-menu-items .navigation-item[aria-disabled="true"] {
        opacity: 0.55;
    }
}
