/* ==========================================================================
   Dantara Mandiri - Modern Artikel & Kegiatan Stylesheet
   Max-width 1200px, 3-col Desktop Grid, Horizontal Mobile Cards, Zero Sidebar
   ========================================================================== */

/* Global protection on blog/archive pages to prevent any horizontal page shift */
body.blog,
body.archive,
body.search {
  overflow-x: hidden !important;
}

/* Container */
.dm-articles-container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* ==========================================================================
   1. HERO SECTION
   ========================================================================== */
.dm-articles-hero {
  position: relative;
  width: 100%;
  min-height: 220px;
  padding: 110px 0 42px;
  background-color: #08172c;
  background-image: url('https://dantaramandiri.co.id/wp-content/uploads/2026/10/dantara-articles-hero.webp');
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
}

.dm-articles-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #08172c 0%, rgba(8, 23, 44, 0.95) 45%, rgba(8, 23, 44, 0.75) 70%, rgba(8, 23, 44, 0.35) 100%);
  pointer-events: none;
}

.dm-articles-hero-inner {
  position: relative;
  z-index: 2;
}

.dm-breadcrumb {
  font-size: 13.5px;
  color: #94a3b8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dm-breadcrumb a:hover {
  color: #ffffff;
}

.dm-breadcrumb-sep {
  color: #64748b;
  font-size: 12px;
}

.dm-breadcrumb-current {
  color: #f1f5f9;
  font-weight: 500;
}

.dm-hero-title {
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.dm-hero-desc {
  font-size: 15px;
  color: #cbd5e1;
  margin: 0;
  max-width: 680px;
  line-height: 1.55;
}

/* ==========================================================================
   2. MAIN WRAPPER & FILTER BAR
   ========================================================================== */
.dm-articles-main {
  padding: 36px 0 64px;
  background-color: #ffffff;
}

.dm-filter-bar {
  margin-bottom: 28px;
}

.dm-filter-top-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.dm-search-wrap {
  position: relative;
  flex: 1;
}

.dm-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.dm-search-input {
  width: 100%;
  height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 42px 0 44px;
  font-size: 14.5px;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.dm-search-input:focus {
  border-color: #c8102e;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.dm-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: #e2e8f0;
  color: #475569;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background 0.2s;
}

.dm-search-clear:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.dm-sort-wrap {
  position: relative;
  min-width: 140px;
  flex-shrink: 0;
}

.dm-sort-select {
  width: 100%;
  height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 36px 0 16px;
  font-size: 14px;
  background: #ffffff;
  color: #0f172a;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-weight: 500;
  box-sizing: border-box;
}

.dm-sort-select:focus {
  border-color: #c8102e;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.dm-sort-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #64748b;
  pointer-events: none;
}

/* Category Chips & Result Count */
.dm-filter-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.dm-chips-scroll-wrap {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.dm-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px;
}

.dm-chips-scroll::-webkit-scrollbar {
  display: none;
}

.dm-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  transition: all 0.2s ease;
  outline: none;
  line-height: 1.25;
  flex-shrink: 0;
}

.dm-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.dm-chip.is-active {
  background: #0a192f;
  border-color: #0a192f;
  color: #ffffff;
  font-weight: 600;
}

.dm-results-count {
  font-size: 13.5px;
  color: #64748b;
  white-space: nowrap;
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
}

/* ==========================================================================
   3. DESKTOP ARTICLES GRID (3 COLUMNS)
   ========================================================================== */
.dm-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.dm-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}

.dm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.dm-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f1f5f9;
}

.dm-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.dm-card:hover .dm-card-img {
  transform: scale(1.03);
}

.dm-card-badge-floating {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2.5px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  background: rgba(234, 88, 12, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* Badge colors by category family */
.dm-card-badge-floating[data-category="event"] { background: rgba(234, 88, 12, 0.72); }
.dm-card-badge-inline[data-category="event"] { background: #ea580c; }

.dm-card-badge-floating[data-category="smk2-ketenagalistrikan"],
.dm-card-badge-floating[data-category="audit-smk2"] { background: rgba(225, 29, 72, 0.72); }
.dm-card-badge-inline[data-category="smk2-ketenagalistrikan"],
.dm-card-badge-inline[data-category="audit-smk2"] { background: #e11d48; }

.dm-card-badge-floating[data-category="sertifikasi-ketenagalistrikan"],
.dm-card-badge-floating[data-category="bimtek-ujikom"] { background: rgba(200, 16, 46, 0.72); }
.dm-card-badge-inline[data-category="sertifikasi-ketenagalistrikan"],
.dm-card-badge-inline[data-category="bimtek-ujikom"] { background: #c8102e; }

.dm-card-badge-floating[data-category="in-house"] { background: rgba(217, 119, 6, 0.72); }
.dm-card-badge-inline[data-category="in-house"] { background: #d97706; }

.dm-card-badge-floating[data-category="keselamatan-ketenagalistrikan"],
.dm-card-badge-floating[data-category="k3"] { background: rgba(220, 38, 38, 0.72); }
.dm-card-badge-inline[data-category="keselamatan-ketenagalistrikan"],
.dm-card-badge-inline[data-category="k3"] { background: #dc2626; }

.dm-card-badge-floating[data-category="regulasi-ketenagalistrikan"] { background: rgba(2, 132, 199, 0.72); }
.dm-card-badge-inline[data-category="regulasi-ketenagalistrikan"] { background: #0284c7; }

.dm-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.dm-card-mobile-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dm-card-badge-inline {
  display: none; /* hidden on desktop */
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  background: #c8102e;
  text-transform: uppercase;
}

.dm-card-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

.dm-card-date svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.dm-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #0a192f;
  line-height: 1.35;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.dm-card-title a {
  color: #0a192f;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dm-card:hover .dm-card-title a {
  color: #c8102e;
}

.dm-card-excerpt {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}

.dm-card-footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
}

.dm-card-readmore {
  font-size: 13.5px;
  font-weight: 600;
  color: #c8102e;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease, color 0.2s ease;
}

.dm-card:hover .dm-card-readmore {
  gap: 9px;
  color: #a50d24;
}

/* ==========================================================================
   4. NUMBERED PAGINATION
   ========================================================================== */
.dm-pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 40px auto 0;
  flex-wrap: wrap;
}

.dm-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s;
  cursor: pointer;
  outline: none;
}

.dm-page-btn-icon {
  display: none;
}

.dm-page-btn:hover:not(.is-disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.dm-page-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.dm-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s;
  cursor: pointer;
}

.dm-page-num:hover:not(.is-active) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.dm-page-num.is-active {
  background: #c8102e;
  border-color: #c8102e;
  color: #ffffff;
  font-weight: 700;
}

.dm-page-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 38px;
  color: #94a3b8;
  font-size: 14px;
}

/* ==========================================================================
   5. EMPTY STATE & LOADING STATE
   ========================================================================== */
.dm-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  margin: 20px 0;
}

.dm-empty-icon {
  margin-bottom: 14px;
}

.dm-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #0a192f;
  margin: 0 0 8px;
}

.dm-empty-desc {
  font-size: 14px;
  color: #64748b;
  margin: 0 auto 20px;
  max-width: 440px;
}

.dm-btn-reset-filters {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  background: #c8102e;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.dm-btn-reset-filters:hover {
  background: #a50d24;
}

.dm-articles-ajax-target {
  transition: opacity 0.2s ease;
}

.dm-articles-ajax-target.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ==========================================================================
   7. TABLET RESPONSIVE (768px - 1024px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
  .dm-articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* ==========================================================================
   8. MOBILE RESPONSIVE (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
  .dm-articles-hero {
    min-height: 190px;
    padding: 130px 0 36px;
    background-position: 80% center;
  }

  .dm-articles-hero-overlay {
    background: linear-gradient(180deg, rgba(8, 23, 44, 0.95) 0%, rgba(8, 23, 44, 0.88) 100%);
  }

  .dm-hero-title {
    font-size: 26px;
  }

  .dm-hero-desc {
    font-size: 13.5px;
  }

  .dm-articles-main {
    padding: 24px 0 60px;
  }

  .dm-filter-top-row {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .dm-search-wrap,
  .dm-sort-wrap {
    width: 100%;
  }

  .dm-filter-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .dm-chips-scroll-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .dm-chips-scroll {
    width: 100%;
    max-width: 100%;
  }

  .dm-results-count {
    text-align: left;
    font-size: 12.5px;
    padding-left: 2px;
  }

  /* Mobile: Horizontal Card Layout with Full-Height Thumbnail */
  .dm-articles-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .dm-card {
    flex-direction: row !important;
    align-items: stretch !important;
    padding: 10px !important;
    gap: 12px !important;
    border-radius: 8px !important;
    position: relative !important;
  }

  .dm-card-thumb-link {
    flex: 0 0 35% !important;
    max-width: 35% !important;
    display: flex !important;
    align-self: stretch !important;
    position: relative !important;
  }

  .dm-card-thumb-wrap {
    aspect-ratio: unset !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 110px !important;
    position: relative !important;
    border-radius: 6px !important;
    overflow: hidden !important;
  }

  .dm-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
  }

  .dm-card-badge-floating {
    display: none !important;
  }

  .dm-card-badge-inline {
    display: inline-block !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
  }

  .dm-card-date {
    white-space: nowrap !important;
    font-size: 11.5px !important;
  }

  .dm-card-body {
    padding: 0 !important;
    flex: 1 1 65% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-width: 0 !important;
  }

  .dm-card-title {
    font-size: 14px;
    line-height: 1.3;
    margin: 0 0 4px;
    min-height: unset;
    -webkit-line-clamp: 3;
  }

  .dm-card-excerpt {
    font-size: 12px;
    line-height: 1.35;
    margin: 0 0 6px;
    min-height: unset;
    -webkit-line-clamp: 2;
  }

  .dm-card-footer {
    padding-top: 0;
    margin-top: auto;
  }

  .dm-card-readmore {
    font-size: 12px;
  }

  /* Compact Mobile Pagination */
  .dm-page-btn-text {
    display: none;
  }

  .dm-page-btn-icon {
    display: inline-block;
  }

  .dm-page-btn {
    padding: 0 12px;
  }

  }
