/* ==========================================================================
   DoctorsHub24 — Health Guides & Clinical Updates Dynamic Portal CSS
   ========================================================================== */

.dhbl-page,
dialog.dhbl-dialog {
  --dhbl-teal: #0d9488;
  --dhbl-teal-dark: #0f766e;
  --dhbl-teal-soft: #f0fdfa;
  --dhbl-navy: #0b2d5b;
  --dhbl-ink: #0f172a;
  --dhbl-muted: #64748b;
  --dhbl-line: #e2e8f0;
  --dhbl-bg: #f8fafc;
}

.dhbl-page {
  background: var(--dhbl-bg);
  padding-block: 1.5rem 4rem;
}

.dhbl-shell {
  max-width: 1220px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.dhbl-sr-only {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* ---------- Hero Header ---------- */
.dhbl-hero {
  background: linear-gradient(135deg, #0b2d5b 0%, #0f3f58 55%, #0d9488 100%);
  color: #ffffff;
  border-radius: 22px;
  padding: 2rem 2.15rem;
  margin-block-end: 1.35rem;
  box-shadow: 0 18px 42px rgba(11, 45, 91, 0.14);
}

.dhbl-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1.35rem;
}

.dhbl-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.77rem;
  font-weight: 700;
  margin-block-end: 0.65rem;
}

.dhbl-hero h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 2.7vw, 2.2rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.dhbl-hero-sub {
  margin: 0;
  max-width: 65ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.94rem;
  line-height: 1.55;
}

.dhbl-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.dhbl-kpi {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 0.78rem 1rem;
}

.dhbl-kpi strong {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
}

.dhbl-kpi span {
  font-size: 0.77rem;
  color: rgba(255, 255, 255, 0.84);
}

/* ---------- Toolbar (Search + Topic Tabs + Bookmarks + Sort) ---------- */
.dhbl-toolbar {
  background: #ffffff;
  border: 1px solid var(--dhbl-line);
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  margin-block-end: 1.35rem;
}

.dhbl-filter-row {
  display: grid;
  grid-template-columns: 1.7fr 1fr auto auto;
  gap: 0.65rem;
  align-items: end;
  margin-block-end: 0.85rem;
}

.dhbl-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dhbl-field label {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
}

.dhbl-field input,
.dhbl-field select {
  width: 100%;
  min-height: 42px;
  padding: 0.48rem 0.75rem;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  font: inherit;
  font-size: 0.88rem;
  color: var(--dhbl-ink);
}

.dhbl-field input:focus-visible,
.dhbl-field select:focus-visible,
.dhbl-tab:focus-visible,
.dhbl-bm-filter:focus-visible,
.dhbl-btn-primary:focus-visible,
.dhbl-btn-ghost:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.28);
  outline-offset: 2px;
  border-color: var(--dhbl-teal);
}

.dhbl-bm-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 42px;
  padding: 0.45rem 0.88rem;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.dhbl-bm-filter.is-active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* Single-Row Scrollable Accessible Tablist */
.dhbl-tablist-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-block-start: 1px solid var(--dhbl-line);
  padding-block-start: 0.35rem;
}

.dhbl-tablist {
  display: flex;
  overflow-x: auto;
  gap: 0.25rem;
  flex: 1 1 auto;
  scrollbar-width: none;
}

.dhbl-tablist::-webkit-scrollbar {
  display: none;
}

.dhbl-tab {
  flex: none;
  position: relative;
  padding: 0.65rem 0.88rem;
  border: none;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.dhbl-tab[aria-selected="true"] {
  color: #0f766e;
}

.dhbl-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 3px solid #0d9488;
}

/* ---------- Featured Spotlight Card ---------- */
.dhbl-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
  background: #ffffff;
  border: 1px solid var(--dhbl-line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  margin-block-end: 1.5rem;
}

.dhbl-featured[hidden] {
  display: none !important;
}

.dhbl-featured-media {
  position: relative;
  min-height: 250px;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0b2d5b 0%, #0f766e 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dhbl-featured-emblem {
  font-size: 3.1rem;
  opacity: 0.9;
}

.dhbl-feat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.dhbl-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.26rem 0.68rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
}

.dhbl-pill.is-feat {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #ffffff;
}

.dhbl-pill.is-tag {
  background: var(--dhbl-teal-soft);
  border: 1px solid #99f6e4;
  color: var(--dhbl-teal-dark);
}

.dhbl-featured-body {
  padding: 1.65rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.65rem;
}

.dhbl-featured-body h2 {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 800;
  color: var(--dhbl-navy);
  line-height: 1.28;
}

.dhbl-featured-body p {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.55;
}

.dhbl-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--dhbl-muted);
  font-weight: 600;
}

.dhbl-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

/* ---------- 3-Column Article Grid ---------- */
.dhbl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  margin-block-end: 1.85rem;
}

.dhbl-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--dhbl-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dhbl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(11, 45, 91, 0.09);
  border-color: #99f6e4;
}

.dhbl-card[hidden] {
  display: none !important;
}

.dhbl-card-visual {
  height: 118px;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-block-end: 1px solid var(--dhbl-line);
}

.dhbl-card-visual[data-theme="diagnostics"] {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.dhbl-card-visual[data-theme="safety"] {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}
.dhbl-card-visual[data-theme="tourism"] {
  background: linear-gradient(135deg, #f0f9ff 0%, #cffafe 100%);
}
.dhbl-card-visual[data-theme="preventive"] {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.dhbl-visual-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: #ffffff;
  color: var(--dhbl-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.dhbl-bm-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dhbl-bm-btn.is-saved {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.dhbl-card-body {
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.48rem;
}

.dhbl-card-body h3 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--dhbl-navy);
  line-height: 1.34;
}

.dhbl-card-excerpt {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #475569;
}

.dhbl-author-line {
  font-size: 0.76rem;
  color: #0f766e;
  font-weight: 700;
  margin-top: auto;
  padding-top: 0.35rem;
}

.dhbl-card-foot {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
  margin-top: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--dhbl-line);
}

.dhbl-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 40px;
  padding: 0.42rem 0.88rem;
  border-radius: 10px;
  border: none;
  background: #0d9488;
  color: #ffffff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.dhbl-btn-primary:hover {
  background: #0f766e;
  color: #ffffff;
}

.dhbl-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 40px;
  padding: 0.42rem 0.72rem;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 0.79rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.dhbl-btn-ghost:hover {
  border-color: var(--dhbl-teal);
  color: var(--dhbl-teal-dark);
}

.dhbl-btn-ghost.is-voted {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.dhbl-empty {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 2.3rem 1.25rem;
  text-align: center;
  color: #475569;
  margin-block-end: 1.5rem;
}

.dhbl-empty[hidden] {
  display: none;
}

/* ---------- Health Digest Subscription Strip ---------- */
.dhbl-digest-box {
  background: #ffffff;
  border: 1px solid var(--dhbl-line);
  border-radius: 18px;
  padding: 1.4rem 1.55rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  display: grid;
  grid-template-columns: 1.15fr 1.35fr;
  gap: 1.2rem;
  align-items: center;
}

.dhbl-digest-box h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dhbl-navy);
}

.dhbl-digest-box p {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
}

.dhbl-digest-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.dhbl-digest-form input,
.dhbl-digest-form select {
  flex: 1 1 180px;
  min-height: 44px;
  padding: 0.52rem 0.78rem;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  font: inherit;
  font-size: max(0.95rem, 1em);
  color: var(--dhbl-ink);
}

.dhbl-digest-form input:user-invalid {
  border-color: #dc2626;
  background: #fffafa;
}

.dhbl-status-msg {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.dhbl-status-msg[hidden] {
  display: none;
}

.dhbl-status-msg.is-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.dhbl-status-msg.is-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* ---------- Native Top-Layer Article Reader <dialog> ---------- */
dialog.dhbl-dialog {
  width: min(820px, calc(100vw - 2rem));
  max-height: min(92dvh, 780px);
  margin: auto;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  flex-direction: column;
}

dialog.dhbl-dialog[open] {
  display: flex;
}

dialog.dhbl-dialog:modal {
  overscroll-behavior: contain;
}

dialog.dhbl-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
}

.dhbl-dlg-head {
  padding: 1rem 1.35rem 0.75rem;
  border-block-end: 1px solid #e2e8f0;
  background: #ffffff;
}

.dhbl-dlg-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.dhbl-dlg-title {
  margin: 0.25rem 0 0.2rem;
  font-size: 1.22rem;
  font-weight: 800;
  color: #0b2d5b;
  line-height: 1.3;
}

.dhbl-dlg-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 1.05rem;
  cursor: pointer;
  flex: 0 0 auto;
}

progress.dhbl-read-progress {
  width: 100%;
  height: 5px;
  margin-top: 0.65rem;
  border-radius: 999px;
  overflow: hidden;
  accent-color: #0d9488;
}

.dhbl-reader-scroll {
  overflow-y: auto;
  padding: 1.2rem 1.35rem 1.45rem;
  flex: 1 1 auto;
}

.dhbl-prose p {
  font-size: 0.94rem;
  line-height: 1.68;
  color: #334155;
  margin: 0 0 0.95rem;
}

.dhbl-prose ol,
.dhbl-prose ul {
  margin: 0 0 1.05rem;
  padding-inline-start: 1.35rem;
  color: #1e293b;
  font-size: 0.92rem;
  line-height: 1.65;
}

.dhbl-prose li {
  margin-bottom: 0.42rem;
}

.dhbl-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  margin-block: 1.1rem;
}

.dhbl-comments-box {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.1rem;
  margin-top: 1.1rem;
}

.dhbl-comment-item {
  padding: 0.72rem 0.9rem;
  border-radius: 11px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 0.55rem;
}

.dhbl-comment-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.dhbl-comment-form .is-full {
  grid-column: 1 / -1;
}

.dhbl-comment-form input,
.dhbl-comment-form textarea {
  width: 100%;
  padding: 0.52rem 0.75rem;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  font: inherit;
  font-size: max(0.95rem, 1em);
  color: #0f172a;
}

.dhbl-comment-form input:user-invalid,
.dhbl-comment-form textarea:user-invalid {
  border-color: #dc2626;
  background: #fffafa;
}

@media (max-width: 1024px) {
  .dhbl-filter-row {
    grid-template-columns: 1fr 1fr;
  }
  .dhbl-featured,
  .dhbl-digest-box {
    grid-template-columns: 1fr;
  }
  .dhbl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dhbl-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dhbl-filter-row,
  .dhbl-grid,
  .dhbl-comment-form {
    grid-template-columns: 1fr;
  }
}
