/* ubertex/public/assets/css/news.css */

/* Root tokens */
:root {
  --bg: #f5f6f8;
  --dark: #1f1f28;
  --muted: #6d7280;
  --accent: #E6A57E;
  --accent-hover: #CF9270;
  --radius: 16px;
  --shadow: 0 30px 80px -10px rgba(31,31,40,0.08);
  --transition: .35s cubic-bezier(.4,.2,.2,1);
  --text-shadow: 0 2px 12px rgba(0,0,0,0.2);
  --text-shadow-dark: 0 2px 8px rgba(0,0,0,0.6);
  --breakpoint-md: 992px;
  --breakpoint-lg: 1200px;

  /* KONTRAS AMAN (update) */
  --accent-contrast: #8C4B21;          /* aman di atas abu-abu terang */
  --accent-contrast-hover: #7A3C16;    /* hover lebih gelap */
  --muted-600: #4B5563;                /* meta kecil */

  font-family: system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}

/* Base / container */
.news-page,
#news-section {
  background: var(--bg);
  color: var(--dark);
}
.container {
  width: 90%;
  max-width: 1240px;
  margin: 0 auto;
}

/* HERO / BANNER */
.news-hero {
  position: relative;
  padding: 80px 0 50px;
  overflow: hidden;
  background: linear-gradient(135deg, #1f1f28 0%, #2f2f42 100%);
  color: #fff;
  margin-bottom: 2rem;
}
.news-hero .container {
  position: relative;
  z-index: 1;
  max-width: 1150px;
  margin: 0 auto;
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.news-hero .wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  display: block;
}
.hero-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.header-line {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.accent-square {
  width: 10px;
  height: 50px;
  background: #E6A57E;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 4px;
}
.text-block { flex: 1; }
.hero-title {
  font-size: 2.8rem;
  margin: 0;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.5px;
}
.hero-subtitle {
  font-size: 1.05rem;
  margin: 8px 0 0;
  max-width: 700px;
  line-height: 1.5;
  opacity: 0.9;
}
.hero-cta { margin-top: 16px; }
.quick-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-btn {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: background .25s, transform .2s;
}
.filter-btn.active,
.filter-btn:hover {
  background: #fff;
  color: #1f1f28;
  border-color: #fff;
  transform: translateY(-1px);
}

/* OPTIONAL SECONDARY HEADER / FILTER */
.news-header {
  margin-top: 40px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.headline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.accent-bar {
  width: 8px;
  height: 48px;
  background: var(--accent);
  border-radius: 4px;
  flex-shrink: 0;
}
.news-title {
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
}
.subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.subnav .filter-btn {
  background: transparent;
  border: 2px solid var(--dark);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
  position: relative;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.subnav .filter-btn.active,
.subnav .filter-btn:hover {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

/* FEATURED CARD */
.featured-section { margin-top: 16px; }
.featured-card {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  color: inherit;
  background: #111;
  box-shadow: 0 40px 100px -15px rgba(31,31,40,0.12);
}
.featured-card .image-wrapper {
  flex: 1 1 55%;
  min-width: 320px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #000;
}
.featured-card .image-wrapper::before {
  content: "";
  display: block;
  padding-bottom: calc((2 / 3) * 100%);
}
.featured-card .image-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.95);
}
.featured-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.45) 65%, rgba(0,0,0,0.75) 85%, rgba(0,0,0,0.95) 100%);
  pointer-events: none;
}
.featured-card .content {
  flex: 1 1 45%;
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(250,250,250,0.02) 100%);
}
.featured-card .meta {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  display: flex;
  gap: 8px;
  color: #fff;
}
.featured-card .title {
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  text-shadow: var(--text-shadow);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-card .excerpt {
  font-size: 1rem;
  margin: 0;
  color: #fff;
  line-height: 1.45;
}
.read-more-wrapper .read-more {
  display: inline-block;
  font-weight: 600;
  color: #fff;
  position: relative;
  text-decoration: none;
}
.read-more-wrapper .read-more::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: width .35s ease;
}
.read-more-wrapper .read-more:hover::after {
  width: 100%;
}

/* GRID LIST */
.grid-section { padding-top: 10px; }
#news-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  grid-auto-rows: 1fr;
  margin-top: 10px;
  align-items: start;
}

/* REGULAR CARD */
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  position: relative;
  box-shadow: var(--shadow);
  transition: none;
}
.card .image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #e9ecf2;
}
.card .image-wrapper::before {
  content: "";
  display: block;
  padding-bottom: calc((2 / 3) * 100%);
}
.card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
/* Perbaikan kontras meta kecil */
.card .meta {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted-600) !important;
  display: flex;
  gap: 6px;
}
.card .title {
  font-size: 1.15rem;
  margin: 0;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .excerpt {
  font-size: .9rem;
  margin: 0;
  color: #444;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.footer { margin-top: auto; }

/* Perbaikan kontras link "Baca selengkapnya" + fallback layout lain */
.card .read-more,
.card .read-more:visited,
.article-card-main a.article-read-more,
.article-card-main a.article-read-more:visited,
.article-read-more,
.article-read-more:visited {
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent-contrast) !important;
  text-decoration: underline;
  position: relative;
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}
.card .read-more::after,
.article-card-main a.article-read-more::after,
.article-read-more::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent-contrast);
  border-radius: 2px;
  transition: width .35s ease;
}
.card .read-more:hover,
.article-card-main a.article-read-more:hover,
.article-read-more:hover {
  color: var(--accent-contrast-hover) !important;
}
.card .read-more:hover::after,
.article-card-main a.article-read-more:hover::after,
.article-read-more:hover::after {
  width: 100%;
}
.card .read-more .arrow { margin-left: 4px; transition: transform .3s ease; }
.card .read-more:hover .arrow { transform: translateX(3px); }

/* Fallback meta/date/author di berbagai markup */
.date,
.author,
.article-card-main .date,
.article-card-main .author {
  color: var(--muted-600) !important;
}

/* Tombol generik “Try This” */
.item-btn.try-btn,
.item-btn.try-btn:visited {
  background-color: var(--accent) !important;
  color: var(--dark) !important;
  border: 1px solid transparent !important;
}
.item-btn.try-btn:hover,
.item-btn.try-btn:focus {
  background-color: var(--accent-hover) !important;
  color: var(--dark) !important;
}
.item-btn.try-btn:focus-visible {
  outline: 2px solid var(--accent-contrast) !important;
  outline-offset: 2px !important;
}

/* Fade-in utility (optional) */
[data-animate] { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; }
[data-animate].visible { opacity: 1; transform: translateY(0); }

/* RESPONSIVE ADJUSTMENTS */
@media (min-width: var(--breakpoint-md)) {
  .featured-card { flex-wrap: nowrap; }
}

/* ===== MOBILE CLEANUP FOR NEWS ===== */
@media (max-width: 700px) {
  .news-page .container,
  #news-section .container {
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }
  .news-hero { padding: 54px 0 34px; padding-top: 90px; margin-bottom: 18px; }
  .hero-content { gap: 10px; }
  .header-line { gap: 8px; }
  .hero-title { font-size: clamp(1.7rem, 6vw, 2.1rem); line-height: 1.15; margin: 0; word-break: break-word; }
  .hero-subtitle { font-size: .95rem; line-height: 1.45; margin-top: 6px; }
  .quick-filters { gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .quick-filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex: 0 0 auto; padding: 8px 12px; font-size: .8rem; }
  .featured-section { margin-top: 8px; }
  .featured-card { flex-direction: column; border-radius: 16px; }
  .featured-card .image-wrapper { aspect-ratio: 16/9; min-width: 0; }
  .featured-card .content { padding: 14px 14px 16px; gap: 8px; }
  .featured-card .title { font-size: 1.35rem; -webkit-line-clamp: 3; }
  .featured-card .excerpt { font-size: .95rem; }
  #news-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 8px; }
  .card { border-radius: 14px; }
  .card .image-wrapper { aspect-ratio: 16/9; background: #eef1f5; }
  .card .title { font-size: 1.05rem; -webkit-line-clamp: 2; }
  .card .excerpt { font-size: .92rem; -webkit-line-clamp: 3; }
  .card .meta { font-size: .62rem; gap: 4px; }
  .body { padding: 12px; gap: 6px; }
  .card .title,
  .featured-card .title,
  .card .excerpt,
  .featured-card .excerpt { overflow-wrap: anywhere; word-break: break-word; }
  .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 12px 6px 24px;
  }
  .pagination .page-link,
  .pagination .page-link.prev,
  .pagination .page-link.next {
    border: 1px solid rgba(0,0,0,.08);
    background: #fff;
    padding: 8px 10px;
    line-height: 1;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    color: #333;
  }
  .pagination .page-link.active {
    background: var(--accent);
    color: var(--dark);
    border-color: var(--accent);
  }
  .pagination .ellipsis { display: none; }
}

/* very small devices */
@media (max-width: 360px) {
  .hero-title { font-size: 1.6rem; }
  .featured-card .title { font-size: 1.2rem; }
  .card .title { font-size: 1rem; }
}
