:root {
  --dg-bg: #ffffff;
  --dg-surface: #f5f6f8;
  --dg-header: #f3f4f6;
  --dg-text: #1f2937;
  --dg-muted: #4b5563;
  --dg-border: #e5e7eb;
  --dg-accent: #3b82f6;
  --dg-accent-soft: #60a5fa;
  --dg-down: #ef4444;
  --dg-up: #3b82f6;
  --dg-radius: 14px;
  --dg-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --dg-max: 1120px;
  --dg-font: "Segoe UI", Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--dg-bg);
  color: var(--dg-text);
  font-family: var(--dg-font);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.dg-wrap {
  width: min(100% - 32px, var(--dg-max));
  margin-inline: auto;
}

/* Header */
.dg-header {
  background: var(--dg-header);
  border-bottom: 1px solid var(--dg-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.dg-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}

.dg-logo {
  display: block;
  width: 180px;
  height: 57px;
  flex-shrink: 0;
}

.dg-logo img {
  width: 180px;
  height: 57px;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

.dg-search-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dg-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dg-search-btn:hover {
  color: var(--dg-text);
  background: #e5e7eb;
}

.dg-search-panel {
  display: none;
  padding: 0 0 16px;
}

.dg-search-panel.is-open {
  display: block;
}

.dg-search-panel form {
  display: flex;
  gap: 8px;
}

.dg-search-panel input[type="search"] {
  flex: 1;
  border: 1px solid var(--dg-border);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  background: #fff;
}

.dg-search-panel button {
  border: 0;
  border-radius: 10px;
  background: var(--dg-accent);
  color: #fff;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}

/* Layout */
.dg-main {
  padding: 24px 0 56px;
}

.dg-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.dg-content {
  min-width: 0;
}

.dg-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Hero — height follows image ratio (not text length) */
.dg-hero {
  position: relative;
  border-radius: var(--dg-radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 0;
  background: #111827;
  box-shadow: var(--dg-shadow);
}

.dg-hero__media {
  position: absolute;
  inset: 0;
}

.dg-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.dg-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.78) 100%);
}

.dg-hero__body {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(14px, 3.5vw, 28px);
  color: #fff;
  overflow: hidden;
}

.dg-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: #1d4ed8;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.dg-hero__title {
  margin: 0 0 8px;
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  line-height: 1.35;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dg-hero__title a {
  color: #fff;
}

.dg-hero__excerpt {
  margin: 0;
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Latest news */
.dg-section {
  margin-top: 28px;
}

.dg-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dg-section__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
}

.dg-section__more {
  color: var(--dg-accent-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

.dg-section__more:hover {
  color: var(--dg-accent);
}

.dg-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dg-card {
  background: #fff;
  border: 1px solid var(--dg-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dg-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.dg-card__media {
  aspect-ratio: 16 / 10;
  background: #e5e7eb;
  overflow: hidden;
}

.dg-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dg-card__body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.dg-card__cat {
  color: var(--dg-accent-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.dg-card__title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.45;
  font-weight: 700;
}

.dg-card__excerpt {
  margin: 0;
  color: var(--dg-muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dg-card__meta {
  margin-top: auto;
  padding-top: 8px;
  color: #4b5563;
  font-size: 0.8rem;
}

/* Sidebar widgets */
.dg-widget {
  background: var(--dg-surface);
  border: 1px solid var(--dg-border);
  border-radius: 12px;
  padding: 16px;
}

.dg-widget__title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
}

.dg-widget--isx .dg-widget__title {
  margin-bottom: 4px;
}

.dg-isx__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.dg-isx__date {
  color: var(--dg-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.dg-isx__index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.dg-isx__pair {
  background: #fff;
  border: 1px solid var(--dg-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dg-isx__label {
  color: var(--dg-muted);
  font-size: 0.75rem;
}

.dg-isx__value {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dg-isx__unit {
  color: #4b5563;
  font-size: 0.72rem;
}

.dg-isx__change {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.dg-isx__chg-value {
  color: var(--dg-muted);
  font-size: 0.8rem;
}

.dg-isx__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #e5e7eb;
  font-size: 0.88rem;
}

.dg-isx__row strong {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.dg-isx__row small {
  color: var(--dg-muted);
  font-weight: 500;
}

.dg-isx__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 4px;
}

.dg-isx__stats > div {
  background: #fff;
  border: 1px solid var(--dg-border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.dg-isx__stats strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 2px;
}

.dg-isx__up {
  color: #16a34a;
}

.dg-isx__down {
  color: #dc2626;
}

.dg-isx__source {
  display: inline-block;
  margin-top: 10px;
  color: var(--dg-accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.dg-market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #e5e7eb;
}

.dg-market-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.dg-market-row:last-child {
  padding-bottom: 0;
}

.dg-market-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.dg-market-values {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dg-market-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dg-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.dg-chip--down {
  background: var(--dg-down);
}

.dg-chip--up {
  background: var(--dg-up);
}

.dg-read-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dg-read-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid #e5e7eb;
}

.dg-read-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.dg-read-list li:last-child {
  padding-bottom: 0;
}

.dg-read-num {
  color: #4b5563;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.5;
}

.dg-read-list a {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.55;
}

.dg-read-list a:hover {
  color: var(--dg-accent);
}

/* News archive & single */
.dg-page-title {
  margin: 0 0 20px;
  font-size: 1.75rem;
  font-weight: 800;
}

.dg-news-list {
  display: grid;
  gap: 18px;
}

.dg-news-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  border: 1px solid var(--dg-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.dg-news-item__media {
  min-height: 140px;
  background: #e5e7eb;
}

.dg-news-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dg-news-item__body {
  padding: 14px 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dg-single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}

.dg-single {
  max-width: none;
  margin: 0;
}

.dg-single-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 88px;
}

.dg-widget--compact {
  padding: 14px;
}

.dg-widget--cta {
  text-align: center;
  background: #fff;
}

.dg-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dg-related-list li {
  border-top: 1px solid var(--dg-border);
  padding: 10px 0;
}

.dg-related-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.dg-related-list li:last-child {
  padding-bottom: 0;
}

.dg-related-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dg-related-list__title {
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--dg-text);
}

.dg-related-list a:hover .dg-related-list__title {
  color: var(--dg-accent);
}

.dg-related-list__meta {
  font-size: 0.75rem;
  color: #4b5563;
}

.dg-cta-logo {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}

.dg-widget--cta .dg-widget__title {
  margin-top: 0;
}

.dg-cta-logo img {
  max-width: 160px;
  height: auto;
}

.dg-cta-text {
  margin: 0 0 14px;
  color: var(--dg-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.dg-cta-btn {
  display: block;
  width: 100%;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dg-cta-btn--primary {
  background: #0f766e;
  color: #fff;
}

.dg-cta-btn--primary:hover {
  background: #0d9488;
  color: #fff;
}

.dg-cta-btn--secondary {
  background: #fff;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.dg-cta-btn--secondary:hover {
  background: #f0fdfa;
  color: #0f766e;
}

.dg-single__back {
  margin-top: 28px;
}

.dg-single__title {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.35;
}

.dg-single__meta {
  color: var(--dg-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.dg-single__media {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 22px;
}

.dg-single__content {
  font-size: 1.05rem;
  line-height: 1.9;
}

.dg-single__content p {
  margin: 0 0 1.1em;
}

.dg-pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 28px;
}

.dg-pagination a,
.dg-pagination span {
  display: inline-flex;
  min-width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--dg-border);
  padding: 0 10px;
}

.dg-pagination .current {
  background: var(--dg-accent);
  border-color: var(--dg-accent);
  color: #fff;
}

/* Footer */
.dg-footer {
  border-top: 1px solid var(--dg-border);
  background: #fafafa;
  padding: 22px 0;
  color: var(--dg-muted);
  font-size: 0.9rem;
}

.dg-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .dg-home-grid {
    grid-template-columns: 1fr;
  }

  .dg-sidebar {
    order: 2;
  }

  .dg-cards {
    grid-template-columns: 1fr;
  }

  .dg-news-item {
    grid-template-columns: 1fr;
  }

  .dg-news-item__media {
    aspect-ratio: 16 / 9;
  }

  .dg-news-item__body {
    padding: 14px;
  }

  .dg-hero {
    aspect-ratio: 16 / 10;
  }

  .dg-hero__excerpt {
    -webkit-line-clamp: 2;
  }

  .dg-single-layout {
    grid-template-columns: 1fr;
  }

  .dg-single-sidebar {
    position: static;
    order: 2;
  }
}

@media (min-width: 700px) and (max-width: 980px) {
  .dg-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Alhayat popup on single posts */
html.dg-popup-open {
  overflow: hidden;
}

.dg-popup[hidden] {
  display: none !important;
}

.dg-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dg-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.dg-popup__card {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  background: #fff;
  border: 1px solid var(--dg-border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  padding: 20px 18px 16px;
  text-align: center;
  animation: dg-popup-in 0.22s ease;
}

.dg-popup__close {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.dg-popup__close:hover {
  background: #e5e7eb;
}

.dg-popup__card .dg-cta-logo {
  margin-top: 8px;
}

.dg-popup__card .dg-cta-btn {
  margin-bottom: 8px;
}

@keyframes dg-popup-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 404 */
.dg-404 {
  text-align: center;
  padding: 2.75rem 1.25rem 2rem;
  margin: 1.5rem 0 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
}

.dg-404__code {
  margin: 0;
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  color: #111827;
  letter-spacing: -0.04em;
}

.dg-404__title {
  margin: 0.5rem 0 0.65rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
}

.dg-404__text {
  margin: 0 auto 1.25rem;
  max-width: 36rem;
  color: #4b5563;
  font-size: 1rem;
}

.dg-404__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.dg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.dg-btn:hover {
  background: #374151;
  color: #fff;
}

.dg-btn--ghost {
  background: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.dg-btn--ghost:hover {
  background: #f3f4f6;
  color: #111827;
}

.dg-404__search {
  display: flex;
  gap: 0.5rem;
  max-width: 28rem;
  margin: 0 auto;
}

.dg-404__search input {
  flex: 1;
  min-width: 0;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
}

.dg-404__search button {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  background: #111827;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dg-404__latest {
  margin: 0 0 2rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
}

.dg-404__list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
}

.dg-404__list li {
  padding: 0.7rem 0;
  border-top: 1px solid #f3f4f6;
}

.dg-404__list a {
  font-weight: 700;
  color: #111827;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
