/*
 * Berita Modern 1.2.0
 * Palet navy-maroon, slider, sidebar, share buttons, kategori dan dark mode.
 */
:root {
  --navy: #142b45;
  --navy-deep: #0d1d30;
  --navy-soft: #234563;
  --maroon: #7b233d;
  --maroon-deep: #5d172e;
  --red: var(--maroon);
  --dark: var(--navy-deep);
  --orange: var(--maroon);
  --blue: var(--navy-soft);
  --text: #243449;
  --muted: #718096;
  --line: #e2e7ed;
  --bg: #ffffff;
}

body { background: var(--bg); color: var(--text); }
a:hover { color: var(--maroon); }

.breaking { background: #f8f9fb; border-color: var(--line); }
.breaking__label { background: var(--maroon); }
.breaking__nav button:hover { background: var(--maroon); border-color: var(--maroon); }
.masthead { background: var(--navy); border-bottom: 3px solid var(--maroon); }
.site-title a { color: #fff; }
.site-title a:hover { color: #f1dbe2; }
.site-description { color: rgba(255,255,255,.72); }
.main-nav a { color: rgba(255,255,255,.92); }
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-cat > a,
.main-nav .current-menu-ancestor > a { color: #f0c8d3; }
.main-nav .sub-menu,
.main-nav .children { background: var(--navy-deep); border-color: rgba(255,255,255,.14); }
.main-nav .sub-menu a,
.main-nav .children a { color: #fff; }
.nav-toggle { background: var(--navy-deep); border-color: rgba(255,255,255,.3); }
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after { background: #fff; }
.search-form { border-color: rgba(255,255,255,.25); }
.search-submit { background: var(--maroon); }
.search-submit:hover { background: var(--maroon-deep); }
.search-form:focus-within { border-color: #e9bdca; }
.badge, .badge--c0, .badge--c1, .badge--c2, .badge--c3, .badge--c4 { background: var(--maroon); }
.badge--c1, .badge--c3 { background: var(--navy-soft); }
.section-title::after { background: var(--maroon); }
.headline__label { background: var(--navy); }
.button, .comment-form .submit { background: var(--maroon); }
.button:hover, .comment-form .submit:hover { background: var(--navy); }
.page-numbers.current, .page-numbers:hover { background: var(--maroon); border-color: var(--maroon); }
.entry-content a, .reply a { color: var(--maroon); }
.entry-content blockquote { border-color: var(--maroon); }
.entry-footer .tags a:hover, .post-navigation a:hover { border-color: var(--maroon); }
.not-found h1 { color: var(--maroon); }

/* Theme mode control */
.bm-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 5px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.bm-theme-toggle:hover { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.bm-theme-toggle__icon { font-size: 17px; line-height: 1; }

/* Slider below the primary navigation */
.bm-slider-section {
  padding: 18px 0 20px;
  background: #f4f6f9;
  border-bottom: 1px solid var(--line);
}
.bm-slider__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.bm-slider__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--maroon);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.bm-slider__heading h2 { color: var(--navy); font-size: 19px; line-height: 1.2; }
.bm-slider__controls { display: flex; gap: 6px; }
.bm-slider__controls button {
  width: 32px;
  height: 32px;
  border: 1px solid #d8dee7;
  border-radius: 4px;
  color: var(--navy);
  background: #fff;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.bm-slider__controls button:hover { color: #fff; background: var(--maroon); border-color: var(--maroon); }
.bm-slider { overflow: hidden; }
.bm-slider__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #b8c2cf transparent;
  padding-bottom: 5px;
}
.bm-slider__item {
  position: relative;
  display: flex;
  flex: 0 0 calc((100% - 36px) / 4);
  min-width: 0;
  min-height: 160px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--navy);
  scroll-snap-align: start;
}
.bm-slider__image { position: absolute; inset: 0; }
.bm-slider__image img,
.bm-slider__image .bm-noimg { width: 100%; height: 100%; object-fit: cover; }
.bm-slider__image::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(7,20,34,.04), rgba(7,20,34,.88));
}
.bm-slider__copy {
  position: relative;
  z-index: 1;
  align-self: end;
  width: 100%;
  padding: 14px;
  color: #fff;
}
.bm-slider__copy .badge { margin-bottom: 6px; font-size: 9px; }
.bm-slider__copy h3 {
  display: -webkit-box;
  margin-bottom: 6px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  line-height: 1.32;
  font-weight: 750;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.bm-slider__copy h3 a:hover { color: #f1dbe2; }
.bm-slider__copy .post-date { color: rgba(255,255,255,.78); font-size: 10px; }

/* Homepage main column and sidebar */
.bm-home-layout,
.bm-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--bm-sidebar-width, 290px);
  align-items: start;
  gap: 28px;
  margin-top: 28px;
}
.bm-home-main,
.bm-content-main { min-width: 0; }
.bm-home-layout .section-title { margin-top: 10px; }
.bm-home-layout .editor { margin-bottom: 12px; }
.bm-sidebar { min-width: 0; }
.bm-widget {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.bm-widget .widget-title {
  position: relative;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 16px;
  font-weight: 800;
}
.bm-widget .widget-title::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 34px;
  height: 3px;
  content: "";
  background: var(--maroon);
}
.bm-widget__latest { display: flex; flex-direction: column; gap: 12px; }
.bm-widget-post {
  display: grid;
  grid-template-columns: 76px minmax(0,1fr);
  align-items: start;
  gap: 10px;
}
.bm-widget-post__image {
  width: 76px;
  height: 60px;
  overflow: hidden;
  border-radius: 4px;
  background: #e7ebf0;
}
.bm-widget-post__image img { width: 100%; height: 100%; object-fit: cover; }
.bm-widget-post h3 {
  display: -webkit-box;
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.bm-widget-post time { color: var(--muted); font-size: 10px; }
.bm-widget__categories li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
}
.bm-widget__categories li:last-child { border-bottom: 0; }
.bm-widget__categories a:hover { color: var(--maroon); }

/* Category channel blocks */
.bm-category-sections { margin: 30px 0 42px; }
.bm-category-sections > .section-title { margin-top: 0; }
.bm-category-grid {
  display: grid;
  grid-template-columns: repeat(var(--bm-category-columns, 3), minmax(0,1fr));
  gap: 18px;
}
.bm-category-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.bm-category-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.bm-category-block__header h2 {
  color: var(--navy);
  font-size: 15px;
  font-weight: 850;
}
.bm-category-block__header h2::before {
  display: inline-block;
  width: 4px;
  height: 15px;
  margin-right: 8px;
  background: var(--maroon);
  content: "";
  vertical-align: -2px;
}
.bm-category-block__more {
  flex: 0 0 auto;
  color: var(--maroon);
  font-size: 10px;
  font-weight: 700;
}
.bm-category-block__posts { display: flex; flex-direction: column; gap: 12px; }
.bm-category-post {
  display: grid;
  grid-template-columns: 92px minmax(0,1fr);
  align-items: start;
  gap: 10px;
}
.bm-category-post__image {
  display: block;
  width: 92px;
  height: 68px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8ebf0;
}
.bm-category-post__image img { width: 100%; height: 100%; object-fit: cover; }
.bm-category-post__copy h3 {
  display: -webkit-box;
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 750;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.bm-category-post__copy .post-date { font-size: 9px; }

/* Share controls */
.bm-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.bm-share strong { margin-right: 4px; color: var(--navy); font-size: 12px; }
.bm-share__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--navy);
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.bm-share__button:hover { border-color: var(--maroon); color: #fff; background: var(--maroon); }
.bm-share__status { color: var(--muted); font-size: 11px; }

/* Dark mode */
body.bm-dark {
  --bg: #101a27;
  --text: #e8edf4;
  --muted: #a7b2c0;
  --line: #2a394b;
  --dark: #091321;
  background: var(--bg);
  color: var(--text);
}
body.bm-dark .breaking,
body.bm-dark .bm-slider-section { background: #111f2f; border-color: var(--line); }
body.bm-dark .breaking__text,
body.bm-dark .breaking__text a { color: #e0e7ef; }
body.bm-dark .bm-slider__heading h2 { color: #f2f5f9; }
body.bm-dark .bm-widget,
body.bm-dark .bm-category-block,
body.bm-dark .bm-share__button { background: #172638; border-color: var(--line); color: var(--text); }
body.bm-dark .bm-widget .widget-title,
body.bm-dark .bm-category-block__header h2,
body.bm-dark .bm-share strong { color: #f0f3f8; }
body.bm-dark .bm-category-post__copy h3,
body.bm-dark .bm-widget-post h3,
body.bm-dark .bm-widget__categories li { color: #e5ebf2; }
body.bm-dark .bm-widget-post__image,
body.bm-dark .bm-category-post__image { background: #26374b; }
body.bm-dark .section-title { color: #f1f4f8; border-color: var(--line); }
body.bm-dark .entry-content { color: #d7e0ea; }
body.bm-dark .entry-content blockquote { color: #d7e0ea; }
body.bm-dark .entry-content th,
body.bm-dark .entry-content td { border-color: var(--line); }
body.bm-dark .search-form { background: #172638; border-color: #46566a; }
body.bm-dark .search-field { color: #f2f5f8; }
body.bm-dark .site-footer { border-color: var(--line); }
body.bm-dark .page-numbers { border-color: var(--line); color: #e7edf4; }
body.bm-dark .post-navigation a,
body.bm-dark .entry-footer .tags a { border-color: var(--line); }
body.bm-dark .bm-share__button:hover { background: var(--maroon); color: #fff; }

/* Responsive additions */
@media (max-width: 1050px) {
  .bm-home-layout, .bm-content-layout { grid-template-columns: minmax(0,1fr) 260px; gap: 20px; }
  .bm-category-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bm-slider__item { flex-basis: calc((100% - 24px) / 3); }
}
@media (max-width: 860px) {
  .bm-home-layout, .bm-content-layout { grid-template-columns: 1fr; }
  .bm-sidebar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .bm-widget { margin-bottom: 0; }
  .bm-slider__item { flex-basis: calc((100% - 12px) / 2); }
  .bm-theme-toggle { margin-left: auto; }
}
@media (max-width: 640px) {
  .bm-slider-section { padding: 14px 0; }
  .bm-slider__item { flex-basis: 78%; min-height: 150px; }
  .bm-category-grid { grid-template-columns: 1fr; gap: 12px; }
  .bm-sidebar { grid-template-columns: 1fr; }
  .bm-share { align-items: flex-start; }
  .bm-share strong { flex-basis: 100%; }
  .bm-theme-toggle { padding: 8px 9px; font-size: 11px; }
  .bm-theme-toggle__text { display: none; }
  .bm-content-layout { margin-top: 18px; }
  .entry-wrap { margin-top: 18px; }
}

/* Width adjustments for existing archive and single templates */
.entry-wrap { max-width: none; margin: 0 0 42px; }
.bm-content-main .archive-header { margin-top: 28px; }
.bm-content-main .archive-list { grid-template-columns: 1fr; }
.bm-content-main .pagination { margin-bottom: 40px; }
.bm-content-layout .bm-sidebar { margin-top: 28px; }
@media (max-width: 860px) {
  .bm-content-layout .bm-sidebar { margin-top: 0; }
}


/* Customizer: hide sidebar without leaving an empty column. */
.bm-no-sidebar .bm-home-layout,
.bm-no-sidebar .bm-content-layout {
  grid-template-columns: minmax(0, 1fr);
}
.bm-no-sidebar .bm-sidebar { display: none; }

@media (max-width: 1050px) {
  .bm-category-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .bm-category-grid { grid-template-columns: 1fr; }
}


/* Additional homepage layout controls from Customizer. */
.bm-sidebar-left .bm-home-layout,
.bm-sidebar-left .bm-content-layout {
  grid-template-columns: var(--bm-sidebar-width, 290px) minmax(0, 1fr);
}
.bm-sidebar-left .bm-home-main,
.bm-sidebar-left .bm-content-main { grid-column: 2; grid-row: 1; }
.bm-sidebar-left .bm-sidebar { grid-column: 1; grid-row: 1; }

@media (max-width: 860px) {
  .bm-sidebar-left .bm-home-layout,
  .bm-sidebar-left .bm-content-layout { grid-template-columns: minmax(0,1fr); }
  .bm-sidebar-left .bm-home-main,
  .bm-sidebar-left .bm-content-main,
  .bm-sidebar-left .bm-sidebar { grid-column: auto; grid-row: auto; }
}

@media (max-width: 992px) {
  .headline__track {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }
  .headline__item,
  .headline__item:nth-child(n+4) {
    display: flex;
    flex: 0 0 190px;
    scroll-snap-align: start;
  }
}
@media (max-width: 640px) {
  .headline__item,
  .headline__item:nth-child(n+4) { flex-basis: 155px; }
}
