/* Posts Landing Page & Article Reader */

/* ============================================
   Landing Page
   ============================================ */

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

/* Category Sections */
.posts-category-section {
  margin-bottom: 3rem;
}

.posts-category-section:last-child {
  margin-bottom: 0;
}

.posts-category-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #eaeaea;
}

.posts-category-title {
  font-family: 'Special Gothic Condensed One', sans-serif;
  font-size: 1.5rem;
  color: #2c3e50;
  margin: 0 0 0.25rem;
  font-weight: normal;
}

.posts-category-desc {
  color: #888;
  font-size: 0.9rem;
  margin: 0;
}

/* Card Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Individual Card */
.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
}

/* Card Image */
.post-card-img {
  position: relative;
  height: 180px;
  background: #f5f5f5;
  overflow: hidden;
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

/* Card Body */
.post-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.post-card-date {
  font-size: 0.78rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.3;
  margin: 0;
}

.post-card-desc {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Medium Badge */
.post-card-medium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #999;
  border-top: 1px solid #f0f0f0;
}

.post-card-medium-badge svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ============================================
   Article Reader
   ============================================ */

.article-container {
  max-width: 800px;
  margin: 80px auto 0;
  padding: 2rem 1.5rem;
}

/* Back Link */
.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #888;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.article-back-link:hover {
  color: #D4AF37;
}

/* Article Header */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #eaeaea;
}

.article-header-date {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 0.5rem;
}

.article-header-title {
  font-size: 2.2rem;
  color: #1a1a1a;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.article-medium-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: #000;
  color: #fff;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.article-medium-btn:hover {
  background: #333;
  color: #fff;
  text-decoration: none;
}

.article-medium-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Article Header Actions (Medium btn + Translate) */
.article-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Google Translate Widget Overrides */
#google_translate_element {
  display: inline-block;
}

#google_translate_element .goog-te-gadget {
  font-family: inherit;
  font-size: 0;
}

#google_translate_element .goog-te-gadget > span {
  display: none;
}

#google_translate_element .goog-te-combo {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #555;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

#google_translate_element .goog-te-combo:hover {
  border-color: #D4AF37;
}

#google_translate_element .goog-te-combo:focus {
  border-color: #D4AF37;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Hide Google Translate top banner */
.goog-te-banner-frame {
  display: none !important;
}

body {
  top: 0 !important;
}

/* Article Content (rendered markdown) */
.article-content {
  line-height: 1.7;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  color: #2c3e50;
}

.article-content h1 {
  font-size: 2rem;
  margin: 2rem 0 1rem;
  color: #1a1a1a;
  border-bottom: 2px solid #eaeaea;
  padding-bottom: 0.5rem;
}

.article-content h2 {
  font-size: 1.6rem;
  margin: 2rem 0 1rem;
  color: #2a2a2a;
  border-bottom: 1px solid #eaeaea;
  padding-bottom: 0.5rem;
}

.article-content h3 {
  font-size: 1.3rem;
  margin: 1.5rem 0 0.75rem;
  color: #333;
}

.article-content p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

.article-content strong {
  color: #e67e22;
  font-weight: 600;
}

.article-content em {
  color: #27ae60;
  font-style: italic;
}

.article-content a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.2s;
}

.article-content a:hover {
  color: #2980b9;
  text-decoration: underline;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.article-content code {
  background: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: #e74c3c;
  border: 1px solid #eaeaea;
  font-size: 0.9em;
}

.article-content pre {
  background: #f8f9fa;
  padding: 1.2rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid #eaeaea;
}

.article-content pre code {
  background: none;
  padding: 0;
  border: none;
  color: #2c3e50;
  font-size: 0.95em;
}

.article-content blockquote {
  border-left: 4px solid #3498db;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-radius: 0 8px 8px 0;
  color: #34495e;
}

.article-content ul,
.article-content ol {
  margin: 1.25rem 0;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eaeaea;
}

.article-content th {
  background-color: #f8f9fa;
  color: #2c3e50;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #eaeaea;
}

.article-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eaeaea;
}

.article-content tr:last-child td {
  border-bottom: none;
}

.article-content hr {
  border: none;
  border-top: 1px solid #eaeaea;
  margin: 2rem 0;
}

/* Article Not Found */
.article-not-found {
  text-align: center;
  padding: 4rem 2rem;
  color: #999;
}

.article-not-found h2 {
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 1rem;
}

.article-not-found a {
  color: #D4AF37;
  text-decoration: none;
}

.article-not-found a:hover {
  text-decoration: underline;
}

/* ============================================
   Responsive
   ============================================ */

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

@media (max-width: 768px) {
  .posts-container {
    padding: 0 1rem 2rem;
    margin: 1.5rem auto;
  }

  .article-container {
    margin-top: 60px;
    padding: 1.5rem 1rem;
  }

  .article-header-title {
    font-size: 1.6rem;
  }

  .article-content table {
    display: block;
    overflow-x: auto;
  }
}

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

  .post-card-img {
    height: 200px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .post-card {
    transition: none;
  }

  .post-card-img img {
    transition: none;
  }
}
