/* News Detail Modern Styles */

.news-detail-hero {
  position: relative;
  display: block;
  width: 100%;
  min-height: 46vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.news-detail-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.35) 35%, rgba(0, 0, 0, 0.25) 60%, rgba(0, 0, 0, 0.15) 100%);
}

.news-detail-hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 46vh;
  padding-top: 3rem;
  padding-bottom: 3.5rem;
}

.news-detail-crumbs {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.crumb-link {
  color: #e6f1e6;
  text-decoration: none;
  font-weight: 500;
}

.crumb-link:hover {
  text-decoration: underline;
}

.dot-sep {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  display: inline-block;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(184, 207, 167, 0.25);
  color: #fff;
  font-size: 0.85rem;
}

.date {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.news-detail-title {
  color: #fff;
  font-family: 'Times New Roman', Times, serif;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.2;
  font-size: clamp(2rem, 4vw, 3.25rem);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
  padding: 0.5rem 0.75rem;
}

.reader-toolbar-wrap {
  top: 64px;
  z-index: 5;
  background: linear-gradient(180deg, rgba(250, 250, 249, 0.9) 0%, rgba(250, 250, 249, 0.6) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(107, 142, 91, 0.12);
  padding-left: 16px;
  padding-right: 16px;
}

body.dark-mode .reader-toolbar-wrap {
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.9) 0%, rgba(10, 14, 26, 0.6) 100%);
  border-bottom-color: rgba(99, 102, 241, 0.18);
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.divider {
  width: 1px;
  height: 28px;
  background: rgba(107, 142, 91, 0.25);
}

body.dark-mode .divider {
  background: rgba(99, 102, 241, 0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.btn-pill {
  min-width: 40px;
  height: 40px;
  padding: 0 0.9rem;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #6b8e5b 0%, #5a7a4a 100%);
  box-shadow: 0 6px 16px rgba(107, 142, 91, 0.28);
}

.btn-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(107, 142, 91, 0.32);
}

.btn-pill:active {
  transform: translateY(0);
}

.btn-ghost {
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  color: #5a7a4a;
  background: rgba(90, 122, 74, 0.08);
}

.btn-ghost:hover {
  background: rgba(90, 122, 74, 0.15);
}

body.dark-mode .btn-ghost {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.08);
}

body.dark-mode .btn-ghost:hover {
  background: rgba(99, 102, 241, 0.14);
}

.muted {
  color: #6b8e5b;
  opacity: 0.85;
}

body.dark-mode .muted {
  color: #a5b4fc;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2c3e4e 0%, #456783 100%);
  outline: none;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2c3e4e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2c3e4e;
}

.range-value {
  font-weight: 700;
  color: #2c3e50;
  min-width: 48px;
  text-align: right;
}

body.dark-mode .range-value {
  color: #e0e0e0;
}

.select {
  min-width: 220px;
  max-width: min(50vw, 420px);
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(107, 142, 91, 0.25);
  background: #fff;
  color: #2d3e2d;
}

body.dark-mode .select {
  background: #1f2937;
  color: #e5e7eb;
  border-color: rgba(99, 102, 241, 0.25);
}

.voice-settings {
  position: relative;
}

.voice-settings>summary {
  list-style: none;
}

.voice-settings[open] {
  /* no-op placeholder to avoid empty ruleset warning */
  opacity: 1;
}

.voice-settings>select {
  margin-left: 0.5rem;
}

.news-detail {
  padding: 2rem 0 4rem;
}

.news-detail-content {
  max-width: 840px;
  margin: 0 auto;
  color: #000000;
  font-size: 1.06rem;
  line-height: 1.8;
}

body.dark-mode .news-detail-content {
  color: #ffffff;
}

.news-detail-content h2,
.news-detail-content h3,
.news-detail-content h4 {
  color: #2c3e2d;
}

.news-detail-content p+p {
  margin-top: 1rem;
}

.news-detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Hyperlink styles for news content */
.news-detail-content a {
  color: #6b8e5b;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  font-weight: 500;
}

.news-detail-content a:hover {
  color: #527043;
  text-decoration-color: #527043;
}

body.dark-mode .news-detail-content a {
  color: #b8cfa7;
}

body.dark-mode .news-detail-content a:hover {
  color: #d4e5ca;
}

/* Spoken word highlight */
.highlight {
  background-color: #ffeb3b;
  padding: 0 .15em;
  border-radius: 4px;
  animation: fadeHighlight 1s ease-in-out;
}

@keyframes fadeHighlight {
  0% {
    background-color: #ffeb3b;
  }

  100% {
    background-color: transparent;
  }
}

/* Utilities */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile-friendly reader toolbar */
@media (max-width: 768px) {
  .reader-toolbar-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(250, 250, 249, 0.95) 0%, rgba(250, 250, 249, 0.9) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(107, 142, 91, 0.15);
    border-bottom: none;
    padding: 0.5rem 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }

  body.dark-mode .reader-toolbar-wrap {
    background: linear-gradient(180deg, rgba(10, 14, 26, 0.95) 0%, rgba(10, 14, 26, 0.9) 100%);
    border-top-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  }

  .reader-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.5rem 0;
  }

  .toolbar-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(107, 142, 91, 0.1);
  }

  body.dark-mode .toolbar-group {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(99, 102, 241, 0.2);
  }

  .toolbar-group:first-child {
    margin-bottom: 0.25rem;
  }

  .btn-pill {
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    font-size: 0.85rem;
  }

  .btn-ghost {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  .range {
    width: 80px;
    height: 6px;
  }

  .range-value {
    font-size: 0.8rem;
    min-width: 40px;
  }

  .divider {
    display: none;
  }

  .voice-settings {
    position: relative;
  }

  .voice-settings summary {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  .select {
    min-width: 180px;
    max-width: 200px;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }

  /* Add some bottom padding to content to account for fixed toolbar */
  .news-detail {
    padding-bottom: 8rem;
  }

  .news-detail-content {
    font-size: 1.06rem;
    padding: 20px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .reader-toolbar-wrap {
    padding: 0.25rem 0.75rem;
  }

  .toolbar-group {
    padding: 0.4rem;
    gap: 0.4rem;
  }

  .btn-pill {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    font-size: 0.8rem;
  }

  .btn-ghost {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }

  .range {
    width: 70px;
    height: 5px;
  }

  .range-value {
    font-size: 0.75rem;
    min-width: 35px;
  }

  .select {
    min-width: 160px;
    max-width: 180px;
    font-size: 0.8rem;
  }
}