/* Application styles on top of Tabler 1.6. Colours, fonts and corners live in theme.css. */

/* ------------------------------------ Icons ------------------------------------ */
.icon-14px { width: 14px !important; height: 14px !important; }
.icon-16px { width: 16px !important; height: 16px !important; }
.icon-18px { width: 18px !important; height: 18px !important; }
.icon-20px { width: 20px !important; height: 20px !important; }
.icon-24px { width: 24px !important; height: 24px !important; }

/* Small round badge with an icon on top of a thumbnail */
.icon-overlay {
    top: -5px;
    right: -5px;
    padding: 5px;
    line-height: 0;
    border-radius: 50%;
    color: var(--tblr-body-color);
    background: rgba(var(--tblr-body-bg-rgb), 0.8);
}

/* ------------------------------------ Utilities ------------------------------------ */
/* Lets a flex item shrink below its content, so long text wraps instead of running out of its card (not in Tabler) */
.min-w-0 { min-width: 0; }

/* ------------------------------------ Collapsible card headers ------------------------------------ */
/* The chevron at the end of a header that folds a card open turns down when it is open */
.card-header [data-bs-toggle="collapse"] .icon.ms-auto { transition: transform .15s; }
.card-header [data-bs-toggle="collapse"][aria-expanded="true"] .icon.ms-auto { transform: rotate(90deg); }

/* ------------------------------------ Presences ------------------------------------ */
/* Counts and save button stay in view while scrolling through the musicians;
   above the checked status buttons (z-index 5 in Tabler), below the top bar and menus */
[data-controller="presences"] .card-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background-color: var(--tblr-bg-surface);
}

/* Breaks: small grey details under the name on a smartphone, ordinary columns from tablet width on */
.breaks-list .breaks-actions { width: 5rem; flex-shrink: 0; justify-content: flex-end; }
.breaks-list .breaks-meta { font-size: .8125rem; color: var(--tblr-secondary-color); }
.breaks-list .breaks-reason { font-size: .8125rem; margin-top: .25rem; }
@media (min-width: 768px) {
    .breaks-list .breaks-meta,
    .breaks-list .breaks-reason { font-size: inherit; color: inherit; margin-top: 0; }
}

/* ------------------------------------ Archive ------------------------------------ */
.audio-player {
    width: 100%;
    border-radius: 6px;
}

/* ------------------------------------ Statistics ------------------------------------ */
/* Canvas of a UX Chart.js chart (render_chart(chart, {class: 'chart-lg'})) */
.chart-lg {
    height: 300px;
}

@media (min-width: 992px) {
    .chart-lg {
        height: 450px;
    }
}

#map {
    height: 500px;
    width: 100%;
}

/* Presence grid: one coloured cell per rehearsal */
.presence-table {
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 12px;
    color: var(--tblr-secondary-color);
}

.presence-table th {
    text-align: center;
    padding: 4px;
}

.presence-table td {
    border: 1px solid var(--tblr-border-color);
    padding: 2px 10px;
}

.presence-table td.present,
.presence-table td.excused,
.presence-table td.break,
.presence-table td.absent {
    width: 23px;
    height: 23px;
}

.presence-table td.present { background-color: #00cc00; }
.presence-table td.excused { background-color: #ff9900; }
.presence-table td.break { background-color: #cdcdcd; }
.presence-table td.absent { background-color: #ffffff; }


/* ------------------------------------ Dashboard ------------------------------------ */
/* Based on the Lovable design (resources/ensemble-nexus/src/pages/Dashboard.tsx) */
.dashboard {
    --hs-primary-soft: color-mix(in srgb, var(--tblr-primary) 10%, transparent);
    --hs-primary-border: color-mix(in srgb, var(--tblr-primary) 30%, transparent);
}

.dashboard .card-body {
    padding: 1.25rem;
}


/* Section title: icon, title and an optional link on the right */
.dash-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dash-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.dash-title > svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--tblr-primary);
}

.dash-title-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-inline-start: auto;
    font-size: 0.75rem;
    color: var(--tblr-secondary);
}

.dash-title-link:hover {
    color: var(--tblr-primary);
    text-decoration: none;
}

.dash-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--tblr-secondary);
}

.dash-meta svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

/* Scrollable list (announcements, calendar events) */
.dash-scroll {
    max-height: 340px;
    padding-inline-end: 0.25rem;
    overflow-y: auto;
}

/* Bordered item (announcement, calendar event) */
.dash-item {
    padding: 1rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    transition: border-color 0.15s;
}

.dash-item + .dash-item {
    margin-top: 1rem;
}

.dash-item:hover {
    border-color: var(--hs-primary-border);
}

.dash-item-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
}

.dash-item-body {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--tblr-secondary);
}

.dash-item-body > :last-child {
    margin-bottom: 0;
}

/* Pill badge: navy tint (rehearsal), gold (concert), grey (other) */
.dash-badge {
    flex-shrink: 0;
    margin-top: 0.125rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--tblr-primary);
    background: var(--hs-primary-soft);
    border-radius: var(--tblr-border-radius-pill);
}

.dash-badge-accent {
    color: light-dark(var(--hs-navy), var(--hs-gold));
    background: color-mix(in srgb, var(--hs-gold) 25%, transparent);
}

.dash-badge-muted {
    color: var(--tblr-secondary);
    background: var(--tblr-bg-surface-secondary);
}

/* Recent activity */
.dash-activity-item {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.dash-activity-item + .dash-activity-item {
    margin-top: 1rem;
}

.dash-activity-item .dash-meta {
    margin-top: 0.125rem;
}

.dash-icon-box {
    display: inline-flex;
    flex-shrink: 0;
    align-self: flex-start;
    padding: 0.5rem;
    color: var(--tblr-secondary);
    background: var(--tblr-bg-surface-secondary);
    border-radius: var(--tblr-border-radius);
}

.dash-icon-box svg {
    width: 1rem;
    height: 1rem;
}

/* Band cards */
a.card.dash-band,
a.card.dash-shortcut {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s;
}

a.card.dash-band:hover,
a.card.dash-shortcut:hover {
    border-color: var(--hs-primary-border);
}

.dash-band-name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.dash-band-count {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--tblr-secondary);
}

.dash-band-count span {
    margin-inline-end: 0.125rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tblr-body-color);
}

.dash-band-total {
    background: color-mix(in srgb, var(--tblr-primary) 5%, var(--tblr-bg-surface));
    border-color: color-mix(in srgb, var(--tblr-primary) 20%, transparent);
}

.dash-band-total .dash-band-name,
.dash-band-total .dash-band-count span {
    color: var(--tblr-primary);
}

/* Calendar: month on the left, events from the selected day on the right */
.dash-calendar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .dash-calendar {
        grid-template-columns: auto 1fr;
    }
}

.dash-cal-month {
    width: 16.5rem;
    max-width: 100%;
    margin-inline: auto;
}

.dash-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dash-cal-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.dash-cal-nav {
    display: inline-flex;
    padding: 0.25rem;
    color: var(--tblr-secondary);
    background: none;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-sm);
}

.dash-cal-nav:hover {
    color: var(--tblr-body-color);
    background: var(--tblr-bg-surface-secondary);
}

.dash-cal-nav svg {
    width: 1rem;
    height: 1rem;
}

.dash-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.125rem;
    text-align: center;
}

.dash-cal-weekday {
    padding-bottom: 0.375rem;
    font-size: 0.75rem;
    color: var(--tblr-secondary);
}

.dash-cal-day {
    aspect-ratio: 1;
    padding: 0;
    font-size: 0.8125rem;
    color: var(--tblr-body-color);
    background: none;
    border: 0;
    border-radius: var(--tblr-border-radius-sm);
}

.dash-cal-day:hover {
    background: var(--tblr-bg-surface-secondary);
}

.dash-cal-day.has-event {
    font-weight: 700;
    color: var(--tblr-primary);
    background: color-mix(in srgb, var(--tblr-primary) 20%, transparent);
}

.dash-cal-day.is-today {
    box-shadow: inset 0 0 0 1px var(--tblr-primary);
}

.dash-cal-day.is-selected {
    color: var(--tblr-primary-fg);
    background: var(--tblr-primary);
}

.dash-cal-events {
    min-width: 0;
}

.dash-cal-group + .dash-cal-group {
    margin-top: 1.25rem;
}

/* Day title stays visible while scrolling through its events */
.dash-cal-group-title {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 0 0.5rem;
    padding-block: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tblr-secondary);
    background: var(--tblr-bg-surface);
}

.dash-cal-event {
    padding: 0.75rem;
}

.dash-cal-event + .dash-cal-event {
    margin-top: 0.5rem;
}

.dash-cal-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.dash-cal-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Birthdays */
.dash-birthday {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    font-size: 0.875rem;
    border-radius: var(--tblr-border-radius);
    transition: background-color 0.15s;
}

.dash-birthday + .dash-birthday {
    margin-top: 0.25rem;
}

.dash-birthday:hover {
    background: color-mix(in srgb, var(--tblr-bg-surface-secondary) 50%, transparent);
}

.dash-avatar {
    --tblr-avatar-size: 2.25rem;
    margin: 0;
    object-fit: cover;
    box-shadow: none;
}

.dash-initials {
    font-weight: 700;
    color: var(--tblr-primary);
    background: var(--hs-primary-soft);
}

.dash-birthday-date {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--tblr-primary);
}

/* From the archive: picture with a gradient and a type label */
.dash-archive {
    display: block;
    overflow: hidden;
    color: inherit;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    transition: border-color 0.15s;
}

.dash-archive:hover {
    color: inherit;
    text-decoration: none;
    border-color: var(--hs-primary-border);
}

.dash-archive-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--tblr-bg-surface-secondary);
}

.dash-archive-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.dash-archive:hover .dash-archive-image img {
    transform: scale(1.05);
}

.dash-archive-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgb(0 0 0 / 60%), transparent);
}

.dash-archive-label {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(255 255 255 / 90%);
}

.dash-archive-icon {
    display: inline-flex;
    padding: 0.375rem;
    color: var(--hs-cream);
    background: color-mix(in srgb, var(--hs-navy) 90%, transparent);
    border-radius: var(--tblr-border-radius-sm);
}

.dash-archive-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Archive shortcuts */
.dash-shortcut .card-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.dash-shortcut-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tblr-secondary);
}

.dash-shortcut-count {
    margin-block: 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.dash-shortcut-icon {
    display: inline-flex;
    padding: 0.625rem;
    color: var(--tblr-primary);
    background: var(--hs-primary-soft);
    border-radius: var(--tblr-border-radius);
    transition: background-color 0.15s;
}

.dash-shortcut:hover .dash-shortcut-icon {
    background: color-mix(in srgb, var(--tblr-primary) 20%, transparent);
}

.dash-shortcut-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Video gallery: playlist next to the player, as high as the player on large screens */
.video-playlist-thumb {
    position: relative;
    flex-shrink: 0;
    width: 7.5rem;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: var(--tblr-border-radius);
}

.video-playlist-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-playlist-thumb .badge {
    position: absolute;
    right: 0.25rem;
    bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
    --tblr-badge-padding-y: 0.125rem;
    --tblr-badge-padding-x: 0.25rem;
}

@media (min-width: 992px) {
    .col-lg-4:has(> .video-playlist) {
        contain: size;
    }

    .video-playlist {
        height: 100%;
    }

    .video-playlist .list-group {
        flex: 1 1 0;
        min-height: 0;
    }
}

/* ------------------------------------ HR person page ------------------------------------ */
/* The persons list stays in view next to the person and scrolls on its own */
.hr-persons-list #persons_list { max-height: 40vh; }

@media (min-width: 992px) {
    .hr-persons-list { position: sticky; top: 4.5rem; }
    .hr-persons-list #persons_list { max-height: calc(100vh - 15rem); }
}

/* Memberships timeline: one row per circle, bars placed in % (HRPersonsController::membershipsTimeline) */
.hr-timeline-row { display: flex; align-items: center; min-height: 1.75rem; }
.hr-timeline-label { flex: 0 0 11rem; padding-right: .75rem; font-size: .8125rem; }
.hr-timeline-track { position: relative; flex: 1; height: 1.75rem; border-bottom: 1px dashed var(--tblr-border-color); }
.hr-timeline-bar {
    position: absolute;
    top: .4rem;
    height: .95rem;
    border-radius: 3px;
    background: #ff9900;
    opacity: .55;
}
.hr-timeline-bar-open { opacity: .95; }
.hr-timeline-axis { border-bottom: 0; height: 1.25rem; }
.hr-timeline-axis span {
    position: absolute;
    transform: translateX(-50%);
    font-size: .75rem;
    color: var(--tblr-secondary-color);
}
.hr-timeline-axis span:first-child { transform: none; }
@media (max-width: 575.98px) { .hr-timeline-label { flex-basis: 6rem; } }

/* ------------------------------------ Handbook ------------------------------------ */
/* The table of contents stays in view under the sticky header; a chapter opened by its link starts under the header too */
.handbook-chapter { scroll-margin-top: 5rem; }

@media (min-width: 992px) {
    .handbook-toc { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
}

/* ------------------------------------ Archive: years, posters ------------------------------------ */
/* A year opened by its link (video galleries, press articles) starts under the sticky header */
.archive-year { scroll-margin-top: 5rem; }

/* Posters in columns, each in its own shape */
.posters-grid { column-count: 2; column-gap: 1rem; }
.posters-grid > .card { break-inside: avoid; }
@media (min-width: 768px) { .posters-grid { column-count: 3; } }
@media (min-width: 992px) { .posters-grid { column-count: 4; } }
@media (min-width: 1400px) { .posters-grid { column-count: 6; } }

/* ------------------------------------ Music ------------------------------------ */
/* The player stays in view under the sticky header while scrolling through the songs; the song that plays is marked */
.music-player { position: sticky; top: 4.5rem; z-index: 2; }
[data-song].playing { background-color: var(--tblr-primary-lt); }
[data-song].playing [data-song-name] { color: var(--tblr-primary); font-weight: 500; }

/* ------------------------------------ Statistics ------------------------------------ */
/* The map of where the musicians live */
.statistics-map { height: 360px; }

/* ------------------------------------ Dashboard: concerts of friendly societies ------------------------------------ */
.dash-concert {
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    overflow: hidden;
    transition: border-color .15s;
}
.dash-concert:hover { border-color: var(--tblr-primary); }
.dash-concert-poster {
    display: block;
    aspect-ratio: 3 / 4;
    background: var(--tblr-bg-surface-secondary);
}
.dash-concert-poster img { width: 100%; height: 100%; object-fit: cover; }
.dash-concert-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    color: var(--tblr-secondary);
    font-size: 2.5rem;
}
/* At most 3 lines of the description on the dashboard */
.dash-concert-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ------------------------------------ Branding (house style) ------------------------------------ */
.branding-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
#naam, #orkesten, #logos, #kleuren, #lettertype, #schrijven, #downloads { scroll-margin-top: 5rem; }

/* A text to copy, with its button at the top right */
.branding-copy {
    display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem;
    padding: .75rem 1rem; border: 1px solid var(--tblr-border-color); border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface-secondary);
}

.branding-name { font-weight: 600; padding: .75rem 1rem; border-radius: var(--tblr-border-radius); background: var(--tblr-bg-surface-secondary); }
.branding-strike { text-decoration: line-through; text-decoration-color: var(--tblr-red); font-weight: 600; }
.branding-date { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* The logos are made for a light background: always shown on white, freely placed */
.branding-logo {
    display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; padding: 1.5rem;
    border: 1px solid var(--tblr-border-color); border-radius: var(--tblr-border-radius); background: #fff;
}
.branding-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.branding-swatch { height: 5rem; border: 1px solid var(--tblr-border-color); border-radius: var(--tblr-border-radius); }
.branding-combination {
    display: flex; align-items: center; justify-content: center; height: 4.5rem;
    border: 1px solid var(--tblr-border-color); border-radius: var(--tblr-border-radius); font-weight: 900; font-size: 1.25rem;
}

.branding-type-row { display: grid; gap: .25rem; padding: .75rem 0; border-bottom: 1px solid var(--tblr-border-color); }
.branding-type-row:last-child { border-bottom: 0; }
@media (min-width: 768px) {
    .branding-type-row { grid-template-columns: 14rem 1fr; align-items: baseline; gap: 1rem; }
}
.branding-logo-dark { background: #00144c; border-color: #00144c; }
/* A logo that still has to come */
.branding-logo-missing { flex-direction: column; gap: .25rem; border-style: dashed; background: transparent; color: var(--tblr-secondary); }
.branding-logo-missing.branding-logo-dark { background: #00144c; color: #c9cfdc; border-color: var(--tblr-border-color); }

/* ------------------------------------ Statutes ------------------------------------ */
@media (min-width: 992px) {
    .statutes-toc { position: sticky; top: 5rem; }
}
.statutes h2 { margin-top: 2.5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--tblr-border-color); }
.statutes h2:first-child { margin-top: 0; }
.statutes h3 { margin-top: 1.5rem; }
.statutes h2, .statutes h3 { scroll-margin-top: 5rem; }

/* Statistics, screens: the page views of a row split over the groups, with a gap between the parts */
.viewport-bar { display: flex; gap: 2px; height: .75rem; min-width: 6rem; }
.viewport-bar > span { min-width: 2px; border-radius: 2px; }
.viewport-bar > span:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.viewport-bar > span:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }

/* The text of a text editor field (see App\Service\RichText) */
.rich-text > :last-child { margin-bottom: 0; }
