/* ==========================================================================
   components.css
   Berisi: Komponen UI yang digunakan di banyak halaman
           (Post card, badges, overlay, category block, front-page fp-)
   Urutan load: 3
   ========================================================================== */

/* --------------------------------------------------------------------------
   Post Elements — digunakan di index, archive, category
   -------------------------------------------------------------------------- */
.cat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  display: block;
  margin: 12px 0 4px;
}

.cat-label-inline {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  background: var(--blue-light);
  color: var(--blue);
  padding: 3px 10px;
  border-radius: var(--r-xs);
}

.post-title {
  font-size: 28px;
  margin: 0 0 10px;
  font-weight: bold;
  line-height: 1.2;
}

.post-title.small {
  font-size: 17px;
}

.post-excerpt {
  font-size: 14px;
  color: #555;
  line-height: 1.55;
  margin-bottom: 14px;
}

.read-more {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #333;
}

.post-meta {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
  display: flex;
  gap: 5px;
  font-weight: 500;
}

.post-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-tags a {
  font-size: 10px;
  background: #f0f0f0;
  padding: 4px 10px;
  border-radius: var(--r-xs);
  color: #555;
  font-weight: bold;
  transition: background 0.2s;
}

.post-tags a:hover {
  background: #e0e0e0;
  color: #333;
}

/* Dark mode — post elements */
body.dark-mode .post-excerpt {
  color: #aaa;
}
body.dark-mode .read-more {
  color: #fff;
}
body.dark-mode .cat-label {
  color: #888;
}
body.dark-mode .post-meta {
  color: #aaa;
}
body.dark-mode .post-tags a {
  background: #2a2a2a;
  color: #ccc;
}
body.dark-mode .post-tags a:hover {
  background: #444;
  color: #fff;
}
/* Catatan: rule `body.dark-mode a` dihapus — terlalu global, menyebabkan
   override tak terduga. Gunakan selector spesifik per komponen. */

/* --------------------------------------------------------------------------
   Thumbnail Wrapper & Overlay — digunakan di banyak tempat
   -------------------------------------------------------------------------- */
.post-item {
  transition: transform 0.3s ease;
}

.post-item:hover {
  transform: scale(1.02);
}

.thumb-wrapper {
  position: relative;
  overflow: hidden;
  display: block;
  border-radius: var(--r-xs);
  margin-bottom: 10px;
}

.thumb-wrapper img {
  display: block;
  width: 100%;
  transition: transform 0.3s ease;
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 86, 179, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #fff;
}

.thumb-wrapper:hover .thumb-overlay {
  opacity: 1;
}
.thumb-wrapper:hover img {
  transform: scale(1.08);
}

.overlay-text {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 12px;
}

.overlay-meta {
  position: absolute;
  bottom: 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.side-post-thumb .thumb-overlay {
  padding: 5px;
}
.side-post-thumb .overlay-text {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Post Grid & Side Post — layout lama (index, archive)
   -------------------------------------------------------------------------- */
.hero-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 36px;
  margin: 36px 0;
}

.hero-main img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-left: 1px solid var(--border);
  padding-left: 36px;
}

.sub-hero-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.sub-hero-section .thumb-wrapper img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 36px 0;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.post-card .post-title {
  margin-bottom: 8px;
}

.side-post {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.side-post-thumb img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--r-xs);
  display: block;
}

.side-post-content {
  flex: 1;
}
.side-post .cat-label {
  margin-top: 0;
  margin-bottom: 5px;
}

/* --------------------------------------------------------------------------
   Category Block Section
   -------------------------------------------------------------------------- */
.category-block {
  margin: 48px 0;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.block-title {
  background: #2b3d6b;
  color: #fff;
  padding: 10px 22px;
  margin: 0;
  font-size: 17px;
  border-radius: 4px 4px 0 0;
  transform: translateY(1px);
}

.block-view-all {
  background: #2b3d6b;
  color: #fff;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: bold;
  border-radius: var(--r-xs);
  transition: background 0.3s;
}

.block-view-all:hover {
  background: #1a2a50;
  color: #fff;
}

.block-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.block-large-post .thumb-wrapper img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.block-small-posts {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.block-small-posts .side-post {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.block-small-posts .side-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.block-small-posts .side-post-thumb img {
  width: 140px;
  height: 86px;
  object-fit: cover;
}
.block-small-posts .thumb-wrapper {
  margin-bottom: 0;
}

/* Dark mode — category block */
body.dark-mode .block-header {
  border-bottom-color: #333;
}
body.dark-mode .block-title,
body.dark-mode .block-view-all {
  background: #3b5087;
}
body.dark-mode .block-small-posts .side-post {
  border-bottom-color: #333;
}

/* --------------------------------------------------------------------------
   Front Page — fp- prefix
   -------------------------------------------------------------------------- */

/* Section header */
.fp-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

.fp-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.fp-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  white-space: nowrap;
}

.fp-section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Badge */
.fp-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--blue);
  background: var(--blue-light);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  transition:
    background var(--ease),
    color var(--ease);
}

.fp-badge:hover {
  background: var(--blue);
  color: #fff;
}
.fp-badge--sm {
  font-size: 9px;
  padding: 2px 8px;
  margin-bottom: 7px;
}

/* Buttons */
.fp-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-sm);
  padding: 10px 20px;
  transition: all var(--ease);
  cursor: pointer;
  text-decoration: none;
}

.fp-btn--primary {
  background: var(--blue);
  color: #fff;
}
.fp-btn--primary:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 86, 179, 0.3);
  color: #fff;
}
.fp-btn--ghost {
  color: var(--blue);
  border: 1.5px solid var(--blue);
  background: transparent;
}
.fp-btn--ghost:hover {
  background: var(--blue);
  color: #fff;
}
.fp-btn--sm {
  font-size: 11px;
  padding: 6px 14px;
}
.fp-btn--lg {
  font-size: 14px;
  padding: 14px 32px;
}

/* Link more */
.fp-link-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  margin-top: auto;
  transition:
    gap var(--ease),
    color var(--ease);
}

.fp-link-more:hover {
  gap: 9px;
  color: var(--blue-dark);
}

/* Meta */
.fp-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.fp-meta svg {
  flex-shrink: 0;
}
.fp-meta__dot {
  opacity: 0.5;
}
.fp-meta__author {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fp-meta--sm {
  font-size: 11px;
}

/* Tags */
.fp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.fp-tags a {
  font-size: 10px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 20px;
  transition: all var(--ease);
}
.fp-tags a:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.fp-tags--sm a {
  font-size: 9px;
}

/* Hero */
.fp-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  margin: 32px 0 44px;
}

.fp-hero__card {
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition:
    box-shadow var(--ease),
    transform var(--ease);
}

.fp-hero__card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.fp-hero__thumb-link {
  display: block;
}
.fp-hero__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.fp-hero__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.fp-hero__card:hover .fp-hero__thumb img {
  transform: scale(1.04);
}

.fp-hero__thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 86, 179, 0.5) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--ease);
}

.fp-hero__thumb:hover .fp-hero__thumb-overlay {
  opacity: 1;
}

.fp-hero__body {
  padding: 22px 26px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.fp-hero__title {
  font-size: clamp(19px, 2.1vw, 26px);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 10px;
}
.fp-hero__title a {
  color: var(--text);
  transition: color var(--ease);
}
.fp-hero__title a:hover {
  color: var(--blue);
}
.fp-hero__excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.fp-hero__sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Side card */
.fp-side-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--ease),
    transform var(--ease);
}

.fp-side-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.fp-side-card__thumb-link {
  display: block;
  flex-shrink: 0;
}
.fp-side-card__thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  width: 105px;
  height: 76px;
}
.fp-side-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.fp-side-card:hover .fp-side-card__thumb img {
  transform: scale(1.07);
}

.fp-side-card__thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 86, 179, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--ease);
}

.fp-side-card__thumb:hover .fp-side-card__thumb-overlay {
  opacity: 1;
}
.fp-side-card__body {
  flex: 1;
  min-width: 0;
}
.fp-side-card__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 5px;
}
.fp-side-card__title a {
  color: var(--text);
  transition: color var(--ease);
}
.fp-side-card__title a:hover {
  color: var(--blue);
}
.fp-side-card__excerpt {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Sub-hero */
.fp-sub-hero {
  margin-bottom: 44px;
}
.fp-sub-hero__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* Generic card */
.fp-card {
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition:
    box-shadow var(--ease),
    transform var(--ease);
}

.fp-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.fp-card__thumb-link {
  display: block;
}
.fp-card__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}
.fp-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.fp-card:hover .fp-card__thumb img {
  transform: scale(1.05);
}

.fp-card__thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 86, 179, 0.45) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--ease);
}

.fp-card__thumb:hover .fp-card__thumb-overlay {
  opacity: 1;
}

.fp-overlay__cta {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.fp-overlay__meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 5px;
}

.fp-card__body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.fp-card__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 8px;
}
.fp-card__title a {
  color: var(--text);
  transition: color var(--ease);
}
.fp-card__title a:hover {
  color: var(--blue);
}
.fp-card__excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 12px;
  flex: 1;
}

.fp-grid-section {
  margin-bottom: 44px;
}
.fp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 32px;
}
.fp-view-all-wrap {
  text-align: center;
  padding-top: 6px;
}

/* Cat block */
.fp-cat-block {
  margin: 48px 0;
  padding: 28px 32px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.fp-cat-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.fp-cat-block__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fp-cat-block__accent {
  display: block;
  width: 4px;
  height: 22px;
  background: var(--blue);
  border-radius: 3px;
}
.fp-cat-block__title {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}
.fp-cat-block__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.fp-cat-featured {
  display: flex;
  flex-direction: column;
}
.fp-cat-featured__thumb-link {
  display: block;
}
.fp-cat-featured__thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  aspect-ratio: 4/3;
  margin-bottom: 14px;
}
.fp-cat-featured__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.fp-cat-featured:hover .fp-cat-featured__thumb img {
  transform: scale(1.05);
}
.fp-cat-featured__body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.fp-cat-featured__title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 9px;
}
.fp-cat-featured__title a {
  color: var(--text);
  transition: color var(--ease);
}
.fp-cat-featured__title a:hover {
  color: var(--blue);
}
.fp-cat-featured__excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 14px;
  flex: 1;
}

.fp-cat-block__list {
  display: flex;
  flex-direction: column;
}
.fp-list-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.fp-list-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.fp-list-card:first-child {
  padding-top: 0;
}
.fp-list-card__thumb-link {
  display: block;
  flex-shrink: 0;
}
.fp-list-card__thumb {
  width: 96px;
  height: 68px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.fp-list-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.fp-list-card:hover .fp-list-card__thumb img {
  transform: scale(1.07);
}
.fp-list-card__body {
  flex: 1;
  min-width: 0;
}
.fp-list-card__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 5px;
}
.fp-list-card__title a {
  color: var(--text);
  transition: color var(--ease);
}
.fp-list-card__title a:hover {
  color: var(--blue);
}

/* Dark mode — fp- */
body.dark-mode .fp-hero__card,
body.dark-mode .fp-side-card,
body.dark-mode .fp-card,
body.dark-mode .fp-cat-block {
  background: var(--surface);
  border: 1px solid var(--border);
}
body.dark-mode .fp-tags a {
  background: #1f2937;
}
body.dark-mode .fp-list-card {
  border-bottom-color: var(--border);
}
