/* ── Commune Podcast Search ──────────────────────────────────────── */

:root {
	--linen: #f4f0e3;
	--linen-dark: #e8e2d0;
	--sage: #9aa583;
	--sage-dark: #7d8c6e;
	--forest: #3d5b47;
	--forest-dark: #2c3e33;
	--desert: #c8856a;
	--stone: #6b7d8a;
	--ink: #263029;
}

body {
	background: var(--linen);
	color: var(--ink);
	font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	margin: 0;
}

h1, h2, h3, h4, .ps-serif {
	font-family: 'Libre Baskerville', Georgia, serif;
}

.btn-forest {
	background: var(--forest);
	border-color: var(--forest);
	color: var(--linen);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.btn-forest:hover { background: var(--forest-dark); border-color: var(--forest-dark); color: #fff; }

.btn-outline-forest {
	border-color: var(--forest);
	color: var(--forest);
}
.btn-outline-forest:hover { background: var(--forest); color: var(--linen); }
.btn-outline-forest:disabled { opacity: .4; }

/* ── Boot + auth ─────────────────────────────────────────────────── */

.ps-boot {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ps-auth {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(160deg, var(--linen) 0%, var(--linen-dark) 100%);
}

.ps-auth-card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 4px 24px rgba(44, 53, 48, .15);
	padding: 2.5rem;
	max-width: 420px;
	width: 100%;
	margin: 1.5rem;
	text-align: center;
}

.ps-auth-logo { height: 40px; margin-bottom: 1.25rem; }
.ps-auth-card h2 { font-size: 1.4rem; margin-bottom: .75rem; }
.ps-auth-note { font-size: .8rem; color: var(--stone); margin: .75rem 0 0; }

/* ── Search bar ──────────────────────────────────────────────────── */

.ps-searchbar {
	background: var(--forest-dark);
	padding: 1.25rem 0 1rem;
	position: sticky;
	top: 56px;              /* clears the shared header */
	z-index: 900;
}

.ps-searchbar-inner {
	max-width: 940px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.ps-input-wrap {
	display: flex;
	align-items: center;
	gap: .5rem;
	background: #fff;
	border-radius: 10px;
	padding: .35rem .35rem .35rem .9rem;
}

.ps-input-wrap > .bi-search { color: var(--stone); }

.ps-input-wrap input[type="search"] {
	border: none;
	box-shadow: none !important;
	flex: 1;
	font-size: 1rem;
	padding: .45rem .25rem;
}

.ps-filters {
	display: flex;
	align-items: center;
	gap: .6rem;
	margin-top: .7rem;
	flex-wrap: wrap;
	color: rgba(244, 240, 227, .75);
	font-size: .85rem;
}

.ps-check { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; margin: 0; }

.ps-mini {
	width: 130px;
	height: 32px;
	font-size: .85rem;
	padding: .2rem .55rem;
}
.ps-datefield { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.ps-date { width: 148px; }

/* An empty date field renders its own "mm/dd/yyyy" hint, which the browser
 * draws as dark as typed text. Match the ::placeholder treatment above —
 * the class is toggled in app.js because CSS can't see an empty date. */
.ps-date.ps-date-empty { color: #949e99; }
.ps-date::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.ps-date::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Placeholders read as typed text at the browser default, so lighten them —
 * still legible on white, clearly not content. `opacity` because Firefox
 * dims placeholders on top of the colour. */
.ps-input-wrap input[type="search"]::placeholder,
.ps-mini::placeholder {
	color: #949e99;
	opacity: 1;
}

.ps-select {
	width: auto;
	padding-right: 1.6rem;
	background-position: right .4rem center;
	cursor: pointer;
}

.ps-clear { color: rgba(244, 240, 227, .6); font-size: .85rem; text-decoration: none; padding: 0 .3rem; }
.ps-clear:hover { color: var(--linen); }

.ps-spacer { flex: 1; }

.ps-doclink { color: var(--sage); text-decoration: none; font-size: .85rem; white-space: nowrap; }
.ps-doclink:hover { color: var(--linen); }

/* ── Results ─────────────────────────────────────────────────────── */

.ps-main {
	max-width: 940px;
	margin: 0 auto;
	padding: 1.5rem 1.5rem 4rem;
}

.ps-status {
	color: var(--stone);
	font-size: .9rem;
	margin-bottom: 1rem;
	min-height: 1.2rem;
}

.ps-empty {
	text-align: center;
	color: var(--stone);
	padding: 3.5rem 1rem;
}
.ps-empty i { font-size: 2.2rem; color: var(--sage); display: block; margin-bottom: .75rem; }

.ps-card {
	background: #fff;
	border: 1px solid rgba(44, 62, 51, .08);
	border-radius: 12px;
	padding: 1.1rem 1.25rem;
	margin-bottom: 1rem;
	display: flex;
	gap: 1rem;
	transition: box-shadow .15s ease, transform .15s ease;
}
.ps-card:hover { box-shadow: 0 4px 16px rgba(44, 53, 48, .1); }

.ps-art {
	width: 82px;
	height: 82px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--linen-dark);
}

.ps-card-body { flex: 1; min-width: 0; }

.ps-title {
	font-family: 'Libre Baskerville', Georgia, serif;
	font-size: 1.02rem;
	font-weight: 700;
	color: var(--forest-dark);
	margin: 0 0 .25rem;
	cursor: pointer;
	line-height: 1.35;
}
.ps-title:hover { color: var(--sage-dark); }

.ps-meta {
	font-size: .8rem;
	color: var(--stone);
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	margin-bottom: .5rem;
}

.ps-badge {
	display: inline-block;
	font-size: .68rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: .12rem .45rem;
	border-radius: 4px;
	background: rgba(154, 165, 131, .22);
	color: var(--forest);
}
.ps-badge.transcript { background: rgba(200, 133, 106, .2); color: #a3573a; }

.ps-snippet {
	font-size: .89rem;
	line-height: 1.55;
	color: #45514a;
	margin-bottom: .5rem;
}

.ps-snippet mark,
.ps-hit-text mark {
	background: #f6e6a8;
	padding: 0 .1em;
	border-radius: 2px;
}

.ps-hits { border-top: 1px dashed rgba(44, 62, 51, .14); padding-top: .6rem; margin-top: .4rem; }

.ps-hit {
	display: flex;
	gap: .6rem;
	font-size: .86rem;
	line-height: 1.5;
	margin-bottom: .5rem;
}

.ps-timecode {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: .78rem;
	color: var(--desert);
	white-space: nowrap;
	padding-top: .1rem;
}

.ps-hit-speaker { font-weight: 600; color: var(--forest); }

.ps-more {
	font-size: .8rem;
	color: var(--stone);
}

.ps-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-top: 1.5rem;
	color: var(--stone);
	font-size: .85rem;
}

/* ── Detail ──────────────────────────────────────────────────────── */

.ps-detail {
	background: var(--linen);
	min-height: calc(100vh - 56px);
}

.ps-detail-inner {
	max-width: 860px;
	margin: 0 auto;
	padding: 1.5rem 1.5rem 5rem;
}

.ps-detail-close { color: var(--forest); text-decoration: none; padding-left: 0; }

.ps-detail-head { display: flex; gap: 1.25rem; margin: .5rem 0 1.5rem; }
.ps-detail-head img { width: 130px; height: 130px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.ps-detail-head h1 { font-size: 1.4rem; line-height: 1.35; margin-bottom: .4rem; }

.ps-section {
	background: #fff;
	border: 1px solid rgba(44, 62, 51, .08);
	border-radius: 12px;
	padding: 1.25rem 1.4rem;
	margin-bottom: 1.1rem;
}
.ps-section h3 {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--stone);
	font-family: 'Nunito Sans', sans-serif;
	font-weight: 700;
	margin-bottom: .8rem;
}
.ps-section p { line-height: 1.65; }
.ps-section p:last-child { margin-bottom: 0; }

.ps-topics { display: flex; flex-wrap: wrap; gap: .4rem; }
.ps-topic {
	background: rgba(154, 165, 131, .2);
	color: var(--forest);
	border-radius: 20px;
	padding: .2rem .7rem;
	font-size: .8rem;
}

.ps-notable { display: flex; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid rgba(44, 62, 51, .07); }
.ps-notable:last-child { border-bottom: none; }
.ps-notable-title { font-weight: 600; font-size: .9rem; }
.ps-notable-desc { font-size: .85rem; color: #55605a; }

.ps-turn { display: flex; gap: .75rem; padding: .4rem 0; font-size: .9rem; line-height: 1.6; }
.ps-turn.host .ps-hit-speaker { color: var(--desert); }
.ps-turn-speaker { width: 108px; flex-shrink: 0; font-weight: 600; color: var(--forest); font-size: .82rem; }
.ps-transcript-scroll { max-height: 620px; overflow-y: auto; }

.ps-inline-note {
	background: rgba(200, 133, 106, .12);
	border-left: 3px solid var(--desert);
	padding: .6rem .9rem;
	border-radius: 0 6px 6px 0;
	font-size: .85rem;
	margin-bottom: 1rem;
}

@media (max-width: 640px) {
	.ps-art { width: 56px; height: 56px; }
	.ps-detail-head img { width: 84px; height: 84px; }
	.ps-turn-speaker { width: 80px; }
	.ps-searchbar { position: static; }
}
