/* =====================================================
   Hernandez Sharelines — front-end styles
   Brand palette pulled to match hernandezforny.com
   ===================================================== */

:root {
	--hsl-navy: #04337A;
	--hsl-navy-deep: #022659;
	--hsl-navy-hover: #053f95;
	--hsl-accent: #c8102e;        /* campaign red, used sparingly */
	--hsl-accent-soft: #ff0221;
	--hsl-white: #ffffff;
	--hsl-white-80: rgba(255,255,255,.8);
	--hsl-white-65: rgba(255,255,255,.65);
	--hsl-shadow: 0 6px 20px rgba(6, 26, 48, 0.12);
	--hsl-shadow-hover: 0 12px 32px rgba(6, 26, 48, 0.22);
	--hsl-radius: 6px;
	--hsl-font-stack: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

/* -------- Section wrapper -------- */
.hsl-section {
	width: 100%;
	margin: 0 0 48px;
	font-family: var(--hsl-font-stack);
}

.hsl-section__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--hsl-navy);
}

.hsl-section__heading {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 800;
	color: var(--hsl-navy);
	letter-spacing: .3px;
	text-transform: uppercase;
}

.hsl-section__view-all {
	font-size: .95rem;
	font-weight: 700;
	text-decoration: none;
	color: var(--hsl-accent);
	text-transform: uppercase;
	letter-spacing: .5px;
}
.hsl-section__view-all:hover { text-decoration: underline; }

/* -------- Grid -------- */
.hsl-grid {
	display: grid;
	gap: 22px;
}
.hsl-grid--cols-1 { grid-template-columns: 1fr; }
.hsl-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hsl-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hsl-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
	.hsl-grid--cols-3,
	.hsl-grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.hsl-grid { gap: 16px; }
	.hsl-grid--cols-2,
	.hsl-grid--cols-3,
	.hsl-grid--cols-4 { grid-template-columns: 1fr; }
}

/* -------- Card -------- */
.hsl-card {
	display: block;
	position: relative;
	background-color: var(--hsl-navy);
	color: var(--hsl-white);
	text-decoration: none;
	border-radius: var(--hsl-radius);
	overflow: hidden;
	box-shadow: var(--hsl-shadow);
	transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
	min-height: 200px;
}
.hsl-card:hover,
.hsl-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: var(--hsl-shadow-hover);
	background-color: var(--hsl-navy-hover);
	color: var(--hsl-white);
	text-decoration: none;
}
.hsl-card:focus-visible {
	outline: 3px solid var(--hsl-accent);
	outline-offset: 3px;
}

.hsl-card__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 26px 28px 22px;
}

.hsl-card__meta {
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: .8px;
	text-transform: uppercase;
	color: var(--hsl-white-80);
	margin-bottom: 14px;
	font-style: italic;
}

.hsl-card__title {
	margin: 0 0 18px;
	font-size: 1.35rem;
	line-height: 1.3;
	font-weight: 700;
	color: var(--hsl-white);
	flex: 1 1 auto;
}

.hsl-card__cta {
	display: inline-block;
	margin-top: auto;
	font-size: .85rem;
	font-weight: 700;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: var(--hsl-white-65);
	transition: color .2s ease, transform .2s ease;
}
.hsl-card:hover .hsl-card__cta {
	color: var(--hsl-white);
	transform: translateX(4px);
}

/* When a custom background color is set, the inline style overrides --hsl-navy.
   We don't need a hover variation in that case; subtle lift is enough. */

/* -------- Pagination -------- */
.hsl-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 36px;
}

.hsl-pagination__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	font-size: .9rem;
	font-weight: 700;
	color: var(--hsl-navy);
	background: #fff;
	border: 1.5px solid var(--hsl-navy);
	border-radius: 4px;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.hsl-pagination__link:hover {
	background: var(--hsl-navy);
	color: #fff;
	text-decoration: none;
}
.hsl-pagination__link--current {
	background: var(--hsl-navy);
	color: #fff;
	cursor: default;
}
.hsl-pagination__ellipsis {
	padding: 0 4px;
	color: var(--hsl-navy);
	font-weight: 700;
}

.hsl-pagination__link--prev,
.hsl-pagination__link--next { padding: 0 16px; }

/* -------- Misc -------- */
.hsl-empty {
	padding: 40px;
	text-align: center;
	color: #555;
	font-style: italic;
	border: 1px dashed #ccc;
	border-radius: var(--hsl-radius);
}

.hsl-anchor {
	position: absolute;
	top: -100px;        /* offsets sticky headers */
	left: 0;
	height: 1px;
	width: 1px;
}

/* Make sure cards keep equal height in grids */
.hsl-grid > .hsl-card { height: 100%; }


/* =====================================================
   Slider — single-card-at-a-time carousel
   ===================================================== */

.hsl-section--slider .hsl-section__header {
	border-bottom: none;
	padding-bottom: 0;
	margin-bottom: 16px;
}

.hsl-slider {
	position: relative;
	width: 100%;
}

/* The slider track IS the navy stage. Slides are content layers
   positioned inside it, sliding horizontally on nav. The stage
   height animates to fit the active slide's content. */
.hsl-slider__track {
	position: relative;
	width: 100%;
	background-color: var(--hsl-navy);
	color: var(--hsl-white);
	border-radius: var(--hsl-radius);
	box-shadow: var(--hsl-shadow);
	overflow: hidden;
	transition: height .45s cubic-bezier(.4, 0, .2, 1),
	            background-color .25s ease;
	/* height set dynamically by JS based on active slide content */
}
.hsl-slider__track:hover {
	background-color: var(--hsl-navy-hover);
	box-shadow: var(--hsl-shadow-hover);
}

.hsl-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	color: var(--hsl-white);
	text-decoration: none;
	opacity: 0;
	visibility: hidden;
	transform: translateX(0);
	transition: transform .45s cubic-bezier(.4, 0, .2, 1),
	            opacity .35s ease;
	will-change: transform, opacity;
}
.hsl-slide:focus-visible {
	outline: 3px solid var(--hsl-accent);
	outline-offset: -3px;
}

/* Active slide: visible and centered */
.hsl-slide.is-active {
	position: relative;   /* takes part in layout flow so track can measure height */
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
	z-index: 2;
}

/* Slides queued to enter from the right (when going next) */
.hsl-slide.is-entering-from-right {
	position: absolute;
	transform: translateX(100%);
	opacity: 0;
	visibility: visible;
	z-index: 3;
}
.hsl-slide.is-entering-from-right.is-active {
	transform: translateX(0);
	opacity: 1;
}

/* Slides queued to enter from the left (when going prev) */
.hsl-slide.is-entering-from-left {
	position: absolute;
	transform: translateX(-100%);
	opacity: 0;
	visibility: visible;
	z-index: 3;
}
.hsl-slide.is-entering-from-left.is-active {
	transform: translateX(0);
	opacity: 1;
}

/* Slide leaving to the left (replaced by a next-direction slide) */
.hsl-slide.is-leaving-to-left {
	position: absolute;
	transform: translateX(-100%);
	opacity: 0;
	z-index: 1;
}

/* Slide leaving to the right (replaced by a prev-direction slide) */
.hsl-slide.is-leaving-to-right {
	position: absolute;
	transform: translateX(100%);
	opacity: 0;
	z-index: 1;
}

.hsl-slide__inner {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 48px 80px;
	text-align: center;
	min-height: 240px;
}

.hsl-slide__meta {
	font-size: .9rem;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--hsl-white-80);
	margin-bottom: 22px;
	font-style: italic;
}

.hsl-slide__title {
	margin: 0 0 26px;
	font-size: 1.85rem;
	line-height: 1.3;
	font-weight: 700;
	color: var(--hsl-white);
	max-width: 880px;
	margin-left: auto;
	margin-right: auto;
}

.hsl-slide__cta {
	display: inline-block;
	font-size: .9rem;
	font-weight: 700;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: var(--hsl-white-65);
	transition: color .2s ease, transform .2s ease;
}
.hsl-slide:hover .hsl-slide__cta {
	color: var(--hsl-white);
	transform: translateX(4px);
}

/* Arrows */
.hsl-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--hsl-navy);
	border: none;
	border-radius: 50%;
	font-size: 26px;
	line-height: 1;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 10px rgba(6, 26, 48, 0.15);
	transition: background-color .2s ease, transform .2s ease;
	z-index: 2;
	padding: 0;
}
.hsl-slider__arrow:hover {
	background: var(--hsl-white);
	transform: translateY(-50%) scale(1.08);
}
.hsl-slider__arrow:focus-visible {
	outline: 3px solid var(--hsl-accent);
	outline-offset: 2px;
}
.hsl-slider__arrow span {
	display: block;
	margin-top: -3px;     /* optical-center the chevron glyph */
}
.hsl-slider__arrow--prev { left: 12px; }
.hsl-slider__arrow--next { right: 12px; }

/* Dots */
.hsl-slider__dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
}
.hsl-slider__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(4, 51, 122, 0.25);
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}
.hsl-slider__dot:hover { background: rgba(4, 51, 122, 0.5); }
.hsl-slider__dot.is-active {
	background: var(--hsl-navy);
	transform: scale(1.2);
}
.hsl-slider__dot:focus-visible {
	outline: 2px solid var(--hsl-accent);
	outline-offset: 3px;
}

/* Responsive */
@media (max-width: 700px) {
	.hsl-slide__inner { padding: 40px 56px; min-height: 200px; }
	.hsl-slide__title { font-size: 1.4rem; }
	.hsl-slider__arrow { width: 38px; height: 38px; font-size: 22px; }
	.hsl-slider__arrow--prev { left: 6px; }
	.hsl-slider__arrow--next { right: 6px; }
}
@media (max-width: 480px) {
	.hsl-slide__inner { padding: 32px 44px; min-height: 180px; }
	.hsl-slide__title { font-size: 1.2rem; }
	.hsl-slide__meta { font-size: .8rem; }
}


/* =====================================================
   Theme override hardening
   These selectors win against most theme rules without
   needing every site to add custom CSS.
   ===================================================== */

/* Ensure card / slide titles stay white regardless of theme h3 rules */
.hsl-section .hsl-card__title,
.hsl-section .hsl-slide__title,
.hsl-section a.hsl-card .hsl-card__title,
.hsl-section a.hsl-slide .hsl-slide__title {
	color: var(--hsl-white) !important;
	font-family: var(--hsl-font-stack) !important;
}

/* Ensure CTA stays light regardless of theme link/span rules */
.hsl-section .hsl-card__cta,
.hsl-section .hsl-slide__cta {
	color: var(--hsl-white-65) !important;
	font-family: var(--hsl-font-stack) !important;
}
.hsl-section a.hsl-card:hover .hsl-card__cta,
.hsl-section a.hsl-slide:hover .hsl-slide__cta {
	color: var(--hsl-white) !important;
}

/* Meta line (date · publication) – light, italic */
.hsl-section .hsl-card__meta,
.hsl-section .hsl-slide__meta {
	color: var(--hsl-white-80) !important;
	font-family: var(--hsl-font-stack) !important;
}

/* Card / slide link hover — keep theme from coloring our links */
.hsl-section a.hsl-card,
.hsl-section a.hsl-card:hover,
.hsl-section a.hsl-card:focus,
.hsl-section a.hsl-card:visited,
.hsl-section a.hsl-slide,
.hsl-section a.hsl-slide:hover,
.hsl-section a.hsl-slide:focus,
.hsl-section a.hsl-slide:visited {
	color: var(--hsl-white) !important;
	text-decoration: none !important;
}

/* Arrow buttons — block theme button styling cold */
.hsl-section .hsl-slider__arrow,
.hsl-section .hsl-slider__arrow:hover,
.hsl-section .hsl-slider__arrow:focus,
.hsl-section .hsl-slider__arrow:active {
	background-color: rgba(255,255,255,0.92) !important;
	background-image: none !important;
	color: var(--hsl-navy) !important;
	border: none !important;
	box-shadow: 0 2px 10px rgba(6, 26, 48, 0.15) !important;
	font-family: var(--hsl-font-stack) !important;
	text-shadow: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	line-height: 1 !important;
}
.hsl-section .hsl-slider__arrow:hover {
	background-color: #ffffff !important;
}

/* Render arrow chevrons via SVG (theme-proof) instead of unicode glyphs.
   We hide the existing <span> text and inject SVG via ::before. */
.hsl-section .hsl-slider__arrow span {
	display: none !important;
}
.hsl-section .hsl-slider__arrow::before {
	content: "";
	display: block;
	width: 14px;
	height: 14px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 14px 14px;
}
.hsl-section .hsl-slider__arrow--prev::before {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304337A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='15 18 9 12 15 6'/></svg>");
	margin-left: -1px;  /* optical center */
}
.hsl-section .hsl-slider__arrow--next::before {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304337A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 18 15 12 9 6'/></svg>");
	margin-right: -1px;
}

/* Dots — neutralize any theme button styling */
.hsl-section .hsl-slider__dot,
.hsl-section .hsl-slider__dot:hover,
.hsl-section .hsl-slider__dot:focus {
	background-image: none !important;
	border: none !important;
	box-shadow: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
}


/* =====================================================
   AJAX archive: loading state, card fade-in, spinner
   ===================================================== */

.hsl-grid--loading {
	position: relative;
	pointer-events: none;
}
.hsl-grid--loading .hsl-card {
	opacity: .35;
	transition: opacity .25s ease;
}

/* Loading overlay container — hidden by default, shown during fetch */
.hsl-loading {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 5;
}
.hsl-grid--loading .hsl-loading {
	display: flex;
}

/* Spinner — pure CSS, navy ring */
.hsl-spinner {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 3px solid rgba(4, 51, 122, 0.18);
	border-top-color: var(--hsl-navy);
	animation: hsl-spin .85s linear infinite;
}
@keyframes hsl-spin {
	to { transform: rotate(360deg); }
}

/* New card fade-in animation */
.hsl-card--enter {
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .35s ease, transform .35s ease;
}
.hsl-card--enter-active {
	opacity: 1;
	transform: translateY(0);
}

/* Stagger the fade-in for a polished feel */
.hsl-card--enter-active:nth-child(1) { transition-delay: 0ms; }
.hsl-card--enter-active:nth-child(2) { transition-delay: 40ms; }
.hsl-card--enter-active:nth-child(3) { transition-delay: 80ms; }
.hsl-card--enter-active:nth-child(4) { transition-delay: 120ms; }
.hsl-card--enter-active:nth-child(5) { transition-delay: 160ms; }
.hsl-card--enter-active:nth-child(6) { transition-delay: 200ms; }
.hsl-card--enter-active:nth-child(7) { transition-delay: 220ms; }
.hsl-card--enter-active:nth-child(8) { transition-delay: 240ms; }
.hsl-card--enter-active:nth-child(n+9) { transition-delay: 260ms; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
	.hsl-card--enter,
	.hsl-card--enter-active,
	.hsl-spinner {
		transition: none !important;
		animation: none !important;
	}
}
