/* =========================================
   Mizan News Website – Main Stylesheet
   Colors: #0a58ca (primary accent)
           #ffffff (background)
           #111111 (primary text)
           #666666 (secondary text)
           #e6e6e6 (border)
   Font: Inter / system-ui
   Mobile-first responsive layout
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: #ffffff;
  color: #111111;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #0a58ca;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #084298;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   HEADER / TOP BAR
   ========================================= */

.site-header {
  background-color: #ffffff;
  color: #111111;
  border-bottom: 1px solid #e6e6e6;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo img {
  height: 36px;
  width: auto;
}

.site-logo span {
  font-size: 24px;
  font-weight: 700;
  color: #111111;
  letter-spacing: 0.02em;
}

/* Category navigation */
.cat-nav {
  display: none;
  align-items: center;
  gap: 0;
  flex: 1;
}

@media (min-width: 900px) {
  .cat-nav {
    display: flex;
  }
}

.cat-nav a {
  font-size: 15px;
  font-weight: 500;
  color: #444444;
  padding: 0 12px;
  white-space: nowrap;
  transition: color 0.2s ease;
  text-decoration: none;
}

.cat-nav a:hover {
  color: #0a58ca;
}

/* Search bar */
.header-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

@media (min-width: 900px) {
  .header-search {
    flex: 0 0 240px;
  }
}

.header-search input {
  width: 100%;
  padding: 0.45rem 1rem 0.45rem 2.2rem;
  border: 1px solid #e6e6e6;
  border-radius: 24px;
  background: #f5f5f5;
  color: #111111;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.header-search input::placeholder {
  color: #999999;
}

.header-search input:focus {
  border-color: #0a58ca;
  background: #ffffff;
}

.header-search .search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
}

/* Language selector */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.lang-selector select {
  padding: 0.4rem 0.75rem;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  background: #ffffff;
  color: #111111;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.lang-selector select option {
  background: #ffffff;
  color: #111111;
}

/* =========================================
   MAIN LAYOUT
   ========================================= */

.site-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .site-main {
    grid-template-columns: 1fr 320px;
  }
}

/* =========================================
   HERO STORY SECTION
   ========================================= */

.hero-section {
  margin-bottom: 2rem;
}

.hero-card {
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e6e6e6;
}

.hero-card img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

@media (max-width: 600px) {
  .hero-card img {
    height: 220px;
  }
}

.hero-card-body {
  padding: 1.5rem;
}

.hero-card .category {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0a58ca;
  margin-bottom: 0.5rem;
  display: block;
}

.hero-card h2 {
  font-size: 36px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 0.75rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 600px) {
  .hero-card h2 {
    font-size: 20px;
  }
}

.hero-card p {
  font-size: 15px;
  color: #555555;
  line-height: 1.65;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-card .meta {
  font-size: 13px;
  color: #888888;
}

/* Featured section (legacy compat – used by JS) */
.featured-section {
  margin-bottom: 2rem;
}

.featured-section h2,
.news-list-section h2,
.sidebar h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #111111;
  border-left: 3px solid #0a58ca;
  padding-left: 0.75rem;
  margin-bottom: 1.25rem;
}

.featured-card {
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  transition: background 0.2s ease;
}

.featured-card:hover {
  background: #fafafa;
}

.featured-card-body {
  padding: 20px;
}

.featured-card .tag {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0a58ca;
  margin-bottom: 0.5rem;
}

.featured-card h3 {
  font-size: 22px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.featured-card p {
  font-size: 15px;
  color: #555555;
  margin-bottom: 1rem;
  line-height: 1.65;
}

.featured-card .meta {
  font-size: 13px;
  color: #888888;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =========================================
   BANNER ADS – TOP / INLINE
   ========================================= */

.ad-banner {
  background: #f9f9f9;
  border: 1px dashed #cccccc;
  border-radius: 6px;
  text-align: center;
  padding: 0.75rem 1rem;
  color: #aaaaaa;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 auto 1.5rem;
}

.ad-banner.ad-leaderboard {
  max-width: 1200px;
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-banner.ad-mid-feed {
  max-width: 1200px;
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px auto;
}

@media (max-width: 600px) {
  .ad-banner.ad-leaderboard,
  .ad-banner.ad-mid-feed {
    height: 60px;
  }
}

/* =========================================
   NEWS LIST
   ========================================= */

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

.news-card {
  padding: 20px;
  border-bottom: 1px solid #e6e6e6;
  background: #ffffff;
  transition: background 0.15s ease;
  cursor: pointer;
}

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

.news-card:hover {
  background: #fafafa;
}

.news-card-content {
  flex: 1;
  min-width: 0;
}

.news-card .category {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0a58ca;
  margin-bottom: 0.4rem;
  display: block;
}

.news-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #111111;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card h3 a {
  color: inherit;
}

.news-card h3 a:hover {
  color: #0a58ca;
}

.news-card .snippet {
  font-size: 15px;
  color: #555555;
  line-height: 1.6;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 13px;
  color: #888888;
}

.news-card .card-meta time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Language icon badges */
.lang-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}

.lang-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #f0f4ff;
  color: #0a58ca;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-badge:hover {
  background: #0a58ca;
  color: #ffffff;
}

.lang-badge.active {
  background: #0a58ca;
  color: #ffffff;
}

/* View count label */
.view-count {
  display: block;
  font-size: 11px;
  color: #c0c0c0;
  margin-top: 0.5rem;
}

/* Truncate article summary to 2 lines on the index page */
.news-list .article-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* "Read more" link injected into index page cards */
.read-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0a58ca;
}

.read-more:hover {
  color: #084298;
  text-decoration: underline;
}

/* Category color overrides */
.cat-world    { color: #d32f2f; }
.cat-politics { color: #7b1fa2; }
.cat-business { color: #2e7d32; }
.cat-technology,.cat-tech { color: #1565c0; }
.cat-science  { color: #ef6c00; }

/* =========================================
   SIDEBAR
   ========================================= */

.sidebar {
  display: none;
}

@media (min-width: 900px) {
  .sidebar {
    display: block;
    width: 320px;
  }
}

.sidebar-widget {
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: #ffffff;
}

.sidebar-widget h2 {
  font-size: 13px;
}

.sidebar-ad {
  background: #f9f9f9;
  border: 1px dashed #cccccc;
  border-radius: 8px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #aaaaaa;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.sidebar-ad.tall {
  min-height: 600px;
}

.trending-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trending-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.trending-list .num {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e6e6e6;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
}

.trending-list a {
  font-size: 16px;
  color: #111111;
  line-height: 1.4;
}

.trending-list a:hover {
  color: #0a58ca;
}

/* =========================================
   FOOTER
   ========================================= */

.site-footer {
  background: #111111;
  color: rgba(255, 255, 255, 0.85);
  padding: 40px 1rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand p {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  line-height: 1.6;
  opacity: 0.75;
}

.footer-brand .site-logo span {
  color: #ffffff;
  font-size: 1.2rem;
}

.footer-col h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-col ul li a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: #ffffff;
}

/* Newsletter */
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.85rem;
  outline: none;
}

.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.newsletter-form button {
  padding: 0.5rem 1rem;
  background: #0a58ca;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: #084298;
}

.footer-nav-links {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.footer-nav-links a {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
  padding: 0.1rem 0.4rem;
}

.footer-nav-links a:hover {
  color: #ffffff;
}

.footer-nav-links span {
  color: rgba(255, 255, 255, 0.25);
}

.footer-bottom {
  max-width: 1200px;
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom a:hover {
  color: #ffffff;
}

/* =========================================
   ARTICLE PAGE
   ========================================= */

.article-header {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1rem 1rem;
}

.article-header .breadcrumb {
  font-size: 13px;
  color: #888888;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.article-header .breadcrumb a {
  color: #0a58ca;
}

.article-header .breadcrumb span {
  color: #cccccc;
}

.article-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #111111;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.article-header .subheadline {
  font-size: 1.1rem;
  color: #555555;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.article-header .article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 13px;
  color: #888888;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e6e6e6;
}

/* Article lang switcher */
.lang-switcher-bar {
  max-width: 820px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  background: #f9f9f9;
  border-top: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 13px;
  color: #666666;
}

.lang-switcher-bar span {
  font-weight: 500;
}

.lang-switcher-bar a {
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #e6e6e6;
  color: #0a58ca;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.lang-switcher-bar a:hover,
.lang-switcher-bar a.active {
  background: #0a58ca;
  border-color: #0a58ca;
  color: #ffffff;
}

/* Article layout with sidebar */
.article-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr 320px;
  }
}

/* Article body */
.article-body {
  max-width: 720px;
}

.article-body .ad-banner {
  margin: 1.5rem 0;
}

.article-body p {
  font-size: 18px;
  color: #333333;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.article-body h2 {
  font-size: 22px;
  font-weight: 600;
  color: #111111;
  margin: 1.75rem 0 0.75rem;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111111;
  margin: 1.5rem 0 0.5rem;
}

.article-body blockquote {
  border-left: 4px solid #0a58ca;
  padding: 0.75rem 1.25rem;
  background: #f5f8ff;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: #555555;
}

.article-source {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f9f9f9;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #555555;
}

.article-source a {
  font-weight: 600;
  color: #0a58ca;
}

/* Social share */
.social-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e6e6e6;
  font-size: 0.85rem;
  color: #666666;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid currentColor;
  transition: all 0.2s ease;
  text-decoration: none;
}

.share-btn.twitter { color: #1DA1F2; }
.share-btn.facebook { color: #4267B2; }
.share-btn.telegram { color: #0088CC; }
.share-btn:hover { opacity: 0.75; }

/* RTL support */
[dir="rtl"] .article-body,
[dir="rtl"] .article-header,
[dir="rtl"] .lang-switcher-bar,
[dir="rtl"] .news-card,
[dir="rtl"] .footer-inner {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .article-body blockquote {
  border-left: none;
  border-right: 4px solid #0a58ca;
  border-radius: 8px 0 0 8px;
}

[dir="rtl"] .featured-section h2,
[dir="rtl"] .news-list-section h2,
[dir="rtl"] .sidebar h2 {
  border-left: none;
  border-right: 3px solid #0a58ca;
  padding-left: 0;
  padding-right: 0.75rem;
}

/* =========================================
   UTILITIES
   ========================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-accent {
  color: #0a58ca;
}

.text-primary {
  color: #111111;
}

.text-muted {
  color: #666666;
}
