/* ReflectionChic – comment section
 * Self-contained on purpose: it does not rely on Divi's own comment CSS, which Divi only
 * loads on some pages / languages. Every rule is scoped to #comment-wrap or .rc-modal. */

#comment-wrap,
.rc-modal {
	--rc-ink: #333;
	--rc-text: #666;
	--rc-line: #ccc;
	--rc-error: #d92c3f;
	--rc-badge: #fad062;
	--rc-success: #36c02a;
	--rc-font-head: fromage, Georgia, serif;
	--rc-font-body: "Afacad", "Open Sans", Arial, sans-serif;
	--rc-title: 35px;
}

/* ---------- Container ---------- */

/* Divi limits this wrapper to 80% / 1080px; let the comments use the row width instead. */
.et_post_meta_wrapper:has(> #comment-wrap) {
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

#comment-wrap {
	box-sizing: border-box;
	width: 90%; /* same measure as the Divi rows of the article above */
	max-width: 1200px;
	margin: 0 auto;
	padding: 60px 0;
	font-family: var(--rc-font-body);
	font-size: 20px;
	line-height: 1.35;
	color: var(--rc-text);
	text-align: left;
}

#comment-wrap *,
#comment-wrap *::before,
#comment-wrap *::after,
.rc-modal,
.rc-modal * {
	box-sizing: border-box;
}

#comment-wrap #comment-section.nocomments {
	display: none;
}

/* ---------- Titles ---------- */

#comment-wrap #comments,
#comment-wrap #reply-title,
#comment-wrap .comment-reply-title {
	margin: 0;
	padding: 0;
	font-family: var(--rc-font-head);
	font-size: var(--rc-title);
	font-weight: 600;
	font-style: normal;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
	color: #000;
}

#comment-wrap #comments {
	margin-bottom: 30px;
}

#comment-wrap #reply-title small {
	display: inline-block;
	margin-left: 16px;
	font-family: var(--rc-font-body);
	font-size: 16px;
	font-weight: 400;
}

#comment-wrap #reply-title small a {
	color: var(--rc-text);
	text-decoration: underline;
}

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

#comment-wrap ol.commentlist,
#comment-wrap ol.commentlist ul.children,
#comment-wrap ol.commentlist ol.children {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

#comment-wrap ol.commentlist {
	padding-left: 17px; /* avatars sit 17px inside the title edge */
	margin-bottom: 60px;
}

#comment-wrap .rc-comment {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
	border: 0;
}

#comment-wrap ol.commentlist .rc-comment + .rc-comment,
#comment-wrap ol.commentlist .rc-comment > .children {
	margin-top: 43px;
}

#comment-wrap ol.commentlist .rc-comment > .children {
	padding-left: 94px;
}

#comment-wrap .rc-comment__body {
	display: flex;
	align-items: flex-start;
	gap: 30px;
	margin: 0;
	padding: 0;
	position: static;
}

#comment-wrap .rc-comment__avatar {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	position: static;
}

#comment-wrap .rc-comment__avatar img {
	display: block;
	width: 64px;
	height: 64px;
	max-width: none;
	border-radius: 50%;
	object-fit: cover;
}

#comment-wrap .rc-comment__main {
	flex: 1 1 auto;
	min-width: 0;
}

#comment-wrap .rc-comment__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 5px;
	margin: 0 0 11px;
	padding: 0;
	font-size: 16px;
	line-height: 21px;
	color: var(--rc-text);
}

#comment-wrap .rc-comment__author {
	font-weight: 700;
	color: var(--rc-ink);
}

#comment-wrap .rc-comment__badge {
	display: inline-block;
	margin-left: 5px;
	padding: 2px 8px;
	border-radius: 99px;
	background: var(--rc-badge);
	font-size: 12px;
	line-height: 16px;
	color: var(--rc-text);
	white-space: nowrap;
}

#comment-wrap .rc-comment__text,
#comment-wrap .rc-comment__text p {
	margin: 0;
	padding: 0;
	font-size: 20px;
	line-height: 27px;
	color: var(--rc-text);
	overflow-wrap: anywhere;
	font-weight:300;
}

#comment-wrap .rc-comment__text p + p {
	margin-top: 12px;
}

/* ---------- Buttons (Submit, modal OK) ---------- */

#comment-wrap #commentform #submit,
.rc-modal .rc-modal__ok {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 64px;
	min-width: 154px;
	margin: 0;
	padding: 0 41px !important;
	border: 3px solid var(--rc-ink) !important;
	border-radius: 30px !important;
	background: #fff !important;
	box-shadow: none;
	font-family: var(--rc-font-head) !important;
	font-size: 25px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none;
	white-space: nowrap;
	color: var(--rc-ink) !important;
	cursor: pointer;
	transition: background-color .2s ease;
}

@media (hover: hover) {
	#comment-wrap #commentform #submit:hover,
	.rc-modal .rc-modal__ok:hover {
		background: rgba(0, 0, 0, .05) !important;
	}
}

#comment-wrap #commentform #submit:focus-visible,
.rc-modal button:focus-visible {
	outline: 2px solid var(--rc-ink);
	outline-offset: 3px;
}

#comment-wrap #commentform #submit[disabled] {
	opacity: .5;
	cursor: default;
}

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

#comment-wrap #respond {
	margin: 0 0 0 -4px; /* fields start 4px outside the title edge, as in the design */
	padding: 0;
}

#comment-wrap #respond #reply-title,
#comment-wrap #respond .comment-notes,
#comment-wrap #respond .logged-in-as {
	padding-left: 4px;
}

#comment-wrap #commentform {
	margin: 0;
	padding: 0;
}

#comment-wrap #commentform p {
	margin: 0;
	padding: 0;
	float: none;
	width: auto;
}

#comment-wrap #commentform .comment-notes,
#comment-wrap #commentform .logged-in-as {
	margin: 5px 0 20px;
	padding-bottom: 0;
	font-size: 20px;
	line-height: 27px;
	font-weight:300;
	color: var(--rc-text);
}

#comment-wrap #commentform .required-field-message {
	display: none;
}

#comment-wrap #commentform .rc-field {
	margin-bottom: 15px;
}

#comment-wrap #commentform .rc-field--short {
	max-width: 441px;
}

#comment-wrap #commentform textarea,
#comment-wrap #commentform input[type="text"],
#comment-wrap #commentform input[type="email"] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 10px 17px;
	border: 2px solid var(--rc-line);
	border-radius: 30px;
	background: #fff;
	box-shadow: none;
	font-family: var(--rc-font-body);
	font-size: 20px;
	font-weight: 400;
	line-height: 27px;
	color: var(--rc-ink);
	outline: none;
	transition: border-color .15s ease;
}

#comment-wrap #commentform input[type="text"],
#comment-wrap #commentform input[type="email"] {
	height: 52px;
}

#comment-wrap #commentform textarea {
	height: 186px;
	min-height: 120px;
	resize: vertical;
}

#comment-wrap #commentform ::placeholder {
	color: var(--rc-line);
	opacity: 1;
}

/* focus + filled */
#comment-wrap #commentform textarea:focus,
#comment-wrap #commentform input[type="text"]:focus,
#comment-wrap #commentform input[type="email"]:focus,
#comment-wrap #commentform textarea:not(:placeholder-shown),
#comment-wrap #commentform input[type="text"]:not(:placeholder-shown),
#comment-wrap #commentform input[type="email"]:not(:placeholder-shown) {
	border-color: var(--rc-ink);
}

/* validation error */
#comment-wrap #commentform .rc-field.is-invalid textarea,
#comment-wrap #commentform .rc-field.is-invalid input {
	border-color: var(--rc-error);
	color: var(--rc-error);
}

#comment-wrap #commentform .rc-field__error {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	font-size: 20px;
	line-height: 27px;
	color: var(--rc-error);
}

#comment-wrap #commentform .rc-field__error svg {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
}

#comment-wrap #commentform .form-submit {
	margin-top: 30px;
	text-align: left;
}

/* visually hidden labels (placeholders carry the visible text) */
#comment-wrap .rc-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* honeypot: off-screen instead of display:none, which some bots detect */
#comment-wrap .rc-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Modal ---------- */

.rc-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, .26);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility 0s linear .25s;
}

.rc-modal.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .25s ease;
}

.rc-modal__dialog {
	position: relative;
	width: 491px;
	max-width: 100%;
	max-height: 100%;
	overflow-y: auto;
	padding: 25px;
	border-radius: 30px;
	background: #fff;
	text-align: center;
	font-family: var(--rc-font-body);
	transform: translateY(12px);
	transition: transform .25s ease;
}

.rc-modal.is-open .rc-modal__dialog {
	transform: none;
}

.rc-modal__icon {
	display: block;
	width: 66px;
	height: 66px;
	margin: 5px auto 20px;
}

.rc-modal__title {
	margin: 0 0 15px;
	padding: 0;
	font-family: var(--rc-font-head);
	font-size: min(35px, 8.6vw);
	font-weight: 600;
	line-height: 1.25;
	color: #000;
}

.rc-modal__text {
	margin: 0 0 25px;
	padding: 0;
	font-size: 20px;
	line-height: 27px;
	color: var(--rc-text);
}

.rc-modal .rc-modal__ok {
	width: 100%;
}

.rc-modal__close {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ebebeb;
	color: var(--rc-ink);
	cursor: pointer;
}

.rc-modal__close svg {
	width: 20px;
	height: 20px;
}

html.rc-modal-open {
	overflow: hidden;
}

/* ---------- Tablet ---------- */

@media (max-width: 980px) {
	#comment-wrap {
		--rc-title: 30px;
		padding: 50px 0;
	}

	#comment-wrap ol.commentlist {
		padding-left: 0;
	}

	#comment-wrap ol.commentlist .rc-comment > .children {
		padding-left: 47px;
	}
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
	#comment-wrap {
		--rc-title: 25px;
		padding: 40px 0;
	}

	#comment-wrap #respond {
		margin: 0;
	}

	#comment-wrap #respond #reply-title,
	#comment-wrap #respond .comment-notes,
	#comment-wrap #respond .logged-in-as {
		padding-left: 0;
	}

	/* Avatar with badge + name beside it, comment text across the full width below */
	#comment-wrap .rc-comment__body {
		display: grid;
		grid-template-columns: 64px minmax(0, 1fr);
		column-gap: 16px;
		row-gap: 9px;
		align-items: start;
	}

	#comment-wrap .rc-comment__main {
		display: contents;
	}

	#comment-wrap .rc-comment__avatar {
		grid-column: 1;
		grid-row: 1;
	}

	#comment-wrap .rc-comment__meta {
		grid-column: 2;
		grid-row: 1;
		align-self: center;
		gap: 0 5px;
		margin: 0;
	}

	/* Badge sits on its own line above the name */
	#comment-wrap .rc-comment__meta:has(.rc-comment__badge) {
		align-self: start;
		margin-top: 1px;
	}

	#comment-wrap .rc-comment__meta:has(.rc-comment__badge)::before {
		content: "";
		order: -1;
		flex: 0 0 100%;
	}

	#comment-wrap .rc-comment__badge {
		order: -2;
		margin: 0 0 5px;
	}

	#comment-wrap .rc-comment__text {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	#comment-wrap ol.commentlist .rc-comment > .children {
		padding-left: 24px;
	}

	#comment-wrap #commentform .rc-field--short {
		max-width: none;
	}

	#comment-wrap #commentform #submit {
		width: 100%;
	}

	/* Modal becomes a bottom sheet */
	.rc-modal {
		align-items: flex-end;
		padding: 0;
	}

	.rc-modal__dialog {
		width: 100%;
		max-height: 90%;
		padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px));
		border-radius: 30px 30px 0 0;
		transform: translateY(100%);
		transition: transform .3s cubic-bezier(.2, .8, .2, 1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.rc-modal,
	.rc-modal__dialog {
		transition: none !important;
	}
}
