/* ==========================================================================
   청라시민에너지협동조합 · 공통 스타일
   Theme: 밝은 그린/블루 친환경
   ========================================================================== */

:root {
  --green:        #2e9e5b;
  --green-dark:   #1f7a44;
  --green-light:  #eaf6ee;
  --blue:         #1a86c8;
  --blue-dark:    #12689e;
  --blue-light:   #e8f3fb;
  --sun:          #f6b93b;
  --ink:          #1f2a30;
  --gray:         #5c6b72;
  --line:         #e2e8ea;
  --bg:           #ffffff;
  --bg-soft:      #f6f9f8;
  --radius:       14px;
  --shadow:       0 6px 24px rgba(20, 60, 40, 0.08);
  --shadow-lg:    0 14px 40px rgba(20, 60, 40, 0.12);
  --maxw:         1160px;
  --header-h:     76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- 헤더 / 네비게이션 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 52px; width: auto; max-height: calc(var(--header-h) - 20px); }
.brand .brand-fallback {
  font-weight: 800; font-size: 1.15rem; color: var(--green-dark);
  letter-spacing: -0.5px;
}

.main-nav > ul { display: flex; gap: 4px; align-items: center; }
.main-nav .nav-item { position: relative; }
.main-nav > ul > li > a {
  display: block; padding: 0 18px; line-height: var(--header-h);
  font-weight: 600; font-size: 1.02rem; color: var(--ink);
  transition: color .15s;
}
.main-nav > ul > li > a:hover { color: var(--green); }

.submenu {
  position: absolute; top: calc(var(--header-h) - 14px); left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 190px; padding: 8px; opacity: 0; visibility: hidden;
  transition: opacity .18s, transform .18s;
}
.nav-item:hover .submenu,
.nav-item:focus-within .submenu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.submenu a {
  display: block; padding: 10px 14px; border-radius: 8px;
  font-size: 0.97rem; color: var(--gray); font-weight: 500;
}
.submenu a:hover { background: var(--green-light); color: var(--green-dark); }

.nav-cta {
  margin-left: 12px; padding: 10px 20px !important; line-height: 1.2 !important;
  background: var(--green); color: #fff !important; border-radius: 999px;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--green-dark); color: #fff !important; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; color: var(--ink);
}

/* ---------- 히어로 ---------- */
.hero {
  position: relative; color: #fff; text-align: center;
  padding: 110px 24px; background-size: cover; background-position: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(31,122,68,.82), rgba(18,104,158,.80));
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 2.7rem; font-weight: 800; letter-spacing: -1px; line-height: 1.25; }
.hero p { margin-top: 16px; font-size: 1.2rem; opacity: .95; }
.hero .btn { margin-top: 28px; }

/* ---------- 페이지 헤더(서브페이지 배너) ---------- */
.page-hero {
  color: #fff; text-align: center; padding: 72px 24px 60px;
  background: linear-gradient(120deg, var(--green-dark), var(--blue-dark));
}
.page-hero h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: -.5px; }
.page-hero .crumbs { margin-top: 10px; font-size: .95rem; opacity: .9; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-block; padding: 13px 30px; border-radius: 999px;
  font-weight: 700; font-size: 1.02rem; cursor: pointer; border: 2px solid transparent;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--sun); color: #3a2a00; }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(246,185,59,.4); }
.btn-white { background: #fff; color: var(--green-dark); }
.btn-outline { border-color: var(--green); color: var(--green-dark); background: transparent; }
.btn-outline:hover { background: var(--green); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }

/* ---------- 섹션 공통 ---------- */
.section { padding: 76px 0; }
.section.soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head .eyebrow {
  display: inline-block; color: var(--green); font-weight: 700;
  font-size: .92rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px;
}
.section-head h2 { font-size: 2rem; font-weight: 800; letter-spacing: -.5px; }
.section-head p { margin-top: 14px; color: var(--gray); font-size: 1.05rem; }

/* ---------- 카드 그리드 ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--green-light); color: var(--green-dark); margin-bottom: 16px;
}
.card .icon svg { width: 28px; height: 28px; }
.card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--gray); font-size: .98rem; }
.card .more { display: inline-block; margin-top: 14px; color: var(--green); font-weight: 700; font-size: .95rem; }

/* ---------- 통계 스트립 ---------- */
.stats { background: var(--green-light); }
.stats .grid-4 { text-align: center; }
.stat .num { font-size: 2.6rem; font-weight: 800; color: var(--green-dark); line-height: 1.1; }
.stat .label { color: var(--gray); margin-top: 6px; font-weight: 600; }

/* ---------- 미디어 2열 (이미지+글) ---------- */
.media { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; object-fit: cover; }
.media h2 { font-size: 1.9rem; font-weight: 800; margin-bottom: 16px; letter-spacing: -.5px; }
.media p { color: var(--gray); margin-bottom: 14px; }
.media.reverse .media-text { order: 2; }

/* ---------- 프로세스 스텝 ---------- */
.steps { counter-reset: step; display: grid; gap: 20px; }
.step {
  display: flex; gap: 18px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.step::before {
  counter-increment: step; content: counter(step);
  flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem;
}
.step h3 { font-size: 1.15rem; margin-bottom: 6px; }
.step p { color: var(--gray); font-size: .97rem; }

/* ---------- 테이블 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; background: #fff; min-width: 640px; }
table.data th, table.data td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: .96rem; }
table.data thead th { background: var(--green-dark); color: #fff; font-weight: 700; white-space: nowrap; }
table.data tbody tr:hover { background: var(--green-light); }
table.data td.center, table.data th.center { text-align: center; }

/* ---------- 발전소 카드 ---------- */
.plant-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.plant {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .15s;
}
.plant:hover { transform: translateY(-4px); }
.plant .thumb { height: 180px; background: var(--green-light) center/cover no-repeat; }
.plant .body { padding: 20px 22px; }
.plant .tag { display: inline-block; background: var(--sun); color: #3a2a00; font-weight: 700; font-size: .78rem; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.plant h3 { font-size: 1.15rem; margin-bottom: 10px; }
.plant dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .9rem; }
.plant dt { color: var(--gray); font-weight: 600; white-space: nowrap; }
.plant dd { color: var(--ink); }

/* ---------- 연혁 타임라인 ---------- */
.timeline { position: relative; max-width: 820px; margin: 0 auto; padding-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 120px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-year { display: grid; grid-template-columns: 120px 1fr; gap: 28px; margin-bottom: 34px; }
.tl-year > .year { font-size: 1.6rem; font-weight: 800; color: var(--green); text-align: right; }
.tl-events { position: relative; }
.tl-events li { position: relative; padding: 0 0 14px 26px; }
.tl-events li::before {
  content: ""; position: absolute; left: -6px; top: 8px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--green); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--green);
}
.tl-events .date { font-weight: 700; color: var(--blue-dark); margin-right: 8px; }

/* ---------- 아코디언(FAQ) ---------- */
.accordion { max-width: 820px; margin: 0 auto; }
.acc-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.acc-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 20px 22px; font-size: 1.05rem; font-weight: 700; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.acc-q .plus { flex: 0 0 auto; transition: transform .2s; color: var(--green); font-size: 1.4rem; }
.acc-item.open .acc-q .plus { transform: rotate(45deg); }
.acc-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.acc-a .inner { padding: 0 22px 20px; color: var(--gray); }
.acc-item.open .acc-a { max-height: 500px; }

/* ---------- 정관 문서 ---------- */
.doc { max-width: 860px; margin: 0 auto; }
.doc .toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-bottom: 36px; }
.doc .toc h3 { margin-bottom: 12px; }
.doc .toc ul { columns: 2; }
.doc .toc a { color: var(--blue-dark); font-weight: 600; }
.doc h2 { font-size: 1.4rem; margin: 40px 0 14px; color: var(--green-dark); padding-bottom: 8px; border-bottom: 2px solid var(--green-light); }
.doc h3.art { font-size: 1.05rem; margin: 20px 0 6px; font-weight: 700; }
.doc p { color: #33424a; margin-bottom: 10px; line-height: 1.9; }

/* ---------- 본문 편집기 출력 ---------- */
.doc.wysiwyg-content h1 { margin: 44px 0 18px; color: inherit; font-size: 1.8rem; line-height: 1.35; }
.doc.wysiwyg-content h2 { margin: 40px 0 14px; color: inherit; font-size: 1.4rem; line-height: 1.4; padding-bottom: 0; border-bottom: 0; }
.doc.wysiwyg-content h3:not(.art) { margin: 28px 0 10px; color: inherit; font-size: 1.15rem; line-height: 1.5; }
.doc.wysiwyg-content .ql-size-small { font-size: .75em; }
.doc.wysiwyg-content .ql-size-large { font-size: 1.5em; }
.doc.wysiwyg-content .ql-size-huge { font-size: 2.5em; }
.doc ul,
.doc ol { margin: 0 0 16px; padding-left: 1.6em; color: #33424a; line-height: 1.9; }
.doc ul { list-style: disc; }
.doc ol { list-style: decimal; }
.doc ol > li[data-list="bullet"] { list-style-type: disc; }
.doc ol > li[data-list="ordered"] { list-style-type: decimal; }
.doc li { margin: 2px 0; }
.doc a { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 2px; }
.doc img { max-width: 100%; height: auto; vertical-align: middle; }
.doc .ql-align-left { text-align: left; }
.doc .ql-align-center { text-align: center; }
.doc .ql-align-right { text-align: right; }
.doc .ql-align-justify { text-align: justify; }

/* ---------- 게시판 리스트 ---------- */
.board { border-top: 2px solid var(--green-dark); }
.board .row {
  display: grid; grid-template-columns: 70px 1fr 110px; gap: 16px; align-items: center;
  padding: 18px 12px; border-bottom: 1px solid var(--line);
}
.board .row:hover { background: var(--bg-soft); }
.board .no { color: var(--gray); text-align: center; font-weight: 600; }
.board.compact .row { grid-template-columns: 1fr auto; gap: 12px; }
.board .title { font-weight: 600; }
.board .title .badge { display: inline-block; background: var(--blue); color: #fff; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 8px; }
.board .date { color: var(--gray); font-size: .9rem; text-align: right; }

/* ---------- 블로그 카드 ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.post:hover { transform: translateY(-4px); }
.post .thumb { height: 190px; background: var(--green-light) center/cover no-repeat; }
.post .body { padding: 22px; }
.post .cat { color: var(--green); font-weight: 700; font-size: .82rem; letter-spacing: 1px; }
.post h3 { font-size: 1.15rem; margin: 8px 0 10px; line-height: 1.45; }
.post p { color: var(--gray); font-size: .94rem; }
.post .date { color: var(--gray); font-size: .85rem; margin-top: 14px; }

/* ---------- 지도 / 오시는 길 ---------- */
.map-embed { width: 100%; height: 420px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.info-list { display: grid; gap: 14px; }
.info-list .item { display: flex; gap: 14px; align-items: flex-start; }
.info-list .item .ic { flex: 0 0 42px; height: 42px; border-radius: 10px; background: var(--blue-light); color: var(--blue-dark); display: grid; place-items: center; }
.info-list .item .ic svg { width: 22px; height: 22px; }
.info-list .item .k { font-weight: 700; }
.info-list .item .v { color: var(--gray); }

/* ---------- CTA 배너 ---------- */
.cta-band { background: linear-gradient(120deg, var(--green), var(--blue)); color: #fff; text-align: center; padding: 64px 24px; }
.cta-band h2 { font-size: 1.9rem; font-weight: 800; }
.cta-band p { margin-top: 12px; opacity: .95; font-size: 1.08rem; }
.cta-band .btn { margin-top: 26px; }

/* ---------- 푸터 ---------- */
.site-footer { background: #16232a; color: #b9c7ce; padding: 56px 0 30px; font-size: .93rem; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand .fb-logo { font-weight: 800; font-size: 1.2rem; color: #fff; margin-bottom: 12px; }
.footer-brand p { line-height: 1.9; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer .links li { margin-bottom: 8px; }
.site-footer .links a:hover { color: var(--sun); }
.footer-bottom { border-top: 1px solid #2a3a43; margin-top: 40px; padding-top: 22px; text-align: center; color: #7f929b; font-size: .85rem; }

/* ---------- 유틸 ---------- */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.lead { font-size: 1.12rem; color: var(--gray); }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4, .plant-grid, .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .media { grid-template-columns: 1fr; gap: 28px; }
  .media.reverse .media-text { order: 0; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.1rem; }

  .nav-toggle { display: grid; place-items: center; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: #fff;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .main-nav.open { max-height: 90vh; overflow-y: auto; }
  .main-nav > ul { flex-direction: column; gap: 0; padding: 8px 0; }
  .main-nav > ul > li > a { line-height: 1.4; padding: 14px 24px; }
  .submenu {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; border-radius: 0; min-width: auto; padding: 0 0 8px 12px; background: var(--bg-soft);
    display: none;
  }
  .nav-item.expanded .submenu { display: block; }
  .nav-cta { display: inline-block; margin: 12px 24px; text-align: center; }
  .timeline::before { left: 70px; }
  .tl-year { grid-template-columns: 70px 1fr; gap: 16px; }
  .tl-year > .year { font-size: 1.25rem; }
}

@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4, .plant-grid, .blog-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 52px 0; }
  .hero { padding: 72px 20px; }
  .doc .toc ul { columns: 1; }
  .board .row { grid-template-columns: 1fr 84px; }
  .board .no { display: none; }
}

.main-nav > ul > li > a.active { color: var(--green); }
