/*
Theme Name: ECT Theme
Theme URI: https://ectassn.org
Author: ECT
Description: 사단법인 엑트(ECT) 공식 홈페이지 — 4개 언어(한국어/日本語/中文/English) 브라우저 자동감지 지원 커스텀 테마.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: ect
*/

:root {
	--ect-green: #006835;
	--ect-green-dark: #00532a;
	--ect-cream: #f7f4ea;
	--ect-charcoal: #333333;
	--ect-charcoal-2: #2a2a2a;
	--ect-white: #ffffff;
	--ect-ink: #262620;
	--ect-line: rgba(0, 0, 0, 0.12);
	--ect-max: 1040px;
	--font-kr: 'Noto Sans KR', sans-serif;
	--font-jp: 'Noto Sans JP', sans-serif;
	--font-sc: 'Noto Sans SC', sans-serif;
	--font-latin: 'Inter', 'Noto Sans KR', sans-serif;
	--font-greek: 'EB Garamond', 'Noto Sans KR', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--ect-cream);
	color: var(--ect-ink);
	font-family: var(--font-kr);
	line-height: 1.7;
	font-size: 17px;
}

html[lang="ja"] body { font-family: var(--font-jp); }
html[lang="zh"] body { font-family: var(--font-sc); }
html[lang="en"] body { font-family: var(--font-latin); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.ect-container {
	max-width: var(--ect-max);
	margin: 0 auto;
	padding: 0 24px;
}

/* Header */
.ect-header {
	background: var(--ect-white);
	border-bottom: 1px solid var(--ect-line);
	position: sticky;
	top: 0;
	z-index: 50;
}
.ect-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	max-width: var(--ect-max);
	margin: 0 auto;
	gap: 16px;
	flex-wrap: wrap;
}
.ect-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 1.1rem;
	color: var(--ect-green);
}
.ect-brand img { height: 40px; width: auto; }

.ect-nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.ect-nav a {
	font-weight: 600;
	letter-spacing: 0.02em;
	position: relative;
	padding: 4px 0;
}
.ect-nav a.is-active,
.ect-nav a:hover { color: var(--ect-green); }
.ect-nav a.is-active::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: -2px;
	height: 2px;
	background: var(--ect-green);
}

.ect-nav-dropdown { position: relative; }
.ect-nav-dropdown summary {
	list-style: none;
	cursor: pointer;
	font-weight: 600;
	letter-spacing: 0.02em;
	padding: 4px 16px 4px 0;
	position: relative;
}
.ect-nav-dropdown summary::-webkit-details-marker { display: none; }
.ect-nav-dropdown summary::after {
	content: "";
	position: absolute;
	right: 0; top: 50%;
	width: 7px; height: 7px;
	margin-top: -5px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .15s ease;
}
.ect-nav-dropdown[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.ect-nav-dropdown.is-active summary,
.ect-nav-dropdown summary:hover { color: var(--ect-green); }
.ect-nav-dropdown__menu {
	position: absolute;
	top: calc(100% + 14px);
	left: 0;
	background: var(--ect-white);
	border: 1px solid var(--ect-line);
	border-radius: 8px;
	padding: 6px;
	min-width: 160px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
	z-index: 60;
}
.ect-nav-dropdown__menu a {
	padding: 9px 12px;
	border-radius: 6px;
	font-weight: 500;
	font-size: 0.95rem;
	white-space: nowrap;
}
.ect-nav-dropdown__menu a:hover,
.ect-nav-dropdown__menu a.is-active {
	background: var(--ect-cream);
	color: var(--ect-green);
}

.ect-lang-switch { display: flex; gap: 6px; }
.ect-lang-switch a {
	font-size: 0.8rem;
	padding: 4px 9px;
	border: 1px solid var(--ect-line);
	border-radius: 999px;
	font-weight: 600;
}
.ect-lang-switch a.is-active {
	background: var(--ect-green);
	border-color: var(--ect-green);
	color: var(--ect-white);
}

/* Top banner image */
.ect-banner { width: 100%; line-height: 0; }
.ect-banner img {
	width: 100%;
	height: clamp(200px, 32vw, 420px);
	object-fit: cover;
	display: block;
}

/* Hero */
.ect-hero {
	text-align: center;
	padding: 64px 24px 72px;
}
.ect-hero__cross { width: 72px; margin: 0 auto 28px; }
.ect-hero h1 {
	font-size: clamp(1.9rem, 4vw, 2.6rem);
	margin: 0 0 14px;
	color: var(--ect-green);
	letter-spacing: 0.01em;
}
.ect-hero__greek {
	font-family: var(--font-greek);
	font-style: italic;
	font-size: 1.15rem;
	color: var(--ect-ink);
	margin: 0 0 6px;
}
.ect-hero__local {
	font-size: 1.05rem;
	color: #55554d;
	margin: 0 0 40px;
}
.ect-hero__rule {
	width: 64px;
	height: 3px;
	background: var(--ect-green);
	margin: 0 auto 40px;
}

.ect-latest-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin: 8px auto 40px;
	text-align: left;
}
@media (max-width: 720px) { .ect-latest-grid { grid-template-columns: 1fr; } }
.ect-latest-col {
	min-width: 0;
	background: var(--ect-white);
	border: 1px solid var(--ect-line);
	border-radius: 10px;
	padding: 26px 26px 20px;
}
.ect-latest-col h3 {
	margin: 0 0 14px;
	font-size: 1.05rem;
	color: var(--ect-green);
}
.ect-latest-list { list-style: none; margin: 0; padding: 0; }
.ect-latest-list li { border-top: 1px solid var(--ect-line); }
.ect-latest-list li:first-child { border-top: none; }
.ect-latest-list a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
}
.ect-latest-list a:hover .ect-latest-list__title { color: var(--ect-green); }
.ect-latest-list__title {
	min-width: 0;
	flex: 1 1 auto;
	font-size: 0.94rem;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ect-latest-list time {
	flex-shrink: 0;
	font-size: 0.82rem;
	color: #83837a;
}
.ect-latest-more {
	display: inline-block;
	margin-top: 14px;
	font-size: 0.86rem;
	font-weight: 600;
	color: var(--ect-green);
}

.ect-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-top: 12px;
}
@media (max-width: 720px) { .ect-cards { grid-template-columns: 1fr; } }

.ect-card {
	background: var(--ect-white);
	border: 1px solid var(--ect-line);
	border-radius: 10px;
	padding: 32px 24px;
	text-align: left;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ect-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 26px rgba(0,0,0,0.08);
	border-color: var(--ect-green);
}
.ect-card h3 { margin: 0 0 8px; color: var(--ect-green); font-size: 1.15rem; }
.ect-card p { margin: 0; color: #55554d; font-size: 0.95rem; }

/* Sections */
.ect-section {
	padding: 64px 24px;
	border-top: 1px solid var(--ect-line);
}
.ect-section--charcoal {
	background: var(--ect-charcoal);
	color: var(--ect-white);
	border-top: none;
}
.ect-section--charcoal a { color: var(--ect-white); }
.ect-section__label {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.78rem;
	color: var(--ect-green);
	font-weight: 700;
	margin: 0 0 10px;
}
.ect-section--charcoal .ect-section__label { color: #9fd9b6; }

.ect-mission {
	position: relative;
	background-color: #f0ecdf;
	background-image:
		radial-gradient(circle at 50% 0%, rgba(0, 104, 53, 0.06), transparent 55%),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
	background-repeat: no-repeat, repeat;
	padding: 80px 24px;
}
.ect-section h2 {
	font-size: 1.6rem;
	margin: 0 0 24px;
}

.ect-page-title {
	text-align: center;
	padding: 72px 24px 28px;
}
.ect-page-title h1 {
	color: var(--ect-green);
	font-size: clamp(1.7rem, 3.6vw, 2.2rem);
	margin: 0;
}

.ect-block { max-width: var(--ect-max); margin: 0 auto; }
.ect-block + .ect-block { margin-top: 8px; }

.ect-origin-box {
	background: var(--ect-white);
	border: 1px solid var(--ect-line);
	border-radius: 10px;
	padding: 40px;
	text-align: center;
}
.ect-origin-box__greek {
	font-family: var(--font-greek);
	font-style: italic;
	font-size: 1.3rem;
	margin: 0 0 8px;
}
.ect-origin-box__en {
	color: #55554d;
	margin: 0 0 32px;
}
.ect-verse {
	max-width: 640px;
	margin: 0 auto;
	font-size: 1rem;
	color: #3d3d36;
	border-top: 1px solid var(--ect-line);
	padding-top: 28px;
}
.ect-verse__label {
	font-size: 0.78rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ect-green);
	font-weight: 700;
	margin-bottom: 10px;
}
.ect-verse__ref { margin-top: 12px; font-weight: 600; color: var(--ect-green-dark); }

.ect-info-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	max-width: var(--ect-max);
	margin: 0 auto;
}
@media (max-width: 720px) { .ect-info-grid { grid-template-columns: 1fr; } }
.ect-info-card {
	background: var(--ect-white);
	border: 1px solid var(--ect-line);
	border-radius: 10px;
	padding: 28px 30px;
}
.ect-info-card h3 {
	color: var(--ect-green);
	margin: 0 0 12px;
	font-size: 1.05rem;
}
.ect-info-card p { margin: 0 0 6px; color: #3d3d36; }

.ect-affiliate-list {
	display: grid;
	gap: 16px;
	max-width: var(--ect-max);
	margin: 0 auto;
}
.ect-affiliate {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.18);
	border-radius: 10px;
	padding: 24px 28px;
}
.ect-affiliate h3 { margin: 0 0 4px; font-size: 1.1rem; }
.ect-affiliate span { color: #b7b7ad; font-size: 0.9rem; }
.ect-affiliate .ect-arrow {
	border: 1px solid rgba(255,255,255,0.4);
	border-radius: 999px;
	width: 38px; height: 38px;
	display: flex; align-items: center; justify-content: center;
	flex-shrink: 0;
}
.ect-affiliate:hover .ect-arrow { background: var(--ect-green); border-color: var(--ect-green); }

.ect-notice-list { max-width: var(--ect-max); margin: 0 auto; display: grid; gap: 2px; }
.ect-notice-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	padding: 20px 4px;
	border-bottom: 1px solid var(--ect-line);
}
.ect-notice-row h3 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.ect-notice-row time { color: #83837a; font-size: 0.88rem; white-space: nowrap; }
.ect-notice-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.ect-notice-author {
	color: var(--ect-green-dark);
	font-size: 0.86rem;
	font-weight: 600;
	white-space: nowrap;
}
.ect-notice-empty { text-align: center; color: #83837a; padding: 40px 0; }
@media (max-width: 560px) {
	.ect-notice-row { flex-direction: column; align-items: flex-start; gap: 8px; }
	.ect-notice-meta { flex-wrap: wrap; }
}

.ect-single-notice { max-width: 760px; margin: 0 auto; }
.ect-single-notice h1 { color: var(--ect-green); font-size: 1.6rem; }
.ect-single-notice time { color: #83837a; font-size: 0.9rem; display: block; margin-bottom: 32px; }
.ect-back-link {
	display: inline-block;
	margin-top: 40px;
	font-weight: 600;
	color: var(--ect-green);
}

/* Faith principles page */
.ect-faith-subtitle {
	max-width: 680px;
	margin: 14px auto 0;
	color: #55554d;
	font-size: 1rem;
}
.ect-faith-intro {
	max-width: 720px;
	margin: 0 auto 40px;
	background: var(--ect-white);
	border: 1px solid var(--ect-line);
	border-left: 4px solid var(--ect-green);
	border-radius: 8px;
	padding: 26px 30px;
}
.ect-faith-intro p { margin: 0; color: #3d3d36; }

.ect-faith-toc {
	max-width: 720px;
	margin: 0 auto 40px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
@media (max-width: 620px) { .ect-faith-toc { grid-template-columns: 1fr; } }
.ect-faith-toc a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: var(--ect-white);
	border: 1px solid var(--ect-line);
	border-radius: 8px;
	font-size: 0.92rem;
	font-weight: 600;
}
.ect-faith-toc a:hover { border-color: var(--ect-green); color: var(--ect-green); }
.ect-faith-toc__num {
	flex-shrink: 0;
	width: 22px; height: 22px;
	border-radius: 50%;
	background: var(--ect-green);
	color: var(--ect-white);
	font-size: 0.78rem;
	display: flex; align-items: center; justify-content: center;
}

.ect-faith-list {
	max-width: 720px;
	margin: 0 auto;
	display: grid;
	gap: 14px;
}
.ect-faith-item {
	background: var(--ect-white);
	border: 1px solid var(--ect-line);
	border-radius: 10px;
	overflow: hidden;
	scroll-margin-top: 90px;
}
.ect-faith-item summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px 24px;
	font-weight: 700;
	font-size: 1.02rem;
}
.ect-faith-item summary::-webkit-details-marker { display: none; }
.ect-faith-item__num {
	flex-shrink: 0;
	width: 30px; height: 30px;
	border-radius: 50%;
	background: var(--ect-cream);
	border: 2px solid var(--ect-green);
	color: var(--ect-green);
	font-size: 0.9rem;
	display: flex; align-items: center; justify-content: center;
}
.ect-faith-item__heading { flex: 1; color: var(--ect-green-dark); }
.ect-faith-item__chevron {
	flex-shrink: 0;
	width: 10px; height: 10px;
	border-right: 2px solid #999;
	border-bottom: 2px solid #999;
	transform: rotate(45deg);
	transition: transform .2s ease;
}
.ect-faith-item[open] .ect-faith-item__chevron { transform: rotate(-135deg); }
.ect-faith-item__body {
	padding: 0 24px 26px;
	color: #3d3d36;
	font-size: 0.98rem;
}
.ect-faith-item__body p { margin: 0; text-align: left; }

.ect-faith-closing {
	max-width: 720px;
	margin: 40px auto 0;
	padding-top: 28px;
	border-top: 1px solid var(--ect-line);
	color: #55554d;
	font-size: 0.95rem;
	text-align: center;
}
.ect-faith-closing p { margin: 0; }

/* Footer */
.ect-footer {
	background: var(--ect-charcoal-2);
	color: #c9c9c0;
	padding: 48px 24px 32px;
	font-size: 0.9rem;
}
.ect-footer__inner {
	max-width: var(--ect-max);
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px;
}
.ect-footer strong { color: var(--ect-white); }
.ect-footer a:hover { color: var(--ect-white); }
