@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --background: #FFFFFF;
  --foreground: #1A1A1A;
  --primary: #0000FF;
  --primary-foreground: #FFFFFF;
  --secondary: #F5F5F5;
  --muted-foreground: #666666;
  --border: #E5E5E5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
}

code, pre {
  font-family: 'Inconsolata', monospace;
}

/* ===== Skip Link ===== */
.skip {
  position: absolute;
  top: -9999px;
  left: -9999px;
}

/* ===== Header ===== */
.site-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .site-header {
    padding: 1.5rem 2rem;
  }
  .header-top {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
  }
}

.header-logo-link {
  text-decoration: none;
  color: inherit;
}

.header-logo-label {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 400;
}

.header-logo-subtitle {
  margin-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

@media (min-width: 768px) {
  .header-logo-subtitle {
    font-size: 1.875rem;
  }
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
}

/* 검색 */
.search-box {
  position: relative;
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
  pointer-events: none;
}

.search-input {
  width: 12rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

.search-input:focus {
  border-bottom-color: var(--foreground);
}

@media (min-width: 768px) {
  .search-input {
    width: 16rem;
  }
}

/* 네비게이션 */
.nav-menu {
  display: none;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }
}

.nav-link {
  text-decoration: none;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--foreground);
}

/* 버튼 */
.btn-primary {
  background-color: var(--foreground);
  color: var(--background);
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}

.btn-primary:hover {
  opacity: 0.8;
  color: var(--background);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  border: 1px solid var(--foreground);
  background-color: var(--foreground);
  color: var(--background);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: gap 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  gap: 1rem;
  color: var(--background);
}

.arrow-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* 유저 아바타 + 드롭다운 메뉴 */
.header-user {
  position: relative;
  display: flex;
  align-items: center;
}

.user-avatar-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar--default {
  background-color: var(--secondary);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50%;
}

.user-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 12rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  display: none;
  z-index: 50;
}

.header-user.is-open .user-menu {
  display: block;
}

.user-menu-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}

.user-menu-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.user-menu-id {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.125rem;
}

.user-menu-item {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--foreground);
  text-decoration: none;
  transition: background-color 0.15s;
}

.user-menu-item:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.user-menu-divider {
  height: 1px;
  background-color: var(--border);
  margin: 0.25rem 0;
}

.user-menu-item--danger {
  color: var(--muted-foreground);
}

.user-menu-item--danger:hover {
  background-color: var(--foreground);
  color: var(--background);
}

/* 실시간 상태바 */
.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-family: 'Inconsolata', monospace;
  margin-top: 0.75rem;
}

.status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--muted-foreground);
  flex-shrink: 0;
}

/* ===== Hero ===== */
.hero {
  border-bottom: 1px solid var(--border);
  display: grid;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 2rem;
}

/* 모바일에서 Hero 좌측 컬럼 우측 정렬 */
@media (max-width: 767.98px) {
  .hero-left {
    text-align: right;
  }
  .hero-left .hero-text {
    margin-left: auto;
  }
}

@media (min-width: 768px) {
  .hero-left {
    border-right: 1px solid var(--border);
    border-bottom: none;
    padding: 3rem;
  }
}

.hero-label {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.hero-headline {
  margin-top: 1.5rem;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .hero-headline {
    font-size: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-headline {
    font-size: 3.5rem;
  }
}

.hero-headline strong {
  font-weight: 500;
}

.hero-description {
  margin-top: 3rem;
}

.hero-text {
  max-width: 28rem;
  color: var(--muted-foreground);
}

.hero-right {
  display: flex;
  flex-direction: column;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  border-right: 1px solid var(--border);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .stat-item {
    padding: 2rem;
  }
}

.stat-item:last-child {
  border-right: none;
}

.stat-value {
  font-family: 'Inconsolata', monospace;
  font-size: 1.875rem;
}

@media (min-width: 768px) {
  .stat-value {
    font-size: 2.25rem;
  }
}

.stat-label {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
}

.quote-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  flex: 1;
}

.quote-link {
  color: inherit;
  text-decoration: none;
  display: block;
  transition: opacity 0.2s ease;
}

.quote-link:hover {
  opacity: 0.75;
}

@media (min-width: 768px) {
  .quote-section {
    padding: 3rem;
  }
}

.quote {
  font-size: 1.125rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .quote {
    font-size: 1.25rem;
  }
}

.author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.author-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--secondary);
  flex-shrink: 0;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.author-role {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ===== Main ===== */
#content {
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  #content {
    padding-left: 5%;
    padding-right: 5%;
  }
}

/* ===== Content Area ===== */
.content-area {
  min-height: 40vh;
}

/* ===== Footer ===== */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
}

@media (min-width: 768px) {
  .site-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
  }
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-logo {
  font-family: 'Inconsolata', monospace;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.footer-logo-img {
  height: 2rem;
  width: auto;
}

.footer-tagline {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-right a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-right a:hover {
  color: var(--foreground);
}

/* ===== Section Header (공통) ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

@media (min-width: 768px) {
  .section-header {
    padding: 1rem 2rem;
  }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title h2 {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 400;
}

.section-dot {
  width: 0.375rem;
  height: 0.375rem;
  background-color: var(--muted-foreground);
  border-radius: 50%;
}

.section-subtitle {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.view-all-btn:hover {
  color: var(--foreground);
}

.stat-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-icon {
  width: 1rem;
  height: 1rem;
}

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

/* ===== Featured Section ===== */
.featured-grid {
  display: grid;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .featured-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.featured-card {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
  display: block;
  color: inherit;
  text-decoration: none;
}

.featured-badge-only {
  margin-bottom: 1rem;
}

.category-badge--inline {
  position: static;
  display: inline-block;
}

@media (min-width: 768px) {
  .featured-card {
    padding: 2rem;
    border-bottom: none;
  }
  .featured-card:nth-child(-n+2) {
    border-right: 1px solid var(--border);
  }
}

.featured-card:hover {
  background-color: var(--secondary);
}

.featured-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--secondary);
  margin-bottom: 1.5rem;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.featured-card:hover .featured-image img {
  transform: scale(1.05);
}

.category-badge {
  position: absolute;
  left: 0;
  top: 0;
  background-color: var(--foreground);
  color: var(--background);
  padding: 0.25rem 0.5rem;
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
}

.featured-title {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
  transition: color 0.2s;
}

@media (min-width: 768px) {
  .featured-title {
    font-size: 1.25rem;
  }
}

.featured-card:hover .featured-title {
  color: var(--foreground);
}

.featured-excerpt {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.featured-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.featured-author-avatar {
  width: 2rem;
  height: 2rem;
  background-color: var(--secondary);
  flex-shrink: 0;
}

.featured-author-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.featured-author-role {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.featured-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ===== Community Section ===== */
.community-section {
  border-bottom: 1px solid var(--border);
}

.category-tabs {
  position: relative;
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
}

.category-tabs-indicator {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--foreground);
  transform: translateX(0);
  transition: transform 280ms cubic-bezier(.4,0,.2,1), width 280ms cubic-bezier(.4,0,.2,1);
  pointer-events: none;
  will-change: transform, width;
}
@media (prefers-reduced-motion: reduce) {
  .category-tabs-indicator {
    transition: none;
  }
}
.category-tabs-indicator.is-ready {
  opacity: 1;
}
.category-tabs-indicator:not(.is-ready) {
  opacity: 0;
}

@media (min-width: 768px) {
  .category-tabs {
    padding: 0 2rem;
  }
}

.category-tab {
  padding: 1rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  transition: color 200ms cubic-bezier(.4,0,.2,1);
}

.category-tab:hover {
  color: var(--foreground);
}

.category-tab.active {
  color: var(--foreground);
}

.category-more {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  height: 30px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  color: var(--background);
  background: var(--foreground);
  border: 1px solid var(--foreground);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.4,0,.2,1),
              box-shadow 180ms cubic-bezier(.4,0,.2,1),
              background-color 180ms cubic-bezier(.4,0,.2,1),
              opacity 180ms cubic-bezier(.4,0,.2,1);
}
.category-more svg {
  transition: transform 180ms cubic-bezier(.4,0,.2,1);
}
.category-more:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(0,0,0,.35);
  opacity: .92;
}
.category-more:hover svg {
  transform: translateX(2px);
}
.category-more:active {
  transform: translateY(0);
  transition-duration: 100ms;
}
.category-more:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,0,0,.18);
}
.category-more[hidden] {
  display: none;
}
@media (hover: none) {
  .category-more:hover {
    transform: none;
    box-shadow: none;
    opacity: 1;
  }
  .category-more:hover svg {
    transform: none;
  }
}

.posts-list {
  display: flex;
  flex-direction: column;
}

/* 탭 전환 애니메이션: 카드 등장(stagger) — 데스크탑에서만 */
@media (min-width: 768px) {
  .post-item {
    opacity: 1;
    transform: translateY(0);
  }
  .post-item.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 160ms ease-out, transform 160ms ease-out;
    pointer-events: none;
  }
  .post-item.is-entering {
    opacity: 0;
    transform: translateY(8px);
  }
  .post-item.is-entered {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 320ms cubic-bezier(.4,0,.2,1),
                transform 320ms cubic-bezier(.4,0,.2,1);
  }
}
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .post-item.is-leaving,
  .post-item.is-entering,
  .post-item.is-entered {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

.post-item {
  position: relative;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  background-color: var(--background);
  transition: background-color 0.2s;
}

@media (min-width: 768px) {
  .post-item {
    padding: 1.5rem 2rem;
    transition: transform 220ms cubic-bezier(.4,0,.2,1),
                box-shadow 220ms cubic-bezier(.4,0,.2,1),
                background-color 220ms cubic-bezier(.4,0,.2,1),
                border-color 220ms cubic-bezier(.4,0,.2,1);
    will-change: transform;
  }

  .post-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--foreground);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 220ms cubic-bezier(.4,0,.2,1);
  }

  .post-item:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.18),
                0 2px 6px -2px rgba(0, 0, 0, 0.06);
    border-bottom-color: transparent;
    z-index: 1;
  }

  .post-item:hover::before {
    transform: scaleY(1);
  }

  .post-item:active {
    transform: translateY(0);
    transition-duration: 120ms;
  }
}

@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .post-item,
  .post-item::before {
    transition: none;
  }
  .post-item:hover {
    transform: none;
  }
}

/* 터치 기기에서는 hover 효과 비활성화 (호버 stuck 방지) */
@media (hover: none) {
  .post-item:hover {
    background-color: var(--background);
    transform: none;
    box-shadow: none;
    border-bottom-color: var(--border);
    z-index: auto;
  }
  .post-item:hover::before {
    transform: scaleY(0);
  }
}

.post-content {
  flex: 1;
  min-width: 0;
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-content:hover .post-title {
  text-decoration: underline;
}

.post-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--foreground);
  color: var(--background);
}

.post-badge--new {
  background-color: var(--background);
  color: var(--foreground);
  border: 1px solid var(--foreground);
  padding: calc(0.25rem - 1px) calc(0.5rem - 1px);
}

.post-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.post-title-link {
  color: inherit;
  text-decoration: none;
}

.post-title-link:hover {
  text-decoration: underline;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-family: 'Inconsolata', monospace;
}

.post-side {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}

/* ===== Magazine Section ===== */
.magazine-grid {
  display: grid;
}

@media (min-width: 1024px) {
  .magazine-grid {
    grid-template-columns: 3fr 1fr;
  }
}

.magazine-featured {
  display: grid;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .magazine-featured {
    grid-template-columns: repeat(3, 1fr);
    border-bottom: none;
  }
}

@media (min-width: 1024px) {
  .magazine-featured {
    border-right: 1px solid var(--border);
    border-bottom: none;
  }
}

.magazine-card {
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

/* 카드/퀵리드가 <a>일 때 기본 링크 스타일 제거 */
a.magazine-card,
a.quick-read-item {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.magazine-card .magazine-title,
a.quick-read-item .quick-read-title {
  transition: color 0.2s;
}

a.magazine-card:hover .magazine-title,
a.quick-read-item:hover .quick-read-title {
  color: var(--foreground);
}

@media (min-width: 768px) {
  .magazine-card {
    border-right: 1px solid var(--border);
    border-bottom: none;
  }
  .magazine-card:nth-child(3n) {
    border-right: none;
  }
}

@media (min-width: 1024px) {
  .magazine-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.magazine-card:last-child {
  border-right: none;
  border-bottom: none;
}

.magazine-image {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background-color: var(--secondary);
}

.magazine-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.magazine-card:hover .magazine-image img {
  transform: scale(1.05);
}

.magazine-content {
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .magazine-content {
    padding: 2rem;
  }
}

.magazine-issue {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.magazine-title {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .magazine-title {
    font-size: 1.25rem;
  }
}

.magazine-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.magazine-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  display: none;
}

@media (min-width: 768px) {
  .magazine-description {
    display: block;
  }
}

.magazine-read-time {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 1rem;
}

.quick-reads {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .quick-reads {
    border-bottom: none;
  }
}

.quick-read-item {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.2s;
}

@media (min-width: 768px) {
  .quick-read-item {
    padding: 2rem;
  }
}

.quick-read-item:last-child {
  border-bottom: none;
}

.quick-read-item:hover {
  background-color: var(--secondary);
}

.quick-read-category {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.quick-read-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.quick-read-time {
  font-family: 'Inconsolata', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* =========================================================
 * Member 모듈 스킨(default)을 ds_comm 톤으로 덮어쓰기.
 * member 스킨 파일은 손대지 않고 클래스 매핑으로만 처리.
 * ========================================================= */
.xm {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 0;
  color: var(--foreground);
}
.xm h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.xm h2, .xm h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 8px;
}
.xm > p {
  margin: 0 0 12px;
  color: var(--muted-foreground);
  font-size: 14px;
}

/* 탭 (nav-tabs) */
.xm .nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.xm .nav-tabs > li { margin: 0; }
.xm .nav-tabs > li > a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px 8px 0 0;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s ease, background-color .15s ease;
}
.xm .nav-tabs > li > a:hover {
  background: var(--secondary);
  color: var(--foreground);
}
.xm .nav-tabs > li.active > a {
  background: var(--foreground);
  color: var(--background);
  font-weight: 600;
}

/* 정의 리스트 (회원정보 보기)
 * member.css의 float/white-space 규칙을 덮기 위해 셀렉터를 강화하고
 * float/whitespace를 명시적으로 해제한다.
 */
body .xm dl.dl-horizontal {
  display: grid !important;
  grid-template-columns: 140px minmax(0, 1fr) !important;
  column-gap: 16px;
  row-gap: 12px;
  margin: 0 0 24px;
  padding: 16px 20px;
  background: var(--secondary);
  border-radius: 12px;
}
body .xm dl.dl-horizontal::before,
body .xm dl.dl-horizontal::after {
  content: none !important;
  display: none !important;
}
body .xm dl.dl-horizontal > dt,
body .xm dl.dl-horizontal dt {
  grid-column: 1 !important;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: right;
  align-self: center;
  line-height: 1.4;
}
body .xm dl.dl-horizontal dt em {
  color: #ef4444;
  font-style: normal;
  margin-right: 2px;
}
body .xm dl.dl-horizontal > dd,
body .xm dl.dl-horizontal dd {
  grid-column: 2 !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 14px;
  color: var(--foreground);
  align-self: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  line-height: 1.4;
}

/* 720px 이하에서 라벨이 위로 */
@media (max-width: 720px) {
  body .xm dl.dl-horizontal {
    grid-template-columns: 1fr !important;
    row-gap: 4px;
  }
  body .xm dl.dl-horizontal > dt,
  body .xm dl.dl-horizontal dt {
    grid-column: 1 !important;
    text-align: left;
    padding-top: 8px !important;
  }
  body .xm dl.dl-horizontal > dd,
  body .xm dl.dl-horizontal dd {
    grid-column: 1 !important;
  }
}

/* 폼 (control-group)
 * member.css가 .control-label과 .controls를 float로 잡고
 * 가상요소(:before/:after)로 clearfix를 걸어두기 때문에 우선순위 강화 필요.
 */
body .xm .form-horizontal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body .xm .form-horizontal .control-group {
  display: grid !important;
  grid-template-columns: 140px minmax(0, 1fr) !important;
  gap: 8px 16px !important;
  align-items: start;
  margin-bottom: 0 !important;
}
body .xm .form-horizontal .control-group::before,
body .xm .form-horizontal .control-group::after {
  content: none !important;
  display: none !important;
}
body .xm .form-horizontal .control-label {
  grid-column: 1 !important;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 8px 0 0 !important;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground);
  line-height: 1.4;
}
body .xm .form-horizontal .control-label em {
  color: #ef4444;
  font-style: normal;
  margin-right: 2px;
}
body .xm .form-horizontal .controls {
  grid-column: 2 !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
body .xm .form-horizontal .controls:first-child {
  padding-left: 0 !important;
}
body .xm .form-horizontal .help-inline,
body .xm .form-horizontal .help-block {
  font-size: 12px;
  color: var(--muted-foreground);
  margin: 0;
}

/* 폼 입력 요소 — 모양/높이/라운드만 강제. 폭은 컨텍스트별로 결정.
 * member.css의 width:206px / height:20px / inset box-shadow 무력화.
 */
body .xm input[type="text"],
body .xm input[type="email"],
body .xm input[type="tel"],
body .xm input[type="url"],
body .xm input[type="password"],
body .xm input[type="number"],
body .xm input[type="search"],
body .xm input[type="date"],
body .xm input[type="datetime"],
body .xm input[type="datetime-local"],
body .xm input[type="month"],
body .xm input[type="time"],
body .xm input[type="week"],
body .xm input[type="color"],
body .xm select,
body .xm textarea {
  max-width: 100%;
  height: 40px !important;
  line-height: 20px !important;
  padding: 0 12px !important;
  margin: 0 0 8px !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  font-size: 14px;
  font-family: inherit;
  box-shadow: none !important;
  vertical-align: middle;
}

/* 풀폭이 자연스러운 컨테이너 안에서만 width 100% */
body .xm .form-horizontal .controls > input[type="text"],
body .xm .form-horizontal .controls > input[type="email"],
body .xm .form-horizontal .controls > input[type="password"],
body .xm .form-horizontal .controls > input[type="url"],
body .xm .form-horizontal .controls > input[type="tel"],
body .xm .form-horizontal .controls > input[type="number"],
body .xm .form-horizontal .controls > select,
body .xm .form-horizontal .controls > textarea,
body .xm .input-append > input,
body .xm .input-append > select,
body .xm .input-prepend > input,
body .xm .input-prepend > select,
body .xm .login-body input[type="text"],
body .xm .login-body input[type="password"],
body .xm .login-body input[type="email"] {
  width: 100% !important;
}
body .xm textarea {
  height: auto !important;
  min-height: 120px;
  padding: 10px 12px !important;
  line-height: 1.5 !important;
}
body .xm input[type="text"]:focus,
body .xm input[type="email"]:focus,
body .xm input[type="password"]:focus,
body .xm input[type="search"]:focus,
body .xm input[type="number"]:focus,
body .xm input[type="tel"]:focus,
body .xm input[type="url"]:focus,
body .xm select:focus,
body .xm textarea:focus {
  outline: 2px solid var(--foreground) !important;
  outline-offset: -1px;
  border-color: var(--foreground) !important;
  box-shadow: none !important;
}
body .xm input[type="radio"],
body .xm input[type="checkbox"] {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
}
body .xm input[type="file"] {
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
/* form / span.input-append 같은 inline 컨테이너 폭 잡기 */
body .xm form {
  display: block;
  width: 100%;
}

/* input-append / input-prepend (인풋 + 버튼 한 줄 묶음) */
body .xm .input-append,
body .xm .input-prepend {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: inherit !important;
  white-space: normal !important;
  margin: 0 0 12px !important;
  width: 100% !important;
  max-width: 100%;
}
body .xm .input-append input,
body .xm .input-prepend input,
body .xm .input-append select,
body .xm .input-prepend select {
  flex: 1 1 240px !important;
  width: auto !important;
  min-width: 0 !important;
  border-radius: 8px !important;
  margin: 0 !important;
}
body .xm .input-append .btn,
body .xm .input-prepend .btn,
body .xm .input-append input[type="submit"],
body .xm .input-prepend input[type="submit"] {
  flex: 0 0 auto;
  border-radius: 8px !important;
  margin: 0 !important;
}

/* 라디오 / 체크박스 정렬 */
.xm .controls label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  margin-right: 12px;
}
.xm .controls input[type="radio"],
.xm .controls input[type="checkbox"] {
  margin: 0;
}

/* 버튼 */
body .xm .btn,
body .xm input[type="submit"],
body .xm input[type="button"],
body .xm button[type="submit"],
body .xm button[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  font-size: 13px;
  font-weight: 500;
  line-height: 1 !important;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease;
  box-shadow: none !important;
}
body .xm .btn:hover { background: var(--secondary) !important; }

/* primary 버튼 (submit, .btn-inverse, .submit) */
body .xm input[type="submit"],
body .xm button[type="submit"],
body .xm .btn-inverse,
body .xm .submit {
  background: var(--foreground) !important;
  border-color: var(--foreground) !important;
  color: var(--background) !important;
}
body .xm input[type="submit"]:hover,
body .xm button[type="submit"]:hover,
body .xm .btn-inverse:hover,
body .xm .submit:hover { background: #000 !important; }
.xm .btn-inverse:hover,
.xm button[type="submit"].btn:hover,
.xm input[type="submit"].btn:hover,
.xm .submit:hover { background: #000; }
.xm .btnArea {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}
.xm .btn-group { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.xm .pull-left { margin-right: auto; }
.xm .pull-right { margin-left: auto; }

/* 테이블 */
.xm .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-top: 2px solid var(--foreground);
}
.xm .table th,
.xm .table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.xm .table th {
  background: var(--secondary);
  font-weight: 600;
  color: var(--muted-foreground);
}
.xm .table.table-striped tbody tr:nth-child(odd) {
  background: rgba(0, 0, 0, 0.015);
}
.xm .table.table-hover tbody tr:hover { background: var(--secondary); }

/* 페이지네이션 (게시판 .ds-board-pager와 동일 톤, 가운데 정렬) */
.xm .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 24px 0 16px;
  padding: 16px 0;
}
.xm .pagination > form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: 0;
  float: none !important;
}
.xm .pagination > form select,
.xm .pagination > form input[type="text"],
.xm .pagination > form input[type="search"] {
  width: auto !important;
  min-width: 120px;
  margin: 0 !important;
}
.xm .pagination > ul {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}
.xm .pagination.pagination-centered { justify-content: center; }
.xm .pagination > li > a,
.xm .pagination > li > span,
.xm .pagination > a,
.xm .pagination > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.xm .pagination > li > a:hover,
.xm .pagination > a:hover {
  background: var(--secondary);
  color: var(--foreground);
}
.xm .pagination > li.active > a,
.xm .pagination > strong {
  background: var(--foreground);
  color: var(--background);
  font-weight: 600;
}

/* 메시지 박스 */
.xm .message {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--secondary);
  border-left: 3px solid var(--foreground);
}
.xm .message.error { background: #fef2f2; border-left-color: #ef4444; color: #7f1d1d; }
.xm .message.info { background: #eff6ff; border-left-color: #3b82f6; color: #1e3a8a; }
.xm .message p { margin: 0; }

/* 로그인/회원가입 화면(signin / login-header/body/footer) */
.xm .signin {
  max-width: 420px;
  margin: 40px auto;
  padding: 32px;
  background: var(--secondary);
  border-radius: 16px;
}
.xm .login-header { text-align: center; margin-bottom: 20px; }
.xm .login-header h1 { border: none; padding: 0; }
.xm .login-body { display: flex; flex-direction: column; gap: 12px; }
.xm .login-body label { font-size: 13px; font-weight: 600; }
.xm .login-body input[type="text"],
.xm .login-body input[type="password"] { width: 100%; }
.xm .login-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  font-size: 13px;
}
.xm .login-footer a {
  color: var(--muted-foreground);
  text-decoration: none;
}
.xm .login-footer a:hover { color: var(--foreground); }

/* 스크랩/저장함 보기 - 폴더 등 */
.xm .folder_name { font-weight: 600; }
.xm .savedContent { font-size: 13px; color: var(--muted-foreground); }

/* 반응형 */
@media (max-width: 720px) {
  body .xm .form-horizontal .control-group {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
  body .xm .form-horizontal .control-label {
    grid-column: 1 !important;
    text-align: left;
    padding-top: 0 !important;
  }
  body .xm .form-horizontal .controls {
    grid-column: 1 !important;
  }
  .xm .nav-tabs { font-size: 13px; }
  .xm .nav-tabs > li > a { padding: 8px 12px; }
}
