/**
 * Nos Articles page template – Legal Family
 * Brand: #105050 (primary), #E67E22 (accent), Anuphan + Montserrat
 */

/* ── Entrance animation ──────────────────────────────── */
@keyframes cardReveal {
	from {
		opacity: 0;
		transform: translateY(28px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes accentGrow {
	from { width: 0; }
	to { width: 56px; }
}

.nos-articles-wrapper {
	--lf-primary: #105050;
	--lf-primary-deep: #0c3d3d;
	--lf-accent: #E67E22;
	--lf-accent-hover: #d35400;
	--lf-bg: #ffffff;
	--lf-warm-bg: #faf8f5;
	--lf-text: #333333;
	--lf-overlap: 140px;
	padding-top: 0 !important;
	overflow-x: hidden;
}

/* ── Hero ─────────────────────────────────────────────── */
.nos-articles-hero {
	background: var(--lf-warm-bg);
	width: 100%;
	padding: 56px 20px calc(64px + var(--lf-overlap));
	position: relative;
}

.nos-articles-hero__inner {
	max-width: 720px;
	margin: 0 auto;
	text-align: center;
	animation: fadeInUp 0.6s ease both;
}

.nos-articles-hero h1.nos-articles-hero__title {
	font-family: "Anuphan", sans-serif;
	color: var(--lf-primary);
	font-size: 42px;
	font-weight: 800;
	margin: 0 0 0.75rem;
	line-height: 1.15;
	letter-spacing: -0.5px;
}

.nos-articles-hero__intro {
	color: var(--lf-primary);
	font-size: 1.05rem;
	font-weight: 500;
	line-height: 1.7;
	opacity: 0.85;
}

.nos-articles-hero__intro p {
	margin: 0 0 0.5rem;
}

.nos-articles-hero__intro p:last-child {
	margin-bottom: 0;
}

/* Decorative accent bar below hero text */
.nos-articles-hero__inner::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	background: var(--lf-accent);
	margin: 1.5rem auto 0;
	border-radius: 2px;
	animation: accentGrow 0.5s 0.4s ease both;
}

.nos-articles-hero__line {
	width: 100%;
	margin-top: 28px;
	height: 2px;
	background: var(--lf-primary);
	opacity: 0.15;
	flex-shrink: 0;
}

/* ── Layout (sidebar + grid) ──────────────────────────── */
.nos-articles-layout {
	background: var(--lf-primary);
	width: 100%;
	margin: 0;
	padding: 0;
}

.nos-articles-layout__inner {
	display: grid;
	grid-template-columns: 200px 1fr;
	column-gap: 32px;
	align-items: stretch;
	max-width: 1400px;
	min-height: 600px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── Sidebar ──────────────────────────────────────────── */
.nos-articles-sidebar {
	width: 100%;
	padding: 0.5rem 0 2.5rem 0;
	align-self: stretch;
}

@media (min-width: 1024px) {
	.nos-articles-sidebar__nav {
		position: sticky;
		top: 100px;
	}
}

.nos-articles-sidebar__title {
	display: none;
}

.nos-articles-sidebar__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nos-articles-sidebar__list li {
	margin-bottom: 0.1rem;
}

.nos-articles-sidebar__link {
	display: block;
	padding: 0.45rem 0 0.45rem 0.85rem;
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 1.5;
	border-left: 2px solid transparent;
	transition: color 0.2s ease, border-color 0.2s ease, padding-left 0.2s ease;
}

.nos-articles-sidebar__link:hover {
	color: #fff;
	border-left-color: rgba(255, 255, 255, 0.35);
	padding-left: 1rem;
}

.nos-articles-sidebar__link.is-active {
	color: #fff;
	font-weight: 700;
	border-left-color: var(--lf-accent);
	padding-left: 1rem;
}

/* ── Main content area ────────────────────────────────── */
.nos-articles-main {
	width: 100%;
	padding: 0 2rem 3.5rem 0;
	min-width: 0;
	margin-top: calc(-1 * var(--lf-overlap));
	position: relative;
	z-index: 2;
}

/* ── Article grid ─────────────────────────────────────── */
.nos-articles-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
	margin-bottom: 2rem;
}

/* ── Card ─────────────────────────────────────────────── */
.nos-articles-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
	            box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	animation: cardReveal 0.5s ease both;
}

/* Staggered entrance — each card delays slightly */
.nos-articles-card:nth-child(1) { animation-delay: 0s; }
.nos-articles-card:nth-child(2) { animation-delay: 0.06s; }
.nos-articles-card:nth-child(3) { animation-delay: 0.12s; }
.nos-articles-card:nth-child(4) { animation-delay: 0.15s; }
.nos-articles-card:nth-child(5) { animation-delay: 0.2s; }
.nos-articles-card:nth-child(6) { animation-delay: 0.25s; }
.nos-articles-card:nth-child(7) { animation-delay: 0.28s; }
.nos-articles-card:nth-child(8) { animation-delay: 0.32s; }
.nos-articles-card:nth-child(9) { animation-delay: 0.36s; }

.nos-articles-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

/* Thumbnail */
.nos-articles-card__thumbnail {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #eef2f2;
}

.nos-articles-card__thumbnail a {
	display: block;
	height: 100%;
}

.nos-articles-card__thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.nos-articles-card:hover .nos-articles-card__thumbnail img {
	transform: scale(1.06);
}

/* Card body */
.nos-articles-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.1rem 1.15rem 1rem;
}

/* Category badge */
.nos-articles-card__badge {
	margin-bottom: 0.6rem;
}

.nos-articles-card__badge a {
	display: inline-block;
	padding: 0.2rem 0.55rem;
	background: transparent;
	color: var(--lf-accent);
	font-family: "Anuphan", sans-serif;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	text-decoration: none;
	border: 1.5px solid var(--lf-accent);
	border-radius: 3px;
	transition: background 0.2s ease, color 0.2s ease;
}

.nos-articles-card__badge a:hover {
	background: var(--lf-accent);
	color: #fff;
}

/* Title */
.nos-articles-card__title {
	font-family: "Anuphan", sans-serif;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 0.45rem;
	color: var(--lf-primary);
	letter-spacing: -0.2px;
}

.nos-articles-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.nos-articles-card__title a:hover {
	color: var(--lf-primary-deep);
}

/* Excerpt */
.nos-articles-card__excerpt {
	font-size: 0.8125rem;
	line-height: 1.55;
	color: #5a6068;
	margin-bottom: 0.5rem;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Read more CTA */
.nos-articles-card__read-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: "Anuphan", sans-serif;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--lf-accent);
	text-decoration: none;
	margin-bottom: 0.75rem;
	transition: gap 0.25s ease;
}

.nos-articles-card__read-more svg {
	width: 14px;
	height: 14px;
	transition: transform 0.25s ease;
}

.nos-articles-card:hover .nos-articles-card__read-more {
	gap: 10px;
}

.nos-articles-card:hover .nos-articles-card__read-more svg {
	transform: translateX(2px);
}

/* Meta row: date + reading time */
.nos-articles-card__meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.78rem;
	color: #8e959d;
	margin-top: auto;
	padding-top: 0.65rem;
	border-top: 1px solid #f0f0f0;
}

.nos-articles-card__date {
	white-space: nowrap;
}

.nos-articles-card__meta-sep {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: #c0c7cf;
	flex-shrink: 0;
}

.nos-articles-card__reading-time {
	white-space: nowrap;
}

/* Empty / loading states */
.nos-articles-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem 2rem;
	color: rgba(255, 255, 255, 0.75);
	font-size: 1rem;
}

.nos-articles-loading {
	text-align: center;
	padding: 2rem;
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.9375rem;
}

/* ── Pagination ───────────────────────────────────────── */
.nos-articles-pagination {
	margin-top: 2rem;
}

.nos-articles-pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0.4rem;
	justify-content: center;
}

.nos-articles-pagination .page-numbers li {
	margin: 0;
}

.nos-articles-pagination .page-numbers a,
.nos-articles-pagination .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 0.6rem;
	border: 1.5px solid rgba(255, 255, 255, 0.35);
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 500;
	transition: all 0.2s ease;
}

.nos-articles-pagination .page-numbers a:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.6);
	color: #fff;
}

.nos-articles-pagination .page-numbers .current {
	background: #fff;
	color: var(--lf-primary);
	border-color: #fff;
	font-weight: 700;
}

/* ── Social strip under articles ──────────────────────── */
.nos-articles-social {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
}

.nos-articles-social__line {
	width: 200px;
	height: 1px;
	background: rgba(255, 255, 255, 0.2);
	display: block;
}

.nos-articles-social__list {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0;
	margin: 0;
}

.nos-articles-social__link {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.7);
	border: 1.5px solid rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	text-decoration: none;
	transition: all 0.25s ease;
}

.nos-articles-social__link svg {
	width: 20px;
	height: 20px;
}

.nos-articles-social__link:hover {
	color: #fff;
	border-color: var(--lf-accent);
	background: var(--lf-accent);
	transform: translateY(-2px);
}

/* ── CTA block ────────────────────────────────────────── */
.nos-articles-cta {
	background: var(--lf-bg);
	padding: 80px 20px;
}

.nos-articles-cta__inner {
	max-width: 900px;
	margin: 0 auto;
}

.nos-articles-cta__title {
	color: var(--lf-primary);
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 1rem;
}

.nos-articles-cta__links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.nos-articles-cta__link {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: var(--lf-accent);
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
}

.nos-articles-cta__link:hover {
	opacity: 0.9;
}

/* ── Tablet ───────────────────────────────────────────── */
@media (max-width: 1024px) {
	.nos-articles-wrapper {
		--lf-overlap: 110px;
	}

	.nos-articles-layout__inner {
		grid-template-columns: 200px 1fr;
		column-gap: 24px;
	}

	.nos-articles-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 24px;
	}
}

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 768px) {
	.nos-articles-layout {
		padding-top: 0;
	}

	.nos-articles-layout__inner {
		display: block;
		transform: none;
		padding: 0 16px;
	}

	.nos-articles-sidebar {
		flex: none;
		width: 100%;
		padding: 1.25rem 0;
		margin-top: 0;
		position: static;
	}

	.nos-articles-sidebar__list {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		gap: 0;
		padding-bottom: 0.25rem;
		-webkit-overflow-scrolling: touch;
	}

	.nos-articles-sidebar__list li {
		flex: 0 0 auto;
		margin-bottom: 0;
	}

	.nos-articles-sidebar__link {
		white-space: nowrap;
		padding: 0.35rem 0.75rem;
		border-left: none;
		border-bottom: 2px solid transparent;
		font-size: 0.875rem;
	}

	.nos-articles-sidebar__link:hover {
		padding-left: 0.75rem;
		border-left: none;
		border-bottom-color: rgba(255, 255, 255, 0.35);
	}

	.nos-articles-sidebar__link.is-active {
		padding-left: 0.75rem;
		border-left: none;
		border-bottom-color: var(--lf-accent);
	}

	.nos-articles-main {
		margin-top: 0;
		padding: 1.25rem 0 2rem;
	}

	.nos-articles-social {
		margin-top: 1.5rem;
	}

	.nos-articles-social__line {
		width: 140px;
	}

	.nos-articles-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.nos-articles-card {
		min-height: auto;
		animation-delay: 0s !important;
	}

	.nos-articles-hero {
		padding: 2rem 1rem 1.5rem;
	}

	.nos-articles-hero h1.nos-articles-hero__title {
		font-size: 1.65rem;
	}

	.nos-articles-hero__intro {
		font-size: 0.95rem;
	}

	.nos-articles-card__title {
		font-size: 1rem;
	}
}
