/*! Datebook for Ghost v1.0.0 | (c) 2026 Plainwork Digital */
/* Size unit: 10px at a 16px root. Themes whose root is 62.5% (Source, Casper and most Ghost themes) set --dbk-u: 1rem. */
:root { --dbk-u: 0.625rem; }
/* Uses the host theme's colours: --ghost-accent-color (set by Ghost), plus Source's text/border variables with fallbacks. */
.dbk-box, .dbk-events, .dbk-next, .dbk-generic {
    --dbk-text: var(--color-primary-text, #15171a);
    --dbk-muted: var(--color-secondary-text, rgb(0 0 0 / 0.62));
    --dbk-border: var(--color-border, rgb(0 0 0 / 0.12));
    --dbk-soft: var(--color-lighter-gray, rgb(0 0 0 / 0.05));
    --dbk-accent: var(--ghost-accent-color, #1a5fb4);
}
.dbk-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Badge */
.dbk-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; width: calc(3.6 * var(--dbk-u)); min-height: calc(3.6 * var(--dbk-u)); border: 1px solid var(--dbk-border); border-radius: 8px; background: var(--dbk-soft); line-height: 1; color: var(--dbk-text); }
.dbk-badge-m { font-size: calc(1.15 * var(--dbk-u)); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dbk-accent); padding-top: calc(0.45 * var(--dbk-u)); }
.dbk-badge-d { font-size: calc(1.8 * var(--dbk-u)); font-weight: 700; padding: calc(0.25 * var(--dbk-u)) 0 calc(0.45 * var(--dbk-u)); }

/* Event box on a post */
.dbk-box { display: flex; gap: calc(1.4 * var(--dbk-u)); align-items: flex-start; margin: calc(2.4 * var(--dbk-u)) 0 0; padding: calc(1.6 * var(--dbk-u)) calc(1.8 * var(--dbk-u)); border: 1px solid var(--dbk-border); border-left: 4px solid var(--dbk-accent); border-radius: 8px; color: var(--dbk-text); font-size: calc(1.6 * var(--dbk-u)); }
.dbk-box .dbk-badge { width: calc(4.4 * var(--dbk-u)); min-height: calc(4.4 * var(--dbk-u)); }
.dbk-box-info { min-width: 0; }
.dbk-box p { margin: 0; }
.dbk-line + .dbk-line, .dbk-box .dbk-cal, .dbk-box .dbk-tznote { margin-top: calc(0.5 * var(--dbk-u)); }
.dbk-line-when { font-weight: 600; }
.dbk-line-where:empty { display: none; }
.dbk-status { display: inline-block; margin-bottom: calc(0.6 * var(--dbk-u)) !important; padding: calc(0.2 * var(--dbk-u)) calc(0.8 * var(--dbk-u)); border-radius: 99px; font-size: calc(1.3 * var(--dbk-u)); font-weight: 700; background: var(--dbk-soft); }
.dbk-box.is-today .dbk-status { background: var(--dbk-accent); color: #fff; }
.dbk-box.is-past, .dbk-box.is-cancelled { border-left-color: var(--dbk-border); }
.dbk-box.is-cancelled .dbk-line-when { text-decoration: line-through; }
.dbk-tznote { font-size: calc(1.35 * var(--dbk-u)); color: var(--dbk-muted); }
.dbk-cal { display: flex; flex-wrap: wrap; gap: calc(0.6 * var(--dbk-u)); align-items: center; font-size: calc(1.4 * var(--dbk-u)); }
.dbk-cal[hidden], .dbk-status[hidden], .dbk-tznote[hidden] { display: none; }
.dbk-cal-label { color: var(--dbk-muted); }
.dbk-cal-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 calc(1 * var(--dbk-u)); border: 1px solid var(--dbk-border); border-radius: 99px; color: var(--dbk-text); text-decoration: none; font-weight: 600; }
.dbk-cal-btn:hover { border-color: var(--dbk-accent); }

/* Lists */
.dbk-list { list-style: none; margin: 0; padding: 0; }
.dbk-item { border-bottom: 1px solid var(--dbk-border); }
.dbk-item-link { display: flex; gap: calc(1.4 * var(--dbk-u)); align-items: center; padding: calc(1.4 * var(--dbk-u)) calc(0.2 * var(--dbk-u)); color: var(--dbk-text); text-decoration: none; }
.dbk-item-link:hover .dbk-item-title { text-decoration: underline; text-underline-offset: 3px; }
.dbk-item-body { display: flex; flex-direction: column; gap: calc(0.3 * var(--dbk-u)); min-width: 0; }
.dbk-item-title { font-size: calc(1.8 * var(--dbk-u)); font-weight: 700; line-height: 1.25; }
.dbk-item-meta { font-size: calc(1.45 * var(--dbk-u)); color: var(--dbk-muted); }
.dbk-flag { color: #b3261e; text-transform: uppercase; font-size: calc(1.2 * var(--dbk-u)); letter-spacing: 0.04em; }
.has-light-text .dbk-flag { color: #ffb4ab; }
.dbk-item.is-cancelled .dbk-item-title { text-decoration: line-through; }
.dbk-item.is-past .dbk-badge { opacity: 0.7; }
.dbk-item.is-today .dbk-badge { border-color: var(--dbk-accent); box-shadow: inset 0 0 0 1px var(--dbk-accent); }
.dbk-item.is-invalid .dbk-item-meta, .dbk-box .is-invalid { color: #b3261e; }
.dbk-list-compact .dbk-item-title { font-size: calc(1.65 * var(--dbk-u)); }
.dbk-empty { margin: calc(1.6 * var(--dbk-u)) 0; color: var(--dbk-muted); font-size: calc(1.6 * var(--dbk-u)); }
.dbk-empty[hidden] { display: none; }
.dbk-linkbtn { padding: 0; border: 0; background: none; color: var(--dbk-accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* Events page */
.dbk-page-list { margin-top: calc(2.4 * var(--dbk-u)); margin-bottom: calc(8 * var(--dbk-u)); }
.dbk-nojs-title { font-size: calc(2 * var(--dbk-u)); margin: 0 0 calc(0.8 * var(--dbk-u)); }
.dbk-tabs { display: flex; flex-wrap: wrap; gap: calc(0.4 * var(--dbk-u)); margin-bottom: calc(1.2 * var(--dbk-u)); border-bottom: 1px solid var(--dbk-border); }
.dbk-tabs[hidden] { display: none; }
.dbk-tab { min-height: 44px; padding: 0 calc(1.4 * var(--dbk-u)); border: 0; border-bottom: 3px solid transparent; background: none; color: var(--dbk-muted); font: inherit; font-size: calc(1.6 * var(--dbk-u)); font-weight: 600; cursor: pointer; }
.dbk-tab[aria-selected="true"] { color: var(--dbk-text); border-bottom-color: var(--dbk-accent); }
.dbk-count { font-weight: 400; }
.dbk-tab:focus-visible, .dbk-navbtn:focus-visible, .dbk-linkbtn:focus-visible, .dbk-item-link:focus-visible, .dbk-cal-btn:focus-visible, .dbk-month-table a:focus-visible { outline: 3px solid var(--dbk-accent); outline-offset: 2px; }
.dbk-panel[hidden] { display: none; }
.dbk-events > .dbk-tznote { margin-top: calc(1.2 * var(--dbk-u)); }

/* Month view */
.dbk-month-nav { display: flex; align-items: center; justify-content: space-between; gap: calc(1 * var(--dbk-u)); margin-bottom: calc(1 * var(--dbk-u)); }
.dbk-month-title { margin: 0; font-size: calc(2 * var(--dbk-u)); }
.dbk-navbtn { min-width: 44px; min-height: 44px; border: 1px solid var(--dbk-border); border-radius: 8px; background: none; color: var(--dbk-text); font-size: calc(1.8 * var(--dbk-u)); cursor: pointer; }
.dbk-month { overflow-x: auto; }
.dbk-month-table { width: 100%; min-width: 560px; border-collapse: collapse; table-layout: fixed; font-size: calc(1.35 * var(--dbk-u)); }
.dbk-month-table th { padding: calc(0.6 * var(--dbk-u)) calc(0.4 * var(--dbk-u)); text-align: left; color: var(--dbk-muted); font-weight: 600; }
.dbk-month-table td { height: calc(7.2 * var(--dbk-u)); padding: calc(0.5 * var(--dbk-u)); vertical-align: top; border: 1px solid var(--dbk-border); }
.dbk-month-table td.is-blank { background: var(--dbk-soft); }
.dbk-month-table td.is-today .dbk-daynum { display: inline-flex; align-items: center; justify-content: center; min-width: calc(2.4 * var(--dbk-u)); height: calc(2.4 * var(--dbk-u)); border-radius: 99px; background: var(--dbk-accent); color: #fff; font-weight: 700; }
.dbk-month-table ul { list-style: none; margin: calc(0.3 * var(--dbk-u)) 0 0; padding: 0; }
.dbk-month-table li + li { margin-top: calc(0.3 * var(--dbk-u)); }
.dbk-month-table a { display: block; color: var(--dbk-text); font-weight: 600; line-height: 1.25; text-decoration: none; border-left: 3px solid var(--dbk-accent); padding-left: calc(0.4 * var(--dbk-u)); overflow-wrap: anywhere; }
.dbk-month-table a:hover { text-decoration: underline; }
.dbk-month-table a.is-cancelled { text-decoration: line-through; border-left-color: var(--dbk-border); }

/* Homepage block */
.dbk-next { margin: calc(4 * var(--dbk-u)) 0 0; }
.dbk-next[hidden] { display: none; }
.dbk-next-inner { max-width: 940px; }
.dbk-date.is-invalid { color: #b3261e; }
.dbk-next-head { display: flex; align-items: baseline; justify-content: space-between; gap: calc(1 * var(--dbk-u)); }
.dbk-next-all { font-size: calc(1.5 * var(--dbk-u)); font-weight: 600; color: var(--dbk-accent); text-decoration: none; }
.dbk-next:not(.dbk-ready) .dbk-item:nth-child(n+4) { display: none; }

/* Post card label (Source) */
.gh-card-event { display: inline-flex; gap: calc(0.5 * var(--dbk-u)); align-items: center; font-weight: 600; }

@media (max-width: 600px) {
    .dbk-box { flex-direction: column; padding: calc(1.4 * var(--dbk-u)); }
    .dbk-item-title { font-size: calc(1.65 * var(--dbk-u)); }
}
@media print {
    .dbk-cal, .dbk-tabs, .dbk-month-nav { display: none !important; }
}

/* Generic page template (custom-events.hbs from add-to-any-theme) */
.dbk-generic { max-width: calc(76 * var(--dbk-u)); margin: calc(6 * var(--dbk-u)) auto; padding: 0 calc(2 * var(--dbk-u)); color: var(--dbk-text); }
.dbk-generic-title { margin: 0 0 calc(1 * var(--dbk-u)); }
.dbk-generic-intro { margin: 0 0 calc(2.4 * var(--dbk-u)); color: var(--dbk-muted); }
