/* West of the Tunnel Comments -- buttons + slide-out panel.
   Headline font comes from the theme's --wott-headline-font (Lora), with
   Georgia as a fallback; everything else uses the site's body font. */

/* ---------------- Buttons in the story ---------------- */

.wott-cm-bar {
	margin: 1rem 0 1.5rem;
}

.wott-cm-bar--top {
	display: flex;
	justify-content: flex-end;
	margin: 0.5rem 0 1rem;
}

.wott-cm-bar--bottom {
	margin: 2.5rem 0 1rem;
	padding-top: 1.5rem;
	border-top: 1px solid #ccc;
	text-align: center;
	scroll-margin-top: 2rem;
}

.wott-cm-open {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.5rem 0.95rem;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	color: #444;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.wott-cm-open:hover,
.wott-cm-open:focus-visible {
	border-color: #888;
	background: #f5f5f5;
	color: #111;
}

/* Top-of-story button: speech-bubble icon plus the count, no word. The
   word "Comments" is still there for screen readers (.wott-cm-sr) and
   shows as a tooltip on hover. */
.wott-cm-open--icon {
	padding: 0.4rem 0.65rem;
	gap: 0.35rem;
}

.wott-cm-open-count:empty {
	display: none;
}

.wott-cm-open-count {
	display: inline-block;
	font-size: 0.85rem;
	letter-spacing: 0;
}

/* Visually hidden, still read by screen readers. */
.wott-cm-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.wott-cm-open--big {
	padding: 0.8rem 1.4rem;
	font-size: 0.9rem;
}

.wott-cm-icon {
	flex: 0 0 auto;
}

/* ---------------- Panel ---------------- */

.wott-cm-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.wott-cm-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	/* The theme gives every <aside> a 72px top margin; cancel it here. */
	margin: 0 !important;
	width: min(480px, 100vw);
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #1a1a1a;
	box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18);
	transform: translateX(100%);
	transition: transform 0.25s ease;
	text-align: left;
}

.wott-cm-is-open .wott-cm-panel {
	transform: translateX(0);
}

.wott-cm-is-open .wott-cm-backdrop {
	opacity: 1;
}

/* No page scrolling behind the open panel. */
html.wott-cm-is-open,
html.wott-cm-is-open body {
	overflow: hidden;
}

.wott-cm-panel[hidden],
.wott-cm-backdrop[hidden] {
	display: none !important;
}

/* WordPress admin bar, when shown. */
.admin-bar .wott-cm-panel {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .wott-cm-panel {
		top: 46px;
	}
}

.wott-cm-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem 0.85rem;
	border-bottom: 1px solid #e2e2e2;
	flex: 0 0 auto;
}

.wott-cm-panel .wott-cm-title {
	margin: 0 !important;
	padding: 0 !important;
	font-family: var(--wott-headline-font, Georgia, "Times New Roman", serif) !important;
	font-size: 1.5rem !important;
	font-weight: 400 !important;
	line-height: 1.2 !important;
	color: #111 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}

.wott-cm-title-count {
	color: #767676;
	font-size: 0.85em;
}

.wott-cm-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-right: -8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #444;
	cursor: pointer;
}

.wott-cm-close:hover,
.wott-cm-close:focus-visible {
	background: #f0f0f0;
	color: #111;
}

.wott-cm-scroll {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 1rem 1.25rem 3rem;
}

.wott-cm-story {
	margin: 0 0 1rem !important;
	font-size: 0.8rem !important;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #767676 !important;
	line-height: 1.4 !important;
}

/* ---------------- Form ---------------- */

.wott-cm-form {
	margin: 0 0 1.25rem;
	padding: 1rem;
	background: #f7f7f5;
	border-radius: 4px;
}

.wott-cm-intro,
.wott-cm-help {
	margin: 0 0 0.75rem !important;
	font-size: 0.85rem !important;
	line-height: 1.45 !important;
	color: #444 !important;
}

.wott-cm-intro a {
	color: #941c1c;
	text-decoration: underline;
}

.wott-cm-label {
	display: block;
	margin: 0 0 0.25rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #333;
}

.wott-cm-panel textarea,
.wott-cm-panel input[type="text"],
.wott-cm-panel input[type="email"] {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0 0 0.75rem;
	padding: 0.6rem 0.7rem;
	border: 1px solid #bbb;
	border-radius: 3px;
	background: #fff;
	color: #1a1a1a;
	font: inherit;
	font-size: 1rem;
	line-height: 1.45;
}

/* The comment box starts as one line and opens up when clicked into;
   the name/email fields, checkbox, and Submit button appear with it. */
.wott-cm-panel .wott-cm-form textarea {
	height: 2.75rem;
	min-height: 0;
	resize: none;
	overflow: hidden;
	transition: height 0.15s ease;
}

.wott-cm-panel .wott-cm-form.is-expanded textarea {
	height: 7rem;
	resize: vertical;
	overflow: auto;
}

.wott-cm-more {
	display: none;
}

.wott-cm-form.is-expanded .wott-cm-more {
	display: block;
}

.wott-cm-panel textarea:focus,
.wott-cm-panel input:focus {
	outline: 2px solid #1a1a1a;
	outline-offset: 0;
	border-color: #1a1a1a;
}

.wott-cm-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 0.75rem;
}

@media (max-width: 420px) {
	.wott-cm-fields {
		grid-template-columns: 1fr;
	}
}

.wott-cm-check {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0 0 0.9rem;
	font-size: 0.85rem;
	line-height: 1.4;
	color: #333;
	cursor: pointer;
}

.wott-cm-check input {
	margin-top: 0.15rem;
	flex: 0 0 auto;
}

/* Honeypot: hidden from people, still in the form for bots. */
.wott-cm-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wott-cm-submit,
.wott-cm-follow-row button {
	padding: 0.6rem 1.2rem;
	border: 1px solid #1a1a1a;
	border-radius: 3px;
	background: #1a1a1a;
	color: #fff;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
}

.wott-cm-submit:hover,
.wott-cm-follow-row button:hover {
	background: #333;
}

.wott-cm-submit:disabled,
.wott-cm-follow-row button:disabled {
	opacity: 0.6;
	cursor: wait;
}

.wott-cm-status,
.wott-cm-follow-status {
	margin: 0.75rem 0 0 !important;
	font-size: 0.85rem !important;
	line-height: 1.4 !important;
}

.wott-cm-status:empty,
.wott-cm-follow-status:empty {
	display: none;
}

.is-ok {
	color: #2c6b3a !important;
}

.is-error {
	color: #941c1c !important;
}

.wott-cm-replying {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	color: #333;
}

.wott-cm-replying[hidden] {
	display: none;
}

.wott-cm-cancel-reply {
	margin-left: auto;
	padding: 0.2rem 0.5rem;
	border: 1px solid #bbb;
	border-radius: 3px;
	background: #fff;
	font: inherit;
	font-size: 0.75rem;
	cursor: pointer;
}

/* A reply form sits inside the comment being answered. */
.wott-cm-item .wott-cm-form {
	margin: 0.75rem 0 0.5rem;
}

.wott-cm-closed {
	margin: 0 0 1rem !important;
	font-style: italic;
	color: #555 !important;
}

/* ---------------- Follow without commenting ---------------- */

/* "Not commenting? Get an email..." sits below the comments. */
.wott-cm-follow {
	margin: 1.25rem 0 0;
	padding-top: 1.25rem;
	border-top: 1px solid #e2e2e2;
}

.wott-cm-follow-toggle {
	padding: 0;
	border: 0;
	background: none;
	color: #941c1c;
	font: inherit;
	font-size: 0.85rem;
	text-decoration: underline;
	cursor: pointer;
}

.wott-cm-follow-form {
	margin-top: 0.75rem;
}

.wott-cm-follow-row {
	display: flex;
	gap: 0.5rem;
}

.wott-cm-follow-row input {
	flex: 1 1 auto;
	margin: 0 !important;
}

/* ---------------- Comment list ---------------- */

.wott-cm-loading,
.wott-cm-empty {
	color: #666 !important;
	font-size: 0.9rem !important;
	margin: 0.5rem 0 !important;
}

.wott-cm-item {
	padding: 1rem 0;
	border-top: 1px solid #e2e2e2;
	scroll-margin-top: 1rem;
}

.wott-cm-list > .wott-cm-item:first-child {
	border-top: 0;
	padding-top: 0.25rem;
}

.wott-cm-item--reply {
	margin-left: 1rem;
	padding: 0.85rem 0 0.25rem 0.9rem;
	border-top: 0;
	border-left: 2px solid #e2e2e2;
}

.wott-cm-item--highlight {
	background: #fff8e1;
	box-shadow: 0 0 0 6px #fff8e1;
}

.wott-cm-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2rem 0.6rem;
	margin-bottom: 0.35rem;
}

.wott-cm-author {
	font-weight: 700;
	font-size: 0.95rem;
	color: #111;
}

.wott-cm-staff {
	padding: 0.05rem 0.4rem;
	border-radius: 3px;
	background: #941c1c;
	color: #fff;
	font-size: 0.65rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.wott-cm-date {
	font-size: 0.75rem;
	color: #767676;
}

.wott-cm-body p {
	margin: 0 0 0.6em !important;
	font-size: 0.97rem !important;
	line-height: 1.55 !important;
	color: #222 !important;
	overflow-wrap: anywhere;
}

.wott-cm-body p:last-child {
	margin-bottom: 0 !important;
}

.wott-cm-body a {
	color: #941c1c;
	text-decoration: underline;
}

.wott-cm-actions-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 0.5rem;
}

.wott-cm-like,
.wott-cm-reply {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.55rem;
	border: 1px solid transparent;
	border-radius: 3px;
	background: none;
	color: #555;
	font: inherit;
	font-size: 0.8rem;
	cursor: pointer;
}

.wott-cm-like:hover,
.wott-cm-reply:hover,
.wott-cm-like:focus-visible,
.wott-cm-reply:focus-visible {
	border-color: #ccc;
	color: #111;
}

.wott-cm-like[aria-pressed="true"] {
	color: #941c1c;
}

.wott-cm-like-count:empty {
	display: none;
}

.wott-cm-replies:empty {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.wott-cm-panel,
	.wott-cm-backdrop {
		transition: none;
	}
}
