/* =============================================================
   ARC Discover — theme enhancements (grid + tabs)
   -------------------------------------------------------------
   1. Lays the Discover result cards (authors / institutions /
      sponsors) out as a responsive 2–3 column grid.
   2. Restyles the type tabs with a theme-matched active state.

   The Discover UI lives in the read-only arc-extensions plugin
   (public/shortcodes/discover.php) and prints its own <style>
   block in the page body — i.e. AFTER this file in the <head>.
   So overrides need extra specificity (a `body` / `#arc-disc-tabs`
   prefix) to out-specify the plugin's own rules.

   Loaded only on the page holding the [arc_get_discover]
   shortcode (see functions.php).

   Palette: brand teal #0a3d47 · accent green #79ba3a · line #e4e8e0
   ============================================================= */

body #arc-discover-results {
	max-width: 1140px;
	margin-inline: auto;
	display: grid;
	/* auto-fill → 3 cols ≥ ~1040px, 2 cols on mid widths, 1 col on phones */
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 16px;
	align-items: stretch;
}

/* Cards become equal-height grid tiles (drop the stacked-row margin). */
#arc-discover-results .arc-disc-card {
	margin-bottom: 0;
	height: 100%;
}

/* Full-width states (loading spinner / empty / error) must span every
   column, otherwise they'd render squeezed into the first grid cell. */
#arc-discover-results > .arc-disc-state,
#arc-discover-results > .text-center {
	grid-column: 1 / -1;
}

/* Single-column phones: restore a comfortable centred reading width. */
@media (max-width: 639px) {
	body #arc-discover-results {
		max-width: 680px;
		gap: 12px;
	}
}


/* =============================================================
   Type tabs — Authors / Institutions / Sponsors
   Active tab = filled brand-teal (#0A3D47) tab with white text.
   NOTE: tabs are <button>s, and the theme reset.css colours
   button:hover/:focus magenta (#c36) — every interactive state
   below explicitly overrides that.
   ============================================================= */

#arc-disc-tabs {
	border-bottom: 2px solid #e4e8e0;
	gap: 2px;
}

#arc-disc-tabs .arc-disc-tab {
	position: relative;
	border: none;
	border-bottom: none;              /* drop the plugin's transparent border indicator */
	margin-bottom: -2px;
	padding: .7rem 1.4rem;
	font-size: .9rem;
	font-weight: 600;
	color: #5c6b66;
	background-color: transparent;
	border-radius: 9px 9px 0 0;
	transition: color .18s ease, background-color .18s ease;
}

#arc-disc-tabs .arc-disc-tab i {
	transition: color .18s ease;
}

/* Hover / focus on an INACTIVE tab: teal text + faint teal tint.
   These override reset.css's magenta button:hover/:focus background. */
#arc-disc-tabs .arc-disc-tab:hover,
#arc-disc-tabs .arc-disc-tab:focus,
#arc-disc-tabs .arc-disc-tab:focus:hover {
	color: #0a3d47;
	background-color: rgba(10, 61, 71, .06);
	outline: none;
}
#arc-disc-tabs .arc-disc-tab:hover i,
#arc-disc-tabs .arc-disc-tab:focus i {
	color: #79ba3a;
}

/* ACTIVE tab: solid brand-teal fill, white text, light-green icon.
   Listed for every state (incl. :focus, which persists after a click)
   so the fill is never overridden by the reset's magenta. Placed last
   so it wins over the hover/focus rules above. */
#arc-disc-tabs .arc-disc-tab.active,
#arc-disc-tabs .arc-disc-tab.active:hover,
#arc-disc-tabs .arc-disc-tab.active:focus,
#arc-disc-tabs .arc-disc-tab.active:focus:hover {
	color: #ffffff;
	background-color: #0a3d47;
	font-weight: 700;
	outline: none;
}
#arc-disc-tabs .arc-disc-tab.active i {
	color: #ffffff;
}

@media (max-width: 575px) {
	#arc-disc-tabs .arc-disc-tab {
		padding: .6rem .9rem;
		font-size: .82rem;
	}
}
