/* ======================================================================
   CGS homepage (Settings → CGS homepage). Loaded on the front page only.
   ====================================================================== */
.cgs-homepage { --hp-gap: clamp(2.5rem, 6vw, 4.5rem); }
.cgs-hp { padding-block: calc(var(--hp-gap) / 2); }
.cgs-hp--tint { background: var(--cgs-surface); }
.cgs-hp--tint + .cgs-hp--tint { padding-top: 0; }
.cgs-hp__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; border-bottom: 3px solid var(--cgs-logo-green); padding-bottom: .5rem; }
.cgs-hp__title { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); }
.cgs-hp__more { font-weight: 700; text-decoration: none; white-space: nowrap; color: var(--cgs-logo-green); }
.cgs-hp__more:hover, .cgs-hp__more:focus { text-decoration: underline; }
.cgs-hp .cgs-collection { margin-top: 0 !important; }
.cgs-hp .cgs-collection__heading { font-size: 1.15rem; }
.cgs-hp .cgs-collection__header { border-bottom-width: 1px; border-bottom-color: var(--cgs-border); }

/* Hero */
.cgs-hp--hero { padding-top: clamp(1.5rem, 4vw, 2.5rem); }
.cgs-hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; align-items: stretch; }
.cgs-hero__lead { position: relative; min-height: 26rem; border-radius: 6px; overflow: hidden; background: var(--cgs-logo-green); display: flex; align-items: flex-end; }
.cgs-hero__media { position: absolute; inset: 0; }
.cgs-hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cgs-hero__lead.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 20, 15, 0) 30%, rgba(10, 20, 15, .82) 100%); pointer-events: none; }
.cgs-hero__text { position: relative; z-index: 1; padding: clamp(1.25rem, 3vw, 2.25rem); color: #fff; max-width: 46rem; }
.cgs-hero__kicker { display: inline-block; margin: 0 0 .6rem; padding: .2rem .6rem; background: var(--cgs-logo-red); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: 2px; }
.cgs-hero__title { margin: 0 0 .5rem; font-size: clamp(1.6rem, 3.2vw, 2.6rem); line-height: 1.15; }
.cgs-hero__title a { color: #fff; text-decoration: none; }
.cgs-hero__title a:hover, .cgs-hero__title a:focus { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.cgs-hero__excerpt { margin: 0; color: rgba(255, 255, 255, .9); font-size: 1.05rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cgs-hero__latest { border-top: 3px solid var(--cgs-logo-green); padding-top: .75rem; }
.cgs-hero__latest-title { font-family: var(--wp--preset--font-family--body, system-ui, sans-serif); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cgs-logo-green); margin: 0 0 .5rem; }
.cgs-hero__latest ol { list-style: none; margin: 0; padding: 0; counter-reset: latest; }
.cgs-hero__latest li { position: relative; padding: .8rem 0 .8rem 2.2rem; border-bottom: 1px solid var(--cgs-border); display: flex; flex-direction: column; gap: .15rem; counter-increment: latest; }
.cgs-hero__latest li::before { content: counter(latest); position: absolute; left: 0; top: .7rem; font-family: var(--wp--preset--font-family--heading, Georgia, serif); font-size: 1.4rem; font-weight: 700; color: #c5d9cc; line-height: 1; }
.cgs-hero__latest a { font-family: var(--wp--preset--font-family--heading, Georgia, serif); font-weight: 700; color: var(--cgs-ink); text-decoration: none; line-height: 1.3; }
.cgs-hero__latest a:hover, .cgs-hero__latest a:focus { color: var(--cgs-logo-green); text-decoration: underline; }
.cgs-hero__type { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cgs-logo-green); }
.cgs-hero__date { font-size: .8rem; color: var(--cgs-muted); }
.cgs-hero__more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.75rem; }
@media (max-width: 960px) {
	.cgs-hero { grid-template-columns: 1fr; }
	.cgs-hero__lead { min-height: 20rem; }
	.cgs-hero__more { grid-template-columns: 1fr; }
}

/* Explore chips */
.cgs-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.cgs-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .85rem; border: 1px solid var(--cgs-border); border-radius: 999px; background: #fff; color: var(--cgs-ink); text-decoration: none; font-weight: 600; font-size: .92rem; transition: border-color .15s, background .15s; }
.cgs-chip:hover, .cgs-chip:focus { border-color: var(--cgs-logo-green); background: #eaf3ed; color: var(--cgs-logo-green); }
.cgs-chip__n { font-weight: 500; font-size: .78rem; color: var(--cgs-muted); }
.cgs-chip--flag::before, .cgs-chip--globe::before { content: ""; width: 18px; height: 13.5px; border-radius: 2px; background-position: center; background-size: cover; background-repeat: no-repeat; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.cgs-chip--bd::before { background-image: url("flags/bd.svg"); }
.cgs-chip--mm::before { background-image: url("flags/mm.svg"); }
.cgs-chip--lk::before { background-image: url("flags/lk.svg"); }
.cgs-chip--np::before { background-image: url("flags/np.svg"); background-size: contain; box-shadow: none; }
.cgs-chip--us::before { background-image: url("flags/us.svg"); }
.cgs-chip--globe::before { box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cg fill='none' stroke='%23006238' stroke-width='1.5'%3E%3Ccircle cx='12' cy='9' r='7.5'/%3E%3Cpath d='M4.5 9h15M12 1.5c2.5 2.2 3.6 4.8 3.6 7.5S14.5 14.3 12 16.5M12 1.5C9.5 3.7 8.4 6.3 8.4 9s1.1 5.3 3.6 7.5'/%3E%3C/g%3E%3C/svg%3E"); }
.cgs-chip--topic::before { content: "#"; color: var(--cgs-logo-green); font-weight: 700; }

/* Splits */
.cgs-hp-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2.5rem; }
.cgs-hp-split__side { border-left: 1px solid var(--cgs-border); padding-left: 2.5rem; }
.cgs-hp-split--events, .cgs-hp-split--media { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 960px) {
	.cgs-hp-split, .cgs-hp-split--events, .cgs-hp-split--media { grid-template-columns: 1fr; }
	.cgs-hp-split__side { border-left: 0; padding-left: 0; }
}

/* Periodicals */
.cgs-periodicals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem; }
.cgs-periodical { background: #fff; border: 1px solid var(--cgs-border); border-top: 4px solid var(--cgs-logo-green); border-radius: 4px; padding: 1.25rem 1.25rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.cgs-periodical > * { margin: 0; }
.cgs-periodical__label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cgs-logo-red); }
.cgs-periodical__title { font-size: 1.25rem; }
.cgs-periodical__title a { color: var(--cgs-ink); text-decoration: none; }
.cgs-periodical__title a:hover, .cgs-periodical__title a:focus { color: var(--cgs-logo-green); text-decoration: underline; }
.cgs-periodical__latest { font-size: .92rem; }
.cgs-periodical__count { margin-top: auto; padding-top: .5rem; font-size: .8rem; color: var(--cgs-muted); }

/* Platforms logo strip */
.cgs-platforms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: 1rem; }
.cgs-platforms a { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1rem .75rem; border: 1px solid var(--cgs-border); border-radius: 6px; background: #fff; text-decoration: none; text-align: center; color: var(--cgs-ink); font-size: .8rem; font-weight: 600; line-height: 1.3; transition: border-color .15s, box-shadow .15s, transform .15s; }
.cgs-platforms img { max-height: 46px; max-width: 100%; width: auto; object-fit: contain; }
.cgs-platforms a:hover, .cgs-platforms a:focus { border-color: var(--cgs-logo-green); box-shadow: 0 6px 18px rgba(0, 98, 56, .12); transform: translateY(-2px); }

/* Gallery grid */
.cgs-gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.cgs-gallery-grid a { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--cgs-surface); }
.cgs-gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.cgs-gallery-grid span { position: absolute; inset: auto 0 0 0; padding: 1.5rem .6rem .5rem; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; font-size: .78rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cgs-gallery-grid a:hover img, .cgs-gallery-grid a:focus img { transform: scale(1.04); }
@media (max-width: 600px) { .cgs-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Stats */
.cgs-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 1rem; }
.cgs-stats li { padding: 1.25rem; border-left: 3px solid var(--cgs-logo-green); background: var(--cgs-surface); display: flex; flex-direction: column; gap: .25rem; }
.cgs-stat__n { font-family: var(--wp--preset--font-family--heading, Georgia, serif); font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; color: var(--cgs-logo-green); line-height: 1; }
.cgs-stat__l { font-size: .85rem; color: var(--cgs-muted); }

/* Partner logo wall */
.cgs-logo-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); gap: 1.25rem 1.75rem; align-items: center; }
.cgs-logo-wall a { display: flex; align-items: center; justify-content: center; height: 64px; }
.cgs-logo-wall img { max-height: 56px; max-width: 100%; width: auto; object-fit: contain; filter: grayscale(1); opacity: .75; transition: filter .2s, opacity .2s; }
.cgs-logo-wall a:hover img, .cgs-logo-wall a:focus img { filter: none; opacity: 1; }

.cgs-homepage .cgs-home-mission { margin-top: calc(var(--hp-gap) / 2); }

/* Archive browse filters (chips are shared with the homepage "Explore" section) */
.cgs-filterbar { display: flex; flex-direction: column; gap: .75rem; margin: -0.5rem 0 2rem; padding: 1rem 1.25rem; background: var(--cgs-surface); border-radius: 6px; }
.cgs-filterbar__row { display: flex; align-items: baseline; gap: .75rem 1rem; }
.cgs-filterbar__label { flex: none; width: 4.5rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cgs-muted); }
.cgs-filterbar .cgs-chips { gap: .4rem; }
.cgs-filterbar .cgs-chip { font-size: .85rem; padding: .3rem .7rem; }
.cgs-chip.is-active { background: var(--cgs-logo-green); border-color: var(--cgs-logo-green); color: #fff; }
.cgs-chip.is-active .cgs-chip__n { color: rgba(255, 255, 255, .8); }
@media (max-width: 600px) { .cgs-filterbar__row { flex-direction: column; gap: .4rem; } }
