/* MIR Cloud Blog — Layout & Components */

/* ── Navigation ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-xl);
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 700; color: var(--color-primary);
  letter-spacing: -0.02em;
}
.site-logo img { height: 32px; width: auto; }
.site-logo .slogan {
  font-size: .7rem; font-weight: 400; color: var(--color-text-muted);
  display: block; margin-top: -2px; letter-spacing: 0;
}

.primary-nav { display: flex; align-items: center; gap: var(--space-lg); }
.primary-nav a {
  font-size: .9rem; font-weight: 500; color: var(--color-text-muted);
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.primary-nav a:hover, .primary-nav a.current { color: var(--color-primary); border-color: var(--color-primary); }

.nav-home-link {
  font-size: .85rem; font-weight: 500;
  padding: 6px 14px;
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  transition: background var(--transition), color var(--transition);
}
.nav-home-link:hover { background: var(--color-primary); color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column; gap: 5px; padding: 4px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--color-text); border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    display: none; position: absolute; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-xl);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: var(--space-sm) 0; border-bottom: none; border-top: 1px solid var(--color-border); }
  .primary-nav a:first-child { border-top: none; }
}

/* ── Hero Banner ── */
.blog-hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 60%, var(--color-accent) 100%);
  padding: var(--space-3xl) 0;
  color: #fff; text-align: center;
}
.blog-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.03em; }
.blog-hero p { font-size: 1rem; opacity: .8; margin-top: var(--space-sm); }

/* ── Category Filter ── */
.category-filter {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: var(--nav-height); z-index: 90;
}
.category-filter .container {
  display: flex; gap: var(--space-sm); overflow-x: auto;
  padding-top: var(--space-md); padding-bottom: var(--space-md);
  scrollbar-width: none;
}
.category-filter::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  font-size: .82rem; font-weight: 500;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-muted);
  background: transparent;
  transition: all var(--transition);
}
.cat-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.cat-btn.active {
  background: var(--color-primary); border-color: var(--color-primary);
  color: #fff;
}

/* ── Main Layout ── */
.blog-main {
  padding: var(--space-3xl) 0;
}
.blog-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-2xl);
  align-items: start;
}
@media (max-width: 1024px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
}
@media (max-width: 640px) {
  .blog-sidebar { grid-template-columns: 1fr; }
}

/* ── Post Grid ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

/* ── Post Card ── */
.post-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.post-card__thumb {
  aspect-ratio: 16/9; overflow: hidden; background: var(--color-surface-2);
}
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.05); }
.post-card__thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-light); font-size: 2rem;
}

.post-card__body { padding: var(--space-lg); }

.post-card__cat {
  display: inline-block;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 100px;
  color: #fff; margin-bottom: var(--space-sm);
}

.post-card__title {
  font-size: 1rem; font-weight: 700; line-height: 1.4;
  color: var(--color-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: var(--space-sm);
  transition: color var(--transition);
}
.post-card:hover .post-card__title { color: var(--color-primary); }

.post-card__excerpt {
  font-size: .875rem; color: var(--color-text-muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: var(--space-md);
}

.post-card__meta {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: .78rem; color: var(--color-text-light);
  border-top: 1px solid var(--color-border); padding-top: var(--space-md); margin-top: auto;
}
.post-card__meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--color-border); }

/* ── Featured Post ── */
.post-card--featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr 1fr;
}
.post-card--featured .post-card__thumb { aspect-ratio: auto; }
.post-card--featured .post-card__title { font-size: 1.3rem; -webkit-line-clamp: 3; }
@media (max-width: 640px) {
  .post-card--featured { grid-template-columns: 1fr; }
}

/* ── Pagination ── */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: var(--space-sm);
  margin-top: var(--space-2xl);
}
.pagination a, .pagination span {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500;
  border: 1.5px solid var(--color-border); color: var(--color-text-muted);
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination .current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ── Sidebar ── */
.sidebar-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.sidebar-widget h3 {
  font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--color-text-muted); margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm); border-bottom: 1px solid var(--color-border);
}
.sidebar-cats li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-sm) 0;
  font-size: .875rem; color: var(--color-text-muted);
  border-bottom: 1px dashed var(--color-border);
  transition: color var(--transition);
}
.sidebar-cats li:last-child a { border-bottom: none; }
.sidebar-cats li a:hover { color: var(--color-primary); }
.sidebar-cats .count {
  font-size: .75rem; font-weight: 600;
  background: var(--color-surface-2); padding: 2px 8px; border-radius: 100px;
}

.recent-post-item {
  display: flex; gap: var(--space-md); align-items: flex-start;
  padding: var(--space-sm) 0; border-bottom: 1px dashed var(--color-border);
}
.recent-post-item:last-child { border-bottom: none; }
.recent-post-thumb { width: 60px; height: 45px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--color-surface-2); }
.recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-post-title { font-size: .82rem; line-height: 1.4; color: var(--color-text); transition: color var(--transition); }
.recent-post-item a:hover .recent-post-title { color: var(--color-primary); }
.recent-post-date { font-size: .72rem; color: var(--color-text-light); margin-top: 4px; }

/* ── Footer ── */
.site-footer {
  background: #111827; color: #94A3B8;
  padding: var(--space-2xl) 0;
  font-size: .875rem;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-lg);
  flex-wrap: wrap;
}
.footer-brand { color: #fff; font-weight: 700; font-size: 1rem; }
.footer-links { display: flex; gap: var(--space-lg); }
.footer-links a { color: #94A3B8; transition: color var(--transition); }
.footer-links a:hover { color: #fff; }
.footer-copy { width: 100%; text-align: center; margin-top: var(--space-md); color: #4B5563; font-size: .8rem; }

/* ── Search ── */
.search-form {
  display: flex; gap: var(--space-sm); margin-bottom: var(--space-md);
}
.search-form input {
  flex: 1; padding: 8px 14px; border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: .875rem;
  transition: border-color var(--transition);
}
.search-form input:focus { outline: none; border-color: var(--color-primary); }
.search-form button {
  padding: 8px 16px; background: var(--color-primary); color: #fff;
  border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500;
  transition: background var(--transition);
}
.search-form button:hover { background: var(--color-primary-dark); }

/* ── No posts ── */
.no-posts {
  grid-column: 1/-1; text-align: center;
  padding: var(--space-3xl) 0; color: var(--color-text-muted);
}
.no-posts h2 { font-size: 1.5rem; margin-bottom: var(--space-sm); }

/* featured 카드 본문 표시 수정 */
.post-card--featured .post-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl);
}
.post-card--featured .post-card__thumb {
  min-height: 280px;
}

/* ── 회사 홈페이지 버튼 (솔리드 컬러) ── */
.nav-home-link {
  font-size: .85rem; font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff !important;
  border: none;
  box-shadow: 0 2px 8px rgba(30,64,175,.35);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.nav-home-link:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 4px 14px rgba(30,64,175,.45);
  transform: translateY(-1px);
}

/* ── Blog Hero 개선 ── */
.blog-hero {
  position: relative; overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,.07) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.05) 0%, transparent 40%),
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(255,255,255,.03) 40px, rgba(255,255,255,.03) 80px);
  pointer-events: none;
}
.blog-hero::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 40px;
  background: var(--color-bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.blog-hero .container { position: relative; z-index: 1; }
.blog-hero h1 { text-shadow: 0 2px 16px rgba(0,0,0,.2); }

/* ── Category Hero 공통 ── */
.category-hero {
  position: relative; overflow: hidden;
  padding: var(--space-2xl) 0 calc(var(--space-2xl) + 20px);
  color: #fff; text-align: center;
}
.category-hero::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 40px;
  background: var(--color-bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.category-hero .container { position: relative; z-index: 1; }
.category-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.category-hero p { font-size: .95rem; opacity: .85; margin-top: 6px; }

/* product — 파란 계열 + 육각 패턴 */
.category-hero--product {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 70%, #3B82F6 100%);
}
.category-hero--product::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 75% 30%, rgba(96,165,250,.25) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5L55 20v30L30 55 5 50V20z' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: auto, 60px 60px;
  pointer-events: none;
}

/* service — 초록 계열 + 물결 패턴 */
.category-hero--service {
  background: linear-gradient(135deg, #064E3B 0%, #059669 70%, #10B981 100%);
}
.category-hero--service::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 25% 60%, rgba(52,211,153,.2) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='80' height='40' viewBox='0 0 80 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20 Q20 0 40 20 Q60 40 80 20' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: auto, 80px 40px;
  pointer-events: none;
}

/* tech — 보라 계열 + 그리드 패턴 */
.category-hero--tech {
  background: linear-gradient(135deg, #3B0764 0%, #7C3AED 70%, #A78BFA 100%);
}
.category-hero--tech::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 60% 40%, rgba(167,139,250,.2) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='0' width='40' height='40' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3Ccircle cx='20' cy='20' r='2' fill='rgba(255,255,255,0.08)'/%3E%3C/svg%3E");
  background-size: auto, 40px 40px;
  pointer-events: none;
}

/* marketing — 주황 계열 + 대각선 패턴 */
.category-hero--marketing {
  background: linear-gradient(135deg, #92400E 0%, #D97706 70%, #FBBF24 100%);
}
.category-hero--marketing::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(251,191,36,.25) 0%, transparent 45%),
    repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(255,255,255,.04) 20px, rgba(255,255,255,.04) 21px);
  pointer-events: none;
}

/* notice — 회색 계열 + 점 패턴 */
.category-hero--notice {
  background: linear-gradient(135deg, #1F2937 0%, #374151 70%, #6B7280 100%);
}
.category-hero--notice::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 30% 50%, rgba(156,163,175,.15) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='15' cy='15' r='1.5' fill='rgba(255,255,255,0.08)'/%3E%3C/svg%3E");
  background-size: auto, 30px 30px;
  pointer-events: none;
}

/* default fallback */
.category-hero--default {
  background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
}
.category-hero--default::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 70% 40%, rgba(255,255,255,.1) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Featured 카드 썸네일 높이 제한 ── */
.post-card--featured .post-card__thumb {
  min-height: 240px;
  max-height: 300px;
}
.post-card--featured .post-card__thumb img,
.post-card--featured .post-card__thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Post Card 썸네일 링크 블록화 ── */
.post-card__thumb {
  display: block;
}
.post-card__thumb img,
.post-card__thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
