/* 282W 식물도감 — 프론트엔드 스타일
 * 모든 규칙은 .w282 아래로 스코프되어 테마 스타일과 충돌하지 않습니다.
 */

.w282 {
	--w-green:      #2f7a4d;
	--w-green-dk:   #1f5636;
	--w-green-lt:   #eaf5ee;
	--w-ink:        #1f2328;
	--w-ink-2:      #57606a;
	--w-ink-3:      #8b949e;
	--w-line:       #e3e6ea;
	--w-surface:    #ffffff;
	--w-surface-2:  #f6f8f7;
	--w-danger:     #b3261e;
	--w-danger-bg:  #fdecea;
	--w-caution:    #8a6100;
	--w-caution-bg: #fdf6e3;
	--w-safe:       #1f6b3f;
	--w-safe-bg:    #e8f5ec;
	--w-radius:     14px;

	max-width: 1080px;
	margin: 0 auto;
	padding: 24px 20px 72px;
	color: var(--w-ink);
	line-height: 1.7;
	word-break: keep-all;
	overflow-wrap: break-word;
}

.w282 *,
.w282 *::before,
.w282 *::after { box-sizing: border-box; }

.w282 a { color: var(--w-green-dk); }

/* ---------- 공통 타이포 ---------- */

.w282-title {
	font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
	line-height: 1.25;
	margin: 0 0 6px;
	letter-spacing: -0.02em;
	font-weight: 700;
}

.w282-h2 {
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--w-green-lt);
	letter-spacing: -0.01em;
}

.w282-h2--sm { font-size: 1rem; }

.w282-lead {
	color: var(--w-ink-2);
	margin: 0 0 4px;
	font-size: 0.98rem;
}

.w282-section { margin: 40px 0 0; }

.w282-fineprint {
	font-size: 0.83rem;
	color: var(--w-ink-3);
	line-height: 1.65;
	margin: 12px 0 0;
}

/* ---------- 브레드크럼 / 앱 유입 ---------- */

.w282-crumbs {
	font-size: 0.82rem;
	color: var(--w-ink-3);
	margin: 0 0 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}
.w282-crumbs a { color: var(--w-ink-2); text-decoration: none; }
.w282-crumbs a:hover { text-decoration: underline; }

.w282-appnote {
	background: var(--w-green-lt);
	border: 1px solid #cfe6d8;
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 0.88rem;
	color: var(--w-green-dk);
	margin: 0 0 20px;
}

/* ---------- HERO ---------- */

.w282-hero {
	display: grid;
	grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}

.w282-hero__media { margin: 0; }

.w282-hero__media img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--w-radius);
	display: block;
	background: var(--w-surface-2);
}

.w282-hero__ph {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: var(--w-radius);
	background: linear-gradient(140deg, #eef6f1, #dcebe2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 4.5rem;
	line-height: 1;
}

.w282-sharednote {
	margin: 8px 0 0;
	padding: 9px 12px;
	font-size: 0.8rem;
	line-height: 1.55;
	color: var(--w-caution);
	background: var(--w-caution-bg);
	border: 1px solid #ecdaa8;
	border-radius: 8px;
}

.w282-credit {
	font-size: 0.74rem;
	color: var(--w-ink-3);
	margin: 8px 0 0;
}

.w282-dexno {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--w-green);
	margin: 0 0 6px;
	text-transform: uppercase;
}

.w282-sci {
	font-size: 1rem;
	color: var(--w-ink-2);
	margin: 0 0 14px;
}

.w282-summary {
	font-size: 1.02rem;
	margin: 16px 0 0;
	color: var(--w-ink);
}

/* ---------- 배지 ---------- */

.w282-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.w282-badge {
	display: inline-block;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 4px 11px;
	border-radius: 999px;
	background: var(--w-surface-2);
	color: var(--w-ink-2);
	border: 1px solid var(--w-line);
	text-decoration: none;
	line-height: 1.5;
}
.w282-badge:hover { border-color: var(--w-green); color: var(--w-green-dk); }

.w282-badge--group { background: var(--w-green-lt); color: var(--w-green-dk); border-color: #cfe6d8; }
.w282-badge--safe    { background: var(--w-safe-bg);    color: var(--w-safe);    border-color: #c6e4d1; }
.w282-badge--danger  { background: var(--w-danger-bg);  color: var(--w-danger);  border-color: #f5c6c2; }
.w282-badge--caution { background: var(--w-caution-bg); color: var(--w-caution); border-color: #ecdaa8; }

/* ---------- 스펙 카드 ---------- */

.w282-specs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 10px;
}

.w282-spec {
	background: var(--w-surface-2);
	border: 1px solid var(--w-line);
	border-radius: 12px;
	padding: 14px 14px 12px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.w282-spec__icon { font-size: 1.15rem; line-height: 1.2; }
.w282-spec__label { font-size: 0.76rem; color: var(--w-ink-3); font-weight: 600; }
.w282-spec__value { font-size: 0.95rem; font-weight: 700; color: var(--w-ink); line-height: 1.45; }

/* ---------- 콜아웃 ---------- */

.w282-callout {
	background: var(--w-surface-2);
	border: 1px solid var(--w-line);
	border-left: 4px solid var(--w-green);
	border-radius: 10px;
	padding: 14px 16px;
}
.w282-callout p { margin: 0; }

.w282-callout--warn {
	background: var(--w-caution-bg);
	border-color: #ecdaa8;
	border-left-color: #c9962a;
}

/* ---------- 독성 ---------- */

.w282-verdict {
	border-radius: 10px;
	padding: 12px 16px;
	margin: 0 0 14px;
	font-size: 0.98rem;
}
.w282-verdict--safe    { background: var(--w-safe-bg);    color: var(--w-safe);    border: 1px solid #c6e4d1; }
.w282-verdict--danger  { background: var(--w-danger-bg);  color: var(--w-danger);  border: 1px solid #f5c6c2; }
.w282-verdict--caution { background: var(--w-caution-bg); color: var(--w-caution); border: 1px solid #ecdaa8; }

.w282-toxgrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin: 0 0 14px;
}

.w282-tox {
	border: 1px solid var(--w-line);
	border-radius: 12px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	background: var(--w-surface);
}
.w282-tox__who { font-size: 0.8rem; color: var(--w-ink-3); font-weight: 600; }
.w282-tox__val { font-size: 1rem; font-weight: 700; }

.w282-tox--safe    { background: var(--w-safe-bg);    border-color: #c6e4d1; }
.w282-tox--safe .w282-tox__val { color: var(--w-safe); }
.w282-tox--danger  { background: var(--w-danger-bg);  border-color: #f5c6c2; }
.w282-tox--danger .w282-tox__val { color: var(--w-danger); }
.w282-tox--unknown .w282-tox__val { color: var(--w-ink-3); }
.w282-tox--meta { background: var(--w-surface-2); }

/* ---------- 표 ---------- */

.w282-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.93rem;
}
.w282-table th,
.w282-table td {
	text-align: left;
	padding: 11px 14px;
	border-bottom: 1px solid var(--w-line);
	vertical-align: top;
}
.w282-table th {
	width: 34%;
	min-width: 110px;
	color: var(--w-ink-2);
	font-weight: 600;
	background: var(--w-surface-2);
}
.w282-table tr:last-child th,
.w282-table tr:last-child td { border-bottom: 0; }

/* ---------- 링크 목록 ---------- */

.w282-links,
.w282-articles {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.w282-links a,
.w282-articles a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 12px 15px;
	border: 1px solid var(--w-line);
	border-radius: 10px;
	text-decoration: none;
	color: var(--w-ink);
	background: var(--w-surface);
	font-weight: 600;
	font-size: 0.93rem;
	transition: border-color .15s, background .15s;
}
.w282-links a:hover,
.w282-articles a:hover { border-color: var(--w-green); background: var(--w-green-lt); }

.w282-links__host {
	font-size: 0.76rem;
	color: var(--w-ink-3);
	font-weight: 500;
	white-space: nowrap;
}

/* ---------- 카드 그리드 ---------- */

.w282-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 16px;
}
.w282-grid--sm { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }

.w282-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--w-line);
	border-radius: var(--w-radius);
	overflow: hidden;
	background: var(--w-surface);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
	min-width: 0;
}
.w282-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(31, 86, 54, .10);
	border-color: #cfe6d8;
}

.w282-card__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--w-surface-2);
}
.w282-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.w282-card__ph {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.4rem;
	background: linear-gradient(140deg, #eef6f1, #dcebe2);
}

.w282-card__flag {
	position: absolute;
	left: 8px;
	bottom: 8px;
	font-size: 0.7rem;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 999px;
	backdrop-filter: blur(4px);
}
.w282-card__flag--safe   { background: rgba(232, 245, 236, .95); color: var(--w-safe); }
.w282-card__flag--danger { background: rgba(253, 236, 234, .95); color: var(--w-danger); }

.w282-card__body {
	padding: 11px 13px 13px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.w282-card__name {
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1.4;
}
.w282-grid--sm .w282-card__name {
	font-size: 0.85rem;
	padding: 9px 10px 11px;
}
.w282-card__sci {
	font-size: 0.76rem;
	color: var(--w-ink-3);
	font-style: italic;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.w282-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 4px;
}
.w282-minitag {
	font-size: 0.7rem;
	color: var(--w-ink-2);
	background: var(--w-surface-2);
	border-radius: 999px;
	padding: 2px 7px;
	white-space: nowrap;
}

/* ---------- 목록 페이지 ---------- */

.w282-archive__head { margin-bottom: 22px; }

.w282-search {
	display: flex;
	gap: 8px;
	margin: 0 0 22px;
}
.w282-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 12px 16px;
	font-size: 0.95rem;
	border: 1px solid var(--w-line);
	border-radius: 10px;
	background: var(--w-surface);
	color: var(--w-ink);
}
.w282-search input[type="search"]:focus {
	outline: 2px solid var(--w-green);
	outline-offset: 1px;
	border-color: var(--w-green);
}
.w282-search button {
	flex: 0 0 auto;
	padding: 12px 22px;
	font-size: 0.93rem;
	font-weight: 700;
	color: #fff;
	background: var(--w-green);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
}
.w282-search button:hover { background: var(--w-green-dk); }

.w282-filters {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 18px;
	background: var(--w-surface-2);
	border: 1px solid var(--w-line);
	border-radius: var(--w-radius);
	margin: 0 0 20px;
}

.w282-filterrow {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}
.w282-filterrow__label {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--w-ink-3);
	padding-top: 5px;
}

.w282-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.w282-chip {
	font-size: 0.82rem;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--w-surface);
	border: 1px solid var(--w-line);
	color: var(--w-ink-2);
	text-decoration: none;
	line-height: 1.5;
	white-space: nowrap;
}
.w282-chip:hover { border-color: var(--w-green); color: var(--w-green-dk); }
.w282-chip.is-on {
	background: var(--w-green);
	border-color: var(--w-green);
	color: #fff;
	font-weight: 700;
}

.w282-resultbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: space-between;
	align-items: baseline;
	margin: 0 0 14px;
}
.w282-count { margin: 0; font-size: 0.95rem; color: var(--w-ink-2); }
.w282-count strong { color: var(--w-green-dk); font-size: 1.15rem; }

.w282-sort { display: flex; gap: 14px; font-size: 0.85rem; }
.w282-sort a { color: var(--w-ink-3); text-decoration: none; }
.w282-sort a:hover { color: var(--w-green-dk); }
.w282-sort a.is-on { color: var(--w-green-dk); font-weight: 700; }

.w282-reset { margin: -6px 0 14px; font-size: 0.84rem; }

.w282-empty {
	text-align: center;
	padding: 60px 20px;
	background: var(--w-surface-2);
	border-radius: var(--w-radius);
	color: var(--w-ink-2);
}
.w282-empty__emoji { font-size: 3rem; margin: 0 0 8px; }
.w282-empty p { margin: 0 0 6px; }

.w282-btn {
	display: inline-block;
	margin-top: 12px;
	padding: 10px 22px;
	background: var(--w-green);
	color: #fff !important;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.9rem;
}
.w282-btn:hover { background: var(--w-green-dk); }

.w282-pagination {
	margin: 34px 0 0;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
}
.w282-pagination .page-numbers {
	display: inline-block;
	min-width: 38px;
	padding: 8px 12px;
	text-align: center;
	border: 1px solid var(--w-line);
	border-radius: 8px;
	text-decoration: none;
	color: var(--w-ink-2);
	font-size: 0.88rem;
	background: var(--w-surface);
}
.w282-pagination .page-numbers:hover { border-color: var(--w-green); color: var(--w-green-dk); }
.w282-pagination .page-numbers.current {
	background: var(--w-green);
	border-color: var(--w-green);
	color: #fff;
	font-weight: 700;
}
.w282-pagination .page-numbers.dots { border-color: transparent; background: none; }

.w282-meta { border-top: 1px solid var(--w-line); padding-top: 22px; margin-top: 48px; }
.w282-back { margin: 16px 0 0; font-size: 0.9rem; font-weight: 600; }

/* ---------- 반응형 ---------- */

@media (max-width: 782px) {
	.w282 { padding: 18px 16px 56px; }
	.w282-hero { grid-template-columns: 1fr; gap: 18px; }
	.w282-filterrow { grid-template-columns: 1fr; gap: 4px; }
	.w282-filterrow__label { padding-top: 0; }
	.w282-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}
	.w282-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
	.w282-table th { width: 40%; }
	.w282-search { flex-direction: column; }
	.w282-search button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.w282-card { transition: none; }
	.w282-card:hover { transform: none; }
}
