/* ============================================================
   Exchanged Timeline — Frontend styles
   ============================================================ */

/* ---- Wrapper ------------------------------------------------ */
#et-timeline-wrap {
	font-family: inherit;
	box-sizing: border-box;
}

/* Wide mode: break out of the theme's constrained content column to span the
   full viewport width. The negative margins are the classic full-bleed trick —
   they work because the wrapper's containing block is centered on the page. */
#et-timeline-wrap.et-wide {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding-left: clamp(12px, 3vw, 48px);
	padding-right: clamp(12px, 3vw, 48px);
}

/* Full-screen mode: fill the whole screen (native Fullscreen API, with a
   fixed-overlay fallback). Scales the timeline both ways — the canvas container
   flexes to fill the height left after the controls, and the cards dock below
   in a bounded, scrollable strip. */
#et-timeline-wrap.et-fs {
	position: fixed;
	inset: 0;
	z-index: 99999;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 10px clamp(12px, 2vw, 32px) 14px;
	background: #fff;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
#et-timeline-wrap.et-fs .et-controls { flex: 0 0 auto; }
#et-timeline-wrap.et-fs #et-timeline-container {
	flex: 1 1 auto;
	height: auto !important;   /* override the inline height from the shortcode */
	min-height: 0;
}
#et-timeline-wrap.et-fs .et-cards-section {
	flex: 0 0 auto;
	max-height: 32vh;
	margin-top: 8px;
}
#et-timeline-wrap.et-fs .et-col {
	display: flex;
	flex-direction: column;
	min-height: 0;
}
#et-timeline-wrap.et-fs .et-cards-list {
	flex: 1 1 auto;
	overflow-y: auto;
	min-height: 0;
}
#et-timeline-wrap *,
#et-timeline-wrap *::before,
#et-timeline-wrap *::after {
	box-sizing: inherit;
}

/* ---- Controls bar ------------------------------------------ */
.et-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	padding: .5rem 0 .75rem;
}

.et-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .3rem .65rem;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	color: #1d2327;
	font-size: .875rem;
	line-height: 1.4;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}
.et-btn:hover  { background: #f0f0f1; border-color: #8c8f94; }
.et-btn:active { background: #e5e5e5; }

.et-btn-sm {
	padding: .2rem .5rem;
	font-size: .8rem;
}

.et-zoom-group  { display: flex; gap: .25rem; }
.et-filter-group { display: flex; gap: .25rem; }

.et-collection-group,
.et-availability-group { display: flex; align-items: center; }
.et-collection-select,
.et-availability-select {
	padding: .3rem .55rem;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	color: #1d2327;
	font-size: .875rem;
	cursor: pointer;
	max-width: 220px;
	min-width: 140px;
}
.et-collection-select:hover,
.et-availability-select:hover  { border-color: #8c8f94; }
.et-collection-select:focus,
.et-availability-select:focus  { border-color: #2271b1; outline: none; box-shadow: 0 0 0 2px rgba( 34, 113, 177, .2 ); }
/* When a non-empty value is selected, give the chrome a hint that the
   timeline is currently constrained (matches the active filter-btn). */
.et-collection-select:not([value=""]):not(:focus) {
	/* The :not([value=""]) selector unfortunately doesn't react to JS
	   value changes; treated as a styling hint only, real "active"
	   feedback comes from the option label itself. */
}

.et-filter-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .3rem .75rem;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	color: #1d2327;
	font-size: .875rem;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}
.et-filter-btn:hover  { background: #f0f0f1; border-color: #8c8f94; }
.et-filter-btn.active {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.et-search-group {
	flex: 1;
	min-width: 160px;
	max-width: 320px;
}

.et-search-input {
	width: 100%;
	padding: .3rem .65rem;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: .875rem;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.et-search-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34,113,177,.2);
}

/* ===== Consolidated toolbar (2.0.176): Search · Filters▾ · chips · List ===== */

/* Search: icon + borderless input inside one rounded field. */
.et-search-group {
	flex: 1 1 260px;
	min-width: 200px;
	max-width: 460px;
	display: flex;
	align-items: center;
	gap: .4rem;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	padding: 0 .65rem;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.et-search-group:focus-within { border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34,113,177,.2); }
.et-search-ico { color: #8a938f; font-size: .85rem; line-height: 1; }
.et-search-group .et-search-input {
	border: 0;
	border-radius: 0;
	padding: .45rem 0;
	background: transparent;
}
.et-search-group .et-search-input:focus { box-shadow: none; border: 0; }

.et-controls-spacer { flex: 1 1 auto; }

/* Filters button + popover. */
.et-filters-wrap { position: relative; }
.et-filters-btn { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.et-filters-btn[aria-expanded="true"] { border-color: #2271b1; background: #f0f6fb; }
.et-filters-count {
	background: #cf6a45; color: #fff;
	border-radius: 999px;
	font-size: .7rem; font-weight: 700;
	min-width: 1.15rem; height: 1.15rem;
	display: inline-flex; align-items: center; justify-content: center;
	padding: 0 .35rem;
}
.et-caret { font-size: .7rem; color: #8a938f; }
.et-filters-pop {
	position: absolute;
	top: calc(100% + .4rem);
	left: 0;
	z-index: 30;
	width: 272px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 12px;
	box-shadow: 0 14px 40px rgba(20,30,28,.16);
	padding: .95rem;
}
.et-filter-field { margin-bottom: .9rem; }
.et-filter-field:last-child { margin-bottom: 0; }
.et-filter-field > label,
.et-filter-field-label {
	display: block;
	font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
	color: #6e7873; font-weight: 600;
	margin-bottom: .4rem;
}
.et-filters-pop .et-collection-select,
.et-filters-pop .et-availability-select { width: 100%; max-width: none; min-width: 0; }
.et-filters-pop .et-seg { display: flex; width: 100%; }
.et-filters-pop .et-seg .et-filter-btn { flex: 1; border-radius: 0; }
.et-filters-pop .et-seg .et-filter-btn:first-child { border-radius: 6px 0 0 6px; }
.et-filters-pop .et-seg .et-filter-btn:last-child  { border-radius: 0 6px 6px 0; }
.et-filters-pop .et-seg .et-filter-btn + .et-filter-btn { border-left: 0; }

/* Active-filter chips (below the bar). */
.et-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: 0 0 .6rem; }
/* v2.0.261 — the one quiet link to the find surface. */
.et-browse-link { margin: 0 0 .5rem; text-align: right; font-size: .82rem; }
.et-browse-link a { color: #646970; }
.et-chip {
	display: inline-flex; align-items: center; gap: .35rem;
	background: #eef3f2; border: 1px solid #cfe0dc; color: #234e58;
	border-radius: 999px;
	padding: .2rem .3rem .2rem .6rem;
	font-size: .78rem; font-weight: 600;
}
.et-chip b { font-weight: 500; color: #6e7873; }
.et-chip-x {
	border: 0; background: #d3e2de; color: #234e58;
	width: 1.05rem; height: 1.05rem; border-radius: 50%;
	cursor: pointer; font-size: .85rem; line-height: 1;
	display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.et-chip-x:hover { background: #234e58; color: #fff; }
.et-chip-clear { border: 0; background: transparent; color: #6e7873; font-size: .78rem; text-decoration: underline; cursor: pointer; padding: .2rem .3rem; }
.et-chip-clear:hover { color: #234e58; }

/* Floating view controls (zoom / wide / full) over the canvas corner. */
.et-viewctl {
	position: absolute;
	right: .75rem; bottom: 2.1rem;   /* clears the legend footer strip */
	z-index: 8;
	display: flex; flex-direction: column; gap: .4rem; align-items: flex-end;
}
.et-viewctl-row { display: flex; gap: .4rem; }
.et-vb {
	width: 2.1rem; height: 2.1rem;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid #dcdcde; background: #fff; border-radius: 8px;
	font-size: 1rem; color: #1d2327; cursor: pointer; padding: 0;
	box-shadow: 0 1px 3px rgba(0,0,0,.1);
	transition: background .15s, border-color .15s;
}
.et-vb:hover { background: #f0f0f1; border-color: #8c8f94; }
.et-vb[aria-pressed="true"] { background: #234e58; border-color: #234e58; color: #fff; }

/* ---- Timeline canvas container ----------------------------- */
#et-timeline-container {
	position: relative;
	width: 100%;
	overflow: hidden;     /* canvas handles all panning internally via panX/panY */
	background: #fafafa;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}
#et-timeline-container:active { cursor: grabbing; }

#et-timeline-container canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* Loading indicator */
.et-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	color: #646970;
	pointer-events: none;
}
.et-loading.et-hidden { display: none; }

/* ---- Tooltip ----------------------------------------------- */
.et-tooltip {
	position: absolute;
	z-index: 100;
	pointer-events: none;
	background: rgba(0,0,0,.82);
	color: #fff;
	font-size: .8rem;
	line-height: 1.5;
	padding: .45rem .65rem;
	border-radius: 5px;
	max-width: 240px;
	white-space: normal;
	box-shadow: 0 2px 8px rgba(0,0,0,.25);
	transform: translate(10px, -50%);
}
.et-tooltip .et-tt-title  { font-weight: 600; }
.et-tooltip .et-tt-meta   { opacity: .85; font-size: .75rem; }

/* ---- Cards section ----------------------------------------- */
.et-cards-section {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 1rem;
}

@media ( max-width: 600px ) {
	.et-cards-section { grid-template-columns: 1fr; }
}

.et-col {
	border: 1px solid #dcdcde;
	border-radius: 4px;
	overflow: hidden;
}

.et-col-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .5rem .75rem;
	background: #f6f7f7;
	border-bottom: 1px solid #dcdcde;
}

.et-col-title {
	font-weight: 600;
	font-size: .9rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #3c434a;
}

.et-cards-list {
	padding: .5rem;
	min-height: 60px;
	max-height: 420px;
	overflow-y: auto;
}

/* ---- Individual cards -------------------------------------- */
.et-card {
	position: relative;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: .6rem .75rem;
	margin-bottom: .5rem;
	font-size: .875rem;
	line-height: 1.5;
	transition: box-shadow .15s;
}
.et-card:last-child { margin-bottom: 0; }
.et-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.1); }

.et-card-name,
.et-card-title {
	font-weight: 600;
	font-size: .9rem;
	padding-right: 26px;  /* reserve space for the ⋮ menu button */
}

.et-card-name a,
.et-card-title a {
	color: #2271b1;
	text-decoration: none;
}
.et-card-name a:hover,
.et-card-title a:hover { text-decoration: underline; }

.et-card-meta {
	color: #646970;
	font-size: .8rem;
}

.et-card-type {
	display: inline-block;
	padding: .1rem .4rem;
	border-radius: 3px;
	background: #f0f0f1;
	font-size: .75rem;
	color: #3c434a;
	text-transform: capitalize;
	margin-top: .25rem;
}

/* Author card accent */
.et-author-card { border-left: 3px solid var(--et-author-color, #3b82f6); }

/* Work card accent */
.et-work-card   { border-left: 3px solid var(--et-work-color, #f59e0b); }

/* When a work has a WP post, the whole card is a link — kill the default
   anchor styling and add a hover affordance equivalent to .et-card:hover. */
a.et-work-card--link {
	display: block;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}
a.et-work-card--link:hover {
	border-color: #2271b1;
	box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
a.et-work-card--link .et-card-title {
	color: #2271b1;
}

/* Availability badges — visual hints only, not links */
.et-card-avail {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
	margin-top: .45rem;
}
.et-card-avail--none {
	font-size: .78rem;
	color: #8c8f94;
	font-style: italic;
	margin-top: .45rem;
}
.et-avail {
	display: inline-block;
	padding: .15rem .55rem;
	border-radius: 3px;
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .03em;
	white-space: nowrap;
	border: 1px solid transparent;
}
.et-avail--free {
	background: #e8f4ea;
	color: #1a7a2a;
	border-color: #b5debb;
}
/* Hosted "read here" edition — the brand's own free reading copy; solid fill so
   it reads as the primary free action, not just another availability tag. */
.et-avail--read {
	background: #1a7a2a;
	color: #fff;
	border-color: #1a7a2a;
}
.et-avail--buy {
	background: #e7f1fb;
	color: #134e7a;
	border-color: #b5d6f0;
}
.et-avail--free-ext {
	background: #fff;
	color: #1a7a2a;
	border-color: #b5debb;
}
.et-avail--buy-ext {
	background: #fff;
	color: #134e7a;
	border-color: #b5d6f0;
}
.et-avail--audio {
	background: #f3ecfb;
	color: #6b3fa0;
	border-color: #d9c6ef;
}
.et-avail--orig {
	background: #f4f1ea;
	color: #6b5b3a;
	border-color: #ddd3bd;
}

/* ---- Card menu (⋮) button + popover ------------------------ */
.et-card-menu-btn {
	position: absolute;
	top: .3rem;
	right: .3rem;
	width: 22px;
	height: 22px;
	padding: 0;
	border: none;
	background: transparent;
	color: #8c8f94;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	border-radius: 3px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .12s, color .12s;
	/* Sits on top of a link-card; preserves its own pointer semantics. */
	z-index: 2;
}
.et-card-menu-btn:hover,
.et-card-menu-btn:focus-visible {
	background: #f0f0f1;
	color: #1d2327;
	outline: none;
}
/* When the card is a link, hover/focus on the dots shouldn't bleed
   the underlying link-color into the icon. */
a.et-work-card--link .et-card-menu-btn { color: #8c8f94; }
a.et-work-card--link .et-card-menu-btn:hover,
a.et-work-card--link .et-card-menu-btn:focus-visible { color: #1d2327; }

.et-card-menu {
	position: fixed;
	z-index: 1000;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 5px;
	box-shadow: 0 6px 18px rgba(0,0,0,.14);
	padding: .25rem 0;
	min-width: 190px;
	font-size: .85rem;
}
.et-card-menu-item {
	display: block;
	width: 100%;
	padding: .4rem .85rem;
	border: none;
	background: transparent;
	text-align: left;
	color: #1d2327;
	cursor: pointer;
	font-size: inherit;
}
.et-card-menu-item:hover,
.et-card-menu-item:focus-visible {
	background: #f0f6fc;
	color: #134e7a;
	outline: none;
}

/* ---- Toast (ephemeral feedback) ----------------------------- */
.et-toast {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	max-width: 320px;
	background: rgba(29,35,39,.94);
	color: #fff;
	padding: .55rem .9rem;
	border-radius: 5px;
	font-size: .85rem;
	line-height: 1.4;
	z-index: 10000;
	box-shadow: 0 4px 14px rgba(0,0,0,.25);
	opacity: 0;
	transition: opacity .25s;
	pointer-events: none;
}
