/* =========================================================
   GWS UPDATE - 기본 스타일
   흰색 기반 / 넉넉한 여백 / 콘텐츠 중심 블로그·매거진형 / 모바일 대응
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-border: #e8eaed;
  --color-divider: #eef0f2;
  --color-text: #1f2328;
  --color-text-muted: #6b7280;
  --color-text-soft: #8b929c;
  --color-accent: #1a73e8;
  --color-accent-soft: #e8f0fe;
  --color-chip: #f1f3f4;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.10);

  --container: 1080px;
  /* 상세(article) 읽기 폭. 데스크톱에서만 이 최대폭을 쓰고, 그 아래에서는
     .container 패딩 안에서 width:100% 로 자연스럽게 좁아진다. */
  --reading: 900px;
  /* 공개 사이트 기본 폰트: Pretendard 계열. 웹폰트 로드 실패 시 아래 순서로 자연스럽게 fallback.
     (관리자 화면은 admin.css 에서 기존 시스템 스택으로 되돌린다) */
  --font: "Pretendard Variable", "Pretendard", "Noto Sans KR",
          "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); }

img { max-width: 100%; }

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

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-divider);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
}
/* SYSTEMCARE GWS UPDATE 워드마크 — PIMS/IGMS 와 동일한 브랜드 체계, 이미지 없이 CSS 텍스트만.
   SYSTEMCARE + 첫 글자 G 만 공통 그라데이션, 나머지 'WS UPDATE' 는 진한 네이비. */
.brand__wordmark {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.brand__grad {
  color: #e94391; /* background-clip 미지원 시 fallback */
  background: linear-gradient(90deg, #f26430 0%, #e94391 36%, #8a63d2 66%, #2e7dd1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand__grad--g { margin-left: 0.4em; } /* SYSTEMCARE ↔ GWS UPDATE 자연스러운 간격 */
.brand__rest { color: #14213d; }        /* 진한 네이비 */
.site-header__tag {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- 히어로 (좌측 정렬 브랜드 영역, 화이트 헤더 아래 blue 배경) ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 150px;
  padding: 20px 0;
  overflow: hidden;
  color: #fff;
  /* Google Blue 중심의 차분한 gradient + 극히 옅은 violet accent 한 겹. */
  background:
    radial-gradient(72% 130% at 92% 50%, rgba(120, 92, 214, 0.14), transparent 62%),
    linear-gradient(105deg, #1550bb 0%, #1a73e8 62%, #2f8af0 100%);
}
/* 오른쪽 대형 타이포 워터마크 (white opacity ~0.06). Google 로고 아님. */
.hero::after {
  content: "GWS";
  position: absolute;
  right: -0.06em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
  user-select: none;
}
.hero__inner {
  position: relative; /* 워터마크 위로 */
  z-index: 1;
  text-align: left;
}
.hero__title {
  margin: 0 0 8px;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  word-break: keep-all;
}
.hero__desc {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  word-break: keep-all;
}

/* ---------- 카테고리 (텍스트 내비게이션) ---------- */
.tabs {
  margin-top: 30px; /* hero → 흰색 콘텐츠 영역 간격 */
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: 44px;
}
.tabs__list {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--color-text-soft);
  padding: 12px 2px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--color-text); }
.tab.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

/* ---------- 게시글 피드 (썸네일 그리드) ---------- */
.feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 28px;
  padding-bottom: 88px;
}
.feed .post[hidden] { display: none; }
.feed__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: 64px 0;
}

.post { position: relative; }
.post__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.post__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 12px;
}

/* 상단 16:9 썸네일 (이미지 또는 제품별 옅은 커버) */
.post__media {
  position: relative;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-chip);
}
.post__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.post__link:hover .post__media img { transform: scale(1.012); }

/* hero_image 가 없을 때: 외부 이미지/로고 없이 CSS 로만 만드는 에디토리얼 커버.
   제품명 라벨(하단 왼쪽) + 아주 옅은 이니셜/원 장식. gradient·pattern·illustration 없음. */
.post__cover {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  padding: 18px 20px;
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: keep-all;
  color: var(--color-text-muted);
  background: var(--color-chip);
}
.post__cover::before {
  content: "";
  position: absolute;
  top: -0.24em;
  right: 0.06em;
  font-size: 7.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: currentColor;
  opacity: 0.14;
  pointer-events: none;
}
.post__cover::after {
  content: "";
  position: absolute;
  top: -42px;
  left: -36px;
  width: 132px;
  height: 132px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: 0.09;
  pointer-events: none;
}
.post__cover--gmail    { color: #b3261e; background: #fdecec; }
.post__cover--calendar { color: #1a73e8; background: #e8f0fe; }
.post__cover--drive    { color: #188038; background: #e7f4ea; }
.post__cover--meet     { color: #b06000; background: #fdf1dc; }
.post__cover--chat     { color: #188038; background: #e7f4ea; }
.post__cover--docs     { color: #1a73e8; background: #e8f0fe; }
.post__cover--sheets   { color: #188038; background: #e7f4ea; }
.post__cover--slides   { color: #b06000; background: #fdf1dc; }
.post__cover--gemini   { color: #8430ce; background: #f3e9fc; }
.post__cover--other    { color: #5c6470; background: #f1f3f4; }
.post__cover--gmail::before    { content: "G"; }
.post__cover--calendar::before { content: "C"; }
.post__cover--drive::before    { content: "D"; }
.post__cover--meet::before     { content: "M"; }
.post__cover--chat::before     { content: "C"; }
.post__cover--docs::before     { content: "D"; }
.post__cover--sheets::before   { content: "S"; }
.post__cover--slides::before   { content: "S"; }
.post__cover--gemini::before   { content: "G"; }
.post__cover--other::before    { content: "W"; }

.post__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding-top: 14px;
}
.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-chip);
  padding: 3px 8px;
  border-radius: 6px;
}
.chip--imp-critical  { color: #b3261e; background: #fdecec; }
.chip--imp-important { color: #8a5200; background: #fbeedd; }
.chip--imp-tip       { color: #1e7e34; background: #e7f4ea; }

.post__title {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 680;
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--color-text);
  word-break: keep-all;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}
.post__link:hover .post__title { color: var(--color-accent); }

.post__desc {
  margin: 0 0 14px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 제목/요약 길이가 달라도 날짜는 카드 아래쪽에 정렬 */
.post__date {
  margin-top: auto;
  padding-top: 2px;
  font-size: 0.78rem;
  color: var(--color-text-soft);
}

/* ---------- (관리자 편집 화면의 간이 미리보기에서 재사용되는 카드 스타일) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 64px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
}
.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.card__date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.card__title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  line-height: 1.45;
}
.card__desc {
  margin: 0 0 16px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.tag {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  background: var(--color-chip);
  padding: 3px 9px;
  border-radius: 6px;
}
.cards__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: 40px 0;
}

/* ---------- 푸터 (가벼운 블로그형) ---------- */
.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--color-divider);
  padding: 40px 0 60px;
  color: var(--color-text-soft);
  font-size: 0.83rem;
}
.site-footer p { margin: 3px 0; }
.site-footer__muted { opacity: 0.8; }

/* =========================================================
   상세 페이지 (블로그 포스트형)
   ========================================================= */
.detail {
  max-width: var(--reading);
  margin: 0 auto;
  padding: 48px 0 96px;
}
.detail__back a {
  font-size: 0.88rem;
  color: var(--color-text-soft);
  text-decoration: none;
}
.detail__back a:hover { color: var(--color-accent); text-decoration: underline; }
.detail__back--bottom { margin-top: 56px; }

.detail__head {
  margin: 18px 0 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--color-border);
}
.detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.badge--imp { color: var(--color-text-muted); background: var(--color-chip); }
.badge--imp-critical  { color: #b3261e; background: #fdecec; }
.badge--imp-important { color: #8a5200; background: #fbeedd; }
.badge--imp-normal    { color: var(--color-accent); background: var(--color-accent-soft); }
.badge--imp-tip       { color: #1e7e34; background: #e7f4ea; }

.detail__title {
  margin: 0 0 16px;
  font-size: 2.15rem;
  font-weight: 680;
  line-height: 1.26;
  letter-spacing: -0.015em;
  /* 한글 단어/조사가 중간에서 끊기지 않도록. 긴 영문/URL은 그래도 줄바꿈되게 */
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.detail__summary {
  margin: 0 0 24px;
  font-size: 1.16rem;
  line-height: 1.66;
  color: var(--color-text-muted);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 22px;
  margin: 0;
}
.detail__meta div { display: flex; align-items: baseline; gap: 6px; }
.detail__meta dt { color: var(--color-text-soft); font-size: 0.82rem; }
.detail__meta dd { margin: 0; font-size: 0.86rem; font-weight: 500; color: var(--color-text-muted); }

.detail__section { margin: 40px 0; }
.detail__section + .detail__section { margin-top: 40px; }
.detail__h2 {
  margin: 0 0 14px;
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.detail__tip .detail__h2,
.detail__callout .detail__h2 { margin-bottom: 12px; }
.detail__prose {
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.85;
  font-size: 1.02rem;
  color: var(--color-text);
}
.detail__muted { color: var(--color-text-muted); }

/* 본문 이미지/영상 + 캡션 — 넓게, 얇은 radius, 앞뒤 여백 충분히 */
.detail__figure {
  margin: 34px 0;
}
.detail__figure img,
.detail__figure video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}
.detail__figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-soft);
}
/* 대표 이미지: 제목/요약 블록 바로 아래 */
.detail__hero {
  margin: 8px 0 12px;
}
/* 본문 텍스트 없이 이미지만 있는 섹션: 제목 바로 아래 이미지 간격 정리 */
.detail__h2 + .detail__figure {
  margin-top: 14px;
}

/* "우리 회사에서는?" — editorial callout (박스보다 왼쪽 강조선 중심) */
.detail__callout {
  background: #f5f8ff;
  border: 0;
  border-left: 3px solid var(--color-accent);
  border-radius: 4px;
  padding: 22px 26px;
  margin-left: -4px;
}
.detail__callout .detail__h2 { color: var(--color-accent); }
.detail__callout .detail__prose { line-height: 1.8; }

/* "이렇게 활용해 보세요" — 부드러운 배경 + 여백 (테두리 없음) */
.detail__tip {
  background: #fdfaf0;
  border: 0;
  border-radius: 10px;
  padding: 24px 26px;
}
.detail__tip .detail__h2 { color: #9a6b00; }
.detail__tip .detail__prose { line-height: 1.8; }

/* 적용 정보 — 박스 대신 얇은 divider 위의 정의 목록 */
.detail__info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px 24px;
  margin: 0;
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid var(--color-divider);
  border-radius: 0;
}
.detail__info div { display: contents; }
.detail__info dt { color: var(--color-text-soft); font-size: 0.88rem; }
.detail__info dd { margin: 0; font-size: 0.9rem; }

/* 본문 하단 YouTube 플레이어 — 16:9 responsive (참고문구 바로 앞) */
.detail__video { margin: 34px 0; }
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.video-embed__frame,
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
@supports not (aspect-ratio: 16 / 9) {
  .video-embed { height: 0; padding-bottom: 56.25%; }
}

.detail__source { margin: 36px 0 0; }
.detail__source a { color: var(--color-accent); font-weight: 600; text-decoration: none; }
.detail__source a:hover { text-decoration: underline; }

.detail-missing {
  max-width: 560px;
  margin: 0 auto;
  padding: 88px 0;
  text-align: center;
}
.detail-missing h1 { font-size: 1.5rem; margin: 0 0 12px; }
.detail-missing p { color: var(--color-text-muted); }
.detail-missing .detail__back { margin-top: 24px; }

/* 상세/에러 페이지에서는 푸터 내부 폭을 본문과 맞춘다 */
body:has(.detail) .site-footer .container,
body:has(.detail-missing) .site-footer .container {
  max-width: var(--reading);
}

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 900px) {
  .feed {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 24px;
  }
  .hero { min-height: 150px; }
  .hero__title { font-size: 2.1rem; }
  .hero::after { font-size: 7rem; }
}

@media (max-width: 600px) {
  .container { padding: 0 18px; }

  .brand { font-size: 0.95rem; }

  /* 모바일: 고정 최소높이 해제 → 콘텐츠 기준 자동 높이 (잘림/겹침 방지).
     좁은 폭에서는 설명 줄바꿈(<br>)을 유지해 우측이 잘리지 않게 한다. */
  .hero { min-height: 0; padding: 22px 0; }
  .hero__title { font-size: 1.7rem; }
  .hero__desc { font-size: 1rem; }
  .hero::after { display: none; }

  .tabs { margin-top: 22px; margin-bottom: 32px; }
  .tabs__list { gap: 20px; }

  .feed {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 64px;
  }
  .post__title { font-size: 1.1rem; }

  .detail { padding: 30px 0 64px; }
  .detail__head { margin: 14px 0 32px; padding-bottom: 24px; }
  .detail__title { font-size: 1.56rem; }
  .detail__summary { font-size: 1.06rem; }
  .detail__section { margin: 32px 0; }
  .detail__section + .detail__section { margin-top: 32px; }
  .detail__prose { line-height: 1.78; }
  .detail__callout { padding: 20px 20px; margin-left: 0; }
  .detail__tip { padding: 20px 20px; }
  .detail__info { grid-template-columns: 1fr; gap: 4px 0; }
  .detail__info div { display: block; margin-bottom: 12px; }
}
