/* ============================================================
   MIPB — Lignans Table & Comparison Tool
   Stylesheet for [lignan_table] and [compare_lignans]
   Theme: Olive Green — seeds & plant heritage
   ============================================================ */

/* ── Header grid ───────────────────────────────────────────── */
.mlig-header-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	margin: 0 auto 2rem;
	max-width: 1040px;
	align-items: start;
}
@media (max-width: 720px) {
	.mlig-header-grid { grid-template-columns: 1fr; }
}

/* ── Top-10 SEO block ────────────────────────────────────────── */
.mlig-top10 { margin-bottom: 0; }
.mlig-top10 h2 { font-size: 1.25rem; margin-bottom: .5rem; color: #2d3d1f; }
.mlig-top10-list { margin: 0; padding-left: 1.4rem; }
.mlig-top10-list li { margin-bottom: .3rem; line-height: 1.5; }

/* ── Insight box ─────────────────────────────────────────────── */
.mlig-insight-box {
	background: #f0f3eb;
	border: 1px solid #d4dcc8;
	border-left: 4px solid #2d3d1f;
	border-radius: 6px;
	padding: .85rem 1rem;
	margin-bottom: .9rem;
}
.mlig-insight-title {
	font-size: .8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: #2d3d1f;
	margin: 0 0 .55rem;
}
.mlig-insight-list {
	margin: 0;
	padding-left: 1.1rem;
	font-size: .88rem;
	color: #333;
}
.mlig-insight-list li { margin-bottom: .28rem; line-height: 1.5; }

/* ── Context card ─────────────────────────────────────────────── */
.mlig-context-card {
	background: #f0f3eb;
	border: 1px solid #d4dcc8;
	border-left: 4px solid #558B2F;
	border-radius: 6px;
	padding: .75rem 1rem;
	font-size: .87rem;
	color: #333;
	line-height: 1.55;
}
.mlig-context-label {
	font-size: .75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: #558B2F;
	margin: 0 0 .35rem;
}
.mlig-context-card p { margin: 0; }
.mlig-context-card a { color: #2d3d1f; font-weight: 600; text-decoration: underline; }
.mlig-context-card a:hover { color: #558B2F; }

/* ── Main wrap ────────────────────────────────────────────────── */
.mlig-wrap {
	--primary:  #2d3d1f;
	--primary-bright: #558B2F;
	--bg-light: #f0f3eb;
	--border:   #d4dcc8;
	--bar-bg:   #558B2F;
	max-width: 1040px;
	margin: 0 auto;
	font-family: inherit;
}

/* ── Controls row ────────────────────────────────────────────── */
.mlig-controls {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	align-items: center;
	margin-bottom: .75rem;
}
.mlig-search,
.mlig-select {
	padding: .45rem .7rem;
	border: 1px solid var(--border);
	border-radius: 4px;
	font-size: .9rem;
	background: #fff;
	color: #333;
	outline: none;
	transition: border-color .15s;
}
.mlig-search { flex: 1 1 200px; min-width: 150px; }
.mlig-select { flex: 0 1 220px; }
.mlig-search:focus,
.mlig-select:focus { border-color: var(--primary-bright); box-shadow: 0 0 0 2px #e8ead2; }

.mlig-btn {
	padding: .45rem .9rem;
	background: var(--primary-bright);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: .88rem;
	cursor: pointer;
	white-space: nowrap;
	transition: background .15s;
}
.mlig-btn:hover { background: #4a7a2b; }

/* ── Table ────────────────────────────────────────────────────── */
.mlig-table-wrap { overflow-x: auto; margin-top: .6rem; }
.mlig-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9rem;
}
.mlig-table th {
	background: var(--primary);
	color: #fff;
	padding: .55rem .75rem;
	text-align: left;
	white-space: nowrap;
	font-weight: 600;
}
.mlig-table td {
	padding: .45rem .75rem;
	border-bottom: 1px solid #e8ead2;
	vertical-align: middle;
	color: #222;
}
.mlig-table tr:hover td { background: var(--bg-light); }
.mlig-table tr:last-child td { border-bottom: none; }

.col-rank  { width: 3rem; text-align: center; color: #777; font-size: .82rem; }
.col-food  { min-width: 160px; }
.col-group { min-width: 120px; color: #555; font-size: .85rem; }
.col-val   { width: 8rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.col-bar   { width: 120px; padding-right: .5rem; }

/* ── Bar ─────────────────────────────────────────────────────── */
.mlig-bar {
	height: 10px;
	background: linear-gradient(90deg, #558B2F, #7da345);
	border-radius: 3px;
	min-width: 2px;
}

/* ── Pagination ──────────────────────────────────────────────── */
.mlig-pagination {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-top: .75rem;
	flex-wrap: wrap;
}
.mlig-page-info { font-size: .85rem; color: #555; flex: 1 1 auto; }
.mlig-page-btn {
	padding: .4rem .85rem;
	background: var(--primary-bright);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: .85rem;
	cursor: pointer;
	transition: background .15s;
}
.mlig-page-btn:hover { background: #4a7a2b; }

/* ── Loading / empty states ──────────────────────────────────── */
.mlig-loading,
.mlig-empty {
	text-align: center;
	padding: 2rem 1rem;
	color: #888;
	font-style: italic;
}

/* ── Attribution ─────────────────────────────────────────────── */
.mlig-attribution {
	margin-top: 1rem;
	font-size: .78rem;
	color: #777;
	line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────
   COMPARISON TOOL — [compare_lignans]
   ──────────────────────────────────────────────────────────── */

.mligc-wrap {
	--primary:  #2d3d1f;
	--primary-bright: #558B2F;
	--bg-light: #f0f3eb;
	--border:   #d4dcc8;
	max-width: 960px;
	margin: 0 auto;
}

/* ── Picker area ─────────────────────────────────────────────── */
.mligc-picker-area { margin-bottom: 1rem; }
.mligc-search-row { display: flex; gap: .5rem; margin-bottom: .5rem; }
.mligc-search {
	flex: 1;
	padding: .5rem .8rem;
	border: 1px solid var(--border);
	border-radius: 4px;
	font-size: .9rem;
	background: #fff;
	outline: none;
	transition: border-color .15s;
}
.mligc-search:focus { border-color: var(--primary-bright); box-shadow: 0 0 0 2px #e8ead2; }

/* ── Suggestion dropdown ────────────────────────────────────── */
.mligc-suggestions {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 4px;
	background: #fff;
	max-height: 260px;
	overflow-y: auto;
	box-shadow: 0 4px 12px rgba(45,61,31,.12);
	position: relative;
	z-index: 100;
}
.mligc-sug-item {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .5rem .75rem;
	cursor: pointer;
	border-bottom: 1px solid #f0f3eb;
	font-size: .88rem;
}
.mligc-sug-item:last-child { border-bottom: none; }
.mligc-sug-item:hover { background: var(--bg-light); }
.mligc-sug-item .sug-name { flex: 1; font-weight: 500; }
.mligc-sug-item .sug-cat  { font-size: .78rem; color: #777; white-space: nowrap; }
.mligc-sug-item .sug-val  { font-size: .82rem; color: var(--primary-bright); font-weight: 600;
							   white-space: nowrap; margin-left: .3rem; }

/* ── Chips ───────────────────────────────────────────────────── */
.mligc-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.mligc-chip {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	padding: .3rem .65rem;
	background: var(--bg-light);
	border: 1px solid var(--border);
	border-radius: 20px;
	font-size: .83rem;
	color: #333;
}
.mligc-chip-x {
	background: none;
	border: none;
	cursor: pointer;
	color: #777;
	font-size: 1rem;
	line-height: 1;
	padding: 0 .1rem;
	transition: color .1s;
}
.mligc-chip-x:hover { color: var(--primary-bright); }

/* ── Table ───────────────────────────────────────────────────── */
.mligc-table-wrap { overflow-x: auto; margin-top: .75rem; }
.mligc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9rem;
}
.mligc-table th {
	background: var(--primary);
	color: #fff;
	padding: .55rem .75rem;
	text-align: left;
	white-space: nowrap;
	font-weight: 600;
}
.mligc-table td {
	padding: .5rem .75rem;
	border-bottom: 1px solid #e8ead2;
	vertical-align: middle;
	color: #222;
}
.mligc-table tr:hover td { background: var(--bg-light); }
.mligc-table tr:last-child td { border-bottom: none; }
.mligc-table .col-val {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	color: var(--primary-bright);
	width: 9rem;
}
.mligc-table .col-bar { width: 160px; }

/* ── Bar ─────────────────────────────────────────────────────── */
.mligc-bar {
	height: 12px;
	background: linear-gradient(90deg, #558B2F, #7da345);
	border-radius: 3px;
	min-width: 2px;
}

/* ── Legend & attribution ─────────────────────────────────────── */
.mligc-legend {
	margin-top: .75rem;
	font-size: .85rem;
	color: #555;
	line-height: 1.6;
}
.mligc-attribution {
	margin-top: .5rem;
	font-size: .78rem;
	color: #777;
	line-height: 1.5;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
	.mlig-controls { flex-direction: column; align-items: stretch; }
	.mlig-search, .mlig-select, .mlig-btn { width: 100%; }
	.mligc-search { width: 100%; }
	.col-group { display: none; }
	.mlig-table .col-group { display: none; }
}

/* ── FAQ section ─────────────────────────────────────────────── */
.mlig-faq {
	max-width: 960px;
	margin: 2rem auto 0;
	font-family: inherit;
}
.mlig-faq h2 {
	font-size: 1.2rem;
	margin-bottom: .75rem;
	color: var(--primary, #2d3d1f);
}
.mlig-faq details {
	border: 1px solid var(--border, #d4dcc8);
	border-radius: 6px;
	margin-bottom: .5rem;
	padding: .6rem .9rem;
}
.mlig-faq details[open] {
	border-color: var(--primary, #2d3d1f);
}
.mlig-faq summary {
	cursor: pointer;
	font-weight: 600;
	font-size: .95rem;
	list-style: none;
	padding-right: 1.4rem;
	position: relative;
}
.mlig-faq summary::-webkit-details-marker { display: none; }
.mlig-faq summary::after {
	content: '+';
	position: absolute;
	right: 0;
	color: var(--primary, #2d3d1f);
	font-size: 1.1rem;
	line-height: 1;
}
.mlig-faq details[open] summary::after { content: '−'; }
.mlig-faq details p {
	margin: .6rem 0 .2rem;
	font-size: .92rem;
	line-height: 1.65;
	color: #444;
}
.mlig-faq details p a {
	color: var(--primary, #2d3d1f);
	text-decoration: underline;
}
