/* Pretendard는 각 페이지 head에서 공식 CSS를 불러온다.
   해당 CSS의 @font-face에 font-display: swap이 포함되어 있다. */

:root {
  --color-main: #1B5E8C;
  --color-accent: #F26B21;
  --color-bg: #FFFFFF;
  --color-bg-soft: #F5F7F9;
  --color-text: #333333;
  --color-text-sub: #666666;
  --color-line: #E1E6EB;
  --color-letterbox: #1B2A33;
  --content-width: 720px;
  --radius: 10px;
  --tel-bar-height: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-bottom: calc(var(--tel-bar-height) + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, 'Malgun Gothic', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  word-break: keep-all;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-main);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.4;
  color: #1a1a1a;
  margin: 2em 0 0.6em;
}

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.35rem;
  padding-left: 12px;
  border-left: 4px solid var(--color-main);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1.2em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- layout ---------- */

.container,
.site-main {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 18px;
}

.site-main {
  padding-top: 24px;
  padding-bottom: 48px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 18px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-main);
  letter-spacing: -0.02em;
}

.logo:hover {
  text-decoration: none;
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 44px;
  top: 8px;
  right: 14px;
  margin: 0;
}

.nav-toggle-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-main);
  cursor: pointer;
}

.nav-toggle:focus-visible + .nav-toggle-label {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.site-nav {
  display: none;
  width: 100%;
  order: 3;
}

.nav-toggle:checked ~ .site-nav {
  display: block;
}

.nav-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--color-line);
}

.nav-list a {
  display: block;
  padding: 13px 2px;
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 1px solid var(--color-line);
}

.nav-tel {
  display: block;
  margin: 12px 0 4px;
  padding: 12px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius);
}

.nav-tel:hover,
.header-tel:hover {
  text-decoration: none;
}

.header-tel {
  display: none;
}

/* ---------- utility boxes ---------- */

.summary-box {
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--color-bg-soft);
  border-left: 4px solid var(--color-main);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.warning-box {
  margin: 24px 0;
  padding: 18px 20px;
  background: #FFF4EC;
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.step-box {
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.step-box + .step-box {
  margin-top: 12px;
}

.cta-box {
  margin: 36px 0;
  padding: 26px 20px;
  background: var(--color-main);
  color: #fff;
  text-align: center;
  border-radius: var(--radius);
}

.cta-box a {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 26px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
}

.cta-box a:hover {
  text-decoration: none;
}

.cta-box p {
  margin: 0;
}

.summary-box > :first-child,
.warning-box > :first-child,
.step-box > :first-child {
  margin-top: 0;
}

.summary-box > :last-child,
.warning-box > :last-child,
.step-box > :last-child {
  margin-bottom: 0;
}

.warning-box h3,
.step-box h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5em;
}

/* ---------- hero ---------- */

.hero {
  padding-top: 8px;
}

.hero h1 {
  margin: 0 0 10px;
}

.hero-slogan {
  margin: 0 0 20px;
  font-size: 1.05rem;
  color: var(--color-text-sub);
}

.hero-tel {
  display: inline-block;
  padding: 13px 26px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
}

.hero-tel:hover {
  text-decoration: none;
}

/* ---------- hero slider (CSS 전용 자동 전환) ---------- */

.hero-slider {
  position: relative;
  aspect-ratio: 3 / 2;
  margin: 0 0 22px;
  overflow: hidden;
  background: var(--color-letterbox);
  border-radius: var(--radius);
}

.hero-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.hero-track {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  background: var(--color-letterbox);
  animation: heroFade 18s linear infinite;
}

/* 이미지가 아직 없어도 자리와 높이가 유지되도록 라벨을 깔아둔다. */
.hero-slide::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #9FB3C0;
}

.hero-slide img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  font-size: 0.9rem;
  color: #9FB3C0;
}

.hero-slide:nth-child(2) {
  animation-delay: 4.5s;
}

.hero-slide:nth-child(3) {
  animation-delay: 9s;
}

.hero-slide:nth-child(4) {
  animation-delay: 13.5s;
}

@keyframes heroFade {
  0% { opacity: 0; }
  1% { opacity: 1; }
  25% { opacity: 1; }
  26% { opacity: 0; }
  100% { opacity: 0; }
}

/* 화살표나 점을 누르면 자동 전환을 멈추고 해당 사진을 고정한다. */
.hero-input:checked ~ .hero-track .hero-slide {
  animation: none;
  opacity: 0;
}

#hero-1:checked ~ .hero-track .hero-slide:nth-child(1),
#hero-2:checked ~ .hero-track .hero-slide:nth-child(2),
#hero-3:checked ~ .hero-track .hero-slide:nth-child(3),
#hero-4:checked ~ .hero-track .hero-slide:nth-child(4) {
  opacity: 1;
}

.hero-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.hero-nav-auto {
  display: flex;
}

.hero-input:checked ~ .hero-nav-auto {
  display: none;
}

#hero-1:checked ~ .hero-nav-1,
#hero-2:checked ~ .hero-nav-2,
#hero-3:checked ~ .hero-nav-3,
#hero-4:checked ~ .hero-nav-4 {
  display: flex;
}

.hero-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(27, 94, 140, 0.55);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
}

.hero-arrow:hover {
  background: rgba(27, 94, 140, 0.8);
}

.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.hero-dots label {
  width: 9px;
  height: 9px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

#hero-1:checked ~ .hero-dots label:nth-child(1),
#hero-2:checked ~ .hero-dots label:nth-child(2),
#hero-3:checked ~ .hero-dots label:nth-child(3),
#hero-4:checked ~ .hero-dots label:nth-child(4) {
  background: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    animation: none;
  }

  .hero-slide:nth-child(1) {
    opacity: 1;
  }
}

/* ---------- symptoms ---------- */

.symptom-list {
  margin: 20px 0 28px;
  padding: 0;
  list-style: none;
}

.symptom-list li {
  position: relative;
  margin-bottom: 12px;
  padding: 12px 16px 12px 44px;
  background: var(--color-bg-soft);
  border-radius: var(--radius);
}

.symptom-list li::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 18px;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
}

.symptom-tip {
  display: block;
  margin-top: 6px;
  font-size: 0.93rem;
  color: var(--color-text-sub);
}

/* ---------- faq ---------- */

.faq-item {
  margin-bottom: 10px;
  padding: 0 18px;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.faq-item summary {
  padding: 15px 0;
  font-weight: 700;
  color: #1a1a1a;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  float: right;
  margin-left: 12px;
  color: var(--color-main);
  font-size: 1.2rem;
  line-height: 1.4;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  margin: 0 0 16px;
  color: var(--color-text);
}

/* ---------- contact ---------- */

.contact-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.contact-list li {
  margin-bottom: 6px;
}

.contact-list strong {
  display: inline-block;
  min-width: 7.2em;
  margin-right: 6px;
  color: var(--color-main);
}

.contact-note {
  margin: 0;
  font-size: 0.93rem;
  color: var(--color-text-sub);
}

.section-more {
  margin: 4px 0 0;
  font-weight: 600;
}

/* ---------- case cards ---------- */

.case-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.case-card {
  display: block;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.case-card:hover {
  text-decoration: none;
  border-color: var(--color-main);
}

.case-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--color-bg-soft);
}

.case-card-body {
  padding: 14px 16px 18px;
}

.case-card-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
}

.case-card-meta {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--color-text-sub);
}

.case-card-summary {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.case-empty {
  margin: 24px 0;
  padding: 40px 20px;
  background: var(--color-bg-soft);
  color: var(--color-text-sub);
  text-align: center;
  border-radius: var(--radius);
}

/* ---------- case detail ---------- */

.case-detail h1 {
  margin-top: 0.4em;
}

.case-meta {
  margin: 0 0 24px;
  font-size: 0.92rem;
  color: var(--color-text-sub);
}

.case-hero {
  margin: 0 0 28px;
}

.case-hero img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--color-bg-soft);
  border-radius: var(--radius);
}

.case-body img {
  margin: 20px 0;
  border-radius: var(--radius);
}

.case-back {
  margin: 28px 0 0;
  font-weight: 600;
}

/* ---------- privacy ---------- */

.site-main ul:not([class]) {
  margin: 0 0 1.4em;
  padding-left: 1.2em;
}

.site-main ul:not([class]) li {
  margin-bottom: 0.4em;
}

.privacy-date {
  margin-top: 36px;
  font-size: 0.9rem;
  color: var(--color-text-sub);
}

/* ---------- slider ---------- */

.slider {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  padding-bottom: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.slider > * {
  flex: 0 0 82%;
  scroll-snap-align: start;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 48px;
  padding: 32px 0 40px;
  background: var(--color-bg-soft);
  border-top: 1px solid var(--color-line);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text-sub);
}

.footer-inner {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 18px;
}

.footer-company {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-main);
}

.footer-info {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.footer-info a {
  color: var(--color-text-sub);
}

.footer-links {
  margin: 0 0 10px;
}

.footer-copy {
  margin: 0;
  font-size: 0.85rem;
}

/* ---------- floating tel ---------- */

.floating-tel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--tel-bar-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--color-accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.floating-tel:hover {
  text-decoration: none;
}

/* ---------- 768px and up ---------- */

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .header-inner {
    flex-wrap: nowrap;
    padding: 14px 24px;
  }

  .logo {
    margin-right: 32px;
    font-size: 1.35rem;
  }

  .nav-toggle,
  .nav-toggle-label,
  .nav-tel {
    display: none;
  }

  .site-nav {
    display: flex;
    align-items: center;
    width: auto;
    order: 0;
    margin-left: auto;
  }

  .nav-list {
    display: flex;
    gap: 30px;
    margin: 0;
    border-top: 0;
  }

  .nav-list a {
    padding: 4px 0;
    font-size: 0.98rem;
    border-bottom: 0;
  }

  .nav-list a:hover {
    color: var(--color-main);
  }

  .header-tel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 24px;
    padding: 6px 16px;
    background: var(--color-accent);
    color: #fff;
    line-height: 1.25;
    border-radius: 999px;
    white-space: nowrap;
  }

  .header-tel-label {
    font-size: 13px;
    font-weight: 500;
  }

  .header-tel-number {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  h1 {
    font-size: 2.1rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .site-main {
    padding-top: 40px;
    padding-bottom: 64px;
  }

  .hero-slogan {
    font-size: 1.15rem;
  }

  /* 3:2를 유지한 채 높이를 360px로 묶으려면 폭을 540px로 제한해야 한다. */
  .hero-slider {
    width: min(100%, 540px);
    margin: 0 auto 32px;
  }

  .hero-arrow {
    width: 46px;
    height: 46px;
    font-size: 1.8rem;
  }

  .case-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .slider > * {
    flex: 0 0 46%;
  }

  .floating-tel {
    left: auto;
    right: 28px;
    bottom: 28px;
    width: auto;
    height: auto;
    padding: 16px 26px;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  }
}
