/**
 * Education Notes
 *
 * Public-facing styles.
 *
 * @package Education_Notes
 */

/* ==========================================================================
   Color System
   ========================================================================== */

:root {
	--en-primary: #2563eb;
	--en-primary-dark: #1d4ed8;
	--en-primary-light: #eff6ff;

	--en-secondary: #7c3aed;
	--en-secondary-light: #f5f3ff;

	--en-success: #16a34a;
	--en-success-light: #f0fdf4;

	--en-warning: #ea580c;
	--en-warning-light: #fff7ed;

	--en-text: #1e293b;
	--en-text-light: #64748b;

	--en-border: #dbe3ef;
	--en-background: #f8fafc;
	--en-white: #ffffff;

	--en-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
	--en-shadow-hover: 0 14px 32px rgba(37, 99, 235, 0.12);
}

/* ==========================================================================
   Public Wrapper
   ========================================================================== */

.en-public {
	width: 100%;
	max-width: 1100px;
	margin: 30px auto;
	padding: 30px;
	box-sizing: border-box;

	background:
		linear-gradient(
			180deg,
			#ffffff 0%,
			#f8fbff 100%
		);

	border: 1px solid var(--en-border);
	border-radius: 16px;

	box-shadow: var(--en-shadow);
}

/* ==========================================================================
   Header
   ========================================================================== */

.en-public__header {
	position: relative;
	margin-bottom: 28px;
	padding: 24px 26px;

	background:
		linear-gradient(
			135deg,
			#eff6ff 0%,
			#f5f3ff 100%
		);

	border: 1px solid #dbeafe;
	border-radius: 14px;
	overflow: hidden;
}

.en-public__header::after {
	content: "";
	position: absolute;
	width: 150px;
	height: 150px;
	right: -60px;
	top: -70px;

	background: rgba(124, 58, 237, 0.08);
	border-radius: 50%;
}

.en-public__title {
	position: relative;
	z-index: 1;

	margin: 0 0 8px;

	font-size: 28px;
	line-height: 1.3;
	font-weight: 700;

	color: var(--en-primary-dark);
}

.en-public__description {
	position: relative;
	z-index: 1;

	margin: 0;

	font-size: 15px;
	line-height: 1.6;

	color: var(--en-text-light);
}

/* ==========================================================================
   Selectors
   ========================================================================== */

.en-public__selectors {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;

	margin-bottom: 30px;
	padding: 22px;

	background: #ffffff;

	border: 1px solid var(--en-border);
	border-radius: 14px;

	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   Selector Fields
   ========================================================================== */

.en-public__field {
	position: relative;
	min-width: 0;
}

.en-public__field label {
	display: block;

	margin: 0 0 8px;

	font-size: 13px;
	line-height: 1.4;
	font-weight: 700;

	color: var(--en-text);
}

/*
 * Different colors for the four selection stages.
 */

.en-public__field:nth-child(1) label {
	color: var(--en-primary-dark);
}

.en-public__field:nth-child(2) label {
	color: var(--en-success);
}

.en-public__field:nth-child(3) label {
	color: var(--en-warning);
}

.en-public__field:nth-child(4) label {
	color: var(--en-secondary);
}

/* ==========================================================================
   Select
   ========================================================================== */

.en-public__select {
	display: block;
	width: 100%;
	min-height: 46px;

	padding: 10px 13px;

	box-sizing: border-box;

	border: 1px solid #cbd5e1;
	border-radius: 9px;

	background-color: #ffffff;

	color: var(--en-text);

	font-size: 14px;
	line-height: 1.4;

	cursor: pointer;

	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		background-color 0.2s ease,
		transform 0.2s ease;
}

.en-public__select:hover:not(:disabled) {
	border-color: #94a3b8;
	background-color: #fcfdff;
}

.en-public__select:focus {
	outline: none;

	border-color: var(--en-primary);

	box-shadow:
		0 0 0 3px rgba(37, 99, 235, 0.12);
}

/*
 * Active/usable selectors.
 */

.en-public__select:not(:disabled):not(:focus) {
	background-color: #ffffff;
}

/*
 * Disabled selectors.
 */

.en-public__select:disabled {
	background-color: #f1f5f9;
	color: #94a3b8;

	border-color: #e2e8f0;

	cursor: not-allowed;
}

/* ==========================================================================
   Notes Container
   ========================================================================== */

.en-public__notes {
	width: 100%;
	min-height: 100px;
}

/* ==========================================================================
   Empty / Loading / Error
   ========================================================================== */

.en-public__empty,
.en-public__loading,
.en-public__error {
	padding: 24px;

	border-radius: 12px;

	text-align: center;
}

.en-public__empty {
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
}

.en-public__loading {
	background: var(--en-primary-light);
	border: 1px solid #bfdbfe;
}

.en-public__error {
	background: #fef2f2;
	border: 1px solid #fecaca;
}

.en-public__empty p,
.en-public__loading p,
.en-public__error p {
	margin: 0;

	font-size: 14px;
	line-height: 1.6;
}

.en-public__empty p {
	color: var(--en-text-light);
}

.en-public__loading p {
	color: var(--en-primary-dark);
}

.en-public__error p {
	color: #b91c1c;
}

/* ==========================================================================
   Note List
   ========================================================================== */

.en-public__note-list {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* ==========================================================================
   Note Card
   ========================================================================== */

.en-public__note {
	position: relative;

	padding: 0;

	overflow: hidden;

	background: #ffffff;

	border: 1px solid var(--en-border);
	border-radius: 14px;

	box-shadow: var(--en-shadow);

	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		border-color 0.2s ease;
}

.en-public__note:hover {
	transform: translateY(-2px);

	border-color: #bfdbfe;

	box-shadow: var(--en-shadow-hover);
}

/* ==========================================================================
   Note Card Title
   ========================================================================== */

.en-public__note-title {
	position: relative;

	margin: 0;

	padding: 18px 24px 18px 28px;

	background:
		linear-gradient(
			135deg,
			#2563eb 0%,
			#4f46e5 100%
		);

	color: #ffffff;

	font-size: 20px;
	line-height: 1.4;
	font-weight: 700;
}

/*
 * Decorative title stripe.
 */

.en-public__note-title::before {
	content: "";

	position: absolute;

	left: 0;
	top: 0;
	bottom: 0;

	width: 6px;

	background: #fbbf24;
}

/* ==========================================================================
   Note Content
   ========================================================================== */

.en-public__note-content {
	padding: 24px 28px;

	font-size: 15px;
	line-height: 1.75;

	color: #334155;

	overflow-wrap: anywhere;
}

.en-public__note-content > *:first-child {
	margin-top: 0;
}

.en-public__note-content > *:last-child {
	margin-bottom: 0;
}

.en-public__note-content p {
	margin: 0 0 16px;
}

/* ==========================================================================
   Content Headings
   ========================================================================== */

.en-public__note-content h1,
.en-public__note-content h2,
.en-public__note-content h3,
.en-public__note-content h4,
.en-public__note-content h5,
.en-public__note-content h6 {
	margin: 26px 0 12px;

	line-height: 1.4;

	color: var(--en-primary-dark);
}

.en-public__note-content h1 {
	font-size: 26px;
}

.en-public__note-content h2 {
	font-size: 23px;
}

.en-public__note-content h3 {
	font-size: 20px;
}

.en-public__note-content h4 {
	font-size: 18px;
}

/* ==========================================================================
   Lists
   ========================================================================== */

.en-public__note-content ul,
.en-public__note-content ol {
	margin: 0 0 16px;
	padding-left: 24px;
}

.en-public__note-content li {
	margin-bottom: 6px;
}

/* ==========================================================================
   Blockquote
   ========================================================================== */

.en-public__note-content blockquote {
	margin: 20px 0;

	padding: 14px 18px;

	border-left: 4px solid var(--en-secondary);

	background: var(--en-secondary-light);

	color: #475569;

	border-radius: 0 8px 8px 0;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.en-public__note-content table {
	width: 100%;

	margin: 20px 0;

	border-collapse: collapse;

	overflow: hidden;

	border: 1px solid #cbd5e1;
	border-radius: 8px;
}

.en-public__note-content th,
.en-public__note-content td {
	padding: 10px 12px;

	border: 1px solid #cbd5e1;

	text-align: left;
	vertical-align: top;
}

.en-public__note-content th {
	background: var(--en-primary-light);

	font-weight: 700;

	color: var(--en-primary-dark);
}

.en-public__note-content tr:nth-child(even) td {
	background: #fafcff;
}

/* ==========================================================================
   Images
   ========================================================================== */

.en-public__note-content img {
	display: block;

	max-width: 100%;
	height: auto;

	margin: 18px auto;

	border-radius: 8px;

	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
/* ==========================================================================
   Links
   ========================================================================== */

.en-public__note-content a {
	color: var(--en-primary-dark);

	text-decoration: underline;

	font-weight: 500;
}

.en-public__note-content a:hover {
	text-decoration: none;
}

/* ==========================================================================
   Code / Pre
   ========================================================================== */

.en-public__note-content pre {
	max-width: 100%;

	overflow-x: auto;

	padding: 14px;

	border-radius: 8px;

	background: #f1f5f9;

	font-size: 13px;
	line-height: 1.6;
}

.en-public__note-content code {
	font-size: 0.9em;
}

/* ==========================================================================
   Note Date
   ========================================================================== */

.en-public__note-date {
	margin: 0;

	padding: 12px 28px;

	background: #f8fafc;

	border-top: 1px solid #e2e8f0;

	font-size: 12px;
	line-height: 1.5;

	color: #94a3b8;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {

	.en-public {
		padding: 24px;
	}

	.en-public__selectors {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

}

@media (max-width: 600px) {

	.en-public {
		margin: 20px 0;
		padding: 14px;

		border-radius: 10px;
	}

	.en-public__header {
		margin-bottom: 20px;
		padding: 20px;

		border-radius: 12px;
	}

	.en-public__title {
		font-size: 24px;
	}

	.en-public__description {
		font-size: 14px;
	}

	.en-public__selectors {
		grid-template-columns: 1fr;

		gap: 14px;

		margin-bottom: 22px;
		padding: 18px;

		border-radius: 12px;
	}

	.en-public__select {
		min-height: 46px;
	}

	.en-public__note-list {
		gap: 18px;
	}

	.en-public__note {
		border-radius: 12px;
	}

	.en-public__note-title {
		padding: 16px 18px 16px 22px;

		font-size: 18px;
	}

	.en-public__note-content {
		padding: 20px;

		font-size: 14px;
		line-height: 1.7;
	}

	.en-public__note-date {
		padding: 11px 20px;
	}

	.en-public__note-content table {
		display: block;

		overflow-x: auto;

		white-space: nowrap;
	}

}