/*
 * Gather Right Here public frontend styles.
 *
 * This file intentionally uses low-specificity :where() selectors so a theme can
 * override GRH with normal class selectors and without !important.
 *
 * Recommended theme override file:
 * /wp-content/themes/your-child-theme/gather-right-here/grh.css
 *
 * See docs/css-reference.md and assets/css/theme-overrides.example.css.
 */

:where(.grh-content-grid,.grh-creator-profile,.grh-creator-list,.grh-creator-template){
	--grh-grid-min-width:240px;
	--grh-grid-gap:1.25rem;
	--grh-card-background:transparent;
	--grh-card-radius:0;
	--grh-card-padding:0;
	--grh-thumb-ratio:16/9;
	--grh-thumb-background:#ddd;
	--grh-title-size:1rem;
	--grh-title-line-height:1.3;
	--grh-creator-size:.8rem;
	--grh-meta-size:.78rem;
	--grh-muted-opacity:.7;
	--grh-badge-background:rgba(0,0,0,.78);
	--grh-badge-color:#fff;
	--grh-badge-radius:4px;
	--grh-badge-size:.75rem;
	--grh-profile-image-size:120px;
	--grh-profile-image-radius:50%;
	--grh-profile-banner-height:340px;
	--grh-platform-gap:.5rem;
	--grh-creator-card-width:220px;
	--grh-creator-card-background:transparent;
	--grh-creator-card-border:1px solid rgba(127,127,127,.22);
	--grh-creator-card-radius:10px;
	--grh-creator-card-image-ratio:1/1;
	--grh-creator-card-image-fit:cover;
	--grh-creator-card-body-padding:.8rem;
	--grh-creator-card-cta-border:1px solid currentColor;
	--grh-creator-card-cta-radius:999px;
	--grh-creator-card-cta-padding:.35rem .8rem;
	--grh-creator-list-gap:1rem;
	--grh-button-radius:6px;
	--grh-button-padding:.55rem .8rem;
}

:where(.grh-content-grid){display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--grh-grid-min-width),1fr));gap:var(--grh-grid-gap)}
:where(.grh-content-card){min-width:0;background:var(--grh-card-background);border-radius:var(--grh-card-radius);padding:var(--grh-card-padding)}
:where(.grh-content-card__thumb){position:relative;display:block;aspect-ratio:var(--grh-thumb-ratio);background:var(--grh-thumb-background);overflow:hidden;text-decoration:none}
:where(.grh-content-card__image){width:100%;height:100%;object-fit:cover;display:block}
:where(.grh-content-card__placeholder){display:block;width:100%;height:100%;background:#e5e5e5}
:where(.grh-platform-badge,.grh-duration){position:absolute;bottom:.5rem;background:var(--grh-badge-background);color:var(--grh-badge-color);border-radius:var(--grh-badge-radius);padding:.25rem .45rem;font-size:var(--grh-badge-size);line-height:1;display:flex;gap:.3rem;align-items:center}
:where(.grh-platform-badge){left:.5rem}
:where(.grh-duration){right:.5rem}
:where(.grh-platform-badge svg,.grh-platform-button svg){width:1em;height:1em;fill:currentColor}
:where(.grh-content-card__body){padding:.75rem 0}
:where(.grh-content-card__creator){font-size:var(--grh-creator-size);text-decoration:none}
:where(.grh-content-card__title){font-size:var(--grh-title-size);line-height:var(--grh-title-line-height);margin:.25rem 0}
:where(.grh-content-card__title-link){text-decoration:none;color:inherit}
:where(.grh-content-card__date){font-size:var(--grh-meta-size);opacity:var(--grh-muted-opacity)}
:where(.grh-creator-profile__banner-image){display:block;width:100%;max-height:var(--grh-profile-banner-height);object-fit:cover}
:where(.grh-creator-profile__header){display:flex;gap:1.25rem;align-items:center;margin:1.25rem 0}
:where(.grh-creator-profile__image){width:var(--grh-profile-image-size);height:var(--grh-profile-image-size);object-fit:cover;border-radius:var(--grh-profile-image-radius)}
:where(.grh-creator-profile__name){margin:0}
:where(.grh-creator-profile__platforms){display:flex;flex-wrap:wrap;gap:var(--grh-platform-gap);margin:1rem 0}
:where(.grh-platform-button){display:inline-flex;gap:.45rem;align-items:center;padding:var(--grh-button-padding);border:1px solid currentColor;border-radius:var(--grh-button-radius);text-decoration:none}
:where(.grh-creator-list){display:flex;flex-wrap:wrap;align-items:stretch;justify-content:flex-start;gap:var(--grh-creator-list-gap)}
:where(.grh-creator-list__item){flex:0 1 var(--grh-creator-card-width);width:var(--grh-creator-card-width);max-width:100%;min-width:0;background:var(--grh-creator-card-background);border:var(--grh-creator-card-border);border-radius:var(--grh-creator-card-radius);overflow:hidden}
:where(.grh-creator-list__link,.grh-creator-card__link){display:flex;flex-direction:column;height:100%;text-decoration:none;color:inherit}
:where(.grh-creator-card__media){display:block;width:100%;aspect-ratio:var(--grh-creator-card-image-ratio);overflow:hidden}
:where(.grh-creator-list__image,.grh-creator-card__image){width:100%;height:100%;object-fit:var(--grh-creator-card-image-fit);display:block}
:where(.grh-creator-card__image-placeholder){display:block;width:100%;height:100%;background:var(--grh-thumb-background)}
:where(.grh-creator-card__body){display:flex;flex:1;flex-direction:column;align-items:center;justify-content:space-between;gap:.75rem;padding:var(--grh-creator-card-body-padding);text-align:center}
:where(.grh-creator-list__name,.grh-creator-card__name){margin:0;font-size:1rem;line-height:1.25}
:where(.grh-creator-card__cta){display:inline-flex;align-items:center;justify-content:center;margin-top:auto;padding:var(--grh-creator-card-cta-padding);border:var(--grh-creator-card-cta-border);border-radius:var(--grh-creator-card-cta-radius);font-size:.8rem;line-height:1.1}
:where(.grh-content-grid--hero){grid-template-columns:1fr}

@media(max-width:600px){
	:where(.grh-creator-profile__header){align-items:flex-start}
	:where(.grh-creator-profile__image){--grh-profile-image-size:88px}
}

/* -------------------------------------------------------------------------
 * v0.9.14 composable layout API
 * ---------------------------------------------------------------------- */
:where(.grh-content-collection,.grh-creator-list,.grh-category-list,.grh-featured-carousel,.grh-trending-list,.grh-search){
	--grh-section-gap:var(--grh-grid-gap,1.25rem);
	--grh-card-width:300px;
	--grh-category-card-width:190px;
	--grh-columns:0;
	--grh-rail-rows:1;
	--grh-carousel-height:460px;
	--grh-carousel-radius:12px;
	--grh-carousel-overlay:linear-gradient(90deg,rgba(0,0,0,.72),rgba(0,0,0,.12) 58%,rgba(0,0,0,0));
	--grh-carousel-cta-background:#c9902e;
	--grh-carousel-cta-color:#111;
	--grh-category-background:rgba(127,127,127,.08);
	--grh-category-border:1px solid rgba(127,127,127,.18);
	--grh-category-radius:10px;
}

/* Explicit-column grid. Without --grh-columns, the original auto-fit grid remains. */
:where(.grh-content-grid.grh-layout-grid){gap:var(--grh-section-gap)}
:where(.grh-content-grid.grh-layout-grid[style*="--grh-columns"]){grid-template-columns:repeat(var(--grh-columns),minmax(0,1fr))}

/* Horizontal content rail. rows > 1 creates a horizontally scrolling multi-row rail. */
:where(.grh-content-grid.grh-layout-rail){
	display:grid;
	grid-auto-flow:column;
	grid-auto-columns:var(--grh-card-width);
	grid-template-rows:repeat(var(--grh-rail-rows),auto);
	grid-template-columns:none;
	gap:var(--grh-section-gap);
	overflow-x:auto;
	overflow-y:hidden;
	overscroll-behavior-inline:contain;
	scroll-snap-type:x proximity;
	scrollbar-width:thin;
	padding-bottom:.35rem;
}
:where(.grh-content-grid.grh-layout-rail > .grh-content-card){scroll-snap-align:start}

/* Vertical/list mode for content. */
:where(.grh-content-grid.grh-layout-list){display:flex;flex-direction:column;gap:var(--grh-section-gap)}
:where(.grh-content-grid.grh-layout-list .grh-content-card){display:grid;grid-template-columns:minmax(150px,34%) 1fr;gap:1rem;align-items:start}
:where(.grh-content-grid.grh-layout-list .grh-content-card__body){padding:0}

/* Shared rail shell and optional arrows. */
:where(.grh-rail-shell){position:relative;min-width:0}
:where(.grh-rail-track){min-width:0;overflow:hidden}
:where(.grh-rail-arrow){position:absolute;z-index:4;top:50%;translate:0 -50%;width:38px;height:38px;border:0;border-radius:999px;cursor:pointer;background:rgba(0,0,0,.72);color:#fff;font-size:1.6rem;line-height:1;display:grid;place-items:center}
:where(.grh-rail-arrow--prev){left:.4rem}
:where(.grh-rail-arrow--next){right:.4rem}

/* Creator layout variants. */
:where(.grh-creator-list.grh-layout-grid){display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--grh-creator-card-width),var(--grh-creator-card-width)));gap:var(--grh-section-gap);justify-content:start}
:where(.grh-creator-list.grh-layout-grid[style*="--grh-columns"]){grid-template-columns:repeat(var(--grh-columns),minmax(0,1fr))}
:where(.grh-creator-list.grh-layout-grid[style*="--grh-columns"] .grh-creator-list__item){width:100%;max-width:none}
:where(.grh-creator-list.grh-layout-rail){display:grid;grid-auto-flow:column;grid-auto-columns:var(--grh-creator-card-width);grid-template-rows:repeat(var(--grh-rail-rows),auto);gap:var(--grh-section-gap);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;padding-bottom:.35rem}
:where(.grh-creator-list.grh-layout-rail .grh-creator-list__item){width:100%;max-width:none;scroll-snap-align:start}
:where(.grh-creator-list.grh-layout-list){display:flex;flex-direction:column;gap:var(--grh-section-gap)}
:where(.grh-creator-list.grh-layout-list .grh-creator-list__item){width:100%;max-width:none}
:where(.grh-creator-list.grh-layout-list .grh-creator-card__link){display:grid;grid-template-columns:110px 1fr;align-items:center}
:where(.grh-creator-list.grh-layout-list .grh-creator-card__media){aspect-ratio:1/1}
:where(.grh-creator-list.grh-layout-list .grh-creator-card__body){align-items:flex-start;text-align:left}

/* Featured Creator rails are intentionally compact.
 * These are low-specificity defaults only; theme CSS can override them normally.
 * Explicit shortcode card_width/gap attributes are emitted inline and remain authoritative. */
:where(.grh-creator-list--featured.grh-layout-rail){
	--grh-creator-card-width:112px;
	--grh-creator-list-gap:6px;
	--grh-section-gap:var(--grh-creator-list-gap);
}
:where(.grh-creator-list--featured.grh-layout-rail .grh-creator-list__item){
	width:var(--grh-creator-card-width);
	min-width:var(--grh-creator-card-width);
	max-width:var(--grh-creator-card-width);
	height:auto;
	min-height:0;
}
:where(.grh-creator-list--featured .grh-creator-card__link){height:auto}
:where(.grh-creator-list--featured .grh-creator-card__body){
	flex:0 0 auto;
	min-height:0;
	justify-content:flex-start;
	gap:.35rem;
}
:where(.grh-creator-list--featured .grh-creator-card__cta){margin-top:0}

/* Category cards / topic browser. Icons can be supplied by theme CSS using ::before. */
:where(.grh-category-list){gap:var(--grh-section-gap)}
:where(.grh-category-list.grh-layout-grid){display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--grh-category-card-width),1fr))}
:where(.grh-category-list.grh-layout-grid[style*="--grh-columns"]){grid-template-columns:repeat(var(--grh-columns),minmax(0,1fr))}
:where(.grh-category-list.grh-layout-rail){display:grid;grid-auto-flow:column;grid-auto-columns:var(--grh-category-card-width);grid-template-rows:repeat(var(--grh-rail-rows),auto);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;padding-bottom:.35rem}
:where(.grh-category-list.grh-layout-list){display:flex;flex-direction:column}
:where(.grh-category-card){display:flex;align-items:center;justify-content:center;gap:.55rem;min-height:52px;padding:.75rem 1rem;background:var(--grh-category-background);border:var(--grh-category-border);border-radius:var(--grh-category-radius);color:inherit;text-decoration:none;text-align:center;scroll-snap-align:start}
:where(.grh-category-card__count){font-size:.75em;opacity:.6}

/* Featured hero carousel. */
:where(.grh-featured-carousel){position:relative;width:100%;min-width:0}
:where(.grh-featured-carousel__viewport){overflow:hidden;border-radius:var(--grh-carousel-radius)}
:where(.grh-featured-carousel__track){display:flex;width:100%;transition:transform .45s ease;will-change:transform}
:where(.grh-featured-carousel__slide){position:relative;flex:0 0 100%;height:var(--grh-carousel-height);overflow:hidden;background:#111}
:where(.grh-featured-carousel__image,.grh-featured-carousel__placeholder){display:block;width:100%;height:100%;object-fit:cover}
:where(.grh-featured-carousel__placeholder){background:var(--grh-thumb-background,#ddd)}
:where(.grh-featured-carousel__overlay){position:absolute;inset:0;display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:.55rem;padding:clamp(1rem,4vw,3rem);background:var(--grh-carousel-overlay);color:#fff;pointer-events:none}
:where(.grh-featured-carousel__creator){font-size:.9rem;opacity:.82}
:where(.grh-featured-carousel__title){max-width:700px;margin:0;font-size:clamp(1.6rem,4vw,3.2rem);line-height:1.03}
:where(.grh-featured-carousel__cta){pointer-events:auto;display:inline-flex;margin-top:.5rem;padding:.7rem 1.1rem;border-radius:7px;background:var(--grh-carousel-cta-background);color:var(--grh-carousel-cta-color);text-decoration:none;font-weight:600}
:where(.grh-featured-carousel__arrow){position:absolute;z-index:5;top:50%;translate:0 -50%;width:42px;height:42px;border:0;border-radius:999px;background:rgba(0,0,0,.68);color:#fff;cursor:pointer;font-size:1.7rem;display:grid;place-items:center}
:where(.grh-featured-carousel__arrow--prev){left:.8rem}
:where(.grh-featured-carousel__arrow--next){right:.8rem}
:where(.grh-featured-carousel__dots){position:absolute;z-index:5;left:50%;bottom:.8rem;translate:-50% 0;display:flex;gap:.45rem}
:where(.grh-featured-carousel__dot){width:9px;height:9px;border:0;border-radius:999px;padding:0;background:rgba(255,255,255,.46);cursor:pointer}
:where(.grh-featured-carousel__dot.is-active){background:var(--grh-carousel-cta-background)}

/* Ranked/trending sidebar list. */
:where(.grh-trending-list){list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.8rem}
:where(.grh-trending-list__item){display:grid;grid-template-columns:2rem minmax(96px,132px) 1fr;gap:.7rem;align-items:start;min-width:0}
:where(.grh-trending-list__rank){font-size:1.3rem;font-weight:700;line-height:1.2;text-align:center}
:where(.grh-trending-list__thumb){position:relative;display:block;aspect-ratio:16/9;overflow:hidden;background:var(--grh-thumb-background,#ddd)}
:where(.grh-trending-list__thumb img,.grh-trending-list__placeholder){width:100%;height:100%;display:block;object-fit:cover}
:where(.grh-trending-list__body){display:flex;flex-direction:column;gap:.25rem;min-width:0}
:where(.grh-trending-list__title){color:inherit;text-decoration:none;font-weight:600;line-height:1.25}
:where(.grh-trending-list__creator,.grh-trending-list__date){font-size:.78rem;opacity:.68}

/* Local GRH search. */
:where(.grh-search__form){display:flex;gap:.6rem;width:100%}
:where(.grh-search__input){flex:1;min-width:0;padding:.75rem 1rem;border:1px solid rgba(127,127,127,.3);border-radius:8px;background:transparent;color:inherit}
:where(.grh-search__submit){padding:.7rem 1rem;border:1px solid currentColor;border-radius:8px;background:transparent;color:inherit;cursor:pointer}
:where(.grh-search__results){display:flex;flex-direction:column;gap:2rem;margin-top:1.5rem}
:where(.grh-search__section > h2){margin:0 0 .8rem}
:where(.grh-search .screen-reader-text){position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@media(max-width:700px){
	:where(.grh-content-grid.grh-layout-list .grh-content-card){grid-template-columns:130px 1fr}
	:where(.grh-featured-carousel){--grh-carousel-height:360px}
	:where(.grh-featured-carousel__overlay){padding:1.25rem}
	:where(.grh-trending-list__item){grid-template-columns:1.5rem 104px 1fr}
}

@media(max-width:480px){
	:where(.grh-content-grid.grh-layout-list .grh-content-card){grid-template-columns:110px 1fr;gap:.7rem}
	:where(.grh-featured-carousel){--grh-carousel-height:300px}
	:where(.grh-featured-carousel__title){font-size:1.45rem}
	:where(.grh-featured-carousel__arrow){width:34px;height:34px}
	:where(.grh-trending-list__item){grid-template-columns:1.25rem 92px 1fr;gap:.5rem}
}

@media(prefers-reduced-motion:reduce){
	:where(.grh-featured-carousel__track){transition:none}
	:where(.grh-content-grid.grh-layout-rail,.grh-creator-list.grh-layout-rail,.grh-category-list.grh-layout-rail){scroll-behavior:auto}
}
:where(.grh-featured-carousel__media){position:absolute;inset:0;display:block}
:where(.grh-featured-carousel__title-link){color:inherit;text-decoration:none;pointer-events:auto}

/* -------------------------------------------------------------------------
 * v0.9.22 Videos / Explore archive
 * ---------------------------------------------------------------------- */
:where(.grh-video-archive){
	--grh-filter-gap:.75rem;
	--grh-filter-background:rgba(127,127,127,.06);
	--grh-filter-border:1px solid rgba(127,127,127,.2);
	--grh-filter-radius:10px;
	--grh-filter-control-background:transparent;
	--grh-filter-control-border:1px solid rgba(127,127,127,.28);
	--grh-filter-control-radius:7px;
	--grh-pagination-gap:.4rem;
	--grh-pagination-size:2.35rem;
}
:where(.grh-video-filters){
	margin:0 0 1rem;
	padding:1rem;
	background:var(--grh-filter-background);
	border:var(--grh-filter-border);
	border-radius:var(--grh-filter-radius);
	scroll-margin-top:1rem;
}
:where(.grh-video-filters__toggle){display:none}
:where(.grh-video-filters__panel){
	display:grid;
	grid-template-columns:minmax(180px,1.5fr) repeat(4,minmax(130px,1fr)) auto;
	gap:var(--grh-filter-gap);
	align-items:end;
}
:where(.grh-video-filters__field){display:flex;flex-direction:column;gap:.35rem;min-width:0}
:where(.grh-video-filters__field label){font-size:.76rem;font-weight:600;opacity:.72}
:where(.grh-video-filters__input,.grh-video-filters__select){
	width:100%;
	min-width:0;
	height:40px;
	box-sizing:border-box;
	padding:.5rem .7rem;
	border:var(--grh-filter-control-border);
	border-radius:var(--grh-filter-control-radius);
	background:var(--grh-filter-control-background);
	color:inherit;
	font:inherit;
}
:where(.grh-video-filters__actions){display:flex;align-items:center;gap:.55rem;white-space:nowrap}
:where(.grh-video-filters__submit,.grh-video-filters__clear){
	display:inline-flex;
	align-items:center;
	justify-content:center;
	height:40px;
	box-sizing:border-box;
	padding:.5rem .85rem;
	border:1px solid currentColor;
	border-radius:var(--grh-filter-control-radius);
	background:transparent;
	color:inherit;
	font:inherit;
	text-decoration:none;
	cursor:pointer;
}
:where(.grh-video-filters__clear){border-color:transparent;opacity:.72}
:where(.grh-video-archive__summary){margin:.2rem 0 .9rem;font-size:.82rem;opacity:.68}
:where(.grh-video-archive__empty){padding:2rem 1rem;text-align:center;border:1px dashed rgba(127,127,127,.3);border-radius:10px;opacity:.72}
:where(.grh-pagination){display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:var(--grh-pagination-gap);margin:1.75rem 0 0}
:where(.grh-pagination__page,.grh-pagination__dots){
	display:inline-flex;
	align-items:center;
	justify-content:center;
	min-width:var(--grh-pagination-size);
	height:var(--grh-pagination-size);
	box-sizing:border-box;
	padding:0 .65rem;
	border:1px solid rgba(127,127,127,.24);
	border-radius:7px;
	color:inherit;
	text-decoration:none;
	line-height:1;
}
:where(.grh-pagination__page.is-current){font-weight:700;border-color:currentColor}
:where(.grh-pagination__dots){border-color:transparent;min-width:auto;padding:0 .2rem}

/* Desktop: filter controls are always visible and the toggle stays hidden. */
@media(min-width:1025px){
	:where(.grh-video-filters__toggle){display:none!important}
	:where(.grh-video-filters__panel){display:grid!important}
}

/* Tablet/mobile: compact toggle, collapsed by default, active filters open. */
@media(max-width:1024px){
	:where(.grh-video-filters){padding:.7rem .8rem}
	:where(.grh-video-filters__toggle){
		display:flex;
		width:100%;
		align-items:center;
		justify-content:space-between;
		gap:.75rem;
		padding:.25rem 0;
		border:0;
		background:transparent;
		color:inherit;
		font:inherit;
		font-weight:700;
		text-align:left;
		cursor:pointer;
	}
	:where(.grh-video-filters__toggle-label){display:inline-flex;align-items:center;gap:.35rem}
	:where(.grh-video-filters__active-count){font-size:.82em;font-weight:600;opacity:.7}
	:where(.grh-video-filters__toggle-icon){display:inline-block;font-size:1.15em;line-height:1;transition:transform .18s ease}
	:where(.grh-video-filters.is-open .grh-video-filters__toggle-icon){transform:rotate(180deg)}
	:where(.grh-video-filters__panel){display:none;grid-template-columns:repeat(3,minmax(0,1fr));margin-top:.75rem}
	:where(.grh-video-filters.is-open .grh-video-filters__panel){display:grid}
	:where(.grh-video-filters__field--search){grid-column:span 2}
}
@media(max-width:700px){
	:where(.grh-video-filters__panel){grid-template-columns:1fr 1fr}
	:where(.grh-video-filters__field--search){grid-column:1/-1}
	:where(.grh-video-filters__actions){grid-column:1/-1}
}
@media(max-width:460px){
	:where(.grh-video-filters__panel){grid-template-columns:1fr}
	:where(.grh-video-filters__field--search,.grh-video-filters__actions){grid-column:auto}
	:where(.grh-video-filters__actions){justify-content:space-between}
}
@media(prefers-reduced-motion:reduce){
	:where(.grh-video-filters__toggle-icon){transition:none}
}
