/* ==========================================================================
   수상작 갤러리
   ========================================================================== */

.gallery-page {
	--gallery-primary: var(--primary, #0088cc);
	--gallery-primary-bg: color-mix(in srgb, var(--gallery-primary) 10%, #fff);
	--gallery-primary-border: color-mix(in srgb, var(--gallery-primary) 22%, #e2e8ef);
	--gallery-border: #e2e8ef;
	--gallery-surface: #fff;
	--gallery-muted: #f5f7fa;
	--gallery-text: #1a2332;
	--gallery-text-soft: #5b6675;
	--gallery-radius: 12px;
	padding-top: 0;
	padding-bottom: 3.5rem;
}

.gallery-list__header {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 1rem;
	margin-bottom: 2rem;
}

.gallery-card__division {
	display: inline-block;
	font-size: 0.78rem;
	color: var(--gallery-primary);
	margin-bottom: 0.5rem;
	font-weight: 600;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: var(--gallery-primary-bg);
}

.year-selector--single {
	box-shadow: none;
}

.year-selector--single .year-current {
	cursor: default;
	font-size: 1rem;
	font-weight: 700;
	min-width: auto;
	padding: 0.45rem 0.9rem;
}

.year-selector--single .year-current:hover {
	opacity: 1;
}

/* Fancybox */
.fancybox__counter { display: none; }
.fancybox__button--slideshow { display: none; }
.is-prev { display: none; }
.is-next { display: none; }
div.toolbar { display: none; }

/* 연도 선택기 */
.year-selector {
	display: inline-flex;
	align-items: center;
	gap: 0;
	background: #fff;
	border: 1px solid var(--gallery-primary-border);
	border-radius: 12px;
	padding: 4px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
	position: relative;
	z-index: 50;
	overflow: visible;
}

.year-current {
	font-size: 1.6rem;
	font-weight: 900;
	color: var(--gallery-primary);
	min-width: 80px;
	text-align: center;
	letter-spacing: -0.02em;
	line-height: 1;
	padding: 6px 8px;
	cursor: pointer;
	user-select: none;
}

.year-current:hover {
	opacity: 0.8;
}

.year-dropdown {
	display: none;
	position: fixed;
	background: #fff;
	border: 1px solid var(--primary-color-border);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
	padding: 6px;
	z-index: 9999;
	min-width: 110px;
}

.year-dropdown a {
	display: block;
	padding: 8px 16px;
	font-size: 0.95rem;
	font-weight: 600;
	color: #555;
	text-decoration: none;
	border-radius: 6px;
	text-align: center;
	transition: all 0.15s ease;
}

.year-dropdown a:hover {
	background: var(--primary-color-bg);
	color: var(--primary-color);
}

.year-dropdown a.active {
	background: var(--primary-color);
	color: #fff;
}

.year-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	color: var(--primary-color);
	font-size: 0.85rem;
	transition: all 0.2s ease;
	text-decoration: none;
}

.year-nav:hover {
	background: var(--primary-color);
	color: #fff;
	text-decoration: none;
}

.year-nav.disabled {
	color: var(--text-light);
	pointer-events: none;
}

/* 수상작 카드 */
.gallery-card {
	border: 1px solid #e3e8ef;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: none;
	transition:
		transform 0.25s ease,
		box-shadow 0.25s ease,
		border-color 0.25s ease;
	background-color: #fff;
}

.gallery-card:hover {
	transform: translateY(-4px);
	border-color: rgba(var(--primary-color-rgb), 0.35);
	box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.gallery-card .card-img-wrapper {
	overflow: hidden;
	position: relative;
	background: #f3f5f8;
	line-height: 0;
	border-bottom: 1px solid #e8ecf0;
}

.gallery-card .card-img-wrapper a {
	display: block;
	width: 100%;
}

.gallery-card .card-img-top {
	width: 100%;
	height: auto;
	display: block;
	transition: transform 0.4s ease;
}

.gallery-card:hover .card-img-top {
	transform: scale(1.03);
}

.gallery-card .card-body {
	padding: 1rem 1.1rem 1.15rem;
	background: #fff;
}

.gallery-card .card-title {
	font-size: 1.02rem;
	font-weight: 700;
	margin-bottom: 0;
	color: #1f2937;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.3em;
}

/* 상격 그룹 */
.grade-group {
	background: #fff;
	border-radius: 18px;
	padding: 1.75rem 1.5rem 0.5rem;
	margin-bottom: 2.25rem;
	border: 1px solid #e3e8ef;
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.grade-section {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 1.5rem;
	padding-bottom: 16px;
	border-bottom: 2px solid;
}

.grade-icon-wrap {
	position: relative;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #fff;
}

.grade-icon-wrap i {
	font-size: 1.3rem;
	position: relative;
	z-index: 1;
}

.grade-info {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.grade-info .grade-name {
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.02em;
}

.grade-info .grade-count {
	font-size: 0.8rem;
	color: #aaa;
	font-weight: 400;
}

.grade-1 .grade-section { border-bottom-color: #d4a017; }
.grade-1 .grade-icon-wrap { background: linear-gradient(135deg, #c9a020, #e8c840); }
.grade-1 .grade-name { color: #9a7a0a; }

.grade-2 .grade-section { border-bottom-color: #8a9bae; }
.grade-2 .grade-icon-wrap { background: linear-gradient(135deg, #7a8a9e, #a8b8c8); }
.grade-2 .grade-name { color: #5a6a7a; }

.grade-3 .grade-section { border-bottom-color: #b07840; }
.grade-3 .grade-icon-wrap { background: linear-gradient(135deg, #a06830, #c89060); }
.grade-3 .grade-name { color: #7a5020; }

.grade-4 .grade-section { border-bottom-color: #0078d4; }
.grade-4 .grade-icon-wrap { background: linear-gradient(135deg, #0070c4, #2b88d8); }
.grade-4 .grade-name { color: #0060aa; }

@media (max-width: 767px) {
	.gallery-list__header {
		justify-content: flex-end;
	}
}

/* ==========================================================================
   수상작 표 (대학생부 / 일반부)
   ========================================================================== */

.gallery-winners__panel {
	background: var(--gallery-surface);
	border: 1px solid var(--gallery-border);
	border-radius: var(--gallery-radius);
	overflow: hidden;
	box-shadow: none;
}

.gallery-winners__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem 1rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--gallery-border);
	background: #fff;
}

.gallery-winners__year {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--gallery-text);
}

.gallery-winners__tabs {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px;
	border-radius: 10px;
	background: var(--gallery-muted);
	border: 1px solid var(--gallery-border);
	margin-left: auto;
}

.gallery-winners__tab {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--gallery-text-soft);
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.4rem 0.8rem;
	border-radius: 999px;
	font-size: 0.88rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.gallery-winners__tab:hover {
	color: var(--gallery-text);
	background: rgba(255, 255, 255, 0.7);
}

.gallery-winners__tab.is-active {
	background: var(--gallery-primary);
	color: #fff;
	box-shadow: none;
}

.gallery-winners__tab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.35rem;
	height: 1.35rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	background: rgba(255, 255, 255, 0.22);
	color: inherit;
}

.gallery-winners__tab:not(.is-active) .gallery-winners__tab-count {
	background: #fff;
	color: var(--gallery-text-soft);
	border: 1px solid var(--gallery-border);
}

.gallery-winners__content {
	padding: 0.85rem 1rem 1rem;
}

.gallery-winners__pane[hidden] {
	display: none !important;
}

.gallery-winners__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: flex-start;
	gap: 0.35rem 0.75rem;
	margin-bottom: 0.65rem;
}

.gallery-winners__heading {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--gallery-text);
}

.gallery-winners__summary {
	margin: 0;
	font-size: 0.84rem;
	color: var(--gallery-text-soft);
	font-weight: 500;
}

.gallery-winners__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--gallery-border);
	border-radius: 10px;
	background: #fff;
}

.gallery-winners__table {
	width: 100%;
	min-width: 760px;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	font-size: 0.88rem;
	color: var(--gallery-text);
}

.gallery-winners__table th,
.gallery-winners__table td {
	padding: 0.55rem 0.5rem;
	text-align: center;
	vertical-align: middle;
	border-bottom: 1px solid var(--gallery-border);
	word-break: keep-all;
}

.gallery-winners__table thead th {
	background: color-mix(in srgb, var(--gallery-primary) 7%, #f8fafc);
	color: #334155;
	font-weight: 700;
	font-size: 0.84rem;
	letter-spacing: -0.02em;
	border-bottom-color: var(--gallery-primary-border);
	white-space: nowrap;
}

.gallery-winners__table tbody tr:last-child td {
	border-bottom: 0;
}

.gallery-winners__table tbody tr:hover td {
	background: color-mix(in srgb, var(--gallery-primary) 4%, #fff);
}

.gallery-winners__table .is-no {
	width: 4.25rem;
	color: var(--gallery-text-soft);
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.gallery-winners__table .is-topic {
	width: 11.5rem;
	font-weight: 600;
}

.gallery-winners__table .is-type,
.gallery-winners__table .is-cate {
	width: 7.25rem;
}

.gallery-winners__table .is-grade {
	width: 8.5rem;
}

.gallery-winners__table .is-title {
	text-align: left;
	line-height: 1.45;
	font-weight: 500;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
}

.gallery-winners__chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 5.75rem;
	min-width: 5.75rem;
	padding: 0.28rem 0.45rem;
	border-radius: 999px;
	background: var(--gallery-primary-bg);
	border: 1px solid var(--gallery-primary-border);
	color: var(--gallery-primary);
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1;
	box-sizing: border-box;
}

.gallery-winners__chip--mute {
	background: #f1f5f9;
	border-color: #e2e8f0;
	color: #475569;
	width: 5.75rem;
	min-width: 5.75rem;
}

.gallery-winners__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 5.5rem;
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1;
	border: 1px solid transparent;
}

.gallery-winners__badge.grade-grand {
	background: linear-gradient(135deg, #fff4d6, #ffe8a3);
	border-color: #e6c35c;
	color: #8a6410;
}

.gallery-winners__badge.grade-top {
	background: linear-gradient(135deg, #eef2f7, #dfe7f1);
	border-color: #9aacc0;
	color: #44566c;
}

.gallery-winners__badge.grade-excellence {
	background: linear-gradient(135deg, #f7ebe0, #efd4bc);
	border-color: #c79263;
	color: #7a4a22;
}

.gallery-winners__badge.grade-creative {
	background: color-mix(in srgb, var(--gallery-primary) 12%, #fff);
	border-color: color-mix(in srgb, var(--gallery-primary) 35%, #fff);
	color: var(--gallery-primary);
}

.gallery-winners__badge.grade-finalist,
.gallery-winners__badge.grade-default {
	background: #f8fafc;
	border-color: #dbe3ec;
	color: #64748b;
}

.gallery-winners__divider-row td {
	padding: 0.45rem 0.75rem;
	background: #f8fafc;
	border-top: 2px solid color-mix(in srgb, var(--gallery-primary) 28%, #cbd5e1);
	border-bottom-color: var(--gallery-border);
	text-align: left;
}

.gallery-winners__divider-label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--gallery-text-soft);
	text-transform: none;
}

.gallery-winners__divider-label::before {
	content: '';
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: var(--gallery-primary);
}

.gallery-winners__table tbody tr.is-finalist td {
	background: #fbfcfd;
	color: #475569;
}

.gallery-winners__empty {
	padding: 3.5rem 1.5rem;
	text-align: center;
	color: var(--gallery-text-soft);
	background: var(--gallery-surface);
	border: 1px dashed var(--gallery-border);
	border-radius: var(--gallery-radius);
}

.gallery-winners__empty--inset {
	border: 0;
	background: var(--gallery-muted);
	border-radius: 12px;
	padding: 2.5rem 1rem;
}

.gallery-winners__empty p {
	margin: 0;
	font-weight: 500;
}

@media (max-width: 767.98px) {
	.gallery-winners__toolbar {
		padding: 0.65rem 0.75rem;
		align-items: stretch;
		flex-direction: column;
	}

	.gallery-winners__tabs {
		width: 100%;
		margin-left: 0;
	}

	.gallery-winners__tab {
		flex: 1;
		justify-content: center;
		padding: 0.5rem 0.65rem;
	}

	.gallery-winners__content {
		padding: 0.75rem;
	}

	.gallery-winners__table {
		font-size: 0.84rem;
		min-width: 680px;
	}

	.gallery-winners__table th,
	.gallery-winners__table td {
		padding: 0.5rem 0.4rem;
	}

	.gallery-winners__table .is-title {
		padding-left: 0.6rem;
		padding-right: 0.6rem;
	}
}
