/**
 * Zip Articles Grid
 * Faithful, self-contained reproduction of the retired Essential Grid "eg-zip2" skin.
 * All rules are scoped under .zag so they cannot leak into the theme.
 */

.zag {
	--zag-red: #d22630;
	--zag-title: #363839;
	--zag-meta: #aaaaaa;
	--zag-excerpt: #999999;
	--zag-card-bg: #ffffff;
	--zag-gap: 30px;
	--zag-font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--zag-font-button: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--zag-font-filter: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	box-sizing: border-box;
}

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

/* -------------------------------------------------------------------------
 * Filter bar
 * Hidden by default; revealed only once JS marks the grid interactive so
 * no-JS visitors are never shown dead buttons (they still see every card).
 * ---------------------------------------------------------------------- */
.zag__filters {
	display: none;
	text-align: center;
	margin: 0 0 25px;
}

.zag--js .zag__filters {
	display: block;
}

.zag__filter {
	display: inline-block;
	margin: 0 4px 8px;
	padding: 9px 22px;
	line-height: 1.2;
	font-family: var(--zag-font-filter);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #6b6f72;
	background: #fff;
	border: 1px solid #e2e3e5;
	border-radius: 0;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.zag__filter:hover {
	color: var(--zag-red);
	border-color: var(--zag-red);
}

.zag__filter:focus-visible {
	outline: 2px solid var(--zag-red);
	outline-offset: 2px;
}

.zag__filter.is-active {
	color: #fff;
	background-color: var(--zag-red);
	border-color: var(--zag-red);
	box-shadow: 0 4px 10px 0 rgba(210, 38, 48, 0.25);
}

.zag__filter.is-active:hover {
	color: #fff;
}

/* -------------------------------------------------------------------------
 * Grid
 * ---------------------------------------------------------------------- */
.zag__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--zag-gap);
}

.zag--cols-1 .zag__grid { grid-template-columns: 1fr; }
.zag--cols-2 .zag__grid { grid-template-columns: repeat(2, 1fr); }
.zag--cols-3 .zag__grid { grid-template-columns: repeat(3, 1fr); }
.zag--cols-4 .zag__grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 767px) {
	.zag__grid { grid-template-columns: 1fr !important; }
}

/* -------------------------------------------------------------------------
 * Card
 * ---------------------------------------------------------------------- */
.zag__card {
	background: var(--zag-card-bg);
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.zag__card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.zag__card[hidden] {
	display: none;
}

/* Fade applied by JS each time the visible set changes. */
.zag__card.zag__card--show {
	animation: zag-fade-in 0.35s ease both;
}

@keyframes zag-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* Media ---------------------------------------------------------------- */
.zag__media {
	display: block;
	position: relative;
	padding: 30px 30px 0;
	line-height: 0;
	text-decoration: none;
}

.zag__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1024 / 377;
	object-fit: cover;
	transition: filter 0.4s ease-in-out;
}

/* Optional legacy greyscale-until-hover behaviour. */
.zag__media--grayscale .zag__img { filter: grayscale(100%); }
.zag__media--grayscale:hover .zag__img { filter: grayscale(0); }

.zag__overlay {
	position: absolute;
	top: 30px;
	right: 30px;
	bottom: 0;
	left: 30px;
	background: rgba(54, 56, 57, 0.85);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.zag__media:hover .zag__overlay,
.zag__media:focus-visible .zag__overlay {
	opacity: 1;
}

/* Body ----------------------------------------------------------------- */
.zag__body {
	padding: 24px 30px 30px;
	text-align: left;
	font-family: var(--zag-font);
}

.zag__title {
	margin: 0 0 16px;
	padding: 0;
	font-family: var(--zag-font);
	font-size: 20px;
	line-height: 25px;
	font-weight: 600;
}

.zag--title-capitalize .zag__title { text-transform: capitalize; }
.zag--title-uppercase .zag__title { text-transform: uppercase; }
.zag--title-none .zag__title { text-transform: none; }

.zag__title a {
	color: var(--zag-title);
	text-decoration: none;
	transition: color 0.2s ease;
}

.zag__title a:hover,
.zag__title a:focus-visible {
	color: var(--zag-red);
}

/* Meta row: date | category(ies) --------------------------------------- */
.zag__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0 0 16px;
	font-family: var(--zag-font);
	font-size: 12px;
	line-height: 14px;
	font-weight: 300;
	color: var(--zag-meta);
	text-transform: capitalize;
}

.zag__date {
	padding-right: 10px;
	border-right: 1px solid var(--zag-meta);
}

.zag__cats {
	margin-left: 10px;
}

.zag__cats a {
	color: var(--zag-meta);
	text-decoration: none;
	transition: color 0.2s ease;
}

.zag__cats a:hover,
.zag__cats a:focus-visible {
	color: var(--zag-red);
}

.zag__sep {
	margin: 0 1px 0 0;
}

/* Excerpt -------------------------------------------------------------- */
.zag__excerpt {
	margin: 0 0 16px;
	font-family: var(--zag-font);
	font-size: 16px;
	line-height: 20px;
	font-weight: 400;
	color: var(--zag-excerpt);
	/* Sentence case: the original skin force-Title-Cased this, which misreads
	   real sentences (especially Indonesian). Restore with text-transform:
	   capitalize here if exact legacy fidelity is required. */
}

/* Read more ------------------------------------------------------------ */
.zag__more {
	display: inline-block;
	margin-top: 10px;
	padding: 5px 10px;
	font-family: var(--zag-font-button);
	font-size: 12px;
	line-height: 20px;
	font-weight: 800;
	text-transform: uppercase;
	color: #fff;
	background: rgba(0, 0, 0, 0.25);
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.zag__more:hover {
	color: #fff;
	background: var(--zag-red);
}

.zag__more:focus-visible {
	color: #fff;
	background: var(--zag-red);
	outline: 2px solid var(--zag-title);
	outline-offset: 2px;
}

/* Empty state ---------------------------------------------------------- */
.zag--empty {
	font-family: var(--zag-font);
	color: var(--zag-excerpt);
	text-align: center;
	padding: 30px;
}

@media (prefers-reduced-motion: reduce) {
	.zag__card,
	.zag__card.zag__card--show,
	.zag__img,
	.zag__overlay,
	.zag__more,
	.zag__filter {
		transition: none;
		animation: none;
	}
}
