
/* ========== 1. Variabel & Reset ========== */
:root {
  --red: #e8203a;
  --dark: #111111;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --bg: #ffffff;
  --orange: #f08a00;
  --blue: #1473e6;
  --radius: 4px;
  --container: 1200px;
  --font: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

a:hover {
  color: var(--red);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ========== 2. Komponen umum ========== */

/* tanggal dengan ikon jam */
.post-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.post-date::before {
  content: "";
  width: 11px;
  height: 11px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* label kategori */
.badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--orange);
  border-radius: 2px;
  text-transform: capitalize;
}

.badge--blue { background: var(--blue); }

/* kartu dengan gambar penuh dan teks di atasnya */
.card-overlay {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #222;
  color: #fff;
}

.card-overlay img {
  position: absolute;
  inset: 0;
  transition: transform 0.5s ease;
}

.card-overlay:hover img {
  transform: scale(1.05);
}

.card-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 75%);
}

.card-overlay__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.card-overlay__title {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
}

.card-overlay__title a:hover { color: #fff; text-decoration: underline; }

.card-overlay .post-date { color: #ddd; }

/* kartu kecil: teks + thumbnail */
.post-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.post-item__thumb {
  flex: 0 0 90px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
}

.post-item__thumb img { transition: transform 0.4s ease; }
.post-item:hover .post-item__thumb img { transform: scale(1.08); }

.post-item__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.post-item__title {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

/* judul section */
.section-title {
  position: relative;
  padding-bottom: 12px;
  margin: 36px 0 18px;
  font-size: 20px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 36px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
}

/* ========== 3. Breaking news ========== */
.breaking {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.breaking__inner {
  display: flex;
  align-items: stretch;
  height: 42px;
}

.breaking__label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.breaking__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.breaking__text {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.breaking__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breaking__nav button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.breaking__nav button:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ========== 4. Hero ========== */
.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.hero__main {
  min-height: 460px;
}

.hero__side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.hero__side .post-item {
  flex-direction: row-reverse;
  justify-content: space-between;
}

.hero__side .post-item__body { flex: 1; }

/* ========== 5. Headline news ========== */
.headline {
  position: relative;
  margin-top: 28px;
  padding-top: 0;
  border-top: 2px solid var(--line);
}

.headline__label {
  display: inline-block;
  margin-top: -2px;
  padding: 8px 16px;
  background: var(--dark);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.headline__track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.headline__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.headline__thumb {
  height: 84px;
  border-radius: var(--radius);
  overflow: hidden;
}

.headline__thumb img { transition: transform 0.4s ease; }
.headline__item:hover .headline__thumb img { transform: scale(1.08); }

.headline__title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

/* ========== 6. Pilihan editor ========== */
.editor {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 40px;
}

.editor__main {
  min-height: 420px;
}

.editor__col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.editor__col .post-item__thumb {
  flex-basis: 80px;
  height: 68px;
}

.editor__col .post-item__title { font-size: 13px; }

/* ========== 7. Footer ========== */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ========== 8. Responsif ========== */
@media (max-width: 992px) {
  .hero { grid-template-columns: 1fr; }
  .hero__main { min-height: 380px; }
  .hero__side { gap: 16px; }

  .editor { grid-template-columns: 1fr 1fr; }
  .editor__main { grid-column: 1 / -1; min-height: 340px; }

  .headline__track { grid-template-columns: repeat(3, 1fr); }
  .headline__item:nth-child(n+4) { display: none; }
}

@media (max-width: 640px) {
  .card-overlay__title { font-size: 21px; }
  .card-overlay__body { padding: 16px; }
  .hero__main { min-height: 300px; }

  .editor { grid-template-columns: 1fr; }
  .editor__main { min-height: 280px; }

  .breaking__label span { display: none; }
  .breaking__nav { display: none; }

  .headline__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
  }

  .headline__item {
    flex: 0 0 60%;
    scroll-snap-align: start;
  }

  .headline__item:nth-child(n+4) { display: flex; }
}
