/* Junglefun Åbningstider – fælles CSS for [junglefun_kalender] og [aabningstider-status] på alle sprog.
   Omgivelserne følger sidens CSS (arver farve og skrift, flader af currentColor).
   Statusfarverne er uændrede fra version 4.1.0. */

:is(.jfc-wrapper, .jfc-status-list) {
    /* Statusfarver – UÆNDREDE */
    --jfc-open: #bfe3c7;          --jfc-open-line: #7fbe8e;
    --jfc-special: #ffdca8;       --jfc-special-line: #ffb84a;
    --jfc-closed: #f1f3f0;        --jfc-closed-line: #dde2da;
    --jfc-pending: #f1f3f0;       --jfc-pending-line: #dde2da;
    --jfc-note: #d9480f;
    --jfc-today: #d9480f;         --jfc-today-text: #fff;
    --jfc-day-text: #1b2a21;      --jfc-day-num: #0f4d2e;
    --jfc-badge-open: #ffd166;    --jfc-badge-open-text: #0f4d2e;
    --jfc-badge-closed: #d9480f;  --jfc-badge-closed-text: #fff;
    --jfc-badge-pending: #ffdca8; --jfc-badge-pending-text: #1b2a21;
    --jfc-closed-text: #d9534f;   --jfc-pending-text: #856404;
    /* "I dag" i statuslisten – UÆNDRET */
    --jfc-hl-bg: #0f4d2e; --jfc-hl-line: #ffd166; --jfc-hl-label: #ffd166; --jfc-hl-sub: #e6f7e2;
    --jfc-hl-text: #fff;  --jfc-hl-closed: #ff8884; --jfc-hl-pending: #ffc107;
    /* Omgivelser – følger sidens farve */
    --jfc-surface: color-mix(in srgb, currentColor 8%, transparent);
    --jfc-line: color-mix(in srgb, currentColor 25%, transparent);
    box-sizing: border-box;
    color: inherit;
    font-family: inherit;
    line-height: 1.35;
}
:is(.jfc-wrapper, .jfc-status-list) :is(*, ::before, ::after) { box-sizing: inherit; }

/* ===== Kalender – mobil først ===== */
.jfc-wrapper {
    container-type: inline-size;
    inline-size: 100%;
    max-inline-size: 53.125rem;
    margin-inline: auto;
    padding: var(--jf-space-xs, 0.5rem);
    background: var(--jfc-surface);
    border: 0.0625rem solid var(--jfc-line);
    border-radius: var(--jf-radius, 1rem);
    font-size: var(--jf-fs-body, 1rem);
}
.jfc-wrapper.jfc-loading { opacity: 0.5; pointer-events: none; }

.jfc-header {
    display: grid;
    gap: 0.75rem;
    padding: 0.875rem;
    margin-block-end: 0.75rem;
    background: var(--jfc-surface);
    border-radius: var(--jf-radius, 1rem);
}
.jfc-header-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.625rem;
    padding-block-end: 0.75rem;
    border-block-end: 0.0625rem solid var(--jf-line, var(--jfc-line));
}
.jfc-header-left { display: flex; align-items: center; gap: 0.625rem; min-inline-size: 0; }
.jfc-leaf { flex: none; inline-size: 1.75rem; block-size: 1.75rem; }
.jfc-title, .jfc-month-label, .jfc-note-date, .jfc-badge, .jfc-day-num { font-family: var(--jf-font-head, inherit); font-weight: 600; }
.jfc-title { font-size: 1.3em; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.jfc-sub { font-size: 0.85em; }
.jfc-status-block { text-align: end; }
.jfc-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: var(--jf-radius-pill, 62rem);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.jfc-badge-open { background: var(--jfc-badge-open); color: var(--jfc-badge-open-text); }
.jfc-badge-closed { background: var(--jfc-badge-closed); color: var(--jfc-badge-closed-text); }
.jfc-badge-pending { background: var(--jfc-badge-pending); color: var(--jfc-badge-pending-text); }
.jfc-badge-hours { margin-block-start: 0.25rem; font-size: 0.85em; font-weight: 700; }

.jfc-nav { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.jfc-month-label { flex: 1 1 auto; min-inline-size: 0; text-align: center; font-size: 1.25em; }
.jfc-wrapper :is(.jfc-nav-btn, .jfc-note-close) {
    display: inline-grid;
    place-items: center;
    flex: none;
    inline-size: var(--jf-tap, 2.75rem);
    block-size: var(--jf-tap, 2.75rem);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 14%, transparent);
    color: inherit;
    font-family: inherit;
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s;
}
.jfc-wrapper .jfc-note-close { font-size: 1.25rem; }
.jfc-wrapper :is(.jfc-nav-btn, .jfc-note-close):hover { background: color-mix(in srgb, currentColor 28%, transparent); }
.jfc-wrapper :is(.jfc-nav-btn, .jfc-note-close, .jfc-day-hasnote):focus-visible { outline: 0.1875rem solid currentColor; outline-offset: 0.125rem; }

/* Forklaring (samme farver som dagsfelterne) */
.jfc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-block-end: 0.75rem;
    padding-inline: 0.125rem;
    font-size: 0.85em;
    font-weight: 600;
}
.jfc-legend-item { display: flex; align-items: center; gap: 0.375rem; }
.jfc-dot { inline-size: 0.75rem; block-size: 0.75rem; border-radius: 50%; background: var(--fill); border: 0.0625rem solid var(--line); }
.jfc-dot-open { --fill: var(--jfc-open); --line: var(--jfc-open-line); }
.jfc-dot-override { --fill: var(--jfc-special); --line: var(--jfc-special-line); }
.jfc-dot-note { --fill: var(--jfc-note); border: 0; }

/* Kalendergitter: 7 kolonner, tider stables på mobil */
.jfc-grid-matrix { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.125rem; margin-block-end: 0.25rem; }
.jfc-wd-cell { padding-block: 0.25rem; text-align: center; font-size: 0.625rem; font-weight: 700; }
.jfc-day-card {
    --fill: var(--jfc-closed);
    --line: var(--jfc-closed-line);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.125rem;
    min-inline-size: 0;
    min-block-size: 3.625rem;
    padding: 0.3125rem 0 0.25rem; /* ingen sidepolstring på mobil, så "Afventer" kan stå på én linje ved 360 px */
    text-align: center;
    background: var(--fill);
    border: 0.0625rem solid var(--line);
    border-radius: 0.5rem;
}
.jfc-day-open { --fill: var(--jfc-open); --line: var(--jfc-open-line); }
.jfc-day-override { --fill: var(--jfc-special); --line: var(--jfc-special-line); }
.jfc-day-pending { --fill: var(--jfc-pending); --line: var(--jfc-pending-line); }
.jfc-day-empty { background: none; border: 0; }
.jfc-day-num { padding-inline: 0.125rem; text-align: start; font-size: 0.75rem; line-height: 1.1; color: var(--jfc-day-num); }
.jfc-day-hours { font-size: 0.5625rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; color: var(--jfc-day-text); }
.jfc-day-t { display: block; white-space: nowrap; font-size: 0.625rem; }
.jfc-day-sep, .jfc-day-full { display: none; }

/* I dag: kant og mærke i statusfarven */
.jfc-day-today { z-index: 2; border: 0.125rem solid var(--jfc-today); }
.jfc-day-today .jfc-day-num { color: var(--jfc-today); }
.jfc-day-today::after {
    content: attr(data-today);
    position: absolute;
    top: -0.4375rem;
    left: 50%;
    translate: -50% 0;
    padding: 0.125rem 0.25rem;
    background: var(--jfc-today);
    color: var(--jfc-today-text);
    border-radius: var(--jf-radius-pill, 62rem);
    font-size: 0.4375rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
}

/* Bemærkning: prik, valgt dag og infopanel */
.jfc-day-hasnote { cursor: pointer; }
.jfc-day-dot { position: absolute; top: 0.25rem; right: 0.25rem; inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%; background: var(--jfc-note); }
.jfc-day-selected { outline: 0.125rem solid currentColor; outline-offset: 0.0625rem; }
.jfc-note-panel { margin-block-start: 0.625rem; padding: 0.875rem; background: var(--jfc-surface); border-radius: var(--jf-radius, 1rem); }
.jfc-note-panel[hidden] { display: none; }
.jfc-note-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.625rem; }
.jfc-note-date { font-size: 1.15em; }
.jfc-note-hours { margin-block-start: 0.125rem; font-weight: 700; }
.jfc-note-text { margin: 0.625rem 0 0; padding: 0; font-size: 1.05em; line-height: 1.5; }

/* Tablet: større felter, tider på én linje */
@media (min-width: 48rem) {
    .jfc-wrapper { padding: 1.25rem; }
    .jfc-grid-matrix { gap: 0.375rem; }
    .jfc-wd-cell { padding-block: 0.375rem; font-size: clamp(0.75rem, 1.7cqw, 1rem); letter-spacing: 0.03em; }
    .jfc-day-card { min-block-size: 5.25rem; padding: 0.5rem 0.25rem; gap: 0.25rem; border-radius: 0.75rem; }
    .jfc-day-num { font-size: clamp(0.875rem, calc(1.9cqw + 0.0625rem), 1.125rem); }
    .jfc-day-hours { font-size: clamp(0.6875rem, calc(2.05cqw - 0.15625rem), 1rem); white-space: nowrap; }
    .jfc-day-t { display: inline; font-size: inherit; }
    .jfc-day-sep { display: inline; margin-inline: 0.2em; }
    .jfc-day-full { display: inline; }
    .jfc-day-short { display: none; }
    .jfc-day-dot { position: static; display: inline-block; margin-inline-start: 0.375rem; vertical-align: middle; inline-size: 0.5625rem; block-size: 0.5625rem; }
    .jfc-day-today::after { padding: 0.125rem 0.375rem; font-size: 0.625rem; }
    .jfc-note-panel { padding: 1.125rem 1.25rem; margin-block-start: 0.875rem; }
}

/* Desktop */
@media (min-width: 64rem) {
    .jfc-wrapper { font-size: var(--jf-fs-lead, 1.125rem); }
    .jfc-day-card { min-block-size: 6rem; }
    .jfc-day-today::after { font-size: 0.6875rem; }
}

/* Bred kalender: "i dag"-mærket i hjørnet, så det aldrig dækker datoen */
@container (min-width: 50rem) {
    .jfc-day-today::after { top: 0.375rem; right: 0.375rem; left: auto; translate: none; padding: 0.125rem 0.3125rem; border-radius: 0.1875rem; }
}

/* ===== Statusliste: i dag, i morgen, overmorgen =====
   Størrelser i em (følger omgivelsernes skriftstørrelse), da sidens rod kan være 10 px. */
.jfc-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.625em;
    inline-size: 100%;
    max-inline-size: 848px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}
.jfc-status-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.25em 1em;
    margin: 0;
    padding: 0.75em 0.9375em;
    background: var(--jfc-surface);
    border: 1px solid var(--jfc-line);
    border-radius: var(--jf-radius, 16px);
    font-size: 1em;
}
.jfc-status-left { display: flex; align-items: center; gap: 0.9375em; min-inline-size: 0; }
.jfc-status-right { min-inline-size: 0; text-align: end; overflow-wrap: anywhere; }
.jfc-status-day-label, .jfc-status-hours { font-size: 0.9375em; font-weight: 800; }
.jfc-status-date-sub { font-size: 0.8125em; font-weight: 600; }
.jfc-status-note { display: block; margin-block-start: 0.125em; font-size: 0.75em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.jfc-status-closed-text { color: var(--jfc-closed-text); }
.jfc-status-pending-text { color: var(--jfc-pending-text); }
.jfc-status-today-highlight { background: var(--jfc-hl-bg); border: 0.125rem solid var(--jfc-hl-line); color: var(--jfc-hl-text); }
.jfc-status-today-highlight :is(.jfc-status-day-label, .jfc-status-note) { color: var(--jfc-hl-label); }
.jfc-status-today-highlight .jfc-status-date-sub { color: var(--jfc-hl-sub); opacity: 0.9; }
.jfc-status-today-highlight .jfc-status-closed-text { color: var(--jfc-hl-closed); }
.jfc-status-today-highlight .jfc-status-pending-text { color: var(--jfc-hl-pending); }

@media (min-width: 30rem) {
    .jfc-status-item { padding: 0.875em 1.25em; }
    .jfc-status-day-label, .jfc-status-hours { font-size: 1em; }
}

/* ===== "Se hele måneden": knap og dialog =====
   Størrelser i px/em (ikke rem), da sidens rod-skriftstørrelse varierer. */
/* Liste + knap i én kolonne – knappen står altid under "Overmorgen", også når
   shortcoden ligger i en Bricks-container med flex-række. */
.jfc-status-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 100%;
    inline-size: 100%;
    min-inline-size: 0;
}
.jfc-status-wrap > .jfc-status-list { margin-inline: auto; }

.jfc-modal-host {
    /* Dialogens farver – kan overskrives fra siden */
    --jfc-dialog-bg: #fff;
    --jfc-dialog-text: #1b2a21;
    --jfc-dialog-backdrop: rgb(0 0 0 / 0.6);
    box-sizing: border-box;
    inline-size: 100%;
    max-inline-size: 848px;
    margin: 0.75em auto 0;
    text-align: center;
    font-size: 1em;
}
.jfc-modal-host[hidden] { display: none; }
.jfc-modal-host :is(*, ::before, ::after) { box-sizing: border-box; }

.jfc-month-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-inline-size: 100%;
    min-block-size: 44px;
    margin: 0;
    padding: 0.5em 1.25em;
    border: 2px solid currentColor;
    border-radius: var(--jf-radius-pill, 999px);
    background: transparent;
    color: inherit;
    font-family: var(--jf-font-head, inherit);
    font-size: 1em;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    white-space: normal;      /* lange oversættelser (tysk) må knække pænt på smalle skærme */
    overflow-wrap: break-word;
    cursor: pointer;
    transition: background-color 0.2s;
}
.jfc-month-btn:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.jfc-month-btn:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

.jfc-dialog {
    inline-size: min(720px, 100% - 32px);
    max-inline-size: none;
    max-block-size: 90vh;
    max-block-size: 90dvh;
    margin: auto;
    padding: 0;               /* klik på selve <dialog> = klik på baggrunden */
    overflow: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: var(--jf-radius, 16px);
    background: var(--jfc-dialog-bg);
    color: var(--jfc-dialog-text);
    text-align: start;
    box-shadow: 0 20px 60px rgb(0 0 0 / 0.35);
}
.jfc-dialog[open] { animation: jfc-dialog-in 0.2s ease-out; }
.jfc-dialog::backdrop { background: var(--jfc-dialog-backdrop, rgb(0 0 0 / 0.6)); }
@keyframes jfc-dialog-in { from { opacity: 0; transform: translateY(12px); } }

.jfc-dialog-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    padding: 8px 8px 0;
    background: var(--jfc-dialog-bg);
}
.jfc-dialog-close {
    display: inline-grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 12%, transparent);
    color: inherit;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.jfc-dialog-close:hover { background: color-mix(in srgb, currentColor 24%, transparent); }
.jfc-dialog-close:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.jfc-dialog-body { padding: 4px 12px 12px; }
.jfc-dialog-body .jfc-wrapper { max-inline-size: none; }
.jfc-dialog-msg { margin: 0; padding: 2em 1em; text-align: center; font-weight: 600; }
.jfc-dialog-error { color: var(--jfc-closed-text, #d9534f); }

html.jfc-dialog-open { overflow: hidden; } /* ingen scroll bag dialogen */

/* Mobil: fuld skærm */
@media (max-width: 599px) {
    .jfc-dialog {
        inline-size: 100%;
        block-size: 100%;
        max-block-size: none;
        border-radius: 0;
    }
    .jfc-dialog-body { padding: 4px 8px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .jfc-wrapper :is(.jfc-nav-btn, .jfc-note-close), .jfc-month-btn { transition: none; }
    .jfc-dialog[open] { animation: none; }
}
