/* Prevent sticky white reveal masks from covering footer */
footer.bg-secondary,
footer.bg-secondary .container {
  position: relative;
  z-index: 1;
}

footer .grid-reveal-masks {
  display: none !important;
}

.kopena-breadcrumb-current {
  max-width: min(18rem, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Outline dark button is used on light sections — keep text dark */
.button-autline-dark {
  border-color: var(--color-secondary) !important;
  background-color: transparent !important;
  color: var(--color-secondary) !important;
}

.button-autline-dark::before {
  background-color: var(--color-secondary) !important;
}

.button-autline-dark:hover {
  border-color: var(--color-secondary) !important;
  color: var(--color-white) !important;
}

/* Kopena public nav — compact submenu with readable contrast */
@media screen and (min-width: 1025px) {
  .main-menu .sub-menu.kopena-sub-menu {
    left: 50%;
    width: auto;
    min-width: 15.5rem;
    max-width: 20rem;
    display: flex !important;
    flex-direction: column;
    grid-template-columns: none;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: #ffffff;
    border: 1px solid rgba(13, 13, 13, 0.08);
    box-shadow: 0 18px 40px -20px rgba(16, 24, 20, 0.45);
  }

  .main-menu .sub-menu.kopena-sub-menu li {
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .main-menu .sub-menu.kopena-sub-menu a {
    display: block;
    width: 100%;
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    color: #0d0d0d !important;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .main-menu .sub-menu.kopena-sub-menu a:hover,
  .main-menu .sub-menu.kopena-sub-menu a:focus-visible {
    background-color: rgba(209, 222, 111, 0.35);
    color: #114a43 !important;
  }

  .main-menu > ul > li:hover > button,
  .main-menu > ul > li:hover > a {
    color: #ffffff;
  }
}

@media screen and (max-width: 1024px) {
  .main-menu .sub-menu.kopena-sub-menu a {
    color: #ffffff !important;
    font-weight: 600;
  }

  .main-menu .sub-menu.kopena-sub-menu a:hover {
    color: var(--color-primary) !important;
  }
}

/* Berita cards — uniform cover height so titles align */
.kopena-article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 768px) {
  .kopena-article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kopena-article-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}

.kopena-article-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  flex-shrink: 0;
  overflow: hidden;
  background-color: #f1f5f9;
}

.kopena-article-card__media img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center;
}

.kopena-article-card__media-fallback {
  display: flex;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
}

.kopena-article-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.kopena-article-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: 2.75em;
}

.kopena-article-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Detail berita */
.kopena-article {
  max-width: 46rem;
  margin: 0 auto;
}

.kopena-article__header {
  margin-bottom: 1.5rem;
}

.kopena-article__meta {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
}

.kopena-article__excerpt {
  margin: 0.75rem 0 0;
  font-size: 1.125rem;
  line-height: 1.6;
  color: #475569;
}

.kopena-article__cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1rem;
  background: #f1f5f9;
  border: 1px solid rgba(13, 13, 13, 0.06);
}

.kopena-article__cover img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center;
}

.kopena-article__body {
  margin-top: 1.75rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #334155;
}

.kopena-article__body p {
  margin: 0 0 1rem;
}

.kopena-article__actions {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(13, 13, 13, 0.08);
}

.kopena-article-related {
  max-width: 46rem;
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(13, 13, 13, 0.08);
}

.kopena-article-related__title {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d0d0d;
}

.kopena-article-related__list {
  display: grid;
  gap: 1rem;
}

.kopena-article-related__item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(13, 13, 13, 0.08);
  background: #fff;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.kopena-article-related__item:hover {
  border-color: var(--color-secondary, #114a43);
}

.kopena-article-related__media {
  width: 7rem;
  min-height: 5.5rem;
  overflow: hidden;
  background: #f1f5f9;
}

.kopena-article-related__media img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
}

.kopena-article-related__media span {
  display: flex;
  height: 100%;
  min-height: 5.5rem;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.kopena-article-related__content {
  padding: 1rem 1rem 1rem 0;
  min-width: 0;
}

.kopena-article-related__item-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-weight: 700;
  color: #0d0d0d;
}

.kopena-article-related__content p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

@media (min-width: 640px) {
  .kopena-article-related__item {
    grid-template-columns: 9rem minmax(0, 1fr);
  }

  .kopena-article-related__media {
    width: 9rem;
    min-height: 6.5rem;
  }
}
