/* ====== Tema Light/Dark ====== */
:root {
  --bg-color-light: #f5f5f5;
  --text-color-light: #111;
  --card-bg-light: #fff;

  --bg-color-dark: #121212;
  --text-color-dark: #eee;
  --card-bg-dark: #1e1e1e;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg-color-light);
  color: var(--text-color-light);
  transition: background-color 0.3s, color 0.3s;
}

/* ====== Tema Dark activă ====== */
body.dark {
  background-color: var(--bg-color-dark);
  color: var(--text-color-dark);
}

body.dark .card {
  background-color: var(--card-bg-dark);
}

body.dark header {
  background-color: #1f1f1f;
  border-bottom: 1px solid #333;
}

button {
  color: inherit; /* ca să moștenească culoarea părintelui */
}

/* ====== Header Sticky ====== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--card-bg-light);
  border-bottom: 1px solid #ddd;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
}

header h1 {
  font-size: 1.2rem;
  margin: 0;
}

#theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo {
  height: 36px;
  width: auto;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: bold;
}

.nowrap {
  display: inline-block;
  white-space: nowrap;
}

/* ====== Linkuri ====== */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.9;
}

/* ====== Containerul de știri ====== */
main#news-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px;
  max-width: 1000px;
  margin: 0 auto;
}

/* ====== Cardul de știre ====== */
.card {
  background-color: var(--card-bg-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s;
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ====== Imaginea din card ====== */
.card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

/* ====== Videoclipul din card ====== */
.card video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  object-fit: cover;
  pointer-events: none; /* ca să nu "interfereze" cu clickul pe card */
}

/* ====== Conținutul cardului ====== */
.card-content {
  padding: 12px;
}

.card-content h2 {
  font-size: 1.2rem;
  font-weight: normal;
  margin: 0 0 8px;
  color: inherit;
  text-decoration: none;
}

.card-content h2 a {
  color: inherit;
  text-decoration: none;
}

.card-content h2 a:hover {
  text-decoration: none;
}

.card-content .source {
  font-size: 0.85rem;
  color: gray;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-content .favicon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  border-radius: 50%;
}

/* ====== Loader ====== */
#loading {
  text-align: center;
  padding: 16px;
  color: #666;
  font-size: 0.9rem;
}

/* ====== Responsive Mobil ====== */
@media (max-width: 600px) {
  main#news-container {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .logo {
    height: 28px;
  }

  header {
    padding: 10px 12px;
  }
}

/* ====== Bonus: Hover pe card cu video ====== */
.card:hover video {
  pointer-events: auto;
  animation: none;
  filter: brightness(1.1);
}
