/*
 * Ghostwriters Central Writers - front-end styles
 * Every selector is scoped under .gwc-writers or .gwc-writer-modal so nothing
 * leaks into Divi or the rest of the site.
 */

/* ------------------------------------------------------------------
 * Design tokens
 * ------------------------------------------------------------------ */
.gwc-writers,
.gwc-writer-modal {
	--gwc-card-bg: #f7f4ef;
	--gwc-navy: #071c2c;
	--gwc-gold: #d9b36c;
	--gwc-text: #071c2c;
	--gwc-text-muted: #3f4b56;
	--gwc-border: rgba(7, 28, 44, 0.12);
	--gwc-shadow: 0 6px 18px rgba(7, 28, 44, 0.08), 0 1px 3px rgba(7, 28, 44, 0.06);
	--gwc-shadow-hover: 0 16px 32px rgba(7, 28, 44, 0.16), 0 3px 8px rgba(7, 28, 44, 0.08);
	--gwc-radius: 16px;
	--gwc-gap: 28px;
	--gwc-photo-ratio: 3 / 2;
	--gwc-icon-size: 56px;
	--gwc-transition: 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ------------------------------------------------------------------
 * Grid
 * ------------------------------------------------------------------ */
.gwc-writers {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 0;
	color: var(--gwc-text);
}

.gwc-writers *,
.gwc-writers *::before,
.gwc-writers *::after {
	box-sizing: border-box;
}

.gwc-writers .gwc-writers-grid {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: var(--gwc-gap);
	align-items: stretch;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 480px) {
	.gwc-writers .gwc-writers-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.gwc-writers .gwc-writers-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.gwc-writers .gwc-writers-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		--gwc-gap: 24px;
	}
}

@media (min-width: 1280px) {
	.gwc-writers .gwc-writers-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

.gwc-writers .gwc-writers-empty {
	margin: 0;
	padding: 24px;
	text-align: center;
	color: var(--gwc-text-muted);
	background: var(--gwc-card-bg);
	border: 1px dashed var(--gwc-border);
	border-radius: var(--gwc-radius);
}

/* ------------------------------------------------------------------
 * Card
 * ------------------------------------------------------------------ */
.gwc-writers .gwc-writer-card {
	display: flex;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none !important;
}

.gwc-writers .gwc-writer-card::marker {
	content: "" !important;
	font-size: 0 !important;
}

.gwc-writers .gwc-writer-card__button {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	cursor: pointer;
	color: var(--gwc-text);
	background: var(--gwc-card-bg);
	border: 1px solid var(--gwc-border);
	border-radius: var(--gwc-radius);
	box-shadow: var(--gwc-shadow);
	text-align: center;
	-webkit-tap-highlight-color: rgba(217, 179, 108, 0.25);
	transition:
		transform var(--gwc-transition),
		box-shadow var(--gwc-transition),
		border-color var(--gwc-transition);
	will-change: transform;
}

.gwc-writers .gwc-writer-card__button:hover,
.gwc-writers .gwc-writer-card__button:focus-visible {
	transform: translateY(-4px);
	box-shadow: var(--gwc-shadow-hover);
	border-color: rgba(217, 179, 108, 0.7);
}

.gwc-writers .gwc-writer-card__button:focus {
	outline: none;
}

.gwc-writers .gwc-writer-card__button:focus-visible {
	outline: 3px solid var(--gwc-gold);
	outline-offset: 3px;
}

.gwc-writers .gwc-writer-card__button:active {
	transform: translateY(-2px);
}

/* ------------------------------------------------------------------
 * Photo
 * ------------------------------------------------------------------ */
.gwc-writers .gwc-writer-photo {
	position: relative;
	width: 100%;
	aspect-ratio: var(--gwc-photo-ratio);
	overflow: hidden;
	background: #e6e1d8;
}

@supports not (aspect-ratio: 1 / 1) {
	.gwc-writers .gwc-writer-photo {
		height: 0;
		padding-top: 66.667%;
	}

	.gwc-writers .gwc-writer-photo__img,
	.gwc-writers .gwc-writer-photo__placeholder {
		position: absolute;
		top: 0;
		left: 0;
	}
}

.gwc-writers .gwc-writer-photo__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	object-position: center;
}

.gwc-writers .gwc-writer-photo__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: rgba(7, 28, 44, 0.25);
	background: linear-gradient(160deg, #ece7de 0%, #ddd6ca 100%);
}

.gwc-writers .gwc-writer-photo__placeholder svg {
	width: 30%;
	height: 30%;
}

/* ------------------------------------------------------------------
 * Navy pen badge
 * ------------------------------------------------------------------ */
.gwc-writers .gwc-writer-icon {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--gwc-icon-size);
	height: var(--gwc-icon-size);
	margin: calc(var(--gwc-icon-size) / -2) auto 0;
	color: var(--gwc-gold);
	background: var(--gwc-navy);
	border: 3px solid var(--gwc-card-bg);
	border-radius: 50%;
	box-shadow: 0 4px 12px rgba(7, 28, 44, 0.25);
}

.gwc-writers .gwc-writer-icon svg {
	width: 46%;
	height: 46%;
}

/* ------------------------------------------------------------------
 * Text area
 * ------------------------------------------------------------------ */
.gwc-writers .gwc-writer-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
	padding: 14px 18px 22px;
}

.gwc-writers .gwc-writer-name {
	position: relative;
	margin: 0 0 12px;
	padding: 0 0 12px;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.01em;
	color: var(--gwc-navy);
	text-transform: none;
}

.gwc-writers .gwc-writer-name::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 36px;
	height: 2px;
	background: var(--gwc-gold);
	transform: translateX(-50%);
	border-radius: 2px;
}

/* ------------------------------------------------------------------
 * Specialty checklist
 * ------------------------------------------------------------------ */
.gwc-writers .gwc-writer-specialties {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 7px;
	width: max-content;
	max-width: 100%;
	margin: 0 auto;
	padding: 0 !important;
	list-style: none !important;
	list-style-type: none !important;
}

.gwc-writers .gwc-writer-specialty {
	display: flex !important;
	align-items: flex-start;
	gap: 9px;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0.9375rem;
	line-height: 1.35;
	color: var(--gwc-text-muted);
	list-style: none !important;
	list-style-type: none !important;
	list-style-position: outside !important;
}

.gwc-writers .gwc-writer-specialty::marker {
	content: "" !important;
	font-size: 0 !important;
	color: transparent !important;
}

.gwc-writers .gwc-writer-specialty::before {
	content: none !important;
	display: none !important;
}

/* Custom navy/gold checkmark */
.gwc-writers .gwc-writer-check,
.gwc-writer-modal .gwc-writer-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	margin-top: 1px;
	margin-right: 5px;
	color: var(--gwc-gold);
	background: var(--gwc-navy);
	border-radius: 4px;
}

.gwc-writers .gwc-writer-check svg,
.gwc-writer-modal .gwc-writer-check svg {
	display: block;
	width: 11px;
	height: 11px;
}

.gwc-writers .gwc-writer-specialty__label {
	min-width: 0;
	text-align: left !important;
}

/* ------------------------------------------------------------------
 * Modal
 * ------------------------------------------------------------------ */
.gwc-writer-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(4, 14, 24, 0.72);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	color: var(--gwc-text);
	opacity: 0;
	transition: opacity 200ms ease;
}

.gwc-writer-modal *,
.gwc-writer-modal *::before,
.gwc-writer-modal *::after {
	box-sizing: border-box;
}

.gwc-writer-modal.is-open {
	display: flex;
}

.gwc-writer-modal.is-visible {
	opacity: 1;
}

.gwc-writer-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 900px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: hidden;
	background: var(--gwc-card-bg);
	border-radius: 20px;
	border-top: 5px solid var(--gwc-gold);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
	outline: none;
	transform: translateY(12px) scale(0.98);
	transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.gwc-writer-modal.is-visible .gwc-writer-modal__dialog {
	transform: translateY(0) scale(1);
}

.gwc-writer-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	cursor: pointer;
	color: var(--gwc-card-bg);
	background: var(--gwc-navy);
	border: 2px solid var(--gwc-card-bg);
	border-radius: 50%;
	box-shadow: 0 4px 12px rgba(7, 28, 44, 0.3);
	transition:
		background-color 160ms ease,
		color 160ms ease,
		transform 160ms ease;
	-webkit-appearance: none;
	appearance: none;
	line-height: 1;
}

.gwc-writer-modal__close:hover,
.gwc-writer-modal__close:focus-visible {
	color: var(--gwc-navy);
	background: var(--gwc-gold);
	transform: scale(1.05);
}

.gwc-writer-modal__close:focus {
	outline: none;
}

.gwc-writer-modal__close:focus-visible {
	outline: 3px solid var(--gwc-gold);
	outline-offset: 2px;
}

.gwc-writer-modal__close svg {
	width: 18px;
	height: 18px;
}

/* Scrollable content */
.gwc-writer-modal__content {
	display: block;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.gwc-writer-modal__photo {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	background: #e6e1d8;
	line-height: 0;
}

.gwc-writer-modal__photo.is-empty {
	display: none;
}

.gwc-writer-modal__photo img {
	display: block;
	width: 100% !important;
	height: auto !important;
	max-width: none;
	aspect-ratio: 3 / 2;
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	object-position: center;
}

.gwc-writer-modal__main {
	padding: 28px 24px 32px;
}

.gwc-writer-modal__eyebrow {
	display: inline-block;
	margin: 0 0 8px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--gwc-gold);
}

.gwc-writer-modal__name {
	margin: 0 0 14px;
	padding: 0 0 14px;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.15;
	color: var(--gwc-navy);
	border-bottom: 2px solid var(--gwc-gold);
}

.gwc-writer-modal__specialties-label {
	display: block;
	margin: 0 0 8px;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--gwc-text-muted);
}

.gwc-writer-modal__specialties {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin: 0 0 24px;
	padding: 0 !important;
	list-style: none !important;
	list-style-type: none !important;
}

.gwc-writer-modal__specialties-wrap.is-empty {
	display: none;
}

.gwc-writer-modal__specialty {
	display: flex !important;
	align-items: flex-start;
	gap: 8px;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0.9375rem;
	line-height: 1.35;
	color: var(--gwc-text);
	list-style: none !important;
	list-style-type: none !important;
}

.gwc-writer-modal__specialty::marker {
	content: "" !important;
	font-size: 0 !important;
	color: transparent !important;
}

.gwc-writer-modal__specialty::before {
	content: none !important;
	display: none !important;
}

/* ------------------------------------------------------------------
 * Biography
 * ------------------------------------------------------------------ */
.gwc-writer-modal__bio {
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--gwc-text);
	overflow-wrap: anywhere;
}

.gwc-writer-modal__bio > :first-child {
	margin-top: 0;
}

.gwc-writer-modal__bio > :last-child {
	margin-bottom: 0;
}

.gwc-writer-modal__bio p {
	margin: 0 0 1.1em;
}

.gwc-writer-modal__bio h2,
.gwc-writer-modal__bio h3,
.gwc-writer-modal__bio h4,
.gwc-writer-modal__bio h5,
.gwc-writer-modal__bio h6 {
	margin: 1.4em 0 0.5em;
	line-height: 1.25;
	color: var(--gwc-navy);
}

.gwc-writer-modal__bio h2 {
	font-size: 1.5rem;
}

.gwc-writer-modal__bio h3 {
	font-size: 1.3rem;
}

.gwc-writer-modal__bio h4 {
	font-size: 1.15rem;
}

.gwc-writer-modal__bio ul,
.gwc-writer-modal__bio ol {
	margin: 0 0 1.1em;
	padding-left: 1.5em;
}

.gwc-writer-modal__bio ul {
	list-style: disc;
}

.gwc-writer-modal__bio ol {
	list-style: decimal;
}

.gwc-writer-modal__bio li {
	margin: 0 0 0.35em;
}

.gwc-writer-modal__bio a {
	color: var(--gwc-navy);
	text-decoration: underline;
	text-decoration-color: var(--gwc-gold);
	text-underline-offset: 2px;
}

.gwc-writer-modal__bio a:hover,
.gwc-writer-modal__bio a:focus {
	color: #b08c45;
}

.gwc-writer-modal__bio blockquote {
	margin: 1.2em 0;
	padding: 0.5em 0 0.5em 1.25em;
	border-left: 3px solid var(--gwc-gold);
	font-style: italic;
	color: var(--gwc-text-muted);
}

.gwc-writer-modal__bio img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.gwc-writer-modal__bio hr {
	margin: 1.5em 0;
	border: 0;
	border-top: 1px solid var(--gwc-border);
}

/* ------------------------------------------------------------------
 * Modal desktop layout
 * ------------------------------------------------------------------ */
@media (min-width: 700px) {
	.gwc-writer-modal {
		padding: 32px;
	}

	.gwc-writer-modal__dialog {
		max-height: calc(100vh - 64px);
		max-height: calc(100dvh - 64px);
	}

	.gwc-writer-modal__content {
		display: grid;
		grid-template-columns: 300px minmax(0, 1fr);
		gap: 0;
		align-items: start;
	}

	.gwc-writer-modal__photo {
		position: sticky;
		top: 0;
		border-right: 1px solid var(--gwc-border);
	}

	.gwc-writer-modal__photo img {
		aspect-ratio: 3 / 2;
	}

	.gwc-writer-modal__photo.is-empty {
		display: none;
	}

	.gwc-writer-modal__photo.is-empty + .gwc-writer-modal__main {
		grid-column: 1 / -1;
	}

	.gwc-writer-modal__main {
		padding: 40px 56px 44px 36px;
	}

	.gwc-writer-modal__name {
		font-size: 2.375rem;
	}
}

@media (min-width: 1024px) {
	.gwc-writer-modal__content {
		grid-template-columns: 340px minmax(0, 1fr);
	}
}

/* ------------------------------------------------------------------
 * Lock page scroll while modal is open
 * ------------------------------------------------------------------ */
html.gwc-modal-open,
html.gwc-modal-open body {
	overflow: hidden !important;
}

html.gwc-modal-open body {
	padding-right: var(--gwc-scrollbar-width, 0px);
}

/* ------------------------------------------------------------------
 * Reduced motion
 * ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	.gwc-writers .gwc-writer-card__button,
	.gwc-writer-modal,
	.gwc-writer-modal__dialog,
	.gwc-writer-modal__close {
		transition: none;
	}

	.gwc-writers .gwc-writer-card__button:hover,
	.gwc-writers .gwc-writer-card__button:focus-visible {
		transform: none;
	}
}

/* ==================================================================
 * DIVI 5 OVERRIDE
 *
 * Divi applies:
 *
 * .et_pb_post_content ul > li,
 * .entry-content ul > li {
 *     display: list-item !important;
 *     list-style-type: disc !important;
 *     list-style-position: inside !important;
 *     padding-left: 20px !important;
 * }
 *
 * These rules intentionally override Divi ONLY inside GWC specialties.
 * ================================================================== */

.et_pb_post_content .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty,
.entry-content .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty,
.et_pb_code .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty,
.gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty {
	display: flex !important;
	align-items: flex-start !important;
	gap: 9px !important;
	list-style: none !important;
	list-style-type: none !important;
	list-style-position: outside !important;
	padding: 0 !important;
	padding-left: 0 !important;
	margin: 0 !important;
	margin-left: 0 !important;
	margin-bottom: 0 !important;
	text-indent: 0 !important;
	line-height: 1.35 !important;
}

/* Kill the browser's real LI marker */
.et_pb_post_content .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty::marker,
.entry-content .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty::marker,
.et_pb_code .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty::marker,
.gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty::marker {
	content: "" !important;
	font-size: 0 !important;
	color: transparent !important;
}

/* Kill any Divi pseudo-element bullet */
.et_pb_post_content .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty::before,
.entry-content .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty::before,
.et_pb_code .gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty::before,
.gwc-writers ul.gwc-writer-specialties > li.gwc-writer-specialty::before {
	content: none !important;
	display: none !important;
}

/* Restore the specialty UL */
.et_pb_post_content .gwc-writers ul.gwc-writer-specialties,
.entry-content .gwc-writers ul.gwc-writer-specialties,
.et_pb_code .gwc-writers ul.gwc-writer-specialties,
.gwc-writers ul.gwc-writer-specialties {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	gap: 7px !important;
	width: max-content !important;
	max-width: 100% !important;
	padding: 0 !important;
	padding-left: 0 !important;
	margin: 0 auto !important;
	list-style: none !important;
	list-style-type: none !important;
}

/* Preserve and align the custom checkmark */
.et_pb_post_content .gwc-writers .gwc-writer-check,
.entry-content .gwc-writers .gwc-writer-check,
.et_pb_code .gwc-writers .gwc-writer-check,
.gwc-writers .gwc-writer-check {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 0 17px !important;
	width: 17px !important;
	height: 17px !important;
	margin-top: 1px !important;
	margin-right: 5px !important;
	color: var(--gwc-gold) !important;
	background: var(--gwc-navy) !important;
	border-radius: 4px !important;
}

/* Preserve the SVG check inside the box */
.et_pb_post_content .gwc-writers .gwc-writer-check svg,
.entry-content .gwc-writers .gwc-writer-check svg,
.et_pb_code .gwc-writers .gwc-writer-check svg,
.gwc-writers .gwc-writer-check svg {
	display: block !important;
	width: 11px !important;
	height: 11px !important;
}

/* ------------------------------------------------------------------
 * Modal specialty Divi protection
 * ------------------------------------------------------------------ */
.et_pb_post_content .gwc-writer-modal ul.gwc-writer-modal__specialties > li,
.entry-content .gwc-writer-modal ul.gwc-writer-modal__specialties > li,
.gwc-writer-modal ul.gwc-writer-modal__specialties > li {
	display: flex !important;
	list-style: none !important;
	list-style-type: none !important;
	list-style-position: outside !important;
	padding-left: 0 !important;
	margin-left: 0 !important;
	text-indent: 0 !important;
}

.et_pb_post_content .gwc-writer-modal ul.gwc-writer-modal__specialties > li::marker,
.entry-content .gwc-writer-modal ul.gwc-writer-modal__specialties > li::marker,
.gwc-writer-modal ul.gwc-writer-modal__specialties > li::marker {
	content: "" !important;
	font-size: 0 !important;
	color: transparent !important;
}

.et_pb_post_content .gwc-writer-modal ul.gwc-writer-modal__specialties > li::before,
.entry-content .gwc-writer-modal ul.gwc-writer-modal__specialties > li::before,
.gwc-writer-modal ul.gwc-writer-modal__specialties > li::before {
	content: none !important;
	display: none !important;
}