/**
 * SGP Custom Styles
 * Custom styles for SGP Network shortcodes and components
 */

/* ==========================================================================
   SGP News Shortcode
   ========================================================================== */

.sgp-news__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 2rem;
	border-bottom: 2px solid #e5e5e5;
	padding-bottom: 1rem;
}

.sgp-news__tab {
	padding: 0.5rem 1rem;
	text-decoration: none !important;
	border-radius: 4px;
	background: #f5f5f5;
	color: #333;
	font-weight: 500;
	transition: background-color 0.2s, color 0.2s;
}

.sgp-news__tab:hover,
.sgp-news__tab:focus {
	background: #e0e0e0;
	color: #333;
	text-decoration: none !important;
}

.sgp-news__tab--active {
	background: #0073aa;
	color: #fff;
}

.sgp-news__tab--active:hover {
	background: #005a87;
	color: #fff;
	text-decoration: none;
}

.sgp-news__item {
	padding: 1.5rem 0;
	border-bottom: 1px solid #e5e5e5;
}

.sgp-news__item:last-child {
	border-bottom: none;
}

.sgp-news__title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
}

.sgp-news__title a {
	color: inherit;
	text-decoration: none;
}

.sgp-news__title a:hover {
	text-decoration: underline;
}

.sgp-news__date {
	color: #666;
	font-size: 0.9em;
	display: block;
}

.sgp-news__excerpt {
	margin-top: 0.5rem;
	color: #444;
}

.sgp-news__pagination {
	margin-top: 2rem;
	text-align: center;
}

.sgp-news__pagination .page-numbers {
	display: inline-block;
	padding: 0.5rem 0.75rem;
	margin: 0 0.25rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none !important;
	color: #333;
}

.sgp-news__pagination .page-numbers:hover,
.sgp-news__pagination .page-numbers:focus {
	text-decoration: none !important;
}

.sgp-news__pagination .page-numbers.current {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

.sgp-news__pagination .page-numbers:hover:not(.current) {
	background: #f5f5f5;
}

.sgp-news__empty {
	padding: 2rem;
	text-align: center;
	color: #666;
}

/* ==========================================================================
   SGP Supplier Gallery Shortcode
   ========================================================================== */

.sgp-supplier-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin: 1.5rem 0;
}

.sgp-gallery-item {
	margin: 0;
}

.sgp-gallery-item a {
	display: block;
	overflow: hidden;
	border-radius: 4px;
}

.sgp-gallery-image {
	width: 100%;
	height: auto;
	transition: transform 0.3s ease;
}

.sgp-gallery-item a:hover .sgp-gallery-image {
	transform: scale(1.05);
}

.sgp-gallery-item figcaption {
	font-size: 0.875rem;
	color: #666;
	margin-top: 0.5rem;
	text-align: center;
}

/* ==========================================================================
   SGP Events Shortcode
   ========================================================================== */

.sgp-events {
	color: #333;
}

.sgp-events__category {
	margin-bottom: 2.5rem;
}

.sgp-events__category h3 {
	color: #1E1E1E;
	font-size: 1.5rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #0073aa;
}

.sgp-events__empty {
	padding: 2rem;
	text-align: center;
	color: #666;
}

/* ==========================================================================
   SGP Menus Table (shared by menus, events, contracts)
   ========================================================================== */

.sgp-menus__table-menu {
	width: 100%;
	display: table;
	border-collapse: collapse;
}

.sgp-menus__table-menu [role="rowgroup"] {
	display: table-row-group;
}

.sgp-menus__table-menu .table-menu-row {
	display: table-row;
}

html[lang*='fr'] .sgp-menus__table-menu .en-only {
	display: none;
}

html[lang*='en'] .sgp-menus__table-menu .fr-only {
	display: none;
}

.sgp-menus__table-menu .table-menu-row--header {
	background-color: #f5f5f5;
}

.sgp-menus__table-menu .table-menu-row--header [role="columnheader"] {
	font-weight: 600;
	color: #1E1E1E;
}

.sgp-menus__table-menu [role="cell"],
.sgp-menus__table-menu [role="columnheader"] {
	display: table-cell;
	padding: 0.75rem 1rem;
	vertical-align: middle;
	border-bottom: 1px solid #e5e5e5;
}

.sgp-menus__table-menu .table-menu-text {
	margin: 0;
	color: #fff;
}

.sgp-menus__table-menu .table-menu-item__subtitle {
	display: block;
	font-size: 0.85em;
	color: #666;
	margin-top: 0.25rem;
}

.sgp-menus__table-menu .document-link {
	color: #fff;
	text-decoration: none;
}

.sgp-menus__table-menu .document-link:hover {
	text-decoration: underline;
}

.sgp-menus__heading {
	color: #1E1E1E;
	font-size: 1.5rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #0073aa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.sgp-menus__table-menu,
	.sgp-menus__table-menu [role="rowgroup"],
	.sgp-menus__table-menu .table-menu-row,
	.sgp-menus__table-menu [role="cell"],
	.sgp-menus__table-menu [role="columnheader"] {
		display: block;
	}

	.sgp-menus__table-menu .table-menu-row--header {
		display: none;
	}

	.sgp-menus__table-menu .table-menu-row {
		padding: 1rem 0;
		border-bottom: 1px solid #e5e5e5;
	}

	.sgp-menus__table-menu [role="cell"] {
		padding: 0.25rem 0;
		border-bottom: none;
	}

	.sgp-menus__table-menu .table-menu-row__date::before {
		content: "Date: ";
		font-weight: 600;
	}

	.sgp-menus__table-menu .table-menu-row__registration::before {
		content: "";
	}
}

.table-menu-row:not(.fall-winter-row) .table-menu-text {
	color: #666;

	&.document-link {
		color: #0073aa;
	}
}

/* ==========================================================================
   Search Result Post Type Badges
   ========================================================================== */

.elementor-post__title:has(.sgp-search-badge),
.elementor-post__title:has(.sgp-search-badge) a {
	text-decoration: none !important;
}

.elementor-post__title a:has(.sgp-search-badge) {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em;
}

.sgp-search-title-text {
	text-decoration: underline;
}

.sgp-search-badge {
	display: inline-block;
	font-size: 0.55em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 0.2em 0.75em;
	border-radius: 999px;
	line-height: 1.4;
	margin-left: auto;
	white-space: nowrap;
	flex-shrink: 0;
	transition: opacity 0.2s;
}

.sgp-search-badge:hover {
	opacity: 0.8;
}

.sgp-search-badge--supplier {
	background: #e6f4ea;
	color: #1b7d3a;
}

.sgp-search-badge--contract {
	background: #e3f0fc;
	color: #1a5fa3;
}

.sgp-search-badge--menu {
	background: #fef3e2;
	color: #b45309;
}

.sgp-search-badge--news-post {
	background: #f0e6f6;
	color: #7c3aad;
}

.sgp-search-note {
	display: block;
	width: 100%;
	font-size: 0.75em;
	color: #666;
	font-weight: 400;
	order: 3;
}
