/* ==========================================================================
   Freemetadata Global News & AI Portal - Master Standalone Stylesheet (v2)
   Light design · Smooth · Mobile + Desktop friendly
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700;900&family=Merriweather:wght@400;700;900&display=swap');

:root {
  --primary-red: #dc2626;
  --primary-red-hover: #b91c1c;
  --dark-slate: #0f172a;
  --bg-slate: #f8fafc;
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --ticker-bg: #fff1f2;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--bg-slate);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img, video, iframe {
  max-width: 100%;
  display: block;
}

img {
  background: #e2e8f0; /* ছবি লোড হওয়ার আগে হালকা ব্যাকগ্রাউন্ড */
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6, .font-serif {
  font-family: 'Playfair Display', 'Merriweather', serif;
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
}

/* CONTAINER & GRID ENGINE */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.grid { display: grid; }
.grid > * { min-width: 0; } /* লম্বা লেখায় লেআউট ভাঙা বন্ধ */

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .md\:col-span-2 { grid-column: span 1; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .lg\:col-span-2 { grid-column: span 1; }
  .lg\:col-span-1 { grid-column: span 1; }
}

/* FLEXBOX ENGINE */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }

/* GAPS */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-10 { gap: 2.5rem; }

/* DISPLAY & VISIBILITY */
.hidden { display: none !important; }
@media (min-width: 768px) {
  .md\:block { display: block !important; }
  .md\:flex { display: flex !important; }
  .md\:hidden { display: none !important; }
  .md\:flex-row { flex-direction: row !important; }
}

/* HEADER & NAVIGATION */
header {
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.top-bar {
  background-color: var(--dark-slate);
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 0.5rem 0;
}

.top-bar a { color: #cbd5e1; }
.top-bar a:hover { color: #ffffff; }

.nav-links a {
  font-weight: 600;
  color: var(--text-body);
  padding: 0.25rem 0;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-red);
}

/* BREAKING NEWS TICKER (এখন হালকা ব্যাকগ্রাউন্ড, পরিষ্কার লেখা) */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background-color: var(--ticker-bg);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  height: 42px;
  border-bottom: 3px solid var(--primary-red);
}

.ticker-badge {
  background: var(--primary-red);
  color: #ffffff;
  padding: 0 18px;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  align-self: stretch;
  flex: none;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 6px 0 10px -3px rgba(220, 38, 38, .3);
}

.ticker-move {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker 30s linear infinite;
  font-size: 0.875rem;
  will-change: transform;
}

.ticker-move a {
  color: #1e293b;
  font-weight: 600;
}

.ticker-move a:hover { color: var(--primary-red); }

@keyframes ticker {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

.ticker-move:hover { animation-play-state: paused; }

/* HERO */
.hero-card {
  position: relative;
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  height: 340px;
  background-color: #e2e8f0;
  color: #ffffff;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, .85) 0%, rgba(15, 23, 42, .3) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  color: #ffffff;
}

/* হিরোর ভেতরের শিরোনাম সবসময় সাদা (আগে গাঢ় রঙ পাচ্ছিল) */
.hero-overlay h1,
.hero-overlay h2,
.hero-overlay h3,
.hero-overlay a {
  color: #ffffff;
}

.hero-overlay h1 { font-size: clamp(1.15rem, 2.4vw, 1.6rem); }
.hero-overlay h2, .hero-overlay h3 { font-size: clamp(.85rem, 1.6vw, 1rem); }

.hero-sub-card {
  position: relative;
  display: block;
  border-radius: 0.75rem;
  overflow: hidden;
  height: 162px;
  background-color: #e2e8f0;
  color: #ffffff;
}

.hero-sub-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

/* NEWS CARDS (থাম্বনেইল ছোট, ১৬:৯ অনুপাত) */
.news-card {
  display: flex;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  margin-bottom: 1.25rem;
}

.news-card figure {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e8f0;
}

.news-card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}

.news-card .card-details {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  padding: 1rem 1.15rem;
}

@media (min-width: 768px) {
  .news-card figure {
    width: 260px;
    height: auto;
  }
  .news-card .card-details { width: auto; }
}

.badge-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary-red);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  line-height: 1.3;
}

/* হোভার ইফেক্ট শুধু মাউস আছে এমন ডিভাইসে (মোবাইলে আটকে যাবে না) */
@media (hover: hover) {
  .news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 22px -6px rgba(0, 0, 0, .1);
  }
  .news-card:hover figure img,
  .hero-card:hover img,
  .hero-sub-card:hover img {
    transform: scale(1.04);
  }
}

/* WIDGETS & SIDEBAR */
.sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.widget-header {
  background: var(--dark-slate);
  color: #ffffff;
  padding: 0.9rem 1rem;
  font-weight: 700;
}

.widget-header h1, .widget-header h2, .widget-header h3,
.widget-header h4, .widget-header h5, .widget-header h6,
.widget-header a {
  color: #ffffff;
}

/* FOOTER (এখন হালকা, সব লিংক পরিষ্কার) */
footer {
  background: #ffffff;
  color: #475569;
  padding: 2.5rem 0 1.5rem 0;
  border-top: 4px solid var(--primary-red);
  margin-top: 3rem;
}

footer h4 { color: var(--text-dark); }
footer a { color: var(--text-body); font-weight: 600; }
footer a:hover { color: var(--primary-red); }

/* UTILITIES */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-pill {
  background: #ffffff;
  border: 2px solid var(--primary-red);
  color: var(--primary-red);
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-block;
  transition: all .2s var(--ease);
}

.btn-pill:hover {
  background: var(--primary-red);
  color: #ffffff;
}

.btn-pill:active { transform: scale(.97); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* ট্যাবলেট */
@media (max-width: 860px) {
  .hero-card { height: 250px; }
  .hero-sub-card { height: 150px; }
  .news-card figure { width: 220px; }
}

/* মোবাইল: ছোট থাম্বনেইল বামে, লেখা ডানে */
@media (max-width: 580px) {
  .container { padding-left: .85rem; padding-right: .85rem; }

  .ticker-wrap { height: 38px; }
  .ticker-badge { padding: 0 12px; font-size: .68rem; }
  .ticker-move { font-size: .8rem; }

  .hero-card { height: 210px; border-radius: .85rem; }
  .hero-sub-card { height: 130px; }
  .hero-overlay { padding: .9rem; }

  /* .flex-col থাকলেও কার্ড পাশাপাশি থাকবে */
  .news-card { flex-direction: row; margin-bottom: .85rem; }
  .news-card figure { width: 124px; }
  .news-card .card-details { padding: .6rem .75rem; }
  .news-card .card-details h2,
  .news-card .card-details h3 { font-size: .95rem; line-height: 1.35; }
  /* মোবাইলে ছোট বিবরণ লুকানো (শুধু শিরোনাম)। দেখাতে চাইলে এই লাইনটা মুছুন */
  .news-card .line-clamp-2 { display: none; }
  .badge-tag { font-size: .55rem; padding: 2px 6px; top: 6px; left: 6px; }

  .sidebar-widget { margin-bottom: 1.1rem; }
  footer { padding: 2rem 0 1.25rem 0; margin-top: 2rem; }
}

/* খুব ছোট স্ক্রিন */
@media (max-width: 380px) {
  .news-card figure { width: 108px; }
}

/* যাদের ডিভাইসে অ্যানিমেশন কমানো আছে */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
  .ticker-move { animation: none; padding-left: 0; }
  .ticker-wrap { overflow-x: auto; }
}
