/* =========================================================================
   Arrangementer & udstillinger – fælles styles
   Indlæses kun på arkiv-, single- og taxonomy-sider for de to posttyper.

   Designtokens er hentet fra johanneslarsenmuseet.dk (Divi):
   - Skrift: din-condensed (Typekit) sat af Divi på body/headings, arves her
   - Navy #09305d (links/nav), grøn #4a6043 (accent), varm off-white #f8f5ef
   - Knapper: 2px mørk kant, næsten ingen radius, uppercase
   Alt er scoped under .tt-program, så Divi ikke påvirkes.
   ========================================================================= */

.tt-program {
    --tt-brand: #09305d;
    --tt-brand-hover: #0c3f7a;
    --tt-accent: #4a6043;
    --tt-text: #222222;
    --tt-muted: #5f5f5f;
    --tt-border: #d9d4cc;
    --tt-bg-soft: #f8f5ef;
    --tt-white: #ffffff;
    --tt-radius: 2px;
    --tt-radius-img: 4px;
    --tt-wrap: 1280px;
    --tt-wrap-narrow: 1080px;
    --tt-gutter: clamp(16px, 4vw, 40px);
    --tt-gap: clamp(20px, 3vw, 36px);
    --tt-section-gap: clamp(48px, 7vw, 96px);
    --tt-focus: 3px solid var(--tt-accent);

    color: var(--tt-text);
    background: var(--tt-white);
    padding: clamp(36px, 6vw, 72px) var(--tt-gutter) clamp(56px, 8vw, 104px);
    overflow-x: clip;
}

/* Nulstil Divi's padding på typografi inden for vores område */
.tt-program h1,
.tt-program h2,
.tt-program h3,
.tt-program h4,
.tt-program p,
.tt-program ul,
.tt-program ol,
.tt-program dl,
.tt-program dd,
.tt-program figure {
    margin: 0;
    padding: 0;
}

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

.tt-program a {
    color: var(--tt-brand);
    text-decoration: underline;
    text-underline-offset: 0.14em;
    text-decoration-thickness: 1px;
}

.tt-program a:hover {
    color: var(--tt-brand-hover);
}

.tt-program :focus-visible {
    outline: var(--tt-focus);
    outline-offset: 3px;
}

.tt-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------------------------------
   Layout
   ---------------------------------------------------------------------- */

.tt-wrap {
    max-width: var(--tt-wrap);
    margin: 0 auto;
}

.tt-wrap--narrow {
    max-width: var(--tt-wrap-narrow);
}

.tt-page-header {
    max-width: 820px;
    margin-bottom: clamp(32px, 5vw, 56px);
}

.tt-kicker {
    display: block;
    margin-bottom: 12px;
    color: var(--tt-accent);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tt-page-title {
    margin: 0 0 14px;
    color: var(--tt-brand);
    font-size: clamp(38px, 5.2vw, 64px);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.005em;
    overflow-wrap: anywhere;
}

.tt-page-intro {
    max-width: 700px;
    color: var(--tt-text);
    font-size: clamp(19px, 1.6vw, 22px);
    line-height: 1.55;
}

.tt-page-intro p + p {
    margin-top: 0.8em;
}

/* Sektioner */
.tt-section + .tt-section {
    margin-top: var(--tt-section-gap);
}

.tt-section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 24px;
    margin-bottom: clamp(18px, 2.5vw, 28px);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tt-border);
}

.tt-section__title {
    color: var(--tt-brand);
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tt-section__aside {
    color: var(--tt-muted);
    font-size: 17px;
}

/* Grid */
.tt-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 44px) var(--tt-gap);
}

.tt-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 32px) var(--tt-gap);
}

.tt-grid--features {
    grid-template-columns: 1fr;
    gap: clamp(36px, 5vw, 64px);
}

@media (max-width: 980px) {
    .tt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tt-grid--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .tt-grid,
    .tt-grid--compact {
        grid-template-columns: 1fr;
    }
    .tt-grid--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -------------------------------------------------------------------------
   Kort (arrangement + udstilling)
   Roligt udtryk: billede, lille datolinje, titel, kort tekst – ingen bokse,
   kanter eller skygger. Hele kortet er klikbart via titel-linket.
   ---------------------------------------------------------------------- */

.tt-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tt-card__media {
    position: relative;
    aspect-ratio: 3 / 2;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: var(--tt-radius-img);
    background: var(--tt-bg-soft);
}

.tt-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

@media (hover: hover) {
    .tt-card:hover .tt-card__media img {
        transform: scale(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tt-card__media img {
        transition: none;
    }
    .tt-card:hover .tt-card__media img {
        transform: none;
    }
}

.tt-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tt-card__meta {
    color: var(--tt-accent);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.4;
}

.tt-card__title {
    color: var(--tt-brand);
    font-size: clamp(24px, 2.2vw, 30px);
    line-height: 1.12;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tt-card__title a {
    color: inherit;
    text-decoration: none;
}

/* Gør hele kortet klikbart uden ekstra links */
.tt-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.tt-card:hover .tt-card__title a,
.tt-card:focus-within .tt-card__title a {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.tt-card:focus-within {
    outline: var(--tt-focus);
    outline-offset: 6px;
    border-radius: var(--tt-radius-img);
}

.tt-card__title a:focus-visible {
    outline: none;
}

.tt-card__excerpt {
    color: var(--tt-text);
    font-size: 18px;
    line-height: 1.5;
}

.tt-card__details {
    color: var(--tt-muted);
    font-size: 17px;
    line-height: 1.5;
}

.tt-card__details span + span::before {
    content: "·";
    margin: 0 0.45em;
    color: var(--tt-border);
}

.tt-card__label {
    color: var(--tt-brand);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Kompakt (tidligere udstillinger/arrangementer) */
.tt-card--compact .tt-card__media {
    aspect-ratio: 4 / 3;
    margin-bottom: 12px;
}

.tt-card--compact .tt-card__title {
    font-size: 21px;
}

.tt-card--compact .tt-card__meta {
    font-size: 14px;
}

.tt-card--compact .tt-card__media img {
    filter: saturate(0.85);
}

/* Fremhævet kort (aktuel særudstilling) */
.tt-card--feature {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(20px, 4vw, 56px);
    align-items: center;
}

.tt-card--feature .tt-card__media {
    aspect-ratio: 16 / 10;
    margin-bottom: 0;
}

.tt-card--feature .tt-card__body {
    gap: 14px;
}

.tt-card--feature .tt-card__title {
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.02;
}

.tt-card--feature .tt-card__excerpt {
    font-size: clamp(18px, 1.5vw, 21px);
}

.tt-card--feature .tt-card__period {
    color: var(--tt-brand);
    font-size: clamp(19px, 1.6vw, 22px);
    font-weight: 700;
}

.tt-card--feature .tt-btn {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    margin-top: 6px;
}

@media (max-width: 820px) {
    .tt-card--feature {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------
   Knapper og links
   ---------------------------------------------------------------------- */

.tt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 50px;
    padding: 0.55em 1.5em;
    border: 2px solid var(--tt-brand);
    border-radius: var(--tt-radius);
    background: transparent;
    color: var(--tt-brand);
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tt-btn:hover,
.tt-btn:focus-visible {
    background: var(--tt-brand);
    color: var(--tt-white);
    text-decoration: none;
}

.tt-btn--primary {
    background: var(--tt-brand);
    color: var(--tt-white);
}

.tt-btn--primary:hover,
.tt-btn--primary:focus-visible {
    background: var(--tt-brand-hover);
    border-color: var(--tt-brand-hover);
}

.tt-btn--muted {
    border-color: var(--tt-border);
    color: var(--tt-muted);
}

.tt-btn--muted:hover,
.tt-btn--muted:focus-visible {
    border-color: var(--tt-brand);
    background: var(--tt-brand);
    color: var(--tt-white);
}

.tt-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}

.tt-backlink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: clamp(20px, 3vw, 32px);
    color: var(--tt-muted);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}

.tt-backlink::before {
    content: "←";
    font-size: 1.1em;
    line-height: 1;
}

.tt-backlink:hover {
    color: var(--tt-brand);
    text-decoration: underline;
}

.tt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: clamp(24px, 3vw, 36px);
}

.tt-more {
    display: flex;
    justify-content: center;
    margin-top: clamp(24px, 3vw, 36px);
}

/* -------------------------------------------------------------------------
   Filter (museum) – matcher dropdown-stilen på Kontakt-siden
   ---------------------------------------------------------------------- */

.tt-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: clamp(32px, 5vw, 56px);
}

.tt-filter__label {
    color: var(--tt-text);
    font-size: 18px;
    font-weight: 700;
}

.tt-filter__select-wrap {
    position: relative;
    min-width: 260px;
    max-width: 100%;
}

.tt-filter__select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 0 48px 0 16px;
    background: var(--tt-bg-soft);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    color: var(--tt-text);
    font-family: inherit;
    font-size: 18px;
    line-height: 1.3;
    cursor: pointer;
}

.tt-filter__select:hover {
    border-color: var(--tt-muted);
}

.tt-filter__select:focus-visible {
    outline: var(--tt-focus);
    outline-offset: 2px;
    border-color: var(--tt-brand);
    background: var(--tt-white);
}

.tt-filter__select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--tt-muted);
    border-bottom: 2px solid var(--tt-muted);
    transform: translateY(-75%) rotate(45deg);
    pointer-events: none;
}

/* Filter-tilstande */
.tt-card.is-hidden {
    display: none;
}

.tt-empty,
.tt-no-results {
    padding: 22px 24px;
    border-left: 3px solid var(--tt-accent);
    background: var(--tt-bg-soft);
    color: var(--tt-text);
    font-size: 18px;
    line-height: 1.5;
}

.tt-no-results {
    display: none;
}

.tt-section.is-empty .tt-no-results {
    display: block;
}

.tt-section.is-empty .tt-grid {
    display: none;
}

/* -------------------------------------------------------------------------
   Single (arrangement + udstilling)
   ---------------------------------------------------------------------- */

.tt-single__header {
    max-width: 900px;
    margin-bottom: clamp(24px, 3vw, 36px);
}

.tt-single__title {
    margin: 0 0 16px;
    color: var(--tt-brand);
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.02;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tt-single__period {
    color: var(--tt-brand);
    font-size: clamp(20px, 1.8vw, 24px);
    font-weight: 700;
}

.tt-single__status {
    display: inline-block;
    margin-left: 0.6em;
    color: var(--tt-accent);
    font-size: 0.8em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Meta-liste: label/værdi i en rolig linje under titlen */
.tt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 36px;
    margin-top: 6px;
    padding-top: 16px;
    border-top: 1px solid var(--tt-border);
}

.tt-meta__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tt-meta__label {
    color: var(--tt-accent);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tt-meta__value {
    color: var(--tt-text);
    font-size: 19px;
    line-height: 1.4;
}

.tt-meta__value--strong {
    color: var(--tt-brand);
    font-weight: 700;
}

.tt-single__hero {
    margin: clamp(24px, 3vw, 36px) 0 clamp(28px, 4vw, 48px);
    border-radius: var(--tt-radius-img);
    overflow: hidden;
    background: var(--tt-bg-soft);
}

.tt-single__hero img {
    width: 100%;
    height: auto;
}

.tt-single__hero figcaption {
    padding: 10px 0 0;
    color: var(--tt-muted);
    font-size: 16px;
}

.tt-single__intro {
    max-width: 800px;
    margin-bottom: clamp(24px, 3vw, 40px);
    color: var(--tt-text);
    font-size: clamp(21px, 1.8vw, 25px);
    line-height: 1.5;
}

.tt-single__layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
}

.tt-single__layout--single {
    grid-template-columns: 1fr;
}

@media (max-width: 900px) {
    .tt-single__layout {
        grid-template-columns: 1fr;
    }
}

.tt-single__aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Brødtekst fra WYSIWYG */
.tt-prose {
    max-width: 760px;
    color: var(--tt-text);
    font-size: 20px;
    line-height: 1.65;
}

.tt-prose > * + * {
    margin-top: 1.1em;
}

.tt-prose h2,
.tt-prose h3,
.tt-prose h4 {
    color: var(--tt-brand);
    line-height: 1.15;
    font-weight: 700;
}

.tt-prose h2 {
    font-size: 1.5em;
    margin-top: 1.6em;
}

.tt-prose h3 {
    font-size: 1.25em;
    margin-top: 1.4em;
}

.tt-prose h4 {
    font-size: 1.1em;
}

.tt-prose ul,
.tt-prose ol {
    padding-left: 1.3em;
}

.tt-prose li + li {
    margin-top: 0.3em;
}

.tt-prose img {
    border-radius: var(--tt-radius-img);
}

.tt-prose blockquote {
    margin: 1.4em 0;
    padding-left: 1.2em;
    border-left: 3px solid var(--tt-accent);
    font-style: italic;
}

/* Infoboks (praktisk information) */
.tt-infobox {
    padding: clamp(20px, 2.5vw, 28px);
    border-radius: 12px;
    background: var(--tt-bg-soft);
    border: 1px solid var(--tt-border);
}

.tt-infobox__title {
    margin-bottom: 12px;
    color: var(--tt-brand);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tt-infobox .tt-prose {
    font-size: 18px;
    line-height: 1.55;
}

.tt-infobox .tt-actions {
    margin-top: 18px;
}

.tt-infobox .tt-btn {
    width: 100%;
}

/* Lille relateret-kort (fx udstilling på et arrangement) */
.tt-related-card {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.tt-related-card__media {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--tt-radius-img);
    background: var(--tt-bg-soft);
}

.tt-related-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tt-related-card__title {
    color: var(--tt-brand);
    font-size: 22px;
    line-height: 1.15;
    font-weight: 700;
}

.tt-related-card__title a {
    color: inherit;
    text-decoration: none;
}

.tt-related-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.tt-related-card:hover .tt-related-card__title a {
    text-decoration: underline;
}

.tt-related-card__meta {
    margin-top: 4px;
    color: var(--tt-muted);
    font-size: 16px;
}

/* Galleri */
.tt-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--tt-gap);
    margin-top: clamp(32px, 4vw, 48px);
}

.tt-gallery__item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--tt-radius-img);
    background: var(--tt-bg-soft);
}

.tt-gallery__item figcaption {
    padding-top: 8px;
    color: var(--tt-muted);
    font-size: 16px;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .tt-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Relaterede sektioner nederst på single */
.tt-single__related {
    margin-top: var(--tt-section-gap);
    padding-top: clamp(32px, 4vw, 48px);
    border-top: 1px solid var(--tt-border);
}

.tt-single__footer {
    margin-top: clamp(40px, 5vw, 64px);
}

/* -------------------------------------------------------------------------
   Mobil
   ---------------------------------------------------------------------- */

@media (max-width: 767px) {
    .tt-btn {
        width: 100%;
    }

    .tt-actions {
        flex-direction: column;
    }

    .tt-filter__select-wrap {
        width: 100%;
    }

    .tt-meta {
        gap: 14px 24px;
    }

    .tt-related-card {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .tt-gallery {
        grid-template-columns: 1fr;
    }

    .tt-card--compact .tt-card__title {
        font-size: 19px;
    }
}
