/**
 * KCAU Notices — default public stylesheet.
 *
 * Deliberately light-touch: every rule here can be overridden from the
 * Kingster/GoodLayers theme's Custom CSS panel by targeting the same
 * classes with a more specific selector, or disabled entirely with
 * `wp_dequeue_style( 'kcau-notices-public' )`.
 *
 * Brand variables reflect the KCAU brand system and can be edited here or
 * overridden in the theme.
 */

:root {
	--kcau-navy: #192C57;
	--kcau-gold: #CBAE2D;
}

.kcau-notices {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/*
 * Grid layout — used by the /notices/ archive page by default, and
 * available to the shortcode via [kcau_notices layout="grid"].
 * 3 columns on wide desktop, 2 on tablet, 1 on mobile. CSS Grid rather than
 * theme-specific column classes, so it renders the same regardless of
 * where Kingster/GoodLayers puts it on the page.
 */
.kcau-notices-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	align-items: stretch;
}

@media (max-width: 1024px) {
	.kcau-notices-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.kcau-notices-grid {
		grid-template-columns: 1fr;
	}
}

.kcau-notice {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid #e2e2e2;
	border-left: 4px solid var(--kcau-navy);
	border-radius: 4px;
	padding: 18px 20px;
	background: #fff;
	height: 100%;
}

/* Card body content grows to fill available space so every card in a grid
   row ends at the same height, with actions pinned to the bottom. */
.kcau-notice-excerpt {
	flex-grow: 1;
}

.kcau-notice-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 2px;
}

.kcau-notice-badges .kcau-notice-badge {
	margin: 0;
}

.kcau-notice-pinned {
	border-left-color: var(--kcau-gold);
	background: #fdfbf3;
}

.kcau-notice-priority-urgent {
	border-left-color: #c0392b;
}

.kcau-notice-pin-flag {
	position: absolute;
	top: 12px;
	right: 14px;
}

.kcau-notice-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	padding: 2px 8px;
	border-radius: 3px;
	margin: 0 6px 8px 0;
	text-transform: uppercase;
}

.kcau-notice-badge-new {
	background: var(--kcau-gold);
	color: var(--kcau-navy);
}

.kcau-notice-badge-important {
	background: #fdf1cf;
	color: #8a6d00;
}

.kcau-notice-badge-urgent {
	background: #c0392b;
	color: #fff;
}

.kcau-notice-category {
	margin-bottom: 6px;
}

.kcau-notice-category-tag {
	display: inline-block;
	font-size: 11px;
	color: var(--kcau-navy);
	background: #eef1f8;
	padding: 2px 8px;
	border-radius: 12px;
	margin-right: 4px;
}

.kcau-notice-title {
	margin: 4px 0 6px;
	font-family: "Futura PT", "Futura", sans-serif;
	font-size: 1.25em;
	line-height: 1.3;
}

.kcau-notice-title a {
	color: var(--kcau-navy);
	text-decoration: none;
}

.kcau-notice-title a:hover {
	text-decoration: underline;
}

.kcau-notice-meta {
	font-size: 13px;
	color: #666;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin-bottom: 10px;
}

.kcau-notice-excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: #333;
	margin-bottom: 10px;
}

.kcau-notice-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
}

.kcau-notice-read-more,
.kcau-notice-download,
.kcau-notice-external-link {
	font-size: 13px;
	font-weight: 600;
	color: var(--kcau-navy);
	text-decoration: none;
}

.kcau-notice-download {
	color: #8a6d00;
}

.kcau-notice-read-more:hover,
.kcau-notice-download:hover,
.kcau-notice-external-link:hover {
	text-decoration: underline;
}

.kcau-notices-empty {
	font-style: italic;
	color: #777;
}

.kcau-notice-view-all {
	margin-top: 10px;
	font-size: 13px;
}

/* Single notice page */
.kcau-notice-single-wrap {
	max-width: 800px;
	margin: 40px auto;
	padding: 0 20px;
}

.kcau-notice-admin-preview-flag {
	background: #fbeaea;
	color: #a94442;
	padding: 10px 14px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-size: 13px;
}

.kcau-notice-single .kcau-notice-title,
.kcau-notice-single h1.kcau-notice-title {
	font-size: 2em;
}

.kcau-notice-content {
	line-height: 1.7;
	margin: 20px 0;
}

.kcau-notice-back {
	margin-top: 24px;
	font-size: 13px;
}

/* Archive page */
.kcau-notice-archive-wrap {
	max-width: 1200px;
	margin: 0 auto 60px;
	padding: 0 20px;
}

/*
 * Page heading — styled as a proper section header (navy bar, gold
 * underline accent), in the spirit of the site's existing
 * "Programme Fee Structures" style heading, without copying it exactly.
 * Fully responsive: the bar's padding/font-size scale down on mobile
 * rather than the text wrapping awkwardly.
 */
.kcau-notice-archive-header {
	background: var(--kcau-navy);
	padding: 28px 24px;
	margin: 0 0 32px;
	border-bottom: 4px solid var(--kcau-gold);
}

.kcau-notice-archive-title {
	font-family: "Futura PT", "Futura", sans-serif;
	color: #fff;
	margin: 0;
	font-size: 1.6em;
	letter-spacing: 0.01em;
}

@media (max-width: 640px) {
	.kcau-notice-archive-header {
		padding: 20px 16px;
	}
	.kcau-notice-archive-title {
		font-size: 1.25em;
	}
}

.kcau-notices-pagination {
	margin-top: 32px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kcau-notices-pagination a,
.kcau-notices-pagination span {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #e2e2e2;
	border-radius: 3px;
	color: var(--kcau-navy);
	text-decoration: none;
	font-size: 13px;
}

.kcau-notices-pagination .current {
	background: var(--kcau-navy);
	color: #fff;
	border-color: var(--kcau-navy);
}

/*
 * Responsive table wrapper — auto-applied to any <table> pasted into a
 * notice's content (see class-content-filters.php), e.g. the graduation
 * certificate collection schedule. Scrolls horizontally within its own
 * contained box on narrow screens instead of breaking the page layout.
 */
.kcau-notice-table-wrapper {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 16px 0;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
}

.kcau-notice-table {
	width: 100%;
	min-width: 480px; /* keeps columns readable; wrapper handles the scroll below this width */
	border-collapse: collapse;
	font-size: 14px;
}

.kcau-notice-table th,
.kcau-notice-table td {
	padding: 10px 14px;
	text-align: left;
	border-bottom: 1px solid #ececec;
	vertical-align: top;
}

.kcau-notice-table th {
	background: var(--kcau-gold);
	color: var(--kcau-navy);
	font-weight: 700;
	white-space: nowrap;
}

.kcau-notice-table tbody tr:nth-child(even) {
	background: #f7f7f8;
}

.kcau-notice-table td {
	word-break: normal;
	overflow-wrap: break-word;
}
