/* ==========================================================================
   main.css  —  Layout, Utilities, Buttons, Sections
   Imports: variables.css → reset.css → THIS
   ========================================================================== */

/* ── Google Fonts ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&family=Noto+Serif+KR:wght@400;700&display=swap');

/* ── Container ────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ── Section ──────────────────────────────────────────────────────────── */
.section {
  padding-block: var(--section-gap);
}

.section--bg-light {
  background-color: var(--color-bg-alt);
}

.section--cta {
  background-color: var(--color-brand-primary);
  color: var(--color-white);
  text-align: center;
}

.section--filter {
  padding-top: var(--space-8);
}

/* ── Section Header ───────────────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--content-gap);
}

.section-label {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-brand-accent);
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-md);
  color: var(--color-text-light);
  max-width: 60ch;
  margin-inline: auto;
}

.section-footer {
  text-align: center;
  margin-top: var(--space-10);
}

/* CTA Section overrides */
.section--cta .cta-title {
  font-size: var(--text-2xl);
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

.section--cta .cta-desc {
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-8);
  margin-inline: auto;
}

/* ── Two Column Layout ────────────────────────────────────────────────── */
.layout-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.two-col-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.two-col-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Features Grid (홈 소개) ──────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-10);
}

.feature-item {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.feature-item .feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
}

.feature-item h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-3);
}

.feature-item p {
  font-size: var(--text-base);
  color: var(--color-text-light);
  margin-inline: auto;
}

/* ── Menu Grid (서비스) ───────────────────────────────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-8);
}

.menu-item {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.menu-item picture,
.menu-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.menu-item-body {
  padding: var(--space-5);
}

.menu-item-body h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-2);
}

.menu-item-body p {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* ── Process Steps ────────────────────────────────────────────────────── */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
  counter-reset: process;
  list-style: none;
}

.process-step {
  position: relative;
  padding: var(--space-6);
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.process-step::before {
  counter-increment: process;
  content: counter(process, decimal-leading-zero);
  display: block;
  font-size: var(--text-xl);
  font-family: var(--font-serif);
  font-weight: var(--font-weight-bold);
  color: var(--color-brand-accent);
  margin-bottom: var(--space-3);
}

/* ── FAQ Accordion ────────────────────────────────────────────────────── */
.faq-list {
  max-width: var(--container-narrow);
  margin-inline: auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--space-5) 0;
  text-align: left;
  font-size: var(--text-md);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  background: none;
  border: none;
}

.faq-question::after {
  content: '+';
  font-size: var(--text-lg);
  color: var(--color-brand-primary);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.faq-item.is-open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-base);
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
  padding-bottom: var(--space-5);
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
}

/* ── Timeline ─────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  max-width: 720px;
  margin-inline: auto;
  padding-left: var(--space-10);
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-brand-secondary);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-10);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-10) - 5px);
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-brand-primary);
  border: 2px solid var(--color-white);
  box-shadow: 0 0 0 2px var(--color-brand-secondary);
}

.timeline-year {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-brand-accent);
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--space-2);
}

.timeline-title {
  font-size: var(--text-md);
  margin-bottom: var(--space-2);
}

.timeline-desc {
  color: var(--color-text-light);
}

/* ── Certifications ───────────────────────────────────────────────────── */
.certs-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  list-style: none;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  box-shadow: var(--shadow-sm);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background-color: var(--color-brand-primary);
  color: var(--color-white);
  border-color: var(--color-brand-primary);
}

.btn--primary:hover {
  background-color: color-mix(in srgb, var(--color-brand-primary) 85%, black);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}

.btn--secondary:hover {
  background-color: var(--color-brand-primary);
  color: var(--color-white);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn--outline:hover {
  background-color: var(--color-white);
  color: var(--color-brand-primary);
}

.btn--lg {
  padding: var(--space-4) var(--space-12);
  font-size: var(--text-md);
}

.btn--full {
  width: 100%;
}

/* ── Rich Text ────────────────────────────────────────────────────────── */
.rich-text p + p {
  margin-top: var(--space-4);
}

.rich-text ul, .rich-text ol {
  padding-left: var(--space-6);
  list-style: disc;
}

.rich-text li + li {
  margin-top: var(--space-2);
}

.rich-text a {
  color: var(--color-brand-primary);
  text-decoration: underline;
}

/* ── Links ────────────────────────────────────────────────────────────── */
.link {
  color: var(--color-brand-primary);
  text-decoration: underline;
}

/* ── Page Hero (짧은 내부 페이지 배너) ───────────────────────────────── */
.page-hero {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  background-color: var(--color-gray-800);
  overflow: hidden;
}

.page-hero--short {
  min-height: 220px;
  background: linear-gradient(
    135deg,
    var(--color-brand-primary) 0%,
    color-mix(in srgb, var(--color-brand-primary) 70%, black) 100%
  );
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
}

.page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.65) 0%,
    rgba(0,0,0,0.3) 60%,
    rgba(0,0,0,0.1) 100%
  );
  z-index: var(--z-raised);
}

.page-hero-content {
  position: relative;
  z-index: var(--z-raised);
  padding-bottom: var(--space-12);
  color: var(--color-white);
}

.page-hero-content h1 {
  font-size: var(--text-2xl);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.page-hero-content p {
  font-size: var(--text-md);
  color: rgba(255,255,255,0.85);
}

/* ── Lazy load fade-in ────────────────────────────────────────────────── */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity var(--transition-slow);
}

img[loading="lazy"].is-loaded {
  opacity: 1;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --section-gap: var(--space-16);
    --container-px: var(--space-4);
  }

  .section-title {
    font-size: var(--text-xl);
  }

  .layout-two-col {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .two-col-text { order: 1; }
  .two-col-image { order: 2; }
}
