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

body {
  font-family: 'Georgia', serif;
  background-color: #1a1a1a;
  color: #e0d6c8;
  line-height: 1.6;
}

a {
  color: #d4a853;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #f0c66b;
}

header {
  background-color: #111;
  border-bottom: 3px solid #d4a853;
  padding: 2rem 1rem;
  text-align: center;
}

header h1 {
  font-size: 2.2rem;
  color: #d4a853;
  letter-spacing: 1px;
}

header p {
  margin-top: 0.5rem;
  color: #999;
  font-style: italic;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.section-title {
  font-size: 1.4rem;
  color: #d4a853;
  margin-bottom: 1rem;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
}

/* Featured Archive Sections */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.featured-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #222;
  border: 1px solid #333;
  transition: transform 0.2s, box-shadow 0.2s;
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.featured-card .card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.featured-card .card-info {
  padding: 1rem;
}

.featured-card .card-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.featured-card .card-info span {
  font-size: 0.85rem;
  color: #888;
}

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.article-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #222;
  border: 1px solid #333;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.article-card .card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

/* CSS placeholder thumbnail for articles without images */
.card-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.featured-card .card-placeholder {
  height: 220px;
}

.card-placeholder::before {
  content: attr(data-initial);
  font-size: 4rem;
  font-weight: bold;
  opacity: 0.12;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Georgia', serif;
  line-height: 1;
}

.card-placeholder .ph-source {
  font-size: 1rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.9);
  z-index: 1;
  text-align: center;
  padding: 0 1rem;
}

.card-placeholder .ph-type {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
  z-index: 1;
}

/* Color themes for placeholder cards */
.card-placeholder.c1 { background: linear-gradient(135deg, #2d1b4e, #1a1030); }
.card-placeholder.c2 { background: linear-gradient(135deg, #1b3a4e, #0f2030); }
.card-placeholder.c3 { background: linear-gradient(135deg, #4e3b1b, #302510); }
.card-placeholder.c4 { background: linear-gradient(135deg, #1b4e2d, #103020); }
.card-placeholder.c5 { background: linear-gradient(135deg, #4e1b1b, #301010); }
.card-placeholder.c6 { background: linear-gradient(135deg, #1b4e4e, #103030); }
.card-placeholder.c7 { background: linear-gradient(135deg, #3a1b4e, #251030); }
.card-placeholder.c8 { background: linear-gradient(135deg, #4e4e1b, #303010); }

.article-card .card-info {
  padding: 0.8rem;
}

.article-card .card-info h3 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.article-card .card-info span {
  font-size: 0.8rem;
  color: #888;
}

/* Archive Viewer */
.archive-header {
  background: #111;
  border-bottom: 2px solid #d4a853;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.archive-header a {
  font-size: 0.9rem;
}

.archive-header h2 {
  font-size: 1rem;
  color: #e0d6c8;
  font-weight: normal;
}

.archive-iframe {
  width: 100%;
  height: calc(100vh - 52px);
  border: none;
  display: block;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #666;
  font-size: 0.85rem;
  border-top: 1px solid #333;
}

/* Responsive */
@media (max-width: 900px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1.6rem;
  }
}
