:root {
  --brand: #e31c23;
  --brand-dark: #b8141a;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e6e6e6;
  --bg: #f5f5f5;
  --paper: #ffffff;
  --sidebar: #111;
  --radius: 4px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-display: "Source Serif 4", Georgia, serif;
  --font-sans: "DM Sans", "Segoe UI", sans-serif;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--paper);
  border-bottom: 3px solid var(--brand);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 0 10px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-logo {
  display: block;
  width: min(200px, 52vw);
  height: auto;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  color: var(--brand);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  padding-left: 2px;
}

.search-form {
  display: flex;
  flex: 1;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fafafa;
  min-width: 0;
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 10px 16px;
  background: transparent;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.search-form button {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 600;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  font: inherit;
  font-weight: 600;
}

.rubrik-nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 2px;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
}

.rubrik-nav a {
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.rubrik-nav a:hover,
.rubrik-nav a.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* Ticker */
.ticker {
  background: var(--sidebar);
  color: #fff;
  overflow: hidden;
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  min-width: 0;
}

.ticker-label {
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  flex-shrink: 0;
}

.ticker-track-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  gap: 28px;
  animation: marquee 35s linear infinite;
  white-space: nowrap;
  width: max-content;
}

.ticker-track a:hover {
  color: #ffb4b7;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Layout */
.page {
  padding: 24px 0 48px;
}

.grid-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.grid-home > .main-col {
  min-width: 0;
}

.headline {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.headline-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 360px;
  background: #222;
  color: #fff;
  box-shadow: var(--shadow);
  animation: rise 0.6s ease both;
}

.headline-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  position: absolute;
  inset: 0;
}

.headline-main .content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-height: 360px;
  padding: 24px;
  background: linear-gradient(transparent 20%, rgba(0, 0, 0, 0.85));
}

.headline-main h2 {
  color: #fff;
  overflow-wrap: anywhere;
}

.headline-main p,
.headline-main .meta {
  color: rgba(255, 255, 255, 0.85);
}

.headline-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.subhead {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  background: var(--paper);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: rise 0.6s ease both;
  min-width: 0;
}

.subhead:nth-child(2) { animation-delay: 0.08s; }
.subhead:nth-child(3) { animation-delay: 0.16s; }

.subhead:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.subhead img {
  width: 110px;
  height: 78px;
  object-fit: cover;
  border-radius: 2px;
  background: #ddd;
}

.subhead h3 {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 8px;
}

.badge.soft {
  background: #ffe5e6;
  color: var(--brand-dark);
}

.meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.headline-main h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-left: 4px solid var(--brand);
  padding-left: 10px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.section-title h2 {
  font-size: 1.25rem;
  margin: 0;
}

.feed-list {
  display: grid;
  gap: 14px;
}

.feed-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  transition: box-shadow 0.2s;
  min-width: 0;
  align-items: start;
}

.feed-item:hover {
  box-shadow: var(--shadow);
}

.feed-item > a:first-child {
  display: block;
  min-width: 0;
}

.feed-item img {
  width: 100%;
  aspect-ratio: 16 / 11;
  height: auto;
  object-fit: cover;
  background: #ddd;
  border-radius: 2px;
}

.feed-item h3 {
  font-size: 1.05rem;
}

.feed-item p {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: #444;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  align-self: start;
  min-width: 0;
}

.sidebar-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}

.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  background: #f0f0f0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.tag-cloud a:hover {
  background: var(--brand);
  color: #fff;
}

.popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pop;
}

.popular-list li {
  counter-increment: pop;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.popular-list li::before {
  content: counter(pop);
  font-weight: 700;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.popular-list a {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-list a:hover {
  color: var(--brand);
}

.rubrik-blocks {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.rubrik-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
}

.rubrik-block h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.rubrik-block h3 a {
  color: var(--brand);
}

.mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mini-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.mini-list a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-list a:hover {
  color: var(--brand);
}

.load-more-wrap {
  text-align: center;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}

.btn:hover {
  background: var(--brand-dark);
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Article */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--brand);
  z-index: 60;
  pointer-events: none;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.article-hero {
  margin: 16px 0;
}

.article-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #ddd;
}

.article-body {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 0;
}

.article-body h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.article-body .content {
  font-size: 1.05rem;
  max-width: 68ch;
  overflow-wrap: anywhere;
}

.article-body .content p {
  margin: 0 0 1.1em;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.share-row a,
.share-row button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
  font: inherit;
  cursor: pointer;
}

.related-section {
  margin-top: 28px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.related-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.related-card img {
  height: 120px;
  width: 100%;
  object-fit: cover;
  background: #ddd;
}

.related-card .pad {
  padding: 10px;
  flex: 1;
}

.related-card h3 {
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.baca-juga {
  background: #fff8f8;
  border-left: 4px solid var(--brand);
  padding: 12px 14px;
  margin: 20px 0;
}

.baca-juga a {
  color: var(--brand);
  font-weight: 700;
}

.tags-after {
  margin-top: 20px;
}

/* Category / search */
.page-head {
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

/* Footer */
.site-footer {
  background: #161616;
  color: #ddd;
  padding: 36px 0 20px;
  margin-top: 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.site-footer .brand-name {
  color: #fff;
  margin-bottom: 8px;
}

.footer-brand {
  display: inline-block;
  margin-bottom: 12px;
}

.footer-brand img {
  width: min(200px, 70vw);
  height: auto;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}

.site-footer h3 {
  color: #fff;
  font-size: 1rem;
}

.site-footer .mini-list li {
  border-bottom-color: #333;
}

.site-footer a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #333;
  font-size: 0.85rem;
  color: #999;
}

.empty {
  background: var(--paper);
  border: 1px dashed var(--line);
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tablet */
@media (max-width: 960px) {
  .grid-home,
  .article-layout,
  .headline,
  .rubrik-blocks,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    position: static;
  }

  .headline-main,
  .headline-main .content {
    min-height: 280px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-top {
    flex-wrap: wrap;
    padding: 10px 0 8px;
  }

  .rubrik-nav {
    display: none;
  }

  .rubrik-nav.open {
    display: flex;
    flex-direction: column;
    max-height: min(70vh, calc(100dvh - 8rem));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .search-form {
    display: flex;
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }

  .feed-item,
  .subhead {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 10px;
  }

  .subhead img {
    width: 100px;
    height: 72px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .article-body {
    padding: 18px 16px;
  }

  .page {
    padding: 16px 0 36px;
  }

  .container {
    width: min(1180px, calc(100% - 24px));
  }
}

/* Small phones */
@media (max-width: 480px) {
  .feed-item,
  .subhead {
    grid-template-columns: 1fr;
  }

  .feed-item img,
  .subhead img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .headline-main,
  .headline-main .content {
    min-height: 240px;
    padding: 16px;
  }

  .share-row a,
  .share-row button {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    justify-content: center;
    display: inline-flex;
  }

  .ticker-inner {
    gap: 10px;
  }

  .ticker-label {
    font-size: 0.65rem;
    padding: 4px 8px;
  }
}
