/* Hicare popup modal (driven by js/news.js + data/news.json) */

.hicare-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0);
  opacity: 0;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.hicare-popup-backdrop.is-open {
  background: rgba(15, 23, 42, 0.55);
  opacity: 1;
}
.hicare-popup-backdrop.is-closing {
  opacity: 0;
  background: rgba(15, 23, 42, 0);
}

.hicare-popup-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.hicare-popup-backdrop.is-open .hicare-popup-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.hicare-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.hicare-popup-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #E8F4FD;
  color: #105D91;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.hicare-popup-date {
  font-size: 0.78rem;
  color: #94A3B8;
  font-weight: 500;
}
.hicare-popup-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #64748B;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.hicare-popup-close:hover {
  background: #F1F5F9;
  color: #1E293B;
}

.hicare-popup-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 14px;
  line-height: 1.35;
}

.hicare-popup-body {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.hicare-popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.hicare-popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.hicare-popup-btn:hover { text-decoration: none; }
.hicare-popup-btn--primary {
  background: #1A8FD8;
  color: #fff;
}
.hicare-popup-btn--primary:hover {
  background: #1578B8;
  color: #fff;
}
.hicare-popup-btn--ghost {
  background: #fff;
  color: #64748B;
  border-color: #E2E8F0;
}
.hicare-popup-btn--ghost:hover {
  background: #F8FAFC;
  color: #334155;
}

/* Popup expansion panel (shows body_* + source link) */
.hicare-popup-panel {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.hicare-popup-panel[hidden] { display: none; }
.hicare-popup-panel__body { white-space: normal; }
.hicare-popup-panel__source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1578B8;
  text-decoration: none;
}
.hicare-popup-panel__source:hover { color: #105D91; text-decoration: underline; }

.hicare-popup-toggle.is-open { background: #1578B8; }

@media (max-width: 480px) {
  .hicare-popup-card { padding: 22px; }
  .hicare-popup-title { font-size: 1.1rem; }
  .hicare-popup-body { font-size: 0.9rem; }
  .hicare-popup-panel { padding: 14px 16px; font-size: 0.85rem; }
}

/* ================================================
   Multi-popup variant: multiple cards in one backdrop
   Cards sit side-by-side on wide viewports; stack vertically
   when the viewport can't hold them next to each other.
   ================================================ */
.hicare-popup-backdrop--multi {
  /* Let long content scroll within the backdrop instead of overflowing. */
  overflow-y: auto;
  padding: 24px 16px;
}
.hicare-popup-stack {
  display: flex;
  flex-wrap: wrap;
  /* Gap between side-by-side notice cards. Set per HNWEB-26. */
  gap: 40px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
}
/* Per-card close animation (the single-popup path collapsed the whole
   backdrop; multi-popup fades each card independently). */
.hicare-popup-card.is-closing {
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 880px) {
  /* Stacked vertically on narrow viewports — smaller gap than desktop (HNWEB-26). */
  .hicare-popup-stack { flex-direction: column; flex-wrap: nowrap; gap: 24px; }
}

/* ================================================
   Image-only popup variant (single notice image)
   Used when news JSON has popup.image / image_ko / image_en.
   Card sizes itself to the image's intrinsic width; no
   header/body padding so the artwork takes the full surface.
   ================================================ */
.hicare-popup-card--image {
  width: auto;
  max-width: min(640px, calc(100vw - 40px));
  padding: 0;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.hicare-popup-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  background: #fff;
}
.hicare-popup-image-link { display: block; text-decoration: none; }
.hicare-popup-image-link:hover .hicare-popup-image { opacity: 0.95; }

/* Floating close button overlaid on the image */
.hicare-popup-close--floating {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 36px;
  height: 36px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
}
.hicare-popup-close--floating:hover {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
}

.hicare-popup-actions--image {
  margin: 0;
  padding: 12px 16px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  justify-content: flex-end;
}

@media (max-width: 480px) {
  .hicare-popup-card--image { max-width: calc(100vw - 24px); border-radius: 10px; }
  .hicare-popup-close--floating { width: 32px; height: 32px; font-size: 1.2rem; }
  .hicare-popup-actions--image { padding: 10px 12px; }
}

/* ================================================
   Newsroom inline expansion (ir.html)
   ================================================ */
.news-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 6px 10px 6px 12px;
  background: transparent;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1578B8;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.news-toggle:hover {
  background: #F0F7FD;
  border-color: #9DD0F4;
  color: #105D91;
}
.news-toggle__chevron {
  font-size: 18px !important;
  transition: transform 0.2s ease;
}
.news-toggle.is-open .news-toggle__chevron { transform: rotate(180deg); }

.news-panel {
  margin-top: 14px;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  animation: newsPanelIn 0.18s ease;
}
.news-panel[hidden] { display: none; }
.news-panel__body { white-space: normal; }
.news-panel__source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1578B8;
  text-decoration: none;
}
.news-panel__source:hover { color: #105D91; text-decoration: underline; }

@keyframes newsPanelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================
   News detail page — layout + typography
   Applied via templates/news-detail.html.
   - .news-detail: page-level background and rhythm
   - .news-article: white "paper" card that holds the article
   - .news-body: body text typography (shared)
   - .news-body--disclosure: document-style spacing/divider/signature
   - .news-body--milestone: regular blog-like article look
   ================================================ */
.news-detail { background: #F5F7FA; min-height: 100vh; }
.news-detail__container { max-width: 820px; }
.news-detail__crumbs a { text-decoration: none; }
.news-detail__back { margin-top: 28px; }

.news-article {
  background: #ffffff;
  border: 1px solid #E5EAF1;
  border-radius: 14px;
  padding: 48px 48px 56px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03), 0 8px 24px rgba(15, 23, 42, 0.04);
}
@media (max-width: 640px) {
  .news-article { padding: 32px 22px 40px; border-radius: 10px; }
}

.news-article__header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid #E5EAF1;
}
.news-article__meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.news-article__tag {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  background: #E8F4FD; color: #105D91;
  font-size: 0.78rem; font-weight: 700;
  border-radius: 999px; letter-spacing: 0.02em;
}
.news-article__date {
  font-size: 0.88rem; color: #64748B; font-weight: 500;
}
.news-article__title {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 800;
  color: #0F172A;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
  word-break: keep-all;
}
.news-article__lede {
  margin-top: 14px;
  font-size: 1.02rem;
  color: #475569;
  line-height: 1.7;
  word-break: keep-all;
}

/* Body common — applies to both disclosure and milestone */
.news-body {
  color: #1E293B;
  line-height: 1.85;
  font-size: 1.02rem;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.news-body p { margin: 0 0 1.15em; }
.news-body p:last-child { margin-bottom: 0; }
.news-body p.text-center { text-align: center; margin: 1.6em 0; color: #475569; }
.news-body p.text-right  { text-align: right; }

/* --- Disclosure (공고) variant: formal document vibe --- */
.news-body--disclosure {
  font-size: 1.04rem;
  line-height: 1.95;
}
.news-body--disclosure p {
  margin-bottom: 1.1em;
  padding-left: 2px;
}
/* Strong clause labels: "1. 일 시", "3. 회의목적사항", etc. */
.news-body--disclosure strong {
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.005em;
}
/* Give the top-level numbered clauses (the <p> whose first child is
   <strong>) a bit more visual separation from the body below. */
.news-body--disclosure p:has(> strong:first-child) {
  margin-top: 1.4em;
}
/* Safari < 15 / older browsers that don't support :has fall back to
   the uniform spacing above — still readable, just less emphatic. */

.news-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 2.4em 0;
  color: #64748B;
  font-weight: 700;
  letter-spacing: 0.4em;
  font-size: 0.95rem;
}
.news-divider__line {
  flex: 0 1 120px;
  height: 1px;
  background: linear-gradient(to right, transparent, #94A3B8, transparent);
}
.news-divider__line:first-child {
  background: linear-gradient(to left, #94A3B8, transparent);
}
.news-divider__line:last-child {
  background: linear-gradient(to right, #94A3B8, transparent);
}
.news-divider__label { flex: 0 0 auto; white-space: nowrap; }

.news-signature {
  margin: 3em 0 0;
  padding-top: 2em;
  border-top: 1px dashed #CBD5E1;
  text-align: center;
  color: #0F172A;
}
.news-signature p { margin: 0.4em 0; }
.news-signature p:first-child {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}
.news-signature p:last-child {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: #1E293B;
}

.news-attachment {
  margin: 0.8em 0;
}
.news-attachment a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.6em 1em;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  color: #1E293B;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.news-attachment a:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
}

/* --- Certificate thumbnail (clickable preview, opens lightbox) --- */
.news-cert {
  display: inline-block;
  margin: 1em 1em 1em 0;
  text-align: center;
  vertical-align: top;
}
.news-cert__thumb {
  display: block;
  padding: 0;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #fff;
  cursor: zoom-in;
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  width: 220px;
}
.news-cert__thumb:hover,
.news-cert__thumb:focus-visible {
  border-color: #94A3B8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
  outline: none;
}
.news-cert__thumb img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: top center;
  background: #F8FAFC;
}
.news-cert__caption {
  margin-top: 0.5em;
  width: 220px;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.35;
  word-break: keep-all;
}

/* --- Lightbox modal --- */
.cert-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.cert-lightbox[aria-hidden="false"] {
  display: flex;
}
body.cert-lightbox-open {
  overflow: hidden;
}
.cert-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(2px);
}
.cert-lightbox__dialog {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  max-width: min(95vw, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cert-lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 0.9em 1.25em;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}
.cert-lightbox__title {
  font-size: 1rem;
  font-weight: 600;
  color: #0F172A;
  margin: 0;
  word-break: keep-all;
}
.cert-lightbox__actions {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-shrink: 0;
}
.cert-lightbox__download {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.45em 0.9em;
  background: #1A8FD8;
  color: #fff;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}
.cert-lightbox__download:hover,
.cert-lightbox__download:focus-visible {
  background: #1578B8;
  outline: none;
}
.cert-lightbox__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cert-lightbox__close:hover,
.cert-lightbox__close:focus-visible {
  background: #F1F5F9;
  border-color: #94A3B8;
  outline: none;
}
.cert-lightbox__body {
  overflow: auto;
  background: #0F172A;
  padding: 1.25em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.cert-lightbox__image {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
  .news-cert,
  .news-cert__thumb,
  .news-cert__caption {
    width: 100%;
    max-width: 280px;
  }
  .news-cert__thumb img { height: 240px; }
  .cert-lightbox__header { flex-wrap: wrap; }
}

/* --- Milestone (사업성과) variant: softer blog-like --- */
.news-body--milestone {
  font-size: 1.02rem;
  color: #334155;
}
