/* Tijdbalk — base styles */

/* --tijdbalk-accent is set per-site via an inline <style> in wp_head
   (see includes/layout.php), based on the TIJDBALK_ACCENT_COLOR config
   constant. Fallback here covers the rare case that ran before wp_head.
   Selector is scoped to .site-branding so its specificity (0,0,2,1) beats
   the GeneratePress theme's own ".main-title a" rule (0,0,1,1) regardless
   of stylesheet load order — this stayed unnoticed pre-refactor because
   nobody had checked the rendered color recently. */
.site-branding .main-title a {
    color: var(--tijdbalk-accent, #3a4a5a);
}

/* GeneratePress renders an uploaded custom_logo at its native pixel size
   unless a Logo Width is set in the Customizer — we set the logo via
   WP-CLI on deploy, bypassing the Customizer, so without this the source
   image (sized for crisp favicon export) renders edge-to-edge. */
.site-logo img {
    max-height: 60px;
    width: auto;
}

.tijdbalk-tabel {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

/* Ruimte tussen het door DataTables ingevoegde zoekveld en de tabel eronder. */
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1em;
}

.tijdbalk-bron-events-kop {
    margin-top: 2em;
}

.tijdbalk-tabel th,
.tijdbalk-tabel td {
    padding: 6px 10px;
    border: 1px solid #ddd;
    vertical-align: top;
}

.tijdbalk-tabel th {
    background: #f0f0f0;
    font-weight: bold;
}

.tijdbalk-th-datum,
.tijdbalk-td-datum {
    white-space: nowrap;
}

.tijdbalk-toc {
    background: #f5f5f5;
    border-left: 4px solid var(--tijdbalk-accent, #3a4a5a);
    border-radius: 3px;
    padding: 0.8em 1.2em;
    margin: 0 0 1.5em;
}

.tijdbalk-toc-title {
    font-weight: bold;
    margin: 0 0 0.4em;
}

.tijdbalk-toc ul {
    margin: 0;
    padding-left: 1.2em;
}

.tijdbalk-toc li {
    margin: 0.15em 0;
}

.tijdbalk-toc a {
    text-decoration: none;
}

.tijdbalk-toc a:hover {
    text-decoration: underline;
}

.tijdbalk-kenmerk {
    background-color: #D56F3F;
    color: #fff;
    padding: 8px 12px;
    margin: 1em 0;
    border-radius: 3px;
}

.tijdbalk-kenmerk a {
    color: #fff;
}

.tijdbalk-nav {
    margin: 0.5em 0 1em;
}

.tijdbalk-infobox {
    border-collapse: collapse;
    margin-bottom: 1em;
    width: auto;
    border: none;
    outline: none;
    box-shadow: none;
}

.tijdbalk-infobox th,
.tijdbalk-infobox td {
    padding: 4px 16px 4px 0;
    border: none;
    outline: none;
    box-shadow: none;
    text-align: left;
}

.tijdbalk-infobox th {
    background: none;
    font-weight: bold;
    white-space: nowrap;
}

/* Subject grid */
.tijdbalk-onderwerpen-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 1.5em;
}

.tijdbalk-onderwerp-item {
    width: 160px;
    text-align: center;
}

.tijdbalk-onderwerp-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tijdbalk-onderwerp-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.tijdbalk-onderwerp-item span {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
}

.tijdbalk-tags {
    margin: 1em 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.tijdbalk-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 999px;
    text-decoration: none;
    color: inherit;
}

.tijdbalk-tag:hover {
    background: #fbe4e2;
    border-color: var(--tijdbalk-accent);
    color: var(--tijdbalk-accent);
}

.tijdbalk-eeuwnav {
    margin: 0.5em 0 1em;
    line-height: 1.8;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tijdbalk-eeuwnav-btn {
    display: inline-block;
    padding: 2px 9px;
    font-size: 0.75em;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 999px;
    text-decoration: none;
    color: inherit;
}

.tijdbalk-eeuwnav-btn:hover {
    background: #fbe4e2;
    border-color: var(--tijdbalk-accent);
    color: var(--tijdbalk-accent);
}

.tijdbalk-eeuwnav-btn-current {
    background: var(--tijdbalk-accent);
    border-color: var(--tijdbalk-accent);
    color: #fff;
}

/* Vorige/volgende-navigatie op de gebeurtenis-pagina (tijdbalk-nav.js) en
   de highlight van de context (onderwerp/eeuw/bron) waarop die knoppen
   navigeren — dezelfde accentkleur, zodat het verband zichtbaar is. */
.tijdbalk-prevnext {
    margin: 0.5em 0 1em;
    display: flex;
    gap: 8px;
}

.tijdbalk-prevnext-btn {
    display: inline-block;
    padding: 1px 7px;
    font-size: 0.7em;
    border: 1px solid #ddd;
    border-radius: 999px;
    text-decoration: none;
    color: inherit;
    background: #f0f0f0;
}

.tijdbalk-tag.tijdbalk-context-actief,
.tijdbalk-eeuwnav-btn.tijdbalk-context-actief,
.tijdbalk-prevnext-btn.tijdbalk-context-actief {
    background: var(--tijdbalk-accent);
    border-color: var(--tijdbalk-accent);
    color: #fff;
}

.tijdbalk-bronnen-list li.tijdbalk-context-actief {
    border-left: 3px solid var(--tijdbalk-accent);
    padding-left: 8px;
    background: rgba(0, 0, 0, 0.04);
}

.tijdbalk-periodes {
    columns: 3;
    list-style: none;
    padding: 0;
}

.tijdbalk-onderwerpen-lijst {
    line-height: 2;
}

.tijdbalk-geen-wijzigingslog {
    color: #767676;
    font-style: italic;
}

/* Click-to-enlarge lightbox for content images (see tijdbalk-lightbox.js) */
a.tijdbalk-lightbox {
    display: inline-block;
}

.entry-content img {
    cursor: zoom-in;
}

.tijdbalk-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    cursor: zoom-out;
    padding: 2rem;
    box-sizing: border-box;
}

.tijdbalk-lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

.tijdbalk-lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
}
