/**
 * CPH News Grid Styles
 *
 * @package Salient_Child
 * @since   1.0.0
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

.cph-news-grid {
	--grid-gap: 30px;
	--card-radius: 45px;
	--featured-radius: 25px;
	--button-radius: 50px;
	--filter-radius: 45px;
	--border-color: #000;
	--border-width: 1px;
	--text-color: #000;
	--font-heading: "Area Normal", sans-serif;
	--font-body: "Aktiv Grotesk", sans-serif;
}

/* ==========================================================================
   Section Header (LATEST, etc.)
   ========================================================================== */

.cph-news-section-header {
	margin-bottom: 80px;
}

.cph-news-section-header__title {
	margin: 0 0 20px;
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 600;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--text-color);
}

.cph-news-section-header__line {
	position: relative;
	width: 100%;
	max-width: 692px;
	height: 1px;
	background: var(--border-color);
}

.cph-news-section-header__line-accent {
	position: absolute;
	top: -2px;
	right: 0;
	width: 208px;
	height: 5px;
	background: var(--text-color);
}

/* ==========================================================================
   Featured Post Section
   ========================================================================== */

.cph-news-featured {
	margin-bottom: 80px;
}

.cph-news-featured__card {
	display: grid;
	grid-template-columns: minmax(300px, 571px) 1fr;
	gap: 80px;
	align-items: start;
}

.cph-news-featured__image {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--featured-radius);
}

.cph-news-featured__image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cph-news-featured__content {
	padding-top: 40px;
}

.cph-news-featured__date {
	display: block;
	margin-bottom: 24px;
	font-family: var(--font-heading);
	font-size: 30px;
	font-weight: 400;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--text-color);
}

.cph-news-featured__title {
	margin: 0 0 32px;
	font-family: var(--font-heading);
	font-size: clamp(36px, 3.5vw, 55px);
	font-weight: 400;
	line-height: 1.36;
	color: var(--text-color);
}

.cph-news-featured__excerpt {
	margin: 0 0 48px;
	font-family: var(--font-body);
	font-size: 22px;
	font-weight: 400;
	line-height: 2.08;
	color: var(--text-color);
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */

.cph-news-filters {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 40px;
}

.cph-news-filters__left {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

/* Filter Dropdowns */
.cph-news-filter {
	position: relative;
}

.cph-news-filter__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 220px;
	height: 52px;
	padding: 0 24px;
	border: var(--border-width) solid var(--border-color);
	border-radius: var(--filter-radius);
	background: transparent;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.cph-news-filter__trigger:hover {
	background-color: rgba(0, 0, 0, 0.03);
}

.cph-news-filter__trigger[aria-expanded="true"] {
	background-color: rgba(0, 0, 0, 0.05);
}

.cph-news-filter__trigger[aria-expanded="true"] .cph-news-filter__arrow {
	transform: rotate(180deg);
}

.cph-news-filter__label {
	font-family: var(--font-heading);
	font-size: 18px;
	font-weight: 400;
	letter-spacing: 0.48px;
	color: var(--text-color);
}

.cph-news-filter__arrow {
	width: 18px;
	height: auto;
	color: var(--text-color);
	transition: transform 0.2s ease;
}

/* Filter Dropdown Menu */
.cph-news-filter__dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 100;
	display: none;
	width: 100%;
	margin: 0;
	padding: 12px 0;
	list-style: none;
	background: #fff;
	border: var(--border-width) solid var(--border-color);
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.cph-news-filter__dropdown.is-open {
	display: block;
}

.cph-news-filter__dropdown li {
	padding: 10px 24px;
	font-family: var(--font-heading);
	font-size: 16px;
	font-weight: 400;
	color: var(--text-color);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.cph-news-filter__dropdown li:hover {
	background-color: rgba(0, 0, 0, 0.05);
}

.cph-news-filter__dropdown li[aria-selected="true"] {
	background-color: rgba(0, 0, 0, 0.08);
	font-weight: 600;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.cph-news-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 32px;
	border: var(--border-width) solid var(--border-color);
	border-radius: var(--button-radius);
	background: transparent;
	font-family: var(--font-heading);
	font-size: 18px;
	font-weight: 400;
	letter-spacing: 0.48px;
	color: var(--text-color);
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cph-news-button:hover {
	background-color: var(--text-color);
	color: #fff;
}

.cph-news-button--wide {
	width: 280px;
	height: 70px;
	font-size: 22px;
}

.cph-news-button--small {
	width: 140px;
	height: 70px;
	font-size: 18px;
}

.cph-news-button--reset {
	width: auto;
	min-width: 120px;
}

/* ==========================================================================
   View Toggle
   ========================================================================== */

.cph-news-view-toggle {
	display: flex;
	border: var(--border-width) solid var(--border-color);
	border-radius: var(--button-radius);
	overflow: hidden;
}

.cph-news-view-toggle__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 24px;
	border: none;
	background: transparent;
	font-family: var(--font-heading);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--text-color);
	cursor: pointer;
	transition: all 0.2s ease;
}

.cph-news-view-toggle__btn.is-active {
	background: var(--text-color);
	color: #fff;
}

.cph-news-view-toggle__btn:hover:not(.is-active) {
	background: rgba(0, 0, 0, 0.05);
}

.cph-news-view-toggle__icon {
	width: 16px;
	height: 16px;
}

/* ==========================================================================
   News Grid Items Container (supports both grid and list views)
   ========================================================================== */

.cph-news-grid__items {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--grid-gap);
}

/* List View Mode */
.cph-news-grid__items[data-view="list"] {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* ==========================================================================
   News Grid Cards (Grid View)
   ========================================================================== */

.cph-news-card {
	display: flex;
	flex-direction: column;
	border: var(--border-width) solid var(--border-color);
	border-radius: var(--card-radius);
	overflow: hidden;
	background: #fff;
}

.cph-news-card__image {
	position: relative;
	aspect-ratio: 693 / 478;
	overflow: hidden;
}

.cph-news-card__image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cph-news-card__content {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 40px;
}

.cph-news-card__title {
	margin: 0 0 16px;
	font-family: var(--font-heading);
	font-size: clamp(20px, 1.8vw, 30px);
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--text-color);
}

.cph-news-card__source {
	margin: 0 0 8px;
	font-family: var(--font-body);
	font-size: 22px;
	font-weight: 500;
	line-height: 2.08;
	color: var(--text-color);
}

.cph-news-card__date {
	display: block;
	margin-bottom: auto;
	font-family: var(--font-heading);
	font-size: 30px;
	font-weight: 400;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--text-color);
}

.cph-news-card .cph-news-button {
	align-self: flex-end;
	margin-top: 32px;
}

/* ==========================================================================
   Load More Section
   ========================================================================== */

.cph-news-grid__load-more {
	display: flex;
	justify-content: center;
	margin-top: 60px;
}

.cph-news-load-more.is-loading {
	pointer-events: none;
	opacity: 0.6;
}

.cph-news-load-more.is-loading span::after {
	content: "...";
	animation: loading-dots 1s infinite;
}

@keyframes loading-dots {
	0%, 20% { content: "."; }
	40% { content: ".."; }
	60%, 100% { content: "..."; }
}

/* Empty State */
.cph-news-grid__empty {
	grid-column: 1 / -1;
	padding: 60px;
	font-family: var(--font-body);
	font-size: 18px;
	text-align: center;
	color: #666;
}

/* ==========================================================================
   News List Items (List View)
   ========================================================================== */

.cph-news-list-item {
	display: grid;
	grid-template-columns: 180px 1fr auto;
	gap: 40px;
	align-items: center;
	padding: 32px 0;
	border-bottom: var(--border-width) solid var(--border-color);
	text-decoration: none;
	color: inherit;
	transition: all 0.25s ease;
}

.cph-news-list-item:first-child {
	border-top: var(--border-width) solid var(--border-color);
}

.cph-news-list-item:hover {
	background: rgba(0, 0, 0, 0.02);
	padding-left: 20px;
	padding-right: 20px;
	margin-left: -20px;
	margin-right: -20px;
}

.cph-news-list-item:hover .cph-news-list-item__image img {
	transform: scale(1.05);
}

.cph-news-list-item:hover .cph-news-list-item__arrow {
	transform: translateX(4px);
}

/* List Item - Image Column */
.cph-news-list-item__image {
	width: 180px;
	height: 120px;
	border-radius: 16px;
	overflow: hidden;
	flex-shrink: 0;
}

.cph-news-list-item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

/* List Item - Content Column */
.cph-news-list-item__content {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.cph-news-list-item__meta {
	display: flex;
	align-items: center;
	gap: 16px;
}

.cph-news-list-item__date {
	font-family: var(--font-heading);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #666;
}

.cph-news-list-item__source {
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 500;
	color: #666;
}

.cph-news-list-item__source::before {
	content: "—";
	margin-right: 16px;
	color: #ccc;
}

.cph-news-list-item__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 400;
	line-height: 1.35;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--text-color);
	/* Truncate to 2 lines */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* List Item - Arrow Column */
.cph-news-list-item__arrow {
	width: 48px;
	height: 48px;
	border: var(--border-width) solid var(--border-color);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.25s ease;
}

.cph-news-list-item__arrow svg {
	width: 20px;
	height: 20px;
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */

@media (max-width: 1200px) {
	.cph-news-featured__card {
		gap: 50px;
	}

	.cph-news-featured__excerpt {
		font-size: 18px;
		line-height: 1.8;
	}

	.cph-news-filter__trigger {
		width: 180px;
		height: 48px;
	}

	.cph-news-filter__label {
		font-size: 16px;
	}

	.cph-news-button {
		height: 48px;
		font-size: 16px;
	}

	.cph-news-button--wide {
		width: 240px;
		height: 60px;
	}

	.cph-news-card__source {
		font-size: 18px;
	}

	.cph-news-card__date {
		font-size: 24px;
	}

	/* View Toggle - Tablet */
	.cph-news-view-toggle__btn {
		padding: 12px 20px;
		font-size: 13px;
	}

	/* List Items - Tablet */
	.cph-news-list-item {
		grid-template-columns: 140px 1fr auto;
		gap: 28px;
		padding: 24px 0;
	}

	.cph-news-list-item__image {
		width: 140px;
		height: 95px;
	}

	.cph-news-list-item__title {
		font-size: 20px;
	}

	.cph-news-list-item__arrow {
		width: 44px;
		height: 44px;
	}
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */

@media (max-width: 999px) {
	.cph-news-section-header {
		margin-bottom: 50px;
	}

	.cph-news-section-header__line {
		max-width: 100%;
	}

	.cph-news-section-header__line-accent {
		width: 120px;
	}

	.cph-news-featured {
		margin-bottom: 50px;
	}

	.cph-news-featured__card {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.cph-news-featured__image {
		max-width: 100%;
		aspect-ratio: 4 / 3;
	}

	.cph-news-featured__content {
		padding-top: 0;
	}

	.cph-news-featured__date {
		font-size: 20px;
		margin-bottom: 16px;
	}

	.cph-news-featured__title {
		font-size: 32px;
		margin-bottom: 20px;
	}

	.cph-news-featured__excerpt {
		font-size: 16px;
		margin-bottom: 30px;
	}

	/* Filters stack vertically */
	.cph-news-filters {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.cph-news-filters__left {
		flex-direction: column;
	}

	.cph-news-filters__right {
		width: 100%;
	}

	.cph-news-filter__trigger {
		width: 100%;
		height: 50px;
	}

	.cph-news-filter__label {
		font-size: 16px;
	}

	.cph-news-button {
		height: 50px;
		font-size: 16px;
	}

	.cph-news-button--wide,
	.cph-news-button--reset {
		width: 100%;
	}

	.cph-news-button--small {
		width: 140px;
	}

	/* View Toggle - Mobile */
	.cph-news-view-toggle {
		width: 100%;
	}

	.cph-news-view-toggle__btn {
		flex: 1;
		padding: 14px 16px;
		font-size: 13px;
	}

	/* Single column grid */
	.cph-news-grid__items {
		grid-template-columns: 1fr;
	}

	.cph-news-card {
		border-radius: 30px;
	}

	.cph-news-card__content {
		padding: 30px;
	}

	.cph-news-card__title {
		font-size: 20px;
	}

	.cph-news-card__source {
		font-size: 16px;
	}

	.cph-news-card__date {
		font-size: 20px;
	}

	.cph-news-card .cph-news-button {
		width: 140px;
		height: 60px;
		font-size: 18px;
	}

	/* List Items - Mobile: Compact stacked layout */
	.cph-news-list-item {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 24px 0;
	}

	.cph-news-list-item:hover {
		padding-left: 0;
		padding-right: 0;
		margin-left: 0;
		margin-right: 0;
	}

	.cph-news-list-item__image {
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
		border-radius: 20px;
	}

	.cph-news-list-item__content {
		gap: 12px;
	}

	.cph-news-list-item__meta {
		flex-wrap: wrap;
		gap: 8px;
	}

	.cph-news-list-item__source::before {
		display: none;
	}

	.cph-news-list-item__title {
		font-size: 18px;
		-webkit-line-clamp: 3;
	}

	.cph-news-list-item__arrow {
		display: none;
	}

	.cph-news-grid__load-more {
		margin-top: 40px;
	}

	.cph-news-grid__load-more .cph-news-button {
		width: 100%;
		max-width: 280px;
	}
}

/* ==========================================================================
   Responsive - Small Mobile
   ========================================================================== */

@media (max-width: 480px) {
	.cph-news-featured__date {
		font-size: 16px;
	}

	.cph-news-featured__title {
		font-size: 26px;
	}

	.cph-news-card__title {
		font-size: 18px;
		letter-spacing: 1px;
	}

	.cph-news-card__date {
		font-size: 16px;
	}
}

/* ==========================================================================
   Salient Overrides
   ========================================================================== */

/* Override Salient's default image styles */
.row .col .cph-news-featured__image img,
.row .col .cph-news-card__image img,
.row .col .cph-news-list-item__image img {
	width: 100%;
	height: 100%;
	max-width: none;
}
