/* =============================================================
   sykimlaw — single-post.css
   Phase 4-3: Single Post Layout / Legal Article Experience
   Depends on: typography.css, article.css
   ============================================================= */

:root {
	--sykim-toc-w: 210px;
}

/* ═══════════════════════════════════════════════════════════
   1. READING PROGRESS BAR
   ═══════════════════════════════════════════════════════════ */

.sykim-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 9999;
	pointer-events: none;
}

.sykim-progress__bar {
	height: 100%;
	width: 0;
	background: linear-gradient(
		90deg,
		var(--wp--preset--color--navy-900) 0%,
		var(--wp--preset--color--gold-500) 100%
	);
	will-change: width;
}

@media (prefers-reduced-motion: reduce) {
	.sykim-progress__bar {
		background: var(--wp--preset--color--gold-500);
	}
}

/* ═══════════════════════════════════════════════════════════
   2. HERO ENHANCEMENTS
   Excerpt + reading time + featured image
   ═══════════════════════════════════════════════════════════ */

.sykim-single__excerpt {
	margin-top: 1.25rem;
}

.sykim-single__excerpt .wp-block-post-excerpt__excerpt {
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	font-size: clamp(1rem, 0.5rem + 1.25vw, 1.125rem);
	line-height: 1.78;
	color: rgba(255, 255, 255, 0.72);
	word-break: keep-all;
	margin-bottom: 0;
}

.sykim-single__excerpt .wp-block-post-excerpt__more-link {
	display: none;
}

/* Reading time injected by JS */
.sykim-reading-time {
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	font-size: var(--wp--preset--font-size--sm);
	color: rgba(255, 255, 255, 0.62);
}

.sykim-reading-time::before {
	content: "·";
	margin-right: 0.375rem;
	opacity: 0.5;
}

/* Featured image at top of article body */
.sykim-single__featured-image.wp-block-post-featured-image {
	margin-bottom: 2.75rem;
	border-radius: 4px;
	overflow: hidden;
}

.sykim-single__featured-image img {
	width: 100%;
	height: auto;
	display: block;
}

/* ═══════════════════════════════════════════════════════════
   3. TABLE OF CONTENTS
   Mobile: collapsible <details> inline
   Desktop (≥1300px): position:fixed right sidebar
   ═══════════════════════════════════════════════════════════ */

.sykim-toc {
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	background-color: #FAFBFC;
	border: 1px solid rgba(13, 31, 60, 0.09);
	border-top: 3px solid var(--wp--preset--color--navy-900);
	border-radius: 0 0 6px 6px;
	margin-bottom: 2.5rem;
	font-size: 0.8125rem;
}

.sykim-toc__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.875rem 1.25rem;
	cursor: pointer;
	font-weight: 700;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--navy-900);
	list-style: none;
	user-select: none;
}

.sykim-toc__toggle::-webkit-details-marker { display: none; }

.sykim-toc__icon {
	font-size: 0.6875rem;
	color: rgba(45, 51, 65, 0.45);
	font-style: normal;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.sykim-toc details[open] .sykim-toc__icon {
	transform: rotate(180deg);
}

.sykim-toc__list {
	list-style: none;
	padding: 0 1.125rem 0.875rem 1.125rem;
	margin: 0;
}

.sykim-toc__item {
	margin: 0;
}

.sykim-toc__link {
	display: block;
	padding: 0.3125rem 0.5rem;
	color: rgba(45, 51, 65, 0.68);
	text-decoration: none;
	border-radius: 3px;
	line-height: 1.5;
	word-break: keep-all;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.sykim-toc__item--h3 > .sykim-toc__link {
	padding-left: 1.375rem;
	font-size: 0.75rem;
	color: rgba(45, 51, 65, 0.52);
}

.sykim-toc__link:hover {
	background-color: rgba(13, 31, 60, 0.05);
	color: var(--wp--preset--color--navy-900);
}

.sykim-toc__link.is-active {
	color: var(--wp--preset--color--navy-900);
	font-weight: 600;
	background-color: rgba(184, 150, 46, 0.09);
}

/* ── Desktop: fixed right sidebar ── */
@media (min-width: 1300px) {
	.sykim-toc {
		position: fixed;
		top: 90px;
		left: max(1.5rem, calc(50% + 368px + 2.25rem));
		width: var(--sykim-toc-w);
		max-height: calc(100vh - 110px);
		overflow-y: auto;
		margin-bottom: 0;
		box-shadow: 0 2px 16px rgba(13, 31, 60, 0.07);
		scrollbar-width: thin;
		scrollbar-color: rgba(13, 31, 60, 0.15) transparent;
	}

	.sykim-toc__icon {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sykim-toc__icon { transition: none; }
	.sykim-toc__link { transition: none; }
}

/* ═══════════════════════════════════════════════════════════
   4. LEGAL CONTENT COMPONENTS
   (Additive — case-summary / legal-conclusion / legal-checklist
   are already defined in typography.css)
   ═══════════════════════════════════════════════════════════ */

/* ── 핵심 요약 박스 (key-takeaway) ── */
.key-takeaway {
	border-left: 3px solid var(--wp--preset--color--gold-500);
	background-color: rgba(184, 150, 46, 0.07);
	padding: 1.25rem 1.625rem;
	margin: 2rem 0;
	border-radius: 0 4px 4px 0;
}

.key-takeaway__label {
	display: block;
	font-size: 0.6875rem;
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-500);
	margin-bottom: 0.625rem;
}

.key-takeaway p {
	margin-bottom: 0.5rem;
	font-size: clamp(0.9375rem, 0.5rem + 1vw, 1rem);
	line-height: 1.8;
	color: var(--sykim-text-body);
}

.key-takeaway p:last-child { margin-bottom: 0; }

.key-takeaway strong { color: var(--wp--preset--color--navy-900); }

/* ── 법조문 인용 (legal-cite) ── */
.legal-cite {
	border-left: 4px solid rgba(13, 31, 60, 0.22);
	background-color: rgba(244, 245, 247, 0.72);
	padding: 1.375rem 1.75rem;
	margin: 2rem 0;
	border-radius: 0 4px 4px 0;
	color: var(--wp--preset--color--navy-900);
	word-break: keep-all;
	overflow-wrap: anywhere;
}

.legal-cite__label {
	display: block;
	font-size: 0.6875rem;
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(45, 51, 65, 0.42);
	margin-bottom: 0.75rem;
}

.legal-cite p {
	font-size: clamp(0.9375rem, 0.5rem + 1vw, 1.0625rem);
	line-height: 1.88;
	margin-bottom: 0.5rem;
}

.legal-cite p:last-child { margin-bottom: 0; }

/* ── FAQ (단일 글 내 Q&A) ── */
.sykim-faq-section {
	margin: 2.5rem 0;
	border-top: 1px solid rgba(13, 31, 60, 0.09);
}

.sykim-faq__item {
	border-bottom: 1px solid rgba(13, 31, 60, 0.09);
}

.sykim-faq__question {
	display: block;
	padding: 1.125rem 3rem 1.125rem 0;
	cursor: pointer;
	font-weight: 600;
	font-size: clamp(0.9375rem, 0.5rem + 1vw, 1.0625rem);
	line-height: 1.55;
	color: var(--wp--preset--color--navy-900);
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	word-break: keep-all;
	list-style: none;
	position: relative;
	user-select: none;
}

.sykim-faq__question::-webkit-details-marker { display: none; }

.sykim-faq__question::after {
	content: "+";
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.375rem;
	font-weight: 300;
	color: var(--wp--preset--color--gold-500);
	line-height: 1;
}

.sykim-faq__item[open] .sykim-faq__question::after {
	content: "−";
}

.sykim-faq__answer {
	padding: 0 0.25rem 1.375rem 0;
	font-size: clamp(0.9375rem, 0.5rem + 1vw, 1rem);
	line-height: 1.87;
	color: var(--sykim-text-body);
	word-break: keep-all;
}

.sykim-faq__answer p { margin-bottom: 0.75rem; }
.sykim-faq__answer p:last-child { margin-bottom: 0; }

/* Table figcaption (additive to article.css) */
.sykim-single__body .wp-block-post-content .wp-block-table figcaption {
	font-size: 0.8125rem;
	color: rgba(45, 51, 65, 0.42);
	text-align: center;
	margin-top: 0.625rem;
	font-style: normal;
	letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════════════════
   5. ARTICLE BODY ENHANCEMENTS
   Additive to article.css — no rule duplication
   ═══════════════════════════════════════════════════════════ */

/* Heading anchor offset for sticky header */
.sykim-single__body .wp-block-post-content h2,
.sykim-single__body .wp-block-post-content h3 {
	scroll-margin-top: 90px;
}

/* No top margin on first heading */
.sykim-single__body .wp-block-post-content > h2:first-child,
.sykim-single__body .wp-block-post-content > h3:first-child,
.sykim-single__body .wp-block-post-content > .wp-block-heading:first-child {
	margin-top: 0;
}

/* Extra breathing room after legal component boxes before h2 */
.sykim-single__body .wp-block-post-content .case-summary + h2,
.sykim-single__body .wp-block-post-content .key-takeaway + h2,
.sykim-single__body .wp-block-post-content .legal-conclusion + h2 {
	margin-top: 3.5rem;
}

/* Refined separator — subtle gold instead of gray */
.sykim-single__body .wp-block-post-content .wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
	border-top-color: rgba(184, 150, 46, 0.38);
	max-width: 4rem;
}

/* ═══════════════════════════════════════════════════════════
   6. AUTHOR BOX
   ═══════════════════════════════════════════════════════════ */

.sykim-single__author-section {
	border-top: 1px solid rgba(13, 31, 60, 0.08);
	padding: 3rem var(--wp--preset--spacing--md);
	background-color: #F5F6F8;
}

.sykim-author-box.wp-block-post-author {
	display: flex;
	gap: 1.5rem 2rem;
	align-items: flex-start;
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
	padding: 2rem 2.25rem;
	background-color: #FFFFFF;
	border: 1px solid rgba(13, 31, 60, 0.08);
	border-left: 3px solid var(--wp--preset--color--navy-900);
	border-radius: 0 4px 4px 0;
	font-family: var(--wp--preset--font-family--noto-sans-kr);
}

.sykim-author-box .wp-block-post-author__avatar {
	flex-shrink: 0;
}

.sykim-author-box .wp-block-post-author__avatar img {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	border: 2px solid rgba(13, 31, 60, 0.1);
}

.sykim-author-box .wp-block-post-author__content {
	flex: 1;
	min-width: 0;
}

.sykim-author-box .wp-block-post-author__name {
	font-family: var(--wp--preset--font-family--noto-serif-kr);
	font-size: 1.0625rem;
	font-weight: 700;
	color: var(--wp--preset--color--navy-900);
	display: block;
	margin-bottom: 0.375rem;
	line-height: 1.4;
}

.sykim-author-box .wp-block-post-author__bio {
	font-size: 0.875rem;
	line-height: 1.78;
	color: var(--sykim-text-body);
	margin: 0;
	word-break: keep-all;
}

/* ═══════════════════════════════════════════════════════════
   7. RELATED ARTICLES
   ═══════════════════════════════════════════════════════════ */

.sykim-single__related {
	background-color: #FFFFFF;
	border-top: 1px solid rgba(13, 31, 60, 0.07);
	padding: 3.5rem var(--wp--preset--spacing--md);
}

.sykim-related__heading {
	font-size: 0.75rem !important;
	font-family: var(--wp--preset--font-family--noto-sans-kr) !important;
	font-weight: 700 !important;
	letter-spacing: 0.07em !important;
	text-transform: uppercase;
	color: rgba(45, 51, 65, 0.5) !important;
	margin-bottom: 1.75rem !important;
	padding-bottom: 0 !important;
	border-bottom: none !important;
}

.sykim-related-posts .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Card */
.sykim-related-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.375rem 1.5rem;
	background-color: #FAFBFC;
	border: 1px solid rgba(13, 31, 60, 0.08);
	border-radius: 4px;
	height: 100%;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sykim-related-card:hover {
	border-color: rgba(13, 31, 60, 0.16);
	box-shadow: 0 4px 16px rgba(13, 31, 60, 0.07);
}

/* wp:post-terms renders <div class="wp-block-post-terms sykim-related-card__cat"> */
.wp-block-post-terms.sykim-related-card__cat,
.sykim-related-card__cat {
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.sykim-related-card__cat a {
	color: var(--wp--preset--color--gold-500);
	text-decoration: none;
}

/* wp:post-title renders <h4 class="wp-block-post-title sykim-related-card__title"><a>...</a></h4> */
.wp-block-post-title.sykim-related-card__title,
.sykim-related-card__title {
	font-family: var(--wp--preset--font-family--noto-serif-kr);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.48;
	color: var(--wp--preset--color--navy-900);
	word-break: keep-all;
}

.sykim-related-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.sykim-related-card__title a:hover {
	color: var(--wp--preset--color--gold-500);
}

.sykim-related-card__excerpt .wp-block-post-excerpt__excerpt {
	font-size: 0.875rem;
	line-height: 1.72;
	color: rgba(45, 51, 65, 0.65);
	word-break: keep-all;
	margin-bottom: 0;
}

.sykim-related-card__excerpt .wp-block-post-excerpt__more-link {
	display: none;
}

/* wp:post-date renders <div class="wp-block-post-date sykim-related-card__date"><time>...</time></div> */
.wp-block-post-date.sykim-related-card__date,
.sykim-related-card__date time,
.sykim-related-card__date a {
	font-size: 0.75rem;
	color: rgba(45, 51, 65, 0.4);
	font-family: var(--wp--preset--font-family--inter);
	text-decoration: none;
	display: block;
	padding-top: 0.375rem;
	margin-top: auto;
}

/* ═══════════════════════════════════════════════════════════
   8. COMMENT AREA
   ═══════════════════════════════════════════════════════════ */

.sykim-single #comments {
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	font-size: 1rem;
	line-height: 1.85;
	color: var(--sykim-text-body);
	word-break: keep-all;
}

.sykim-single .comments-title,
.sykim-single #comments h2 {
	font-family: var(--wp--preset--font-family--noto-serif-kr);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--wp--preset--color--navy-900);
	margin-bottom: 1.5rem;
}

.sykim-single .comment-form label {
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--wp--preset--color--navy-900);
	display: block;
	margin-bottom: 0.375rem;
}

.sykim-single .comment-form input[type="text"],
.sykim-single .comment-form input[type="email"],
.sykim-single .comment-form input[type="url"],
.sykim-single .comment-form textarea {
	width: 100%;
	border: 1px solid rgba(13, 31, 60, 0.15);
	border-radius: 3px;
	padding: 0.625rem 0.875rem;
	font-family: inherit;
	font-size: 0.9375rem;
	color: var(--sykim-text-body);
	background-color: #FFFFFF;
	transition: border-color 0.2s ease;
	box-sizing: border-box;
}

.sykim-single .comment-form input:focus,
.sykim-single .comment-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--navy-900);
	outline-offset: 0;
	border-color: var(--wp--preset--color--navy-900);
	box-shadow: 0 0 0 3px rgba(13, 31, 60, 0.08);
}

.sykim-single .comment-form textarea {
	min-height: 130px;
	resize: vertical;
}

.sykim-single .comment-form .submit {
	background-color: var(--wp--preset--color--navy-900);
	color: #FFFFFF;
	border: none;
	padding: 0.75rem 1.75rem;
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	font-size: 0.9375rem;
	font-weight: 600;
	border-radius: 2px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.sykim-single .comment-form .submit:hover {
	background-color: #152B50;
}

/* ═══════════════════════════════════════════════════════════
   9. MOBILE OVERRIDES
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 599px) {
	.sykim-single__featured-image.wp-block-post-featured-image {
		margin-bottom: 1.75rem;
		border-radius: 3px;
	}

	.sykim-toc {
		margin-bottom: 1.75rem;
	}

	.sykim-author-box.wp-block-post-author {
		gap: 1rem 1.25rem;
		padding: 1.375rem 1.25rem;
	}

	.sykim-author-box .wp-block-post-author__avatar img {
		width: 56px;
		height: 56px;
	}

	.sykim-single__author-section {
		padding: 2rem var(--wp--preset--spacing--sm);
	}

	.sykim-single__related {
		padding: 2.5rem var(--wp--preset--spacing--sm);
	}

	.sykim-related-posts .wp-block-post-template {
		grid-template-columns: 1fr;
	}

	.key-takeaway,
	.legal-cite {
		padding: 1rem 1.125rem;
		margin: 1.5rem 0;
	}

	.sykim-faq__question {
		padding-top: 1rem;
		padding-bottom: 1rem;
	}

	.sykim-faq__answer {
		padding-bottom: 1rem;
	}
}

@media (min-width: 600px) and (max-width: 899px) {
	.sykim-related-posts .wp-block-post-template {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ═══════════════════════════════════════════════════════════
   10. HUB INTERNAL LINKS
   ═══════════════════════════════════════════════════════════ */

.sykim-single__hub-links {
	border-top: 1px solid rgba(13, 31, 60, 0.07);
}

.sykim-hub-links__heading.wp-block-heading {
	font-family: var(--wp--preset--font-family--noto-sans-kr) !important;
	font-size: 0.75rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.07em !important;
	text-transform: uppercase;
	color: rgba(45, 51, 65, 0.45) !important;
}

.sykim-hub-links__list.wp-block-list {
	list-style: none;
	padding-left: 0 !important;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 0.375rem 1.5rem;
}

.sykim-hub-links__list li {
	margin: 0;
	padding: 0;
}

.sykim-hub-links__list li::before {
	display: none;
}

.sykim-hub-links__list a {
	display: block;
	font-size: 0.9375rem;
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	color: rgba(45, 51, 65, 0.72);
	text-decoration: none;
	padding: 0.5rem 0;
	border-bottom: 1px solid transparent;
	word-break: keep-all;
	transition: color 0.15s ease;
}

.sykim-hub-links__list a:hover {
	color: var(--wp--preset--color--navy-900);
}

.sykim-hub-links__list a:focus-visible {
	outline: 2px solid var(--wp--preset--color--gold-500);
	outline-offset: 2px;
	border-radius: 1px;
}

@media (max-width: 599px) {
	.sykim-hub-links__list.wp-block-list {
		grid-template-columns: 1fr;
	}
}

/* ═══════════════════════════════════════════════════════════
   11. CONSULTATION NOTE (pre-CTA trust bridge)
   글 본문 → CTA 사이의 신뢰 기반 전환 문구
   ═══════════════════════════════════════════════════════════ */

.sykim-consult-note__label {
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-500);
}

.sykim-consult-note__heading.wp-block-heading {
	font-family: var(--wp--preset--font-family--noto-serif-kr) !important;
	font-size: clamp(1.125rem, 0.5rem + 1.5vw, 1.375rem) !important;
	font-weight: 700 !important;
	color: var(--wp--preset--color--navy-900) !important;
	line-height: 1.45 !important;
	word-break: keep-all;
	/* prevent heading border from ai-readable.css or typography.css */
	border-bottom: none !important;
	padding-bottom: 0 !important;
}

.sykim-consult-note__body {
	font-family: var(--wp--preset--font-family--noto-sans-kr);
	font-size: clamp(0.9375rem, 0.5rem + 1vw, 1rem);
	line-height: 1.78;
	color: rgba(45, 51, 65, 0.68);
	word-break: keep-all;
}
