/* style.css */

* {
  box-sizing: border-box;
}
html {
min-height: 100%;
  background:#f7f8f9;
  background-attachment: fixed;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 6.4rem 0 0 0;
  color: #111324;
}

header {
  z-index: 1;
  position:fixed;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width:100%;
  top:0;
  color: #07119d;
}

.header {
  width:960px;
  background: rgba(255,255,255,0.6);
  backdrop-filter:blur(16px);
  padding: 1rem 2rem;
  margin:1rem 0 0 0;
  display:flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  border-radius: 1rem;
  border: 1px solid #f1f2f3;
}

header h1 {
  margin: 0;
}

header a {
  color: inherit;
  text-decoration: none;
  font-weight:bold;
  font-size: 1rem;
}

header .logo {
  height: 3rem;
  max-width: 100%;
}

header .menu {
  display:flex;
}

main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.container {
    width: 960px;
}

.ad-area {
  display:flex;
}

.ad-image {
max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  
}

.ad-leaderboard {
  margin: 1rem 0;
  width: 100%;
  height: 90px;
  background: #ffffff;
  border: 1px solid #f1f2f3;
  border-radius:1rem;
  display:flex;
  justify-content: center;
  align-items: center;
}

footer {
  margin: 4rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  color: #5059a9;
  font-size: 0.75rem;
}

footer a {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
}

footer .container {
  text-align: center;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.post-item {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.post-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.post-item a {
  color: inherit;
  text-decoration: none;
  display: block;
  height: 100%;
}

.post-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #e5e7eb;
}

.post-content {
  padding: 1rem 1.1rem 1.1rem;
}

.post-content h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.post-date {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.4rem;
}

.post-snippet {
  font-size: 0.9rem;
  color: #4b5563;
}

#pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

#pagination a {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  text-decoration: none;
  color: #374151;
  font-size: 0.85rem;
}

#pagination a.active {
  background: #111827;
  color: white;
  border-color: #111827;
}

/* 상세 페이지 */

.post-detail {
  background: white;
  border-radius: 1rem;
  border: 1px solid #f1f2f3;
  padding: 4rem 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.post-detail h1 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.post-detail .post-date {
  margin-bottom: 1rem;
}

.post-detail img {
  max-width: 100%;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.post-detail .body {
  line-height: 1.5;
  font-size: 1rem;
  margin: 2rem 0;
}

p {
  margin: 0.5rem 0;
}

/* 모바일(예: 가로 640px 이하)에서는 1열로 표시 */
@media (max-width: 640px) {
  body {
    margin: 6rem 0 0 0; /* 헤더 때문에 위 여백 살짝 줄이고 싶으면 조정 */
  }
.header {
  padding: 1rem 1rem;
  margin:1rem;
}

  main {
    max-width: 100%;
    margin: 1.5rem auto;
    padding: 0 1rem;
  }

  .container {
    width: 100%;
  }

  .post-list {
    grid-template-columns: 1fr; /* ★ 1열 강제 */
    gap: 1rem;
  }

  .post-item {
    border-radius: 0.6rem;
  }

  .post-thumb {
    height: 180px;
  }
}