/* ===== Thai News Blog Styles ===== */
:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #ecf0f1;
  --shadow: 0 2px 15px rgba(0,0,0,0.08);
}

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

body {
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}
.site-header.hidden {
  transform: translateY(-100%);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo h1 { font-size: 24px; font-weight: 700; }
.logo .tagline { font-size: 12px; opacity: 0.8; }

.main-nav { display: flex; gap: 20px; }
.main-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s;
}
.main-nav a:hover, .main-nav a.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* Ticker */
.ticker-bar {
  background: #2c3e50;
  color: white;
  padding: 8px 0;
  overflow: hidden;
}
.ticker-bar .container { display: flex; align-items: center; gap: 15px; }
.ticker-label {
  background: var(--primary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  animation: pulse-label 2s infinite;
}
@keyframes pulse-label { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.ticker-content { overflow: hidden; flex: 1; }
.ticker-text {
  font-size: 13px;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
}
@keyframes ticker-scroll { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* Main Layout */
main.container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  padding-top: 30px;
  padding-bottom: 40px;
}

/* Featured Section */
.featured-section { grid-column: 1 / -1; }
.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 15px;
}

.featured-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #34495e;
  text-decoration: none;
  color: white;
  display: block;
  transition: transform 0.3s;
  min-height: 200px;
}
.featured-card:hover { transform: translateY(-3px); }
.featured-main { grid-row: 1 / 3; min-height: 400px; }
.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}
.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 25px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.featured-overlay h3 { font-size: 18px; margin-top: 8px; line-height: 1.4; }
.featured-main .featured-overlay h3 { font-size: 24px; }
.featured-overlay time { font-size: 12px; opacity: 0.7; }

.source-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.source-badge.small { font-size: 10px; padding: 2px 8px; }

/* News Grid */
.news-section { }
.section-title {
  font-size: 22px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.news-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.news-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.news-card.no-img .news-img { display: none; }
.news-body {
  padding: 15px;
}
.news-body h3 {
  font-size: 16px;
  margin: 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-body p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-body time {
  font-size: 12px;
  color: var(--text-light);
}

/* Sidebar */
.sidebar { }
.widget {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.widget-title {
  font-size: 16px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.source-list { list-style: none; }
.source-list li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.source-dot.bbc { background: #bb1919; }
.source-dot.thairath { background: #0066cc; }
.source-dot.matichon { background: #339933; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 12px;
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.featured-skeleton { min-height: 400px; grid-row: 1 / 3; }
.small-skeleton { min-height: 190px; }
.card-skeleton { min-height: 300px; }

/* Footer */
.site-footer {
  background: #2c3e50;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px;
  font-size: 13px;
}

/* About */
.about-section {
  background: var(--card-bg);
  padding: 40px 0;
  margin-top: 30px;
}
.about-section h2 { margin-bottom: 15px; }
.about-section p { color: var(--text-light); max-width: 600px; }

.no-news {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content { flex-direction: column; gap: 10px; }
  main.container { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-main { grid-row: auto; min-height: 250px; }
  .news-grid { grid-template-columns: 1fr; }
}
