/* --------------------------------------------------------------------------
   Material detail pages
   -------------------------------------------------------------------------- */

.olf-material {
    max-width: var(--olf-container);
    margin: 0 auto;
    padding: clamp(12px, 2vw, 28px) 20px clamp(56px, 7vw, 96px);
}

.single-olf_material .site-content {
    padding-top: 0;
}

.single-olf_material .site-main {
    width: 100%;
}

.single-olf_material .olf-material {
    width: 100%;
}

.single-olf_material .inside-article {
    padding: 0;
    background: transparent;
    border: 0;
}

.olf-material-hero {
    max-width: 900px;
    margin-bottom: clamp(22px, 3vw, 34px);
}

.olf-material-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--olf-muted);
    font-size: 0.92rem;
    font-weight: 650;
}

.olf-material-breadcrumbs a {
    color: inherit;
    text-decoration: none;
}

.olf-material-breadcrumbs a:hover,
.olf-material-breadcrumbs a:focus {
    color: var(--olf-accent);
}

.olf-material-breadcrumbs--bottom {
    max-width: 900px;
    margin-top: clamp(22px, 3vw, 34px);
    margin-bottom: 0;
    padding-top: 18px;
    border-top: 1px solid var(--olf-border);
}

.olf-material-hero h1 {
    margin: 0;
    color: var(--olf-heading);
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.olf-material-hero-image {
    width: 100%;
    max-width: 900px;
    margin: 22px 0 0;
    padding: 10px;
    background: var(--olf-surface);
    border: 1px solid var(--olf-border);
}

.olf-material-hero-image img {
    display: block;
    width: 100%;
    height: auto;
}

.olf-material-lead {
    max-width: 760px;
    margin: 22px 0 0;
    color: var(--olf-muted);
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.5;
}

.olf-material-layout {
    display: block;
    max-width: 900px;
}

.olf-material-main {
    display: grid;
    gap: clamp(20px, 3vw, 28px);
}

.olf-material-section {
    padding: clamp(20px, 2.6vw, 30px);
    background: var(--olf-surface);
    border: 1px solid var(--olf-border);
}

.olf-material-section h2 {
    margin: 0 0 18px;
    font-size: clamp(22px, 2.1vw, 30px);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.olf-material-details {
    margin: 0;
}

.olf-material-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--olf-heading);
    font-size: clamp(17px, 1.35vw, 21px);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.01em;
    cursor: pointer;
    list-style: none;
}

.olf-material-details summary::-webkit-details-marker {
    display: none;
}

.olf-material-details summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    color: var(--olf-accent);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid var(--olf-border);
    border-radius: 999px;
}

.olf-material-details[open] summary {
    margin-bottom: 18px;
}

.olf-material-details[open] summary::after {
    content: "–";
}

.olf-material-facts__link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.olf-material-facts__link:hover,
.olf-material-facts__link:focus {
    color: var(--olf-accent);
}

.olf-material-section h3 {
    margin-top: 0;
    font-size: 1.16rem;
}

.olf-material-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 30px;
    margin: 0;
}

.olf-material-facts__column {
    display: grid;
    gap: 16px;
    min-width: 0;
    margin: 0;
}

.olf-material-facts__item {
    min-width: 0;
}

.olf-material-facts dt,
.olf-material-fragment__location,
.olf-material-media-item__meta {
    margin: 0 0 5px;
    color: var(--olf-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.olf-material-facts dd {
    margin: 0;
    color: var(--olf-heading);
    font-weight: 500;
}


.olf-material-text-block + .olf-material-text-block {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--olf-border);
}

.olf-material-file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    color: var(--olf-accent);
    font-weight: 800;
}

.olf-material-file-actions {
    margin: 12px 0 0;
}

.olf-material-pdf-viewer {
    width: 100%;
    margin: 0;
}

.olf-material-pdf-viewer .cmn-pdf-viewer {
    max-width: 100%;
    margin: 0;
}

.olf-material-pdf-viewer .cmn-pdf-viewer__toolbar,
.olf-material-pdf-viewer .cmn-pdf-viewer__pages {
    margin-top: 0;
}

.olf-material-pdf-viewer__fallback {
    width: 100%;
    height: min(68vh, 680px);
    min-height: 380px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--olf-border);
}

.olf-material-pdf-viewer__fallback iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.olf-material-fragments,
.olf-material-media-list {
    display: grid;
    gap: 20px;
}

.olf-material-fragment,
.olf-material-media-item {
    padding: 20px;
    background: var(--olf-surface-alt);
    border: 1px solid var(--olf-border);
}

.olf-material-fragment {
    display: grid;
    gap: 16px;
    align-items: start;
}

.olf-material-fragment--pdf {
    grid-template-columns: 1fr;
}

.olf-material-fragment--pdf .olf-material-fragment__body {
    order: -1;
}

.olf-material-fragment__visual {
    min-width: 0;
}

.olf-material-fragment__image {
    margin: 0;
    background: #fff;
    border: 1px solid var(--olf-border);
}

.olf-material-fragment__image a {
    display: block;
}

.olf-material-fragment__image img {
    display: block;
    width: 100%;
    height: auto;
}

.olf-material-fragment__body h3,
.olf-material-media-item h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
    line-height: 1.25;
}

.olf-material-fragment__body p {
    font-size: 0.96rem;
    line-height: 1.58;
}

.olf-material-fragment__media {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.olf-material-fragment__media .olf-material-media-item {
    padding: 14px;
    background: #fff;
}

.olf-material-fragment__media .olf-material-media-item h3 {
    font-size: 0.96rem;
}

.olf-material-lightbox[hidden] {
    display: none;
}

.olf-material-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 24px;
}

.olf-material-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 22, 0.78);
}

.olf-material-lightbox__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(1120px, 100%);
    max-height: calc(100vh - 48px);
    padding: 18px;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.olf-material-lightbox__toolbar {
    display: flex;
    flex: 0 0 auto;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.olf-material-lightbox__counter {
    color: var(--olf-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.olf-material-lightbox__stage {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    min-height: 0;
    place-items: center;
}

.olf-material-lightbox__stage img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 170px);
    object-fit: contain;
}

.olf-material-lightbox__close,
.olf-material-lightbox__nav {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    color: transparent;
    font-size: 0;
    line-height: 1;
}

.olf-material-lightbox__close {
    position: relative;
    width: 44px;
    height: 44px;
}

.olf-material-lightbox__close::before,
.olf-material-lightbox__close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
}

.olf-material-lightbox__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.olf-material-lightbox__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.olf-material-lightbox__nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
}

.olf-material-lightbox__nav--prev {
    left: 12px;
}

.olf-material-lightbox__nav--next {
    right: 12px;
}

.olf-material-lightbox__nav::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 11px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
}

.olf-material-lightbox__nav--prev::before {
    transform: translate(-40%, -50%) rotate(135deg);
}

.olf-material-lightbox__nav--next::before {
    transform: translate(-60%, -50%) rotate(-45deg);
}

.olf-material-lightbox__actions {
    flex: 0 0 auto;
    margin: 12px 0 0;
    font-weight: 800;
}

@media (max-width: 720px) {
    .olf-material-lightbox {
        padding: 12px;
    }

    .olf-material-lightbox__dialog {
        max-height: calc(100vh - 24px);
        padding: 12px;
    }

    .olf-material-lightbox__stage img {
        max-height: calc(100vh - 145px);
    }

    .olf-material-lightbox__nav {
        width: 38px;
        height: 38px;
    }

    .olf-material-lightbox__nav--prev {
        left: 6px;
    }

    .olf-material-lightbox__nav--next {
        right: 6px;
    }
}

.olf-material-media-embed {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: #111820;
}

.olf-material-media-embed iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    border: 0;
}

.olf-material-audio .wp-audio-shortcode,
.olf-material-audio audio {
    width: 100% !important;
}



@media (max-width: 720px) {
    .olf-material {
        padding-top: 0;
        padding-right: 16px;
        padding-bottom: 18px;
        padding-left: 16px;
    }

    .olf-material-facts,
    .olf-material-fragment {
        grid-template-columns: 1fr;
    }

    .olf-material-fragment__body {
        order: -1;
    }

    .olf-material-fragment__body h3 {
        font-size: 0.98rem;
    }

    .olf-material-fragment__body p,
    .olf-material-fragment__location {
        font-size: 0.9rem;
    }

    .olf-material-section {
        padding: 20px;
    }

    .olf-material-pdf-viewer__fallback {
        height: 62vh;
        min-height: 300px;
    }
}

/* Reduce excessive space between the last material block and the footer. */
.single-olf_material .olf-material {
    padding-bottom: clamp(20px, 3vw, 38px);
}

.single-olf_material .site-content {
    padding-bottom: 0;
}

@media (max-width: 720px) {
    .single-olf_material .olf-material {
        padding-bottom: 14px;
    }
}

/* Material fragment layout polish. */
.olf-material-fragment__body {
    order: 0;
}

.olf-material-fragment__body h3 {
    margin: 0 0 8px;
    font-size: clamp(1rem, 1.35vw, 1.12rem);
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.olf-material-fragment__location,
.olf-material-fragment__media .olf-material-media-item__meta {
    font-weight: 600;
    letter-spacing: 0.055em;
}

.olf-material-fragment__media .olf-material-media-item {
    padding: 12px;
}



@media (max-width: 720px) {
    .olf-material-hero-image {
        margin: 18px 0 22px;
    }

    .olf-material-hero h1 {
        font-size: clamp(21px, 6vw, 26px);
        line-height: 1.16;
        letter-spacing: -0.03em;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
        text-wrap: wrap;
    }
}

/* Keep material breadcrumbs on one line on narrow screens. */
@media (max-width: 720px) {
    .olf-material-breadcrumbs {
        flex-wrap: nowrap;
        gap: 5px;
        margin-bottom: 14px;
        font-size: 0.74rem;
        line-height: 1.25;
        letter-spacing: -0.01em;
        white-space: nowrap;
    }

    .olf-material-breadcrumbs a,
    .olf-material-breadcrumbs span {
        flex: 0 0 auto;
    }

    .olf-material-breadcrumbs--bottom {
        margin-top: 22px;
        padding-top: 14px;
    }
}


/* Lightbox control refinement: keep close button stable and reduce visual weight. */
.olf-material-lightbox__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.olf-material-lightbox__counter:not([hidden]) {
    margin-right: auto;
    font-size: 0.82rem;
    font-weight: 400;
}

.olf-material-lightbox__close {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 0;
    padding: 0;
    border: 1px solid rgba(24, 31, 38, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    color: rgba(24, 31, 38, 0.68);
    font-size: 0;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
}

.olf-material-lightbox__close:hover,
.olf-material-lightbox__close:focus {
    background: rgba(255, 255, 255, 0.86);
    color: rgba(24, 31, 38, 0.88);
}

.olf-material-lightbox__close::before,
.olf-material-lightbox__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 1.5px;
    margin: 0;
    background: currentColor;
    transform-origin: center;
}

.olf-material-lightbox__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.olf-material-lightbox__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.olf-material-lightbox__nav {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.42);
    color: rgba(24, 31, 38, 0.58);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
}

.olf-material-lightbox__nav:hover,
.olf-material-lightbox__nav:focus {
    background: rgba(255, 255, 255, 0.74);
    color: rgba(24, 31, 38, 0.84);
}

.olf-material-lightbox__nav::before {
    width: 8px;
    height: 8px;
    border-color: currentColor;
    border-width: 0 1.5px 1.5px 0;
}

.olf-material-lightbox__actions a {
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Final lightbox navigation state model. */
.olf-material-lightbox button.olf-material-lightbox__nav {
    appearance: none;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: rgba(32, 38, 41, 0.46);
    box-shadow: none;
    outline: 0;
    opacity: 0.72;
}

.olf-material-lightbox button.olf-material-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.28);
    color: rgba(32, 38, 41, 0.64);
    box-shadow: none;
    outline: 0;
    opacity: 0.92;
}

.olf-material-lightbox button.olf-material-lightbox__nav:focus {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(32, 38, 41, 0.46);
    box-shadow: none;
    outline: 0;
}

.olf-material-lightbox button.olf-material-lightbox__nav:focus:not(:focus-visible) {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(32, 38, 41, 0.46);
    box-shadow: none;
    outline: 0;
}

.olf-material-lightbox button.olf-material-lightbox__nav:focus-visible {
    background: rgba(255, 255, 255, 0.30);
    color: rgba(32, 38, 41, 0.70);
    box-shadow: 0 0 0 2px rgba(32, 38, 41, 0.14);
    outline: 0;
    opacity: 0.95;
}

.olf-material-lightbox button.olf-material-lightbox__nav:active {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: none;
    outline: 0;
    opacity: 0.82;
}

.olf-material-lightbox button.olf-material-lightbox__nav::before {
    width: 6px;
    height: 6px;
    border-width: 0 1px 1px 0;
    border-color: currentColor;
}

.olf-material-lightbox button.olf-material-lightbox__nav::-moz-focus-inner {
    border: 0;
}


/* Clickable material hero image. */
.olf-material-hero-image__link {
    display: block;
    overflow: hidden;
    border-radius: inherit;
    color: inherit;
    cursor: zoom-in;
    text-decoration: none;
}

.olf-material-hero-image__link img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.olf-material-hero-image__link:hover img,
.olf-material-hero-image__link:focus img {
    transform: scale(1.01);
    filter: brightness(0.96);
}
