/* Homepage Styles */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #ffffff;
}

/* Language Switcher */
.header-title-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.header-title-section a {
  color: #ffffff;
  font-weight: 700;
  font-size: 2rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.header-title-section a:hover {
  text-decoration: underline;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  display: inline-block;
  background: url('/favicon.svg') center center / contain no-repeat;
  flex-shrink: 0;
}

.language-switcher-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap; /* keep label inline with flags */
}

.language-title {
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap; /* prevent wrapping above flags */
}

.language-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.language-option:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.language-option.active {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.language-option .language-flag {
  font-size: 1.25rem;
  line-height: 1;
  display: block;
}

/* Header */
header {
  background: #010334;
  color: #ffffff;
  padding: 1rem 0;
  border-bottom: 1px solid #e5e5e5;
  position: relative;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.header-content {
  flex: 1;
}

.header-nav {
  margin-top: 0.5rem;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s;
  font-size: 0.9rem;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

header h1 {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header p {
  font-size: 0.95rem;
  opacity: 0.9;
  font-weight: 400;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Search Input */
.search-container {
  width: 250px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.search-input::placeholder {
  color: rgba(255,255,255,0.6);
}

.search-input:focus {
  outline: none;
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.5);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  pointer-events: none;
}

/* Archive Link */
.archive-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.archive-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Read Later Header Button */
.read-later-header-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.read-later-header-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.5);
}

.read-later-header-btn.active {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.read-later-count {
  font-size: 0.85rem;
  opacity: 0.9;
}


/* Category Filters */
.category-filters {
  background: #ffffff;
  margin: 0;
  padding: 1rem 20px;
  border-bottom: 1px solid #e5e5e5;
}

.category-filters h2 {
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
}

.category-filter {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e5e5;
  background: #f7f7f7;
  color: #1a1a1a;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.category-filter:hover {
  background: #ededed;
  border-color: #dcdcdc;
}

.category-filter.active {
  background: #010334;
  color: #ffffff;
  border-color: #010334;
  font-weight: 600;
}

.category-filter span:first-child {
  font-size: 0.95rem;
}

/* Count Badge */
.count-badge {
  background: rgba(0, 0, 0, 0.1);
  color: #666;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
  line-height: 1.2;
}

/* Count badge on dark background (category filters) */
.category-filter .count-badge {
  background: rgba(0, 0, 0, 0.05);
  color: #666;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  min-width: 1.25rem;
  border-radius: 10px;
}

.category-filter.active .count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Country Filter Panel */
.country-filter-wrapper {
  width: 100%;
  background: #010334;
  padding: 1rem 0;
}

.country-filter-panel {
  background: #010334;
  border: 1px solid #010334;
  border-radius: 8px;
  padding: 1rem 20px;
  margin: 0 auto;
  max-width: 1200px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.country-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.country-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.country-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  flex: 0 0 auto; /* fixed width based on content */
}

.country-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
}

.country-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.country-btn.active .count-badge {
  background: rgba(0, 0, 0, 0.15);
  color: #ffffff;
}

.country-flag {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.country-name {
  white-space: nowrap;
}

.country-btn .count-badge {
  background: rgba(0, 0, 0, 0.15);
  color: #ffffff;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  min-width: 1.25rem;
  border-radius: 10px;
  font-weight: 600;
}

.news-list h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #1a1a1a;
}

/* News List */
.news-list {
  background: white;
  border: 1px solid #e5e5e5;
  margin-bottom: 3rem;
  overflow: hidden;
}

.news-list-items {
  display: flex;
  flex-direction: column;
}

/* Featured News Layout */
.featured-news-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid #e5e5e5;
}

.featured-main {
  width: 100%;
  border-bottom: none;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 0 !important;
}

.featured-content-left {
  width: 50%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  border-right: 1px solid #e5e5e5;
  flex: 0 0 50%;
  box-sizing: border-box;
}

.featured-image-right {
  width: 50%;
  height: 300px;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
  flex: 0 0 50%;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  order: 2;
}

.featured-image-right img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.featured-title {
  font-size: 1.5rem;
  line-height: 1.3;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1rem;
  margin-bottom: 0;
}

.featured-title a {
  font-weight: 700;
}

.featured-summary {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* Styles for news list below (using previous right block styles) */
.featured-side-item {
  border-bottom: 1px solid #e5e5e5;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.featured-side-item:last-child {
  border-bottom: none;
}

.featured-side-item .news-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
}

.featured-side-item .news-header {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
}

.featured-side-item .news-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1rem;
  line-height: 1.4;
}

.featured-side-item .news-summary {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* News Row */
.news-row {
  display: flex;
  align-items: center;
  padding: 1rem 1rem;
  border-bottom: 1px solid #e5e5e5;
  transition: all 0.2s;
  gap: 1.5rem;
}

.featured-side .news-row {
  padding: 0.75rem 1rem;
  gap: 1rem;
  background: white;
}

.news-row:last-child {
  border-bottom: none;
}

.news-row:hover {
  background: #f8f8f8;
}

/* News Content */
.news-content {
  flex-grow: 1;
  min-width: 0;
}

.news-summary {
  margin-top: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.news-header {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.news-meta-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.news-flag-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.news-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #000000;
  margin: 0;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-title a {
  color: inherit;
  text-decoration: none;
}

.news-title a:hover {
  color: #666666;
}

.badge-topic {
  background: white;
  color: black;
  border: 1px solid black;
}

.news-date {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #999;
  font-size: 0.875rem;
}

/* Read Later Button */
.read-later-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s;
  opacity: 0.6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.read-later-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.read-later-btn.active {
  opacity: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem;
  color: #999;
}

.empty-state svg {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 3rem 0;
  padding: 1.5rem 0;
}

.pagination-btn {
  padding: 0.75rem 1.5rem;
  border: 1px solid #e5e5e5;
  background: white;
  color: #000000;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pagination-btn:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #000000;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
  min-width: 120px;
  text-align: center;
}

.pagination-numbers {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-number {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  border: 1px solid #e5e5e5;
  background: white;
  color: #000000;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-number:hover {
  background: #f5f5f5;
  border-color: #000000;
}

.pagination-number.active {
  background: #000000;
  color: white;
  border-color: #000000;
}

.pagination-ellipsis {
  padding: 0 0.5rem;
  color: #666;
  font-size: 0.95rem;
  user-select: none;
}

/* Responsive */
@media (max-width: 992px) {
  header .container {
    flex-direction: column;
    gap: 1.5rem;
  }

  .header-controls {
    justify-content: flex-start;
  }

  .search-container {
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.75rem;
  }

  .header-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .search-container {
    width: 100%;
    max-width: 100%;
  }

  .header-title-section {
    gap: 0.75rem;
  }

  .language-switcher-container {
    gap: 0.4rem;
  }

  .language-option {
    width: 2rem;
    height: 2rem;
  }

  .language-option .language-flag {
    font-size: 1.1rem;
  }

  .read-later-header-btn {
    width: 100%;
    justify-content: center;
  }

  .category-filters {
    padding: 0.75rem 0;
    gap: 0.5rem;
  }

  .category-filter {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .country-filter-panel {
    padding: 0.75rem;
  }

  .country-panel-title {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  .country-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .country-flag {
    font-size: 0.9rem;
  }

  .pagination {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination-info {
    order: -1;
  }

  .pagination-numbers {
    gap: 0.25rem;
    justify-content: center;
  }

  .pagination-number {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
    padding: 0 0.375rem;
  }

  .pagination-btn {
    width: 100%;
    max-width: 200px;
  }


  .news-row {
    padding: 1rem;
  }

  .featured-news-layout {
    flex-direction: column;
  }

  .featured-main {
    flex-direction: row;
  }

  .featured-content-left {
    width: 50%;
    border-right: 1px solid #e5e5e5;
    border-bottom: none;
    padding: 1rem;
    flex: 0 0 50%;
    order: 1;
  }

  .featured-image-right {
    width: 50%;
    height: 300px;
    flex: 0 0 50%;
  }

  .featured-image-right img {
    min-height: 250px;
  }

  .featured-main-image,
  .featured-side-image {
    object-fit: cover;
    object-position: center;
  }

  .news-meta-line {
    gap: 0.5rem;
  }

  .news-flag-icon {
    font-size: 1.25rem;
  }

  .news-title {
    font-size: 1rem;
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  .news-date {
    font-size: 0.8rem;
  }
}

