/* =============================================
   IRAN OBSERVATOR — Global Styles
   ============================================= */

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

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

:root {
  --bg-primary:    #1a1a2e;
  --bg-secondary:  #16213e;
  --bg-tertiary:   #0f3460;
  --accent-green:  #279d2e;
  --accent-teal:   #25b4bd;
  --text-primary:  #ffffff;
  --text-secondary:#b8c0d4;
  --text-muted:    #7a8196;
  --border-color:  #2a2f4a;
  --red-alert:     #e63946;
  --card-radius:   10px;
  --transition:    0.25s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }

/* ---- Header ---- */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1rem;
}

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

.site-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-teal));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}

.site-logo .logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.site-logo .logo-text span {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.lang-toggle {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 4px;
}

.lang-toggle a {
  padding: 5px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: var(--transition);
}

.lang-toggle a.active,
.lang-toggle a:hover {
  background: var(--accent-green);
  color: #fff;
}

/* ---- Breaking News Ticker ---- */
.breaking-ticker {
  background: linear-gradient(90deg, var(--red-alert) 0%, #c1121f 100%);
  overflow: hidden;
  height: 38px;
  display: flex;
  align-items: center;
}

.ticker-label {
  background: rgba(0,0,0,0.3);
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 2;
}

.ticker-track {
  display: flex;
  align-items: center;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}

.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 2.5rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.ticker-item::before {
  content: '●';
  color: var(--accent-green);
  font-size: 0.5rem;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- Main Layout ---- */
.page-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.page-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

/* Left column = Telegram sidebar */
.page-grid > .telegram-sidebar { order: 1; }
/* Center = main content */
.page-grid > .main-content { order: 2; }
/* Right column = news sidebar */
.page-grid > .news-sidebar { order: 3; }

@media (max-width: 1100px) {
  .page-grid { grid-template-columns: 1fr 280px; }
  .page-grid > .telegram-sidebar { order: 3; }
  .page-grid > .main-content { order: 1; }
  .page-grid > .news-sidebar { order: 2; }
}

@media (max-width: 768px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-grid > .telegram-sidebar,
  .page-grid > .main-content,
  .page-grid > .news-sidebar { order: unset; }
}

/* ---- Section Headings ---- */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.section-heading h2 {
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-heading .accent-bar {
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--accent-green), var(--accent-teal));
  border-radius: 2px;
}

/* ---- News Cards ---- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.news-card {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  border-color: var(--accent-teal);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

.news-card .card-image {
  height: 160px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.news-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card .card-image .img-placeholder {
  font-size: 2.5rem;
  opacity: 0.25;
}

.news-card .card-body {
  padding: 1.1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card .card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.news-card .card-tag {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-teal));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 4px;
}

.news-card .card-tag.red { background: linear-gradient(135deg, var(--red-alert), #c1121f); }

.news-card .card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.news-card .card-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.55rem;
  color: var(--text-primary);
  flex: 1;
}

.news-card .card-excerpt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.news-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.news-card .card-source {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.news-card .read-more {
  color: var(--accent-teal);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  transition: var(--transition);
}

.news-card .read-more:hover { color: var(--accent-green); }

/* ---- Video Section ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.video-card {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.video-card:hover {
  border-color: var(--accent-teal);
  transform: translateY(-2px);
}

.video-card .video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.video-card .video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.video-card .video-info {
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.video-card .video-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

/* ---- About Section ---- */
.about-section {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  padding: 2rem;
  margin-top: 2rem;
}

.about-section h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.about-section p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ---- Ad Slots ---- */
.ad-slot {
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border-color);
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
  padding: 1rem;
}

.ad-slot.leaderboard {
  min-height: 90px;
  margin-bottom: 1.5rem;
}

.ad-slot.sidebar {
  min-height: 250px;
  margin-bottom: 1rem;
}

/* ---- Sidebar Widgets ---- */
.sidebar-widget {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.sidebar-widget .widget-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-widget .widget-header .dot {
  width: 8px; height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.sidebar-widget .widget-body { padding: 1rem; }

.sidebar-timeline { list-style: none; }

.sidebar-timeline li {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.sidebar-timeline li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.sidebar-timeline .timeline-dot {
  width: 8px; height: 8px;
  background: var(--accent-teal);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.sidebar-timeline .timeline-text strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.sidebar-timeline .timeline-text span { color: var(--text-muted); font-size: 0.72rem; }

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  padding: 2.5rem 1.25rem 1.5rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
}

.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.85rem;
  color: var(--text-secondary);
}

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 0.5rem; }

.footer-col ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: var(--transition);
}

.footer-col ul li a:hover { color: var(--accent-teal); }

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-bottom .footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-bottom .footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
}

.footer-bottom .footer-links a:hover { color: var(--accent-teal); }

.disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  line-height: 1.5;
  max-width: 900px;
}

/* ---- Utility ---- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--red-alert);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 4px;
}

.live-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.text-teal { color: var(--accent-teal); }
.text-green { color: var(--accent-green); }

/* ---- More News Page ---- */
.page-hero {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--card-radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.page-hero h1 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-teal);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.back-link:hover { color: var(--accent-green); }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .header-inner { height: 58px; }
  .news-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
}

/* ---- Telegram Widget ---- */
.telegram-widget {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.telegram-widget .widget-header {
  margin-bottom: 0.6rem;
}

.telegram-link {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--accent-green);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  margin-bottom: 0.75rem;
  transition: background 0.2s ease, opacity 0.2s ease;
  letter-spacing: 0.3px;
}

.telegram-link:hover {
  background: #1e8a24;
  color: #fff;
  opacity: 0.9;
}

.telegram-posts {
  margin-top: 0.4rem;
}

.telegram-loading,
.telegram-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.8rem 0;
  font-style: italic;
}

.telegram-posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.telegram-post {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s ease;
  border-radius: 4px;
}

.telegram-post:last-child {
  border-bottom: none;
}

.telegram-post:hover {
  background: rgba(39, 157, 46, 0.06);
  padding-left: 0.3rem;
}

.telegram-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.telegram-time {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-teal);
  background: rgba(37, 180, 189, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

.telegram-post-link {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s ease;
  text-decoration: none;
}

.telegram-post-link:hover {
  color: var(--accent-green);
}

.telegram-text {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  word-break: break-word;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .telegram-widget {
    padding: 0.75rem;
  }
  .telegram-text {
    font-size: 0.72rem;
  }
}
