/* LDM Calendar — [ldm_calendar]
   Every rule is prefixed with .ldm-cal (two-class specificity) so X/Pro and the site's
   Global CSS don't leak in. Text uses <div>, not <p>, because Global CSS has
   `body p { color:#000 !important }`. */

.ldm-cal {
	--ldm-bg: #0d0b0c;
	--ldm-surface: #181315;
	--ldm-surface-2: #211a1d;
	--ldm-line: rgba(255, 255, 255, .09);
	--ldm-text: #f3eef0;
	--ldm-muted: #a99ba1;
	--ldm-burgundy: #7f2340;
	--ldm-pink: #e0457b;
	--ldm-radius: 14px;
	--ldm-top: 0px;          /* height of any fixed header above the calendar (sticky offsets) */
	--ldm-head: Questrial, sans-serif;
	--ldm-body: Montserrat, system-ui, sans-serif;

	position: relative;
	container: ldmcal / inline-size; /* layout follows the space it's placed in, not the screen */
	background: var(--ldm-bg);
	color: var(--ldm-text);
	font: 15px/1.5 var(--ldm-body);
	-webkit-font-smoothing: antialiased;
	text-align: left;
}
/* X/Pro navbar is fixed 90px tall from 980px up. Change here if the header height changes. */
@media (min-width: 980px) {
	.ldm-cal { --ldm-top: 90px; }
}
.ldm-cal *, .ldm-cal *::before, .ldm-cal *::after { box-sizing: border-box; }
.ldm-cal.ldm-cal--bleed { width: 100vw !important; max-width: none !important; margin-left: calc(50% - 50vw) !important; margin-right: 0 !important; }

/* ---------- Layout ---------- */
.ldm-cal .ldm-cal__photo { position: relative; height: 72svh; min-height: 420px; max-height: 760px; overflow: hidden; background: #000; }
.ldm-cal .ldm-cal__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 30%; margin: 0; border: 0; }
.ldm-cal .ldm-cal__photo::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(180deg, rgba(13,11,12,.55) 0%, rgba(13,11,12,0) 22%, rgba(13,11,12,0) 50%, var(--ldm-bg) 100%);
}
.ldm-cal .ldm-cal__title { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 1; }
.ldm-cal .ldm-cal__eyebrow { font: 600 11px/1 var(--ldm-body); letter-spacing: .28em; text-transform: uppercase; color: var(--ldm-pink); }
.ldm-cal .ldm-cal__h1 {
	font: 400 clamp(36px, 11cqi, 76px)/1 var(--ldm-head); letter-spacing: .14em; text-transform: uppercase;
	color: var(--ldm-text); margin: .25em 0 0; padding: 0; text-shadow: none;
}
.ldm-cal .ldm-cal__main { padding: 8px 20px 80px; max-width: 760px; margin: 0 auto; }

/* No photo: title sits at the top of the content column */
.ldm-cal.ldm-cal--nophoto .ldm-cal__photo { height: auto; min-height: 0; max-height: none; background: none; padding: 48px 20px 0; max-width: 760px; margin: 0 auto; }
.ldm-cal.ldm-cal--nophoto .ldm-cal__photo::after { display: none; }
.ldm-cal.ldm-cal--nophoto .ldm-cal__title { position: static; }

@container ldmcal (min-width: 900px) {
	.ldm-cal .ldm-cal__wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
	.ldm-cal .ldm-cal__photo { position: sticky; top: var(--ldm-top); height: calc(100vh - var(--ldm-top)); max-height: none; }
	.ldm-cal .ldm-cal__photo::after {
		background: linear-gradient(90deg, rgba(13,11,12,0) 55%, var(--ldm-bg) 100%),
		            linear-gradient(0deg, rgba(13,11,12,.85) 0%, rgba(13,11,12,0) 35%);
	}
	.ldm-cal .ldm-cal__title { left: 48px; right: 24px; bottom: 48px; }
	.ldm-cal .ldm-cal__h1 { font-size: clamp(40px, 5.2cqi, 76px); }
	.ldm-cal .ldm-cal__main { padding: 72px 56px 120px 40px; margin: 0; }
	.ldm-cal .ldm-chips { flex-wrap: wrap; overflow: visible; }

	.ldm-cal.ldm-cal--nophoto .ldm-cal__wrap { display: block; }
	.ldm-cal.ldm-cal--nophoto .ldm-cal__photo { position: static; height: auto; }
	.ldm-cal.ldm-cal--nophoto .ldm-cal__main { margin: 0 auto; padding: 8px 20px 120px; }
}

/* ---------- Section headings ---------- */
.ldm-cal .ldm-cal__h2 {
	font: 400 22px/1.2 var(--ldm-head); letter-spacing: .2em; text-transform: uppercase; color: var(--ldm-text);
	margin: 48px 0 20px; padding: 0; display: flex; align-items: center; gap: 14px;
}
.ldm-cal .ldm-cal__h2::after { content: ""; flex: 1; height: 1px; background: var(--ldm-line); }
.ldm-cal .ldm-cal__section:first-child .ldm-cal__h2 { margin-top: 24px; }

/* ---------- Now & Next timeline ---------- */
.ldm-cal .ldm-now { list-style: none; margin: 0; padding: 0; position: relative; }
.ldm-cal .ldm-now::before {
	content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px;
	background: linear-gradient(var(--ldm-pink), var(--ldm-burgundy) 70%, transparent);
}
.ldm-cal .ldm-now > li { position: relative; margin: 0; padding: 0 0 26px 34px; list-style: none; }
.ldm-cal .ldm-now > li::before {
	content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%;
	background: var(--ldm-bg); border: 2px solid var(--ldm-pink); box-shadow: 0 0 0 4px rgba(224,69,123,.15);
}
.ldm-cal .ldm-now > li.is-upcoming::before { border-color: var(--ldm-muted); box-shadow: none; }
.ldm-cal .ldm-now > li.is-empty::before { display: none; }
.ldm-cal .ldm-now__when { font: 600 11px/1.3 var(--ldm-body); letter-spacing: .16em; text-transform: uppercase; color: var(--ldm-muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ldm-cal .ldm-now__status { color: var(--ldm-pink); }
.ldm-cal .is-upcoming .ldm-now__status { color: var(--ldm-muted); }
.ldm-cal .ldm-now__title { font: 700 17px/1.3 var(--ldm-body); margin: 6px 0 4px; text-transform: uppercase; letter-spacing: .02em; color: var(--ldm-text); }
.ldm-cal .ldm-now__detail { color: var(--ldm-text); }
.ldm-cal .ldm-now__where { margin-top: 4px; color: var(--ldm-muted); font-style: italic; font-size: 14px; }
.ldm-cal .ldm-now__link {
	display: inline-block; margin-top: 10px; font: 600 12px/1 var(--ldm-body); letter-spacing: .08em; text-transform: uppercase;
	color: var(--ldm-text); text-decoration: none; border: 1px solid var(--ldm-pink); border-radius: 999px; padding: 9px 14px;
}
.ldm-cal .ldm-now__link:hover, .ldm-cal .ldm-now__link:focus-visible { background: var(--ldm-pink); color: #fff; }

/* ---------- Stats ---------- */
.ldm-cal .ldm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ldm-line); border-radius: var(--ldm-radius); overflow: hidden; margin-bottom: 18px; }
.ldm-cal .ldm-stats:empty { display: none; }
.ldm-cal .ldm-stats > div { background: var(--ldm-surface); padding: 14px 10px; text-align: center; }
.ldm-cal .ldm-stats b { display: block; font: 400 26px/1.1 var(--ldm-head); color: var(--ldm-text); }
.ldm-cal .ldm-stats span { font: 600 10px/1.3 var(--ldm-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ldm-muted); }

/* ---------- Toolbar (sticks under the header while scrolling the list) ---------- */
.ldm-cal .ldm-tools { position: sticky; top: var(--ldm-top); z-index: 5; background: linear-gradient(var(--ldm-bg) 85%, rgba(13,11,12,0)); padding: 10px 0 14px; margin: 0 -4px; }
.ldm-cal .ldm-search { position: relative; display: block; margin: 0 4px; }
.ldm-cal .ldm-search .ldm-search__input {
	-webkit-appearance: none; appearance: none; display: block; width: 100%; height: auto; margin: 0;
	font: 500 15px/1.3 var(--ldm-body); color: var(--ldm-text); background: var(--ldm-surface-2);
	border: 1px solid var(--ldm-line); border-radius: 999px; padding: 12px 44px 12px 42px; box-shadow: none; outline: none;
}
.ldm-cal .ldm-search .ldm-search__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.ldm-cal .ldm-search .ldm-search__input::placeholder { color: #8a7d83; opacity: 1; }
.ldm-cal .ldm-search .ldm-search__input:focus { border-color: var(--ldm-pink); box-shadow: none; }
.ldm-cal .ldm-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); opacity: .6; color: var(--ldm-text); }
.ldm-cal .ldm-search .ldm-search__clear {
	position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none;
	width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none;
	color: var(--ldm-muted); font: 400 20px/32px var(--ldm-body); cursor: pointer;
}
.ldm-cal .ldm-search.has-value .ldm-search__clear { display: block; }
.ldm-cal .ldm-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 4px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ldm-cal .ldm-chips::-webkit-scrollbar { display: none; }
.ldm-cal .ldm-chips .ldm-chip {
	flex: none; margin: 0; font: 600 12px/1 var(--ldm-body); letter-spacing: .04em; text-transform: none; color: var(--ldm-text);
	background: transparent; border: 1px solid var(--ldm-line); border-radius: 999px; padding: 9px 14px; cursor: pointer; white-space: nowrap; box-shadow: none;
}
.ldm-cal .ldm-chips .ldm-chip:hover { border-color: rgba(255,255,255,.25); }
.ldm-cal .ldm-chips .ldm-chip[aria-pressed="true"] { background: var(--ldm-burgundy); border-color: var(--ldm-burgundy); }
.ldm-cal .ldm-chip small { font-size: 12px; font-weight: 500; opacity: .65; margin-left: 4px; }
.ldm-cal .ldm-meta { display: flex; justify-content: space-between; align-items: center; margin: 10px 4px 0; font-size: 12px; color: var(--ldm-muted); }
.ldm-cal .ldm-meta .ldm-sort { background: none; border: 0; margin: 0; padding: 4px 0; box-shadow: none; color: var(--ldm-muted); font: 600 12px/1 var(--ldm-body); text-transform: none; letter-spacing: 0; cursor: pointer; }
.ldm-cal .ldm-meta .ldm-sort:hover { color: var(--ldm-text); background: none; }

/* ---------- Year groups ---------- */
.ldm-cal .ldm-year { border-top: 1px solid var(--ldm-line); margin: 0; }
.ldm-cal .ldm-year > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; padding: 18px 2px; margin: 0; user-select: none; color: var(--ldm-text); }
.ldm-cal .ldm-year > summary::-webkit-details-marker { display: none; }
.ldm-cal .ldm-year > summary::marker { content: ""; }
.ldm-cal .ldm-year > summary b { font: 400 30px/1 var(--ldm-head); letter-spacing: .06em; }
.ldm-cal .ldm-year > summary span { color: var(--ldm-muted); font-size: 13px; }
.ldm-cal .ldm-year > summary i { margin-left: auto; font-style: normal; color: var(--ldm-muted); transition: transform .2s; }
.ldm-cal .ldm-year[open] > summary i { transform: rotate(180deg); }
.ldm-cal .ldm-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }

/* ---------- Card ---------- */
.ldm-cal .ldm-card {
	display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: start; margin: 0; list-style: none;
	background: var(--ldm-surface); border: 1px solid var(--ldm-line); border-radius: var(--ldm-radius); padding: 12px 14px 12px 12px;
}
.ldm-cal .ldm-date { background: var(--ldm-burgundy); border-radius: 10px; text-align: center; padding: 8px 2px 9px; line-height: 1; color: var(--ldm-text); }
.ldm-cal .ldm-date__m { font: 700 10px/1 var(--ldm-body); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.ldm-cal .ldm-date__d { font: 400 22px/1 var(--ldm-head); margin-top: 5px; white-space: nowrap; letter-spacing: -.02em; }
.ldm-cal .ldm-date__d.is-small { font-size: 15px; margin-top: 7px; }
.ldm-cal .ldm-card--studio .ldm-date { background: #3a2a31; }
.ldm-cal .ldm-card__title { font: 600 15px/1.3 var(--ldm-body); margin: 1px 0 3px; color: var(--ldm-text); }
.ldm-cal .ldm-card__series { font-size: 13px; color: var(--ldm-pink); }
.ldm-cal .ldm-card--studio .ldm-card__series { color: #c9a9b6; }
.ldm-cal .ldm-card__where { font-size: 13px; color: var(--ldm-muted); margin-top: 2px; }
.ldm-cal .ldm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ldm-cal .ldm-tag { font: 600 10px/1 var(--ldm-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ldm-muted); border: 1px solid var(--ldm-line); border-radius: 4px; padding: 4px 6px; }
.ldm-cal .ldm-tag--holiday { color: #8fd1a4; border-color: rgba(143,209,164,.3); }
.ldm-cal .ldm-empty, .ldm-cal .ldm-cal__noscript { padding: 40px 0; text-align: center; color: var(--ldm-muted); }
.ldm-cal mark { background: rgba(224,69,123,.35); color: inherit; border-radius: 2px; padding: 0 1px; }

@media (prefers-reduced-motion: reduce) {
	.ldm-cal .ldm-year > summary i { transition: none; }
}
