/* ===== General ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  background: #f6f7fb;
  color: #222;
  line-height: 1.6;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  background: white;
  text-align: center;
  padding: 1.5rem 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  z-index: 10;
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
}

.site-header input {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid #ddd;
  width: 90%;
  max-width: 400px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.site-header input:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

/* ===== Main Container with Sidebar ===== */
.main-container {
  display: flex;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.article-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center; /* center cards horizontally */
}

/* ===== Article Card Styles ===== */
.article-list article {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease forwards;
  width: 80%; /* card width smaller than container */
  max-width: 800px;
}

.article-list article a {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

/* Image inside the card */
.image-wrap {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid #eee;
}

.image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-list article:hover .image-wrap img {
  transform: scale(1.05);
}

/* Card content */
.content {
  padding: 1.5rem;
}

.content h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: #111;
}

.content p {
  margin: 0 0 1rem;
  color: #555;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags span {
  background: #eef1f7;
  color: #333;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.3s;
}

.tags span:hover {
  background: #007aff;
  color: #fff;
}

/* ===== Tag Sidebar ===== */
.tag-sidebar {
  width: 220px;
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.tag-sidebar h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #111;
}

.tag-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tag-sidebar .tag-btn {
  background: #eef1f7;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.tag-sidebar .tag-btn:hover {
  background: #007aff;
  color: #fff;
}

/* ===== Article Page ===== */
.article-header {
  background: #fff;
  text-align: center;
  padding: 2rem 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.article-header h1 {
  margin-bottom: 0.5rem;
}

.article-header .description {
  color: #666;
  font-size: 1.1rem;
}

.back-btn {
  display: inline-block;
  text-decoration: none;
  color: #007aff;
  font-weight: 600;
  margin-bottom: 1rem;
}

.article-content {
  max-width: 800px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.article-content img {
  width: 100%;
  border-radius: 10px;
  margin: 1rem 0;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #777;
  font-size: 0.9rem;
}

/* ===== Animations ===== */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeUp 0.8s ease forwards;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
  }

  .tag-sidebar {
    width: 100%;
    position: static;
    top: auto;
    margin-bottom: 2rem;
  }
}

@media (max-width: 600px) {
  .article-content {
    padding: 1rem;
  }
  .site-header input {
    width: 95%;
  }

  .article-list article {
    width: 95%;
  }
}
