/**
 * Shared guide shell: TOC rail + 2-col layout + FAQ accordion.
 * Canonical source for hub + free tools (aeo-checker.css no longer duplicates these).
 *
 * @package Maksut
 */

/* ── Guide 2-col layout ─────────────────────────────────────────── */
.aeo-guide__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(200px, 240px);
	gap: clamp(28px, 3.5vw, 48px);
	/* stretch (not start): aside must match main height or sticky TOC has no travel room */
	align-items: stretch;
	width: 100%;
}

.aeo-guide__main {
	min-width: 0;
}

.aeo-guide__aside {
	min-width: 0;
	position: relative;
}

/* ── Sticky TOC ─────────────────────────────────────────────────── */
.aeo-guide-toc {
	position: sticky;
	top: calc(var(--nav-h, 64px) + 20px);
	padding: 16px 16px 18px;
	border: 1px solid rgba(26, 23, 20, 0.1);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.72);
	box-shadow: 0 1px 0 rgba(26, 23, 20, 0.04);
}

.aeo-guide-toc__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.aeo-guide-toc__label {
	margin: 0;
	font-family: var(--mono, var(--ff-m, ui-monospace, monospace));
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--fire, var(--orange, #e84e0a));
}

.aeo-guide-toc__toggle {
	display: none;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 6px 10px;
	border: 1px solid rgba(26, 23, 20, 0.12);
	border-radius: 999px;
	background: #fff;
	color: var(--ink-mid, #3a3028);
	font-family: var(--mono, var(--ff-m, ui-monospace, monospace));
	font-size: 11px;
	letter-spacing: 0.04em;
	cursor: pointer;
	flex-shrink: 0;
}

.aeo-guide-toc__toggle-icon {
	transition: transform 0.2s ease;
}

.aeo-guide-toc.is-open .aeo-guide-toc__toggle-icon {
	transform: rotate(180deg);
}

.aeo-guide-toc__toggle-text--close {
	display: none;
}

.aeo-guide-toc.is-open .aeo-guide-toc__toggle-text--open {
	display: none;
}

.aeo-guide-toc.is-open .aeo-guide-toc__toggle-text--close {
	display: inline;
}

.aeo-guide-toc__panel {
	margin-top: 12px;
}

.aeo-guide-toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	counter-reset: aeo-toc;
}

.aeo-guide-toc-fab,
.aeo-guide-toc-backdrop {
	display: none;
}

.aeo-guide-toc-sentinel {
	height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	overflow: hidden;
	pointer-events: none;
}

.aeo-guide-toc__list > li {
	margin: 0;
	counter-increment: aeo-toc;
}

.aeo-guide-toc__link {
	display: grid;
	grid-template-columns: 1.5rem 1fr;
	gap: 8px;
	align-items: baseline;
	padding: 8px 6px;
	border-radius: 6px;
	color: var(--ink-mid, #3a3028);
	text-decoration: none;
	font-size: 13px;
	line-height: 1.35;
	border-left: 2px solid transparent;
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.aeo-guide-toc__link::before {
	content: counter(aeo-toc, decimal-leading-zero);
	font-family: var(--mono, var(--ff-m, ui-monospace, monospace));
	font-size: 10px;
	letter-spacing: 0.04em;
	color: rgba(26, 23, 20, 0.4);
}

.aeo-guide-toc__link:hover {
	color: var(--ink, #181410);
	background: rgba(232, 78, 10, 0.06);
}

.aeo-guide-toc__link.is-active {
	color: var(--ink, #181410);
	border-left-color: var(--fire, var(--orange, #e84e0a));
	background: rgba(232, 78, 10, 0.08);
	font-weight: 600;
}

.aeo-guide-toc__link.is-active::before {
	color: var(--fire, var(--orange, #e84e0a));
}

/* ── FAQ accordion (hub + tools) ────────────────────────────────── */
.aeo-faq__accordion {
	display: block;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(26, 23, 20, 0.12);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}

.aeo-faq__item {
	margin: 0;
	padding: 0;
	border: none;
	border-bottom: 1px solid rgba(26, 23, 20, 0.12);
	border-radius: 0;
	background: transparent;
	overflow: hidden;
	box-shadow: none;
	transition: none;
}

.aeo-faq__item:last-child {
	border-bottom: none;
}

.aeo-faq__item:hover {
	border-color: rgba(26, 23, 20, 0.12);
}

.aeo-faq__item[open] {
	background: transparent;
	border-color: rgba(26, 23, 20, 0.12);
	box-shadow: none;
}

.aeo-faq__item:last-child[open] {
	border-bottom: none;
}

.aeo-faq__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px;
	cursor: pointer;
	list-style: none;
	font-size: 15px;
	font-weight: 600;
	color: var(--ink, #181410);
	line-height: 1.4;
	user-select: none;
	transition: background 0.12s ease;
}

.aeo-faq__summary:hover {
	background: var(--cream, #f4efe6);
}

.aeo-faq__summary::-webkit-details-marker {
	display: none;
}

.aeo-faq__summary-text {
	flex: 1;
	min-width: 0;
}

.aeo-faq__summary-icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	position: relative;
	border-radius: 0;
	background: transparent;
	transition: transform 0.2s ease;
}

.aeo-faq__summary-icon::before,
.aeo-faq__summary-icon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	background: var(--fire, var(--orange, #e84e0a));
	border-radius: 1px;
	transform: translate(-50%, -50%);
}

.aeo-faq__summary-icon::before {
	width: 12px;
	height: 2px;
}

.aeo-faq__summary-icon::after {
	width: 2px;
	height: 12px;
}

.aeo-faq__item[open] .aeo-faq__summary-icon {
	background: transparent;
	transform: rotate(45deg);
}

.aeo-faq__item[open] .aeo-faq__summary-icon::after {
	transform: translate(-50%, -50%);
}

.aeo-faq__panel {
	padding: 0 20px 18px;
}

.aeo-faq__panel-inner {
	font-size: 15px;
	color: var(--ink-mid, #3a3028);
	line-height: 1.7;
	margin: 0;
	padding-top: 0;
	border-top: none;
}

.aeo-faq__panel-inner p {
	margin: 0 0 0.75rem;
}

.aeo-faq__panel-inner p:last-child {
	margin-bottom: 0;
}

.aeo-guide__title {
	font-family: var(--display, var(--ff-d, sans-serif));
	font-size: clamp(22px, 3.5vw, 32px);
	letter-spacing: 0.04em;
	color: var(--ink, #181410);
	margin: 0 0 1rem;
	line-height: 1.15;
}

.aeo-guide__lede {
	margin: 0 0 1.25rem;
	font-size: 15px;
	line-height: 1.55;
	color: var(--ink-soft, var(--ink-muted, #625850));
}

@media (max-width: 1100px) {
	.aeo-guide__layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.aeo-guide__aside {
		order: -1;
	}

	.aeo-guide-toc {
		position: static;
		padding: 12px 14px;
	}

	.aeo-guide-toc__toggle {
		display: inline-flex;
	}

	.aeo-guide-toc__panel {
		display: none;
		margin-top: 10px;
	}

	.aeo-guide-toc.is-open .aeo-guide-toc__panel {
		display: block;
	}

	.aeo-guide-toc__list {
		display: grid;
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.aeo-guide-toc-fab {
		display: none;
		position: fixed;
		left: 12px;
		bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		z-index: 60;
		width: 46px;
		height: 46px;
		align-items: center;
		justify-content: center;
		border: none;
		border-radius: 50%;
		background: var(--ink, #181410);
		color: #fff;
		box-shadow: 0 8px 24px rgba(26, 23, 20, 0.28);
		cursor: pointer;
		padding: 0;
	}

	.aeo-guide-toc-fab:not([hidden]) {
		display: inline-flex;
	}

	.aeo-guide-toc-fab[aria-expanded="true"] {
		background: var(--fire, var(--orange, #e84e0a));
	}

	.aeo-guide-toc-backdrop:not([hidden]) {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 55;
		background: rgba(26, 23, 20, 0.35);
	}

	.aeo-guide-toc.is-docked {
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(72px + env(safe-area-inset-bottom, 0px));
		top: auto;
		z-index: 58;
		max-height: min(62vh, 420px);
		overflow: auto;
		padding: 14px;
		background: #fff;
		box-shadow: 0 16px 40px rgba(26, 23, 20, 0.22);
	}

	.aeo-guide-toc.is-docked:not(.is-open) {
		display: none;
	}
}

@media (max-width: 560px) {
	.aeo-guide-toc {
		padding: 10px 12px;
	}

	.aeo-guide-toc__list {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.aeo-guide-toc__link {
		padding: 10px 8px;
		font-size: 14px;
		line-height: 1.4;
	}

	.aeo-guide-toc-fab {
		left: 10px;
		width: 44px;
		height: 44px;
	}
}
