/*
 * CineKolkata Box Office – theme compatibility (Bimber and others).
 * Loaded after frontend.css. Neutralises theme/post-content styles that would
 * otherwise leak into .ckbo blocks (list bullets and counters, table stripes,
 * link underlines, heading fonts), and fits the box office pages into
 * Bimber's .g1-row layout. Nothing here targets elements outside .ckbo
 * except the plugin's own wrapper classes.
 */

/* ---------- Resets inside .ckbo (doubled class wins over .entry-content rules) ---------- */
.ckbo.ckbo ul,
.ckbo.ckbo ol { list-style: none; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
.ckbo.ckbo ul > li,
.ckbo.ckbo ol > li { margin-left: 0; padding-left: 0; list-style: none; }
.ckbo.ckbo ul > li::before,
.ckbo.ckbo ol > li::before,
.ckbo.ckbo ul > li::marker,
.ckbo.ckbo ol > li::marker { content: none; display: none; }
.ckbo.ckbo .ckbo-breadcrumbs li + li::before { content: "/"; display: inline; margin-right: 6px; color: #c3c3c8; }

.ckbo.ckbo table { border: 0; border-collapse: collapse; margin: 0; width: 100%; table-layout: auto; }
.ckbo.ckbo th,
.ckbo.ckbo td { border-left: 0; border-right: 0; border-top: 0; background-color: transparent; }
.ckbo.ckbo tr:nth-child(odd) > td,
.ckbo.ckbo tr:nth-child(even) > td { background-color: transparent; }
.ckbo.ckbo .ckbo-data-table tbody tr:hover > td,
.ckbo.ckbo .ckbo-data-table tbody tr:hover > th { background-color: var(--ckbo-soft); }
.ckbo.ckbo .ckbo-data-table tr.is-peak > td,
.ckbo.ckbo .ckbo-data-table tr.is-peak > th { background-color: #fff6f7; }

.ckbo.ckbo a { text-decoration: none; box-shadow: none; background-image: none; }
.ckbo.ckbo a.ckbo-btn,
.ckbo.ckbo .ckbo-btn { color: #fff; }
.ckbo.ckbo a.ckbo-link { border-bottom: 2px solid var(--ckbo-accent); }

.ckbo.ckbo h1, .ckbo.ckbo h2, .ckbo.ckbo h3 { font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; text-transform: none; color: var(--ckbo-ink); }
.ckbo.ckbo figure { margin: 0; }
.ckbo.ckbo dl, .ckbo.ckbo dd { margin-left: 0; }
.ckbo.ckbo p { margin-top: 0; }
.ckbo.ckbo select { -webkit-appearance: auto; appearance: auto; max-width: 100%; }
.ckbo.ckbo canvas { max-width: 100%; }

/* ---------- Bimber layout ---------- */
.ckbo-row .ckbo-content { min-width: 0; }
.ckbo-row .ckbo { padding-bottom: 40px; }
.ckbo-row .g1-row-inner { overflow: visible; }

/* With the optional theme sidebar the content column is narrower: use tablet layouts earlier. */
.ckbo-with-sidebar .ckbo-dash-grid { grid-template-columns: 1fr; }
.ckbo-with-sidebar .ckbo-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ckbo-with-sidebar .ckbo-report-head { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }

/* Rank Math breadcrumb trail, when it is the chosen source. */
.ckbo-breadcrumbs--rankmath { font-size: 13px; color: var(--ckbo-muted); margin: 0 0 18px; }
.ckbo-breadcrumbs--rankmath a { color: var(--ckbo-muted); }

/* ---------- Tablet (portrait iPad ~ 768–1024) ---------- */
@media (min-width: 721px) and (max-width: 1024px) {
	.ckbo-report-head { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
	.ckbo-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ckbo-charts { grid-template-columns: 1fr 1fr; }
}

/* ---------- Phones ---------- */
@media (max-width: 720px) {
	/* Section tabs wrap instead of being cut off. */
	.ckbo-subnav { flex-wrap: wrap; overflow: visible; }
	/* Rankings: keep rank, movie and the ranked figure; drop Year and Days. */
	.ckbo.ckbo .ckbo-rank-table th:nth-child(3),
	.ckbo.ckbo .ckbo-rank-table td:nth-child(3),
	.ckbo.ckbo .ckbo-rank-table th:last-child,
	.ckbo.ckbo .ckbo-rank-table td:last-child { display: none; }
	.ckbo-rank-table th[scope=row] { min-width: 0; white-space: normal; }
	.ckbo.ckbo .ckbo-rank-table td.num { white-space: normal; }
	.ckbo.ckbo .ckbo-rank-table td.num .ckbo-tag { display: block; width: max-content; margin: 4px 0 0 auto; padding: 2px 7px; font-size: 0; letter-spacing: 0; line-height: 1.4; }
	.ckbo.ckbo .ckbo-rank-table td.num .ckbo-tag--override::after { content: "Override"; font-size: 9px; letter-spacing: .04em; }
	.ckbo.ckbo .ckbo-rank-table td.num .ckbo-tag--partial::after { content: "Partial"; font-size: 9px; letter-spacing: .04em; }
	/* Filters two per row. */
	.ckbo-filter { display: grid; grid-template-columns: 1fr 1fr; }
	.ckbo-filter label { flex: none; }
	.ckbo-filter .ckbo-btn { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
	/* Smallest phones: also drop the secondary amount column. */
	.ckbo.ckbo .ckbo-rank-table th:nth-child(5),
	.ckbo.ckbo .ckbo-rank-table td:nth-child(5) { display: none; }
	.ckbo.ckbo .ckbo-rank-table th, .ckbo.ckbo .ckbo-rank-table td { padding-left: 6px; padding-right: 6px; }
}
