/**
 * News Section – UI/UX premium, responsivo e profissional
 * @package GuiaSaude
 */

/* ---- Variáveis locais (fallback usa vars do tema) ---- */
.news-section {
	--news-radius: 16px;
	--news-radius-sm: 12px;
	--news-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
	--news-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.1);
	--news-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Section ---- */
.news-section {
	padding: 3.5rem 0;
	background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.news-section-container {
	width: 100%;
}

@media (min-width: 768px) {
	.news-section {
		padding: 5rem 0 5.5rem;
	}
}

@media (min-width: 1024px) {
	.news-section {
		padding: 6rem 0 6.5rem;
	}
}

/* ---- Header ---- */
.news-section-header {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 2.5rem;
	align-items: flex-start;
}

.news-section-header-left {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.news-section-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.4rem 1rem;
	border-radius: 9999px;
	background: rgba(73, 179, 205, 0.12);
	color: var(--primary-color, #0ea5e9);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	width: fit-content;
}

.news-section-title {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--text-color, #1e293b);
	margin: 0;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.news-section-header-right {
	flex-shrink: 0;
}

.news-section-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0;
	color: var(--primary-color, #0ea5e9);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9375rem;
	transition: color var(--news-transition), gap var(--news-transition);
}

.news-section-link:hover {
	color: var(--primary-dark, #0284c7);
	gap: 0.625rem;
}

.news-section-link:focus-visible {
	outline: 2px solid var(--primary-color, #0ea5e9);
	outline-offset: 3px;
	border-radius: 4px;
}

.news-section-link-icon {
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
	transition: transform var(--news-transition);
}

.news-section-link:hover .news-section-link-icon {
	transform: translateX(2px);
}

@media (min-width: 768px) {
	.news-section-header {
		flex-direction: row;
		align-items: flex-end;
		justify-content: space-between;
		margin-bottom: 3rem;
	}

	.news-section-title {
		font-size: 2.125rem;
	}
}

/* ---- Grid ---- */
.news-section-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

@media (min-width: 1024px) {
	.news-section-grid {
		grid-template-columns: 1.15fr 0.85fr;
		gap: 2.5rem;
		align-items: start;
	}
}

@media (min-width: 1280px) {
	.news-section-grid {
		gap: 3rem;
	}
}

/* ---- Main (featured + secondary) ---- */
.news-main {
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
	min-width: 0;
}

/* ---- Featured card ---- */
.news-featured-card {
	background: #fff;
	border-radius: var(--news-radius);
	overflow: hidden;
	box-shadow: var(--news-shadow);
	border: 1px solid rgba(0, 0, 0, 0.06);
	transition: box-shadow var(--news-transition), border-color var(--news-transition);
}

.news-featured-card:focus-within {
	box-shadow: var(--news-shadow-hover);
}

.news-featured-link {
	display: block;
	text-decoration: none;
	color: inherit;
	outline: none;
}

.news-featured-link:focus-visible {
	outline: 2px solid var(--primary-color, #0ea5e9);
	outline-offset: 2px;
	border-radius: var(--news-radius);
}

.news-featured-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
}

.news-featured-image {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f1f5f9;
}

.news-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-featured-link:hover .news-featured-image img,
.news-featured-link:focus-visible .news-featured-image img {
	transform: scale(1.03);
}

.news-featured-content {
	padding: 1.5rem 1.25rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.5rem;
}

.news-featured-category {
	display: inline-block;
	width: fit-content;
	padding: 0.3rem 0.75rem;
	border-radius: 9999px;
	background: rgba(73, 179, 205, 0.12);
	color: var(--primary-color, #0ea5e9);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.news-featured-title {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--text-color, #1e293b);
	margin: 0;
	line-height: 1.35;
	letter-spacing: -0.01em;
	transition: color var(--news-transition);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.news-featured-link:hover .news-featured-title,
.news-featured-link:focus-visible .news-featured-title {
	color: var(--primary-color, #0ea5e9);
}

.news-featured-excerpt {
	font-size: 0.9375rem;
	color: var(--text-light, #64748b);
	line-height: 1.5;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.news-featured-meta {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.8125rem;
	color: var(--text-light, #64748b);
	margin-top: 0.25rem;
}

.news-featured-meta .news-meta-icon {
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
	opacity: 0.85;
}

@media (min-width: 768px) {
	.news-featured-grid {
		grid-template-columns: 1.1fr 1fr;
	}

	.news-featured-image {
		aspect-ratio: auto;
		min-height: 280px;
	}

	.news-featured-content {
		padding: 1.75rem 1.5rem;
	}

	.news-featured-title {
		font-size: 1.5rem;
		-webkit-line-clamp: 2;
	}
}

/* ---- Secondary cards ---- */
.news-secondary-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
}

.news-secondary-card {
	background: #fff;
	border-radius: var(--news-radius-sm);
	overflow: hidden;
	box-shadow: var(--news-shadow);
	border: 1px solid rgba(0, 0, 0, 0.06);
	transition: box-shadow var(--news-transition), border-color var(--news-transition);
}

.news-secondary-card:focus-within {
	box-shadow: var(--news-shadow-hover);
}

.news-secondary-link {
	display: block;
	text-decoration: none;
	color: inherit;
	outline: none;
}

.news-secondary-link:focus-visible {
	outline: 2px solid var(--primary-color, #0ea5e9);
	outline-offset: 2px;
	border-radius: var(--news-radius-sm);
}

.news-secondary-image {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f1f5f9;
}

.news-secondary-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-secondary-link:hover .news-secondary-image img,
.news-secondary-link:focus-visible .news-secondary-image img {
	transform: scale(1.04);
}

.news-secondary-content {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.news-secondary-category {
	display: inline-block;
	width: fit-content;
	padding: 0.25rem 0.625rem;
	border-radius: 9999px;
	background: var(--light-gray, #f1f5f9);
	color: var(--text-color, #475569);
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.news-secondary-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-color, #1e293b);
	margin: 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color var(--news-transition);
}

.news-secondary-link:hover .news-secondary-title,
.news-secondary-link:focus-visible .news-secondary-title {
	color: var(--primary-color, #0ea5e9);
}

.news-secondary-meta {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.75rem;
	color: var(--text-light, #64748b);
}

.news-secondary-meta .news-meta-icon {
	width: 0.75rem;
	height: 0.75rem;
	flex-shrink: 0;
	opacity: 0.85;
}

@media (min-width: 640px) {
	.news-secondary-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.5rem;
	}
}

/* ---- Sidebar (Mais lidas) ---- */
.news-sidebar {
	position: relative;
}

.news-sidebar-inner {
	background: #fff;
	border-radius: var(--news-radius);
	padding: 1.5rem 1.25rem;
	box-shadow: var(--news-shadow);
	border: 1px solid rgba(0, 0, 0, 0.06);
}

.news-sidebar-title {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--text-color, #1e293b);
	margin: 0 0 1.25rem 0;
	padding-bottom: 1rem;
	border-bottom: 2px solid rgba(73, 179, 205, 0.25);
}

.news-sidebar-title-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 10px;
	background: rgba(73, 179, 205, 0.15);
	color: var(--primary-color, #0ea5e9);
	flex-shrink: 0;
}

.news-sidebar-title-icon svg {
	width: 1rem;
	height: 1rem;
}

.news-sidebar-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.news-sidebar-item {
	margin: 0;
	padding: 0;
}

.news-sidebar-item-link {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 0.875rem 0.75rem;
	border-radius: var(--news-radius-sm);
	text-decoration: none;
	color: inherit;
	transition: background var(--news-transition);
	outline: none;
	border: none;
	width: 100%;
	text-align: left;
	cursor: pointer;
}

.news-sidebar-item-link:hover {
	background: rgba(73, 179, 205, 0.06);
}

.news-sidebar-item-link:focus-visible {
	background: rgba(73, 179, 205, 0.08);
	outline: 2px solid var(--primary-color, #0ea5e9);
	outline-offset: 2px;
}

.news-sidebar-number {
	flex-shrink: 0;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 8px;
	background: linear-gradient(135deg, rgba(73, 179, 205, 0.2) 0%, rgba(73, 179, 205, 0.12) 100%);
	color: var(--primary-color, #0ea5e9);
	font-size: 0.8125rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.news-sidebar-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.news-sidebar-item-title {
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--text-color, #1e293b);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color var(--news-transition);
}

.news-sidebar-item-link:hover .news-sidebar-item-title {
	color: var(--primary-color, #0ea5e9);
}

.news-sidebar-item-meta {
	font-size: 0.75rem;
	color: var(--text-light, #64748b);
}

.news-sidebar-item-arrow {
	flex-shrink: 0;
	margin-top: 0.25rem;
	color: var(--text-light, #94a3b8);
	transition: transform var(--news-transition), color var(--news-transition);
}

.news-sidebar-item-link:hover .news-sidebar-item-arrow {
	transform: translateX(2px);
	color: var(--primary-color, #0ea5e9);
}

.news-sidebar-item:not(:last-child) .news-sidebar-item-link {
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

@media (min-width: 1024px) {
	.news-sidebar-inner {
		padding: 1.75rem 1.5rem;
		position: sticky;
		top: 2rem;
	}

	.news-sidebar-title {
		margin-bottom: 1.25rem;
		padding-bottom: 1rem;
	}
}

/* ---- Responsivo: seção em telas pequenas ---- */
@media (max-width: 1023px) {
	.news-section-grid {
		gap: 2rem;
	}

	.news-sidebar {
		margin-top: 0.5rem;
	}
}

@media (max-width: 767px) {
	.news-section {
		padding: 2.75rem 0 3rem;
	}

	.news-section-header {
		margin-bottom: 2rem;
	}

	.news-section-title {
		font-size: 1.5rem;
	}

	.news-featured-content {
		padding: 1.25rem 1rem;
	}

	.news-featured-title {
		font-size: 1.125rem;
		-webkit-line-clamp: 2;
	}

	.news-secondary-content {
		padding: 1rem;
	}

	.news-sidebar-inner {
		padding: 1.25rem 1rem;
	}
}

@media (max-width: 479px) {
	.news-section {
		padding: 2rem 0 2.5rem;
	}

	.news-section-badge {
		font-size: 0.75rem;
		padding: 0.35rem 0.875rem;
	}

	.news-section-title {
		font-size: 1.375rem;
	}

	.news-featured-image {
		aspect-ratio: 4 / 3;
	}

	.news-secondary-grid {
		gap: 1rem;
	}
}
