/* Article detail page styles */

.artikel-meta-line {
    color: var(--body-text-color);
    font-size: var(--small-font-size);
    margin-bottom: var(--group-space);
}

/* Article two-column layout: top gap matches other pages under the hero;
   no extra bottom margin so the sidebar border can run to the footer. */
.columns:has(.artikel-sidebar-sticky) {
    padding-top: var(--section-space);
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* Article heading sizes – smaller than default */
.columns:has(.artikel-sidebar-sticky) h1 {
    font-size: var(--heading-2-font-size);
    line-height: var(--heading-line-height);
    margin-bottom: var(--section-space);
}

.columns:has(.artikel-sidebar-sticky) h2 {
    font-size: var(--heading-5-font-size);
    line-height: var(--compact-line-height);
}

.columns:has(.artikel-sidebar-sticky) .columns-inner {
    align-items: var(--stretch-align);
}

/* Left column: the section owns the gap under the hero */
.columns:has(.artikel-sidebar-sticky) > .columns-inner > .column:first-child {
    padding-top: 0;
    padding-bottom: var(--section-space);
}

/* Right sidebar: border runs full height from header to footer */
.column:has(.artikel-sidebar-sticky) {
    border-left: var(--hairline-width) solid var(--border-color);
    padding-left: var(--block-space);
    padding-top: var(--item-space);
    padding-bottom: var(--section-space);
}

/* Make the .text wrapper fill the full column height so sticky has room */
.column:has(.artikel-sidebar-sticky) > .text {
    flex: 1;
    min-height: 0;
}

/* Sticky sidebar – stays while the article scrolls. main.js sets
   max-height to the space left under this box. The calc is the
   no-JS fallback (header band only). Scrollbar only when content
   is taller than that visible band. */
.artikel-sidebar-sticky {
    position: sticky;
    top: var(--header-space);
    max-height: calc(100dvh - var(--header-space));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: var(--item-space);
}

.visually-hidden {
    position: absolute;
    width: var(--hairline-width);
    height: var(--hairline-width);
    margin: calc(-1 * var(--hairline-width));
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Sidebar search */
.local-search { position: relative; }

.sidebar-search-form {
    display: flex;
    gap: 0;
}

.sidebar-search-input {
    flex: 1;
    padding: var(--control-padding);
    border: var(--hairline-width) solid var(--border-color);
    border-right: none;
    border-radius: var(--button-radius) 0 0 var(--button-radius);
    font-family: inherit;
    font-size: var(--small-font-size);
    outline: none;
}

.sidebar-search-input:focus {
    border-color: var(--body-link-color);
}

.sidebar-search-btn {
    padding: var(--tight-space) var(--item-space);
    background: var(--button-background-color);
    color: var(--button-color);
    border: none;
    border-radius: 0 var(--button-radius) var(--button-radius) 0;
    cursor: pointer;
    font-weight: var(--button-font-weight);
    font-size: var(--small-font-size);
    transition: all var(--default-transition);
}

.sidebar-search-btn:hover {
    background: var(--button-hover-background-color);
    color: var(--button-hover-color);
    box-shadow: var(--button-hover-shadow);
}

.search-results[hidden],
.artikel-sidebar-default[hidden] {
    display: none;
}

.search-results-empty {
    margin: 0;
    padding: var(--control-space) var(--control-space);
    font-size: var(--small-font-size);
    color: var(--body-text-color);
}

/* Sidebar sections */
.artikel-sidebar-section {
    margin-bottom: var(--block-space);
    padding-bottom: var(--group-space);
    border-bottom: var(--hairline-width) solid var(--border-color);
}

.artikel-sidebar-section:last-child {
    border-bottom: none;
}

.artikel-sidebar-section h3 {
    font-size: var(--lead-font-size);
    font-weight: var(--strong-font-weight);
    margin-bottom: var(--control-space);
    color: var(--body-text-color);
}

/* Recent articles list */
.artikel-recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.artikel-recent-list li {
    padding: var(--tight-space) 0;
}

.artikel-recent-list a {
    color: var(--body-text-color);
    text-decoration: none;
    font-size: var(--small-font-size);
    line-height: var(--compact-line-height);
    display: block;
}

.artikel-recent-list a:hover {
    color: var(--body-link-color);
}

/* Category list */
.artikel-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.artikel-category-list li {
    padding: var(--hair-space) 0;
}

.artikel-category-list a {
    color: var(--body-text-color);
    text-decoration: none;
    font-size: var(--small-font-size);
}

.artikel-category-list a:hover {
    color: var(--body-link-color);
}

/* ============================================================
   Course Listing Cards – horizontal cards for "Åbne kurser" articles
   ============================================================ */

.course-listing-grid {
    display: flex;
    flex-direction: column;
    gap: var(--grid-gap);
    margin-top: var(--group-space);
    margin-bottom: var(--block-space);
}

.course-listing-card {
    display: flex;
    gap: var(--grid-gap);
    background: var(--body-background-color);
    border: var(--hairline-width) solid var(--border-color);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: box-shadow var(--default-transition),
                transform var(--default-transition);
}

.course-listing-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-0.125rem);
}

/* Image area – composite overlay matching logb.dk style:
   course image as background, title in logb-blue top-left,
   instructor portrait (transparent bg) bottom-right */
.course-listing-card-image {
    flex: 0 0 17.5rem;
    min-height: 12.5rem;
    overflow: hidden;
    background: var(--body-background-color);
    position: relative;
    display: block;
    text-decoration: none;
}

.course-listing-card-image .course-listing-card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback logo – center and scale down */
.course-listing-card-image .course-listing-card-bg[src*="lundogbendsen_logo"] {
    object-fit: contain;
    padding: var(--group-space);
}

/* Course name overlay – logb-blue, top-left */
.course-listing-card-overlay-title {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 5rem;
    color: var(--body-link-color);
    font-size: var(--lead-font-size);
    font-weight: var(--strong-font-weight);
    line-height: var(--heading-line-height);
    text-shadow: var(--photo-caption-shadow);
    pointer-events: none;
}

/* Instructor portrait – bottom-right, transparent background */
.course-listing-instructor-portrait {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 7.5rem;
    height: auto;
    max-height: 9.375rem;
    object-fit: contain;
    object-position: bottom right;
    pointer-events: none;
}

.course-listing-card-body {
    flex: 1;
    padding: var(--gutter-space) var(--group-space);
    display: flex;
    flex-direction: column;
    justify-content: var(--center-align);
}

.course-listing-card-title {
    font-size: var(--heading-5-font-size);
    font-weight: var(--strong-font-weight);
    margin: 0 0 var(--control-space);
    line-height: var(--compact-line-height);
}

.course-listing-card-title a {
    color: var(--body-link-color);
    text-decoration: none;
}

.course-listing-card-title a:hover {
    color: var(--body-link-color);
}

/* Meta fields – vertical stack, one field per line (matching logb.dk) */
.course-listing-card-meta {
    display: flex;
    flex-direction: column;
    gap: var(--hair-space);
    font-size: var(--small-font-size);
    color: var(--body-text-color);
    margin-bottom: var(--control-space);
}

.course-listing-meta-item strong {
    color: var(--body-text-color);
    font-weight: var(--heading-font-weight);
}

/* Dates – vertical stack (matching logb.dk) */
.course-listing-dates {
    font-size: var(--small-font-size);
    color: var(--body-text-color);
    display: flex;
    flex-direction: column;
    gap: var(--hair-space);
}

.course-listing-dates-label {
    font-weight: var(--heading-font-weight);
    color: var(--body-text-color);
}

.course-listing-date {
    white-space: nowrap;
}

/* Responsive: stack vertically on small screens */
@media (max-width: 37.5rem) {
    .course-listing-card {
        flex-direction: column;
    }

    .course-listing-card-image {
        flex: 0 0 auto;
        min-height: 11.25rem;
        max-height: 13.75rem;
    }

    .course-listing-card-overlay-title {
        font-size: var(--lead-font-size);
    }

    .course-listing-instructor-portrait {
        width: 7.5rem;
        max-height: 10rem;
    }

    .course-listing-card-body {
        padding: var(--item-space);
    }
}

/* Speaker card from a Divi team-member module. The portrait floats, so the
   card has to contain it. */
.team-member {
    overflow: auto;
}

/* WordPress image alignment classes */
.alignleft {
    float: left;
    margin: var(--hair-space) var(--group-space) var(--item-space) 0;
}

.alignright {
    float: right;
    margin: var(--hair-space) 0 var(--item-space) var(--group-space);
}

.aligncenter {
    display: block;
    margin: var(--item-space) auto;
}

/* ============================================================
   Nyheder listing page – blog-style feed items
   ============================================================ */

/* Blog-style feed – vertical list with image, title, meta, excerpt.
   Applied via visning: "blog" on the feed block (e.g. nyheder listing page). */
.feed-inner--blog {
    display: flex;
    flex-direction: column;
    gap: var(--section-space);
}

.feed-inner--blog .feed-item {
    padding-bottom: var(--section-space);
    border-bottom: var(--hairline-width) solid var(--border-color);
}

.feed-inner--blog .feed-item:last-child {
    border-bottom: none;
}

.feed-inner--blog .feed-item-billede {
    margin-bottom: var(--control-space);
}

.feed-inner--blog .feed-item-billede img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--field-radius);
}

.feed-inner--blog .feed-item-titel {
    font-size: var(--heading-4-font-size);
    font-weight: var(--strong-font-weight);
    line-height: var(--compact-line-height);
    margin: 0 0 var(--hair-space);
}

.feed-inner--blog .feed-item-titel a {
    color: var(--body-text-color);
    text-decoration: none;
}

.feed-inner--blog .feed-item-titel a:hover {
    color: var(--body-link-color);
}

.feed-inner--blog .feed-item-meta {
    color: var(--body-text-color);
    font-size: var(--small-font-size);
    margin: 0 0 var(--control-space);
}

.feed-inner--blog .feed-item-uddrag {
    color: var(--body-text-color);
    font-size: var(--small-font-size);
    line-height: var(--body-line-height);
    margin: 0;
}

/* Newsletter signup */
.artikel-newsletter {
    text-align: var(--center-align);
    padding-top: var(--item-space);
}

.artikel-newsletter .button {
    display: inline-block;
    width: 100%;
    text-align: var(--center-align);
}

/* Blog-style pagination – styled button prev/next */
.feed-inner--blog + .pagination-container {
    margin-top: var(--block-space);
    padding-top: var(--group-space);
}

.feed-inner--blog + .pagination-container .pagination {
    display: flex;
    justify-content: space-between;
    gap: var(--item-space);
}

.pagination-link.button {
    font-size: var(--small-font-size);
    padding: var(--control-space) var(--group-space);
}

.pagination-prev {
    margin-right: auto;
}

.pagination-next {
    margin-left: auto;
}
