/* =========================================================
   Nexus Premium — main.css (non-critical, dimuat async)
   Berisi styling komponen yang TIDAK dibutuhkan untuk render
   awal above-the-fold, sehingga aman dimuat setelah Critical CSS.
   ========================================================= */

/* Layout grid & sidebar */
.nexus-layout-right { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.nexus-layout-left  { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
.nexus-layout-none  { display: block; }
.nexus-layout-left .nexus-sidebar { order: -1; }

/* ===== Masonry grid — pendekatan CSS columns murni (zero JS, zero CLS, best perf) ===== */
.nexus-masonry-grid { columns: 3 280px; column-gap: 24px; margin-block: 24px; }
.nexus-masonry-grid .nexus-card { break-inside: avoid; margin-bottom: 24px; display: inline-block; width: 100%; }
@media (max-width: 1024px) { .nexus-masonry-grid { columns: 2 260px; } }
@media (max-width: 600px)  { .nexus-masonry-grid { columns: 1; } }

.nexus-card { border: 1px solid var(--nexus-border); border-radius: 12px; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; background: var(--nexus-bg); }
.nexus-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.nexus-card-thumb { position: relative; display: block; }
.nexus-card-thumb img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.nexus-card-body { padding: 18px; }
.nexus-card-title { font-size: 1.15rem; margin: 0 0 10px; line-height: 1.35; }
.nexus-card-title a { color: var(--nexus-text); text-decoration: none; }
.nexus-card-title a:hover { color: var(--nexus-primary); }
.nexus-card-meta { font-size: 13px; color: #6b7280; margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.nexus-card-meta-light { color: rgba(255,255,255,.85); }
.nexus-card-dot { opacity: .6; }
.nexus-card-excerpt { font-size: 14px; color: #4b5563; }

/* Category badge */
.nexus-card-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--nexus-primary); color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.nexus-card-badge-sm { font-size: 11px; padding: 3px 10px; }
.nexus-card-thumb .nexus-card-badge { position: absolute; top: 12px; left: 12px; margin-bottom: 0; }

/* ===== Hero section (homepage) ===== */
.nexus-hero-section { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-block: 24px 8px; }
.nexus-hero-card { position: relative; border-radius: 14px; overflow: hidden; min-height: 420px; display: flex; align-items: flex-end; }
.nexus-hero-card-thumb { position: absolute; inset: 0; }
.nexus-hero-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nexus-hero-card-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.15) 60%, transparent 100%); }
.nexus-hero-card-body { position: relative; padding: 28px; color: #fff; }
.nexus-hero-card-title { font-size: clamp(1.4rem, 2.5vw, 2rem); line-height: 1.25; margin: 0 0 10px; }
.nexus-hero-card-title a { color: #fff; text-decoration: none; }

.nexus-hero-side { display: flex; flex-direction: column; gap: 20px; }
.nexus-side-card { display: flex; gap: 14px; }
.nexus-side-card-thumb { flex: 0 0 100px; }
.nexus-side-card-thumb img { width: 100px; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
.nexus-side-card-title { font-size: .95rem; line-height: 1.35; margin: 4px 0 6px; }
.nexus-side-card-title a { color: var(--nexus-text); text-decoration: none; }

/* Filter tabs kategori */
.nexus-filter-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.nexus-filter-btn { border: 1px solid var(--nexus-border); background: transparent; color: var(--nexus-text); padding: 8px 18px; border-radius: 999px; font-size: 14px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.nexus-filter-btn.is-active, .nexus-filter-btn:hover { background: var(--nexus-primary); border-color: var(--nexus-primary); color: #fff; }
.nexus-masonry-grid .nexus-card.nexus-filtered-out { display: none; }

/* ===== Single post — hero cover, spec box, share sidebar ===== */
.nexus-single-hero { position: relative; min-height: 60vh; background-image: var(--nexus-hero-img); background-size: cover; background-position: center; display: flex; align-items: flex-end; }
.nexus-single-hero-overlay { width: 100%; background: linear-gradient(0deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.1) 65%, transparent 100%); padding-block: 60px 32px; }
.nexus-single-hero-title { color: #fff; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.2; margin: 12px 0; max-width: 900px; }

.nexus-single-layout { display: grid; grid-template-columns: 64px 1fr; gap: 24px; align-items: start; }
.nexus-share-sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 10px; }
.nexus-share-buttons { display: flex; flex-direction: column; gap: 10px; }
.nexus-share-buttons-mobile { display: none; }
.nexus-share-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--nexus-border); background: var(--nexus-bg); cursor: pointer; text-decoration: none; }
.nexus-share-label { font-size: 12px; font-weight: 700; line-height: 1; }
.nexus-share-facebook { color: #1877f2; border-color: #1877f2; }
.nexus-share-twitter { color: #111; }
.nexus-share-whatsapp { color: #25d366; border-color: #25d366; }
.nexus-share-telegram { color: #229ed9; border-color: #229ed9; }
.nexus-share-copy .nexus-share-label { font-size: 16px; }

.nexus-spec-box { border: 1px solid var(--nexus-border); border-radius: 10px; padding: 20px; margin-block: 24px; background: rgba(37,99,235,.03); }
.nexus-spec-title { margin: 0 0 12px; font-size: 1.1rem; }
.nexus-spec-table { width: 100%; border-collapse: collapse; }
.nexus-spec-table tr { border-bottom: 1px solid var(--nexus-border); }
.nexus-spec-table tr:last-child { border-bottom: 0; }
.nexus-spec-table th, .nexus-spec-table td { text-align: left; padding: 8px 4px; font-size: 14px; }
.nexus-spec-table th { color: #6b7280; font-weight: 500; width: 40%; }

.nexus-author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 32px; padding: 20px; border: 1px solid var(--nexus-border); border-radius: 10px; }
.nexus-author-box img { border-radius: 50%; }
.nexus-author-box h3 { margin: 0 0 6px; }
.nexus-author-box p { margin: 0; color: #6b7280; font-size: 14px; }

.nexus-section-title { font-size: 1.4rem; margin-block: 40px 8px; }

@media (max-width: 900px) {
	.nexus-hero-section { grid-template-columns: 1fr; }
	.nexus-single-layout { grid-template-columns: 1fr; }
	.nexus-share-sidebar { display: none; }
	.nexus-share-buttons-mobile { display: block; margin-top: 16px; }
	.nexus-share-buttons-mobile .nexus-share-buttons { flex-direction: row; }
}

/* Breadcrumb */
.nexus-breadcrumb { padding-block: 12px; font-size: 14px; }
.nexus-breadcrumb ol { display: flex; list-style: none; padding: 0; margin: 0; gap: 6px; flex-wrap: wrap; }
.nexus-breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 6px; color: #9ca3af; }
.nexus-breadcrumb a { color: var(--nexus-primary); text-decoration: none; }

/* Entry content typography (artikel panjang) */
.nexus-entry-content { max-width: 72ch; }
.nexus-entry-content p { margin-block: 1.2em; }
.nexus-entry-content img { border-radius: 8px; }
.nexus-entry-content h2, .nexus-entry-content h3 { line-height: 1.3; margin-top: 2em; }
.nexus-entry-tags a { display: inline-block; margin: 4px 6px 0 0; padding: 4px 10px; border: 1px solid var(--nexus-border); border-radius: 999px; font-size: 13px; color: var(--nexus-text); text-decoration: none; }

/* Back to top */
.nexus-back-to-top { position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--nexus-primary); color: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.15); transition: opacity .2s ease; }
.nexus-back-to-top[hidden] { display: none; }

/* Sticky mobile ad */
.nexus-sticky-ad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--nexus-bg); border-top: 1px solid var(--nexus-border); display: none; }
.nexus-sticky-ad-close { position: absolute; top: -14px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--nexus-border); background: var(--nexus-bg); cursor: pointer; }
@media (max-width: 768px) { .nexus-sticky-ad { display: block; } }

/* Cookie banner */
.nexus-cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 480px; margin-inline: auto; background: var(--nexus-text); color: var(--nexus-bg); padding: 16px; border-radius: 10px; z-index: 95; }
.nexus-cookie-banner button { margin-top: 8px; padding: 8px 16px; border: 0; border-radius: 6px; background: var(--nexus-primary); color: #fff; cursor: pointer; }

/* Footer */
.nexus-footer { border-top: 1px solid var(--nexus-border); padding-block: 32px; margin-top: 48px; }
.nexus-footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin-bottom: 24px; }
.nexus-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 14px; color: #6b7280; }

/* Comments */
.comment-list { list-style: none; padding: 0; }
.comment-list .comment-body { padding: 16px; border: 1px solid var(--nexus-border); border-radius: 8px; margin-bottom: 12px; }

/* 404 */
.nexus-404 { text-align: center; padding-block: 80px; }
.nexus-404 h1 { font-size: 4rem; margin: 0; }
.nexus-button { display: inline-block; margin-top: 16px; padding: 10px 20px; background: var(--nexus-primary); color: #fff; border-radius: 6px; text-decoration: none; }

/* Responsive breakpoints — mobile-first, diuji di 320/360/375/390/412/768/1024/1280/1440/1600/1920 */
@media (max-width: 1024px) {
	.nexus-layout-right, .nexus-layout-left { grid-template-columns: 1fr; }
	.nexus-layout-left .nexus-sidebar { order: 0; }
}
@media (max-width: 480px) {
	.nexus-container { padding-inline: 16px; }
	.nexus-post-grid { grid-template-columns: 1fr; }
}

/* Lazy background (Intersection Observer target, lihat main.js) */
.nexus-lazy-bg[data-bg-loaded="false"] { background-color: var(--nexus-border); }

/* Focus visibility — WCAG AA/AAA */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 3px solid var(--nexus-primary);
	outline-offset: 2px;
}
