/* ===== Main page (index) ===== */

body.main-page-body {
  background: #ffffff;
  /* padding-top은 base body 규칙의 var(--header-h)를 그대로 사용
     — top.html JS가 실제 헤더 높이를 측정해 변수를 동기화하므로 어떤 뷰포트에서도 정확히 맞음 */
}

/* main-page도 동일한 Bootstrap container 반응형 너비 사용 (custom.css 기본 룰 그대로 유지) */

.main-page {
  background-color: #ffffff;
  padding-bottom: 80px;
  overflow-x: hidden;
}

.collapsing {
  transition: none !important;
}

/* ---------- Hero ---------- */
.hero-section {
  position: relative;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center right;
  padding: 0;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    rgba(255, 255, 255, 1) 30%,
    rgba(255, 255, 255, 0.6) 55%,
    rgba(244, 251, 255, 0.15) 100%);
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 1;
  padding-top: 60px;
  padding-bottom: 160px;
}

.hero-text {
  max-width: 560px;
}

.hero-badge {
  display: inline-block;
  font-size: 17px;
  font-weight: 600;
  color: #004ea2;
  background: #ffffff;
  border: 1px solid #d6e3f3;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.hero-title {
  font-size: 54px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  margin: 0 0 28px;
  word-break: keep-all;
  letter-spacing: -0.01em;
}

.hero-title .text-primary {
  color: #004ea2 !important;
}

.hero-desc {
  font-size: 17px;
  line-height: 1.7;
  color: #475569;
  margin: 0;
}

/* ---------- Entry cards (3-up) ---------- */
.entry-section {
  position: relative;
  margin-top: -100px;
  z-index: 2;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.entry-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #ffffff;
  border-radius: 18px;
  padding: 40px 28px 32px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  border: 1px solid #eef2f7;
  text-decoration: none;
  color: #0f172a;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.entry-card:hover,
.entry-card:focus {
  text-decoration: none;
  color: #0f172a;
  transform: translateY(-4px);
  border-color: #d6e3f3;
  box-shadow: 0 22px 44px rgba(0, 78, 162, 0.18);
}

.entry-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: #eef4fb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: #004ea2;
  font-size: 38px;
  line-height: 1;
  transition: background 0.25s ease, color 0.25s ease;
}

.entry-icon i {
  display: inline-flex;
}

.entry-card:hover .entry-icon,
.entry-card:focus .entry-icon {
  background: #004ea2;
  color: #ffffff;
}

.entry-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.entry-desc {
  font-size: 17px;
  line-height: 1.6;
  color: #64748b;
  margin: 0 0 22px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.entry-link {
  font-size: 17px;
  font-weight: 700;
  color: #004ea2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
  margin-top: auto;   /* 카드 높이가 동일할 때 항상 바닥 정렬 */
}

.entry-card:hover .entry-link {
  border-bottom-color: #004ea2;
}

/* ---------- News + Quick service ---------- */
.news-section {
  padding: 80px 0 40px;
}

.news-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.news-board {
  background: #ffffff;
  border-radius: 16px;
  padding: 8px 4px 0;
  min-width: 0;
}

.news-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.news-title-bar {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  position: relative;
  padding-left: 14px;
}

.news-title-bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: #004ea2;
  border-radius: 2px;
}

.news-more {
  font-size: 17px;
  color: #64748b;
  text-decoration: none;
}

.news-more:hover {
  color: #004ea2;
  text-decoration: none;
}

.nav.nav-news {
  border: none;
  padding: 0 4px;
  margin-bottom: 0;
  gap: 24px;
}

.nav.nav-news .nav-item {
  margin-bottom: 0;
}

.nav.nav-news .nav-link {
  border: none !important;
  background: transparent !important;
  color: #94a3b8;
  font-size: 17px;
  font-weight: 700;
  padding: 14px 0;
  position: relative;
}

.nav.nav-news .nav-link.active {
  color: #004ea2 !important;
  background: transparent !important;
}

.nav.nav-news .nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #004ea2;
}

.news-tab-content {
  border-top: 1px solid #e2e8f0;
  padding: 4px 4px 8px;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list li {
  border-bottom: 1px solid #eef2f7;
}

.news-list li:last-child {
  border-bottom: none;
}

.news-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 8px;
  text-decoration: none;
  color: #1e293b;
  gap: 16px;
  min-width: 0;
}

.news-row:hover {
  text-decoration: none;
  color: #004ea2;
}

.news-row-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 17px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-row-date {
  font-size: 17px;
  color: #94a3b8;
  flex-shrink: 0;
}

.news-empty {
  padding: 60px 0;
  text-align: center;
  color: #94a3b8;
}

.news-empty p {
  margin: 0;
}

/* Quick service */
.quick-service {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.quick-service-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
  position: relative;
  padding-left: 14px;
}

.quick-service-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: #004ea2;
  border-radius: 2px;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  border-radius: 16px;
  padding: 28px 32px 32px;
  min-height: 132px;
  text-decoration: none;
  background: linear-gradient(135deg, #f4f9ff 0%, #e3edfa 100%);
  color: #0f3a72;
  border: 1px solid rgba(0, 78, 162, 0.12);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s cubic-bezier(.2,.7,.3,1),
              box-shadow 0.3s ease,
              border-color 0.3s ease,
              color 0.3s ease;
}

.service-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 78, 162, 0.18), rgba(0, 78, 162, 0) 70%);
  z-index: -1;
  transition: transform 0.5s ease, background 0.4s ease;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1769c8 0%, #004ea2 100%);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.service-card:hover,
.service-card:focus {
  text-decoration: none;
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(0, 78, 162, 0.28);
}

.service-card:hover::after,
.service-card:focus::after {
  opacity: 1;
}

.service-card:hover::before,
.service-card:focus::before {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0) 70%);
  transform: scale(1.15);
}

.service-card:hover .service-arrow,
.service-card:focus .service-arrow {
  background: #ffffff;
  color: #004ea2;
  transform: translateY(-50%) translateX(4px);
}

.service-card .service-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #4a78b5;
  transition: color 0.25s ease;
}

.service-card:hover .service-eyebrow,
.service-card:focus .service-eyebrow {
  color: rgba(255, 255, 255, 0.85);
}

.service-card .service-name {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  padding-right: 56px;
  word-break: keep-all;
}

.service-card .service-arrow {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 78, 162, 0.1);
  color: #004ea2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.3s ease;
}

/* ---------- Footer adjustment when on main page ---------- */
/* sticky footer 유지 — body flex column + margin-top: auto 가 정상 동작하도록 override 제거 */
.main-page {
  flex: 1 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .hero-title {
    font-size: 46px;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .hero-title {
    font-size: 38px;
  }
  .hero-container {
    padding-top: 60px;
    padding-bottom: 140px;
  }
  .entry-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .entry-section {
    margin-top: -80px;
  }
}

@media (max-width: 767px) {
  .hero-text {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  .hero-title,
  .hero-desc {
    text-align: center;
  }
}

@media (max-width: 575px) {
  .hero-container {
    padding-top: 50px;
    padding-bottom: 110px;
  }
  .hero-title {
    font-size: 30px;
  }
  .hero-desc {
    font-size: 17px;
  }
  .news-section {
    padding: 60px 0 20px;
  }
  .news-row-title {
    font-size: 17px;
  }
  .quick-service-title {
    font-size: 16px;
  }
  .service-card {
    padding: 22px 24px 24px;
    min-height: 110px;
    border-radius: 14px;
  }
  .service-card .service-eyebrow {
    font-size: 12px;
  }
  .service-card .service-name {
    font-size: 18px;
    padding-right: 48px;
  }
  .service-card .service-arrow {
    width: 32px;
    height: 32px;
    right: 16px;
    font-size: 14px;
  }
}
