/*
 * Ghostwriters Central Videos - front-end styles
 * Same design language as the Writers grid (cream cards, navy, gold accents).
 * Every selector is scoped under .gwc-videos, .gwc-video-modal or
 * .gwc-video-single__player so nothing leaks into Divi or the rest of the site.
 */

/* ------------------------------------------------------------------
 * Design tokens
 * ------------------------------------------------------------------ */
.gwc-videos,
.gwc-video-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-thumb-ratio: 16 / 9;
	--gwc-icon-size: 56px;
	--gwc-transition: 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

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

.gwc-videos .gwc-videos-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;
}

/* Small tablet: 2 columns */
@media (min-width: 560px) {
	.gwc-videos .gwc-videos-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Tablet / laptop: 3 columns */
@media (min-width: 900px) {
	.gwc-videos .gwc-videos-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		--gwc-gap: 24px;
	}
}

/* Desktop: 4 columns */
@media (min-width: 1280px) {
	.gwc-videos .gwc-videos-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.gwc-videos .gwc-videos-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);
}

/* ------------------------------------------------------------------
 * Filtering
 * ------------------------------------------------------------------ */
.gwc-videos .gwc-video-card[hidden],
.gwc-videos .gwc-video-card.is-filtered-out {
	display: none !important;
}

.gwc-videos .gwc-videos-filter-empty[hidden] {
	display: none !important;
}

.gwc-videos .gwc-videos-filter-empty {
	margin-bottom: var(--gwc-gap);
}

/* Built-in filter bar ([ghostwriters_videos filters="yes"]) */
.gwc-videos .gwc-videos-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0 0 28px;
	padding: 0;
}

/* Icon cards: light card, navy circle with gold icon, bold label (matches the library page) */
.gwc-videos .gwc-videos-filters--icons {
	--gwc-filter-card-bg: #ffffff;
	--gwc-filter-card-w: 118px;
	--gwc-filter-circle: 82px;
	gap: 12px;
	align-items: stretch;
	margin-bottom: 36px;
}

.gwc-videos .gwc-videos-filter--icon {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	width: var(--gwc-filter-card-w);
	margin: 0;
	padding: 16px 8px 14px;
	color: var(--gwc-navy);
	background: var(--gwc-filter-card-bg);
	border: 1px solid var(--gwc-border);
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(7, 28, 44, 0.05);
	cursor: pointer;
	text-align: center;
	transition: transform var(--gwc-transition), box-shadow var(--gwc-transition), border-color var(--gwc-transition);
	-webkit-appearance: none;
	appearance: none;
}

.gwc-videos .gwc-videos-filter--icon:hover,
.gwc-videos .gwc-videos-filter--icon:focus-visible {
	transform: translateY(-3px);
	box-shadow: var(--gwc-shadow-hover);
	border-color: rgba(217, 179, 108, 0.7);
}

.gwc-videos .gwc-videos-filter--icon:focus {
	outline: none;
}

.gwc-videos .gwc-videos-filter--icon:focus-visible {
	outline: 3px solid var(--gwc-gold);
	outline-offset: 3px;
}

.gwc-videos .gwc-videos-filter__circle {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--gwc-filter-circle);
	height: var(--gwc-filter-circle);
	color: var(--gwc-gold);
	background: var(--gwc-navy);
	border-radius: 50%;
	transition: background-color var(--gwc-transition), color var(--gwc-transition), box-shadow var(--gwc-transition);
}

.gwc-videos .gwc-videos-filter__circle svg {
	width: 52%;
	height: 52%;
}

.gwc-videos .gwc-videos-filter__circle img {
	width: 55%;
	height: 55%;
	object-fit: contain;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.gwc-videos .gwc-videos-filter--icon .gwc-videos-filter__label {
	display: block;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--gwc-navy);
}

.gwc-videos .gwc-videos-filter--icon.is-active,
.gwc-videos .gwc-videos-filter--icon.gwcv-filter-active {
	border-color: var(--gwc-gold);
	box-shadow: 0 0 0 2px var(--gwc-gold), var(--gwc-shadow);
}

.gwc-videos .gwc-videos-filter--icon.is-active .gwc-videos-filter__circle,
.gwc-videos .gwc-videos-filter--icon.gwcv-filter-active .gwc-videos-filter__circle {
	color: var(--gwc-navy);
	background: var(--gwc-gold);
}

@media (max-width: 480px) {
	.gwc-videos .gwc-videos-filters--icons {
		--gwc-filter-card-w: calc(50% - 6px);
		--gwc-filter-circle: 68px;
	}
}

/* Pill buttons ([ghostwriters_videos filters="pills"]) */
.gwc-videos .gwc-videos-filter--pill {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 9px 18px;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--gwc-navy);
	background: var(--gwc-card-bg);
	border: 2px solid rgba(7, 28, 44, 0.18);
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.gwc-videos .gwc-videos-filter--pill:hover,
.gwc-videos .gwc-videos-filter--pill:focus-visible {
	border-color: var(--gwc-gold);
}

.gwc-videos .gwc-videos-filter--pill:focus {
	outline: none;
}

.gwc-videos .gwc-videos-filter--pill:focus-visible {
	outline: 3px solid var(--gwc-gold);
	outline-offset: 2px;
}

.gwc-videos .gwc-videos-filter--pill.is-active,
.gwc-videos .gwc-videos-filter--pill.gwcv-filter-active {
	color: var(--gwc-gold);
	background: var(--gwc-navy);
	border-color: var(--gwc-navy);
}

/* External triggers (e.g. Divi icon blurbs linked to #gwcv-slug) get this class when active.
 * Style it in the theme; this default only marks the active icon with a gold ring. */
.et_pb_blurb.gwcv-filter-active .et_pb_main_blurb_image .et-pb-icon,
.et_pb_blurb.gwcv-filter-active .et_pb_main_blurb_image img {
	box-shadow: 0 0 0 4px #d9b36c;
	border-radius: 50%;
}

/* ------------------------------------------------------------------
 * Card
 * ------------------------------------------------------------------ */
.gwc-videos .gwc-video-card {
	display: flex;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.gwc-videos .gwc-video-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-videos .gwc-video-card__button:hover,
.gwc-videos .gwc-video-card__button:focus-visible {
	transform: translateY(-4px);
	box-shadow: var(--gwc-shadow-hover);
	border-color: rgba(217, 179, 108, 0.7);
}

.gwc-videos .gwc-video-card__button:focus {
	outline: none;
}

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

.gwc-videos .gwc-video-card__button:active {
	transform: translateY(-2px);
}

/* Thumbnail */
.gwc-videos .gwc-video-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: var(--gwc-thumb-ratio);
	overflow: hidden;
	background: #0b2033;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
	.gwc-videos .gwc-video-thumb {
		height: 0;
		padding-top: 56.25%;
	}

	.gwc-videos .gwc-video-thumb__img,
	.gwc-videos .gwc-video-thumb__placeholder {
		position: absolute;
		top: 0;
		left: 0;
	}
}

.gwc-videos .gwc-video-thumb__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;
	transition: transform 600ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.gwc-videos .gwc-video-card__button:hover .gwc-video-thumb__img {
	transform: scale(1.04);
}

.gwc-videos .gwc-video-thumb__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: rgba(217, 179, 108, 0.55);
	background: linear-gradient(160deg, #0f2a40 0%, #071c2c 100%);
}

.gwc-videos .gwc-video-thumb__placeholder svg {
	width: 26%;
	height: 26%;
}

/* Navy play badge overlapping the thumbnail */
.gwc-videos .gwc-video-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);
	transition: background-color var(--gwc-transition), color var(--gwc-transition);
}

.gwc-videos .gwc-video-card__button:hover .gwc-video-icon,
.gwc-videos .gwc-video-card__button:focus-visible .gwc-video-icon {
	color: var(--gwc-navy);
	background: var(--gwc-gold);
}

.gwc-videos .gwc-video-icon svg {
	width: 46%;
	height: 46%;
	margin-left: 6%;
}

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

.gwc-videos .gwc-video-title {
	position: relative;
	margin: 0 0 12px;
	padding: 0 0 12px;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.01em;
	color: var(--gwc-navy);
	text-transform: none;
}

/* Small gold rule under the title */
.gwc-videos .gwc-video-title::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 36px;
	height: 2px;
	background: var(--gwc-gold);
	transform: translateX(-50%);
	border-radius: 2px;
}

/* Topic checklist */
.gwc-videos .gwc-video-categories {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 7px;
	width: max-content;
	max-width: 100%;
	margin: 0 auto 10px;
	padding: 0;
	list-style: none;
	text-align: left;
}

.gwc-videos .gwc-video-category {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 0;
	padding: 0;
	font-size: 0.9375rem;
	line-height: 1.35;
	color: var(--gwc-text-muted);
	list-style: none;
}

.gwc-videos .gwc-video-category::before {
	content: none;
}

.gwc-videos .gwc-video-check,
.gwc-video-modal .gwc-video-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	margin-top: 1px;
	color: var(--gwc-gold);
	background: var(--gwc-navy);
	border-radius: 4px;
}

.gwc-videos .gwc-video-check svg,
.gwc-video-modal .gwc-video-check svg {
	width: 11px;
	height: 11px;
}

.gwc-videos .gwc-video-category__label {
	min-width: 0;
}

.gwc-videos .gwc-video-excerpt {
	margin: 2px 0 0;
	padding: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--gwc-text-muted);
}

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

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

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

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

.gwc-video-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 960px;
	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-video-modal.is-visible .gwc-video-modal__dialog {
	transform: translateY(0) scale(1);
}

.gwc-video-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-video-modal__close:hover,
.gwc-video-modal__close:focus-visible {
	color: var(--gwc-navy);
	background: var(--gwc-gold);
	transform: scale(1.05);
}

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

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

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

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

/* 16:9 player */
.gwc-video-modal__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	margin: 0;
	background: #000;
	line-height: 0;
}

@supports not (aspect-ratio: 1 / 1) {
	.gwc-video-modal__player {
		height: 0;
		padding-top: 56.25%;
	}
}

.gwc-video-modal__player iframe,
.gwc-video-modal__player img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
}

.gwc-video-modal__player.is-empty {
	display: none;
}

.gwc-video-modal__main {
	padding: 26px 24px 30px;
}

.gwc-video-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-video-modal__title {
	margin: 0 0 14px;
	padding: 0 0 14px;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--gwc-navy);
	border-bottom: 2px solid var(--gwc-gold);
}

.gwc-video-modal__categories-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-video-modal__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.gwc-video-modal__categories-wrap.is-empty {
	display: none;
}

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

.gwc-video-modal__category::before {
	content: none;
}

/* Description: normal WordPress editor formatting, scoped */
.gwc-video-modal__description {
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--gwc-text);
	overflow-wrap: anywhere;
}

.gwc-video-modal__description.is-empty {
	display: none;
}

.gwc-video-modal__description > :first-child {
	margin-top: 0;
}

.gwc-video-modal__description > :last-child {
	margin-bottom: 0;
}

.gwc-video-modal__description p {
	margin: 0 0 1.1em;
}

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

.gwc-video-modal__description h2 { font-size: 1.5rem; }
.gwc-video-modal__description h3 { font-size: 1.3rem; }
.gwc-video-modal__description h4 { font-size: 1.15rem; }

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

.gwc-video-modal__description ul { list-style: disc; }
.gwc-video-modal__description ol { list-style: decimal; }

.gwc-video-modal__description li {
	margin: 0 0 0.35em;
}

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

.gwc-video-modal__description a:hover,
.gwc-video-modal__description a:focus {
	color: #b08c45;
}

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

/* Links row */
.gwc-video-modal__links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
	margin: 22px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--gwc-border);
}

.gwc-video-modal__links.is-empty {
	display: none;
}

.gwc-video-modal__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--gwc-card-bg) !important;
	text-decoration: none !important;
	background: var(--gwc-navy);
	border: 2px solid var(--gwc-navy);
	border-radius: 999px;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.gwc-video-modal__link:hover,
.gwc-video-modal__link:focus-visible {
	color: var(--gwc-navy) !important;
	background: var(--gwc-gold);
	border-color: var(--gwc-gold);
}

.gwc-video-modal__link--secondary {
	color: var(--gwc-navy) !important;
	background: transparent;
}

.gwc-video-modal__link svg {
	width: 16px;
	height: 16px;
}

.gwc-video-modal__link.is-hidden {
	display: none;
}

/* Wider screens */
@media (min-width: 700px) {
	.gwc-video-modal {
		padding: 32px;
	}

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

	.gwc-video-modal__main {
		padding: 32px 44px 40px;
	}

	.gwc-video-modal__title {
		font-size: 2.125rem;
	}
}

/* Lock page scroll while the 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);
}

/* ------------------------------------------------------------------
 * Single video page player (above the description)
 * ------------------------------------------------------------------ */
.gwc-video-single__player {
	position: relative;
	width: 100%;
	max-width: 960px;
	aspect-ratio: 16 / 9;
	margin: 0 0 28px;
	overflow: hidden;
	background: #000;
	border-radius: 16px;
	box-shadow: 0 16px 40px rgba(7, 28, 44, 0.18);
	line-height: 0;
}

@supports not (aspect-ratio: 1 / 1) {
	.gwc-video-single__player {
		height: 0;
		padding-top: 56.25%;
	}
}

.gwc-video-single__player iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	border: 0;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
	.gwc-videos .gwc-video-card__button,
	.gwc-videos .gwc-video-thumb__img,
	.gwc-video-modal,
	.gwc-video-modal__dialog,
	.gwc-video-modal__close {
		transition: none;
	}

	.gwc-videos .gwc-video-card__button:hover,
	.gwc-videos .gwc-video-card__button:focus-visible {
		transform: none;
	}

	.gwc-videos .gwc-video-card__button:hover .gwc-video-thumb__img {
		transform: none;
	}
}
