/**
 * ESTMJS Publications - front-end styles.
 *
 * Layout only - typography (font-family, heading sizes, link colours) is
 * deliberately left to Astra's Customizer cascade. The `entry-content`
 * class is applied to each wrapping element so Astra's scoped typography
 * rules apply, matching the convention established in the ESTMJS Members
 * (CPT) plugin's stylesheets.
 */

.estmjs-publications-list__items {
	/* A flex/grid container blockifies its <li> children, which suppresses
	   their native ::marker box in every current browser - so this can't
	   use display:flex (as an earlier version did) and get bullets at the
	   same time. Plain block flow + margin-bottom on each item produces
	   the same visual spacing as the old flex "gap" did, without losing
	   the bullets. */
	list-style: disc outside;
	margin: 0;
	padding: 0 0 0 1.3rem;
}

.estmjs-publications-list__item {
	line-height: 1.5;
	margin-bottom: 0.85rem;
}

.estmjs-publications-list__item:last-child {
	margin-bottom: 0;
}

.estmjs-publications-list__caveat {
	font-size: 0.8em;
	opacity: 0.7;
	margin-left: 0.35em;
}

.estmjs-publications-list__heading {
	margin-bottom: 1rem;
}

.estmjs-publications-single__year,
.estmjs-publications-single__members,
.estmjs-publications-single__pubmed {
	margin: 0.4em 0;
}

/* Per-item meta (year/members/category), shown inline after the citation link. */
.estmjs-publications-list__year,
.estmjs-publications-list__members,
.estmjs-publications-list__category {
	font-size: 0.85em;
	opacity: 0.75;
	margin-left: 0.35em;
}

.estmjs-publications-list__excerpt {
	margin: 0.3em 0 0;
	font-size: 0.9em;
	opacity: 0.85;
}

/* Group headings (Block_Publications_List grouped output). */
.estmjs-publications-list__group-heading {
	margin: 1.5rem 0 0.5rem;
}

.estmjs-publications-list__group-heading:first-child {
	margin-top: 0;
}

.estmjs-publications-list__group-continued {
	font-size: 0.75em;
	font-weight: normal;
	opacity: 0.6;
}

/* Empty-state message (block only - see class-block-publications-list.php). */
.estmjs-publications-list__empty {
	opacity: 0.7;
	font-style: italic;
}

/* Pagination (block, member-profile append, and shortcode).
   Structure inspired by Bootstrap v5's pagination component (numbered
   pages, a highlighted current page, disabled Prev/Next at either end,
   an ellipsis for long ranges) - restyled here as fully rounded pill
   buttons instead of Bootstrap's default connected, square-cornered
   group. Every pill shares one fixed rem-based height/min-width
   regardless of its content (a single digit, "12", or a chevron), which
   is what keeps them visually consistent - a difference here was
   previously caused by each pill type having its own font-size and
   em-based padding, which computes to a different actual size per
   element. Colours reference Astra's Global Color Palette CSS variables
   (--ast-global-color-0 = Primary, --ast-global-color-3 = Text), each
   with a hardcoded fallback for sites not running Astra/Astra Pro, or
   any older Astra version predating the 3.7.0 Global Color Palette
   feature. */
.estmjs-publications-list__pagination {
	margin: 1.5rem 0 2rem;
}

.estmjs-publications-list__pagination-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.estmjs-publications-list__page-item {
	display: flex;
}

.estmjs-publications-list__page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.6rem;
	border-radius: 999px;
	background-color: transparent;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	/* !important on colour/underline only: these sit inside an
	   `entry-content` wrapper (for Astra's typography cascade elsewhere),
	   and themes commonly style `.entry-content a` with their link colour
	   and an underline at a selector specificity a single class here
	   can't win on its own. A pagination pill, unlike an inline text
	   link, needs its own neutral/active colouring and no underline
	   regardless - a targeted, intentional exception rather than a
	   general escape hatch. */
	color: var( --ast-global-color-3, #3a3a3a ) !important;
	text-decoration: none !important;
	transition: background-color 150ms ease-in-out, color 150ms ease-in-out, transform 150ms ease-in-out;
}

a.estmjs-publications-list__page-link:hover,
a.estmjs-publications-list__page-link:focus {
	background-color: rgba( 0, 0, 0, 0.08 );
	transform: translateY( -1px );
}

.estmjs-publications-list__page-item.is-current .estmjs-publications-list__page-link {
	background-color: var( --ast-global-color-0, #2271b1 );
	color: #ffffff !important;
}

.estmjs-publications-list__page-item--ellipsis .estmjs-publications-list__page-link {
	cursor: default;
}

.estmjs-publications-list__page-item.is-disabled .estmjs-publications-list__page-link {
	opacity: 0.35;
}

/* Compact display style (Block_Publications_List's "displayStyle" attribute). */
.estmjs-publications-list--compact .estmjs-publications-list__item {
	font-size: 0.9em;
	line-height: 1.3;
	margin-bottom: 0.35rem;
}


/* Category-first browsing: card grid (archive, block, shortcode).
   Colours use Astra's Global Color Palette variables with hardcoded
   fallbacks, as for the pagination above. The whole card is one link, so
   the inner spans are laid out as a column and no text is underlined. */
.estmjs-publications-categories {
	margin: 0 0 2rem;
}

.estmjs-publications-categories__heading {
	margin-bottom: 1rem;
}

.estmjs-publications-categories__grid {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.estmjs-publications-categories__grid--auto {
	grid-template-columns: repeat( auto-fit, minmax( 15rem, 1fr ) );
}

.estmjs-publications-categories__grid--2 {
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
}

.estmjs-publications-categories__grid--3 {
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
}

.estmjs-publications-categories__grid--4 {
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
}

.estmjs-publications-categories__item {
	display: flex;
	margin: 0;
}

.estmjs-publications-categories__card {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	width: 100%;
	box-sizing: border-box;
	padding: 1.15rem 1.3rem;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 14px;
	background-color: transparent;
	color: var( --ast-global-color-3, #3a3a3a ) !important;
	text-decoration: none !important;
	transition: border-color 150ms ease-in-out, box-shadow 150ms ease-in-out, transform 150ms ease-in-out;
}

.estmjs-publications-categories__card:hover,
.estmjs-publications-categories__card:focus {
	border-color: var( --ast-global-color-0, #2271b1 );
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.08 );
	transform: translateY( -2px );
}

.estmjs-publications-categories__title {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
	color: var( --ast-global-color-0, #2271b1 );
}

.estmjs-publications-categories__count {
	font-size: 0.9rem;
	font-weight: 600;
}

.estmjs-publications-categories__description {
	font-size: 0.9rem;
	line-height: 1.45;
	opacity: 0.85;
}

.estmjs-publications-categories__cta {
	margin-top: auto;
	padding-top: 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: var( --ast-global-color-0, #2271b1 );
}

.estmjs-publications-categories__all {
	margin: 1.25rem 0 0;
}

@media ( max-width: 782px ) {

	.estmjs-publications-categories__grid--2,
	.estmjs-publications-categories__grid--3,
	.estmjs-publications-categories__grid--4 {
		grid-template-columns: minmax( 0, 1fr );
	}
}

/* Category switcher shown above a category list: rounded pills matching the
   pagination pills (same height, same Astra colours). */
.estmjs-publications-category-nav {
	margin: 0 0 1.5rem;
}

.estmjs-publications-category-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.estmjs-publications-category-nav__item {
	display: flex;
	margin: 0;
}

.estmjs-publications-category-nav__pill {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	box-sizing: border-box;
	height: 2.25rem;
	padding: 0 0.9rem;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	color: var( --ast-global-color-3, #3a3a3a ) !important;
	text-decoration: none !important;
	transition: background-color 150ms ease-in-out, color 150ms ease-in-out, border-color 150ms ease-in-out;
}

a.estmjs-publications-category-nav__pill:hover,
a.estmjs-publications-category-nav__pill:focus {
	background-color: rgba( 0, 0, 0, 0.06 );
}

.estmjs-publications-category-nav__item.is-current .estmjs-publications-category-nav__pill {
	background-color: var( --ast-global-color-0, #2271b1 );
	border-color: var( --ast-global-color-0, #2271b1 );
	color: #ffffff !important;
}

.estmjs-publications-category-nav__count {
	font-size: 0.75rem;
	font-weight: 600;
	opacity: 0.7;
}

/* Category page header text. */
.estmjs-publications-archive__description {
	margin: 0.5rem 0 0;
}

.estmjs-publications-archive__count {
	margin: 0.35rem 0 0;
	font-size: 0.9rem;
	opacity: 0.75;
}
