/* ============================================================
   Sewami Berita — news.sewami.id
   Desain editorial: tipografi tegas, layout bersih, mobile-first
   ============================================================ */

:root {
    --nw-primary: #1e3a5f;
    --nw-primary-dark: #142842;
    --nw-accent: #f97316;
    --nw-bg: #f6f7f9;
    --nw-card: #ffffff;
    --nw-text: #0f172a;
    --nw-text-2: #475569;
    --nw-muted: #94a3b8;
    --nw-border: #e5e7eb;
    --nw-radius: 16px;
    --nw-shadow: 0 6px 24px rgba(15, 23, 42, .06);
    --nw-transition: all .2s cubic-bezier(.4, 0, .2, 1);
    --nw-header-h: 62px;
}

* { -webkit-tap-highlight-color: transparent; }

body.nw-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--nw-bg);
    color: var(--nw-text);
    margin: 0;
}

.nw-body a { color: inherit; }

/* ---------- Masthead ---------- */
.nw-masthead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--nw-border);
}
.nw-masthead-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
    height: var(--nw-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.nw-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}
.nw-brand img { height: 30px; display: block; }
.nw-brand-tag {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--nw-primary), var(--nw-accent));
    padding: 3px 9px;
    border-radius: 999px;
}
.nw-masthead-link {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--nw-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.nw-masthead-link:hover { color: var(--nw-accent); }

/* ---------- Kategori nav ---------- */
.nw-nav {
    background: var(--nw-card);
    border-bottom: 1px solid var(--nw-border);
}
.nw-nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.nw-nav-inner::-webkit-scrollbar { display: none; }
.nw-pill {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--nw-text-2);
    text-decoration: none;
    padding: 7px 15px;
    border-radius: 999px;
    border: 1px solid var(--nw-border);
    background: var(--nw-card);
    transition: var(--nw-transition);
}
.nw-pill:hover { border-color: var(--nw-primary); color: var(--nw-primary); }
.nw-pill.active {
    background: var(--nw-primary);
    border-color: var(--nw-primary);
    color: #fff;
}

/* ---------- Layout utama ---------- */
.nw-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 22px 16px 40px;
}
.nw-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 26px 0 14px;
}
.nw-section-head h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -.2px;
    position: relative;
    padding-left: 12px;
}
.nw-section-head h2::before {
    content: '';
    position: absolute;
    left: 0; top: 15%;
    width: 4px; height: 70%;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--nw-primary), var(--nw-accent));
}
.nw-section-head .nw-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--nw-primary);
    text-decoration: none;
}
.nw-section-head .nw-more:hover { color: var(--nw-accent); }

/* ---------- Hero unggulan ---------- */
.nw-hero {
    display: block;
    position: relative;
    border-radius: var(--nw-radius);
    overflow: hidden;
    background: #0f172a;
    text-decoration: none;
    box-shadow: var(--nw-shadow);
}
.nw-hero-media {
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: 420px;
    width: 100%;
}
.nw-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.nw-hero:hover .nw-hero-media img { transform: scale(1.03); }
.nw-hero-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 30%, rgba(15, 23, 42, .88) 100%);
}
.nw-hero-body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 22px 22px 20px;
    z-index: 2;
    color: #fff;
}
.nw-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #fff;
    background: var(--nw-accent);
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.nw-hero-body h1 {
    font-size: clamp(20px, 3.4vw, 30px);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 8px;
    letter-spacing: -.4px;
}
.nw-hero-body p {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .85);
    margin: 0;
    max-width: 640px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nw-hero-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, .7);
    margin-top: 10px;
    display: flex;
    gap: 14px;
}

/* ---------- Grid kartu ---------- */
.nw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.nw-card {
    display: flex;
    flex-direction: column;
    background: var(--nw-card);
    border: 1px solid var(--nw-border);
    border-radius: var(--nw-radius);
    overflow: hidden;
    text-decoration: none;
    transition: var(--nw-transition);
}
.nw-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--nw-shadow);
    border-color: #d7dce3;
}
.nw-card-media {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--nw-primary), var(--nw-accent));
    position: relative;
    overflow: hidden;
}
.nw-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.nw-card:hover .nw-card-media img { transform: scale(1.04); }
.nw-card-media .nw-card-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .9);
    font-size: 34px;
}
.nw-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.nw-card-cat {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--nw-accent);
    margin-bottom: 7px;
}
.nw-card-body h3 {
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px;
    letter-spacing: -.2px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nw-card-body p {
    font-size: 13px;
    line-height: 1.55;
    color: var(--nw-text-2);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nw-card-meta {
    margin-top: auto;
    font-size: 11.5px;
    color: var(--nw-muted);
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ---------- Slot iklan (isi kode AdSense setelah disetujui) ---------- */
.nw-ad {
    max-width: 1080px;
    margin: 26px auto;
    padding: 0 16px;
}
.nw-ad-box {
    min-height: 96px;
    border: 1.5px dashed var(--nw-border);
    border-radius: 12px;
    background: #fbfcfd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nw-muted);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ---------- Detail artikel ---------- */
.nw-article {
    max-width: 720px;
    margin: 0 auto;
}
.nw-breadcrumb {
    font-size: 12.5px;
    color: var(--nw-muted);
    margin-bottom: 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.nw-breadcrumb a { color: var(--nw-primary); text-decoration: none; font-weight: 600; }
.nw-breadcrumb a:hover { color: var(--nw-accent); }
.nw-article h1 {
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.5px;
    margin: 0 0 14px;
}
.nw-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 13px;
    color: var(--nw-text-2);
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--nw-border);
}
.nw-article-meta strong { color: var(--nw-text); font-weight: 600; }
.nw-article-cover {
    width: 100%;
    border-radius: var(--nw-radius);
    display: block;
    margin-bottom: 8px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.nw-article-caption {
    font-size: 11.5px;
    color: var(--nw-muted);
    text-align: center;
    margin-bottom: 24px;
}
.nw-article-body p {
    font-size: 17px;
    line-height: 1.8;
    color: #1e293b;
    margin: 0 0 20px;
}
.nw-article-body p:first-child::first-letter {
    font-size: 3.1em;
    font-weight: 800;
    line-height: .9;
    float: left;
    padding: 4px 10px 0 0;
    color: var(--nw-primary);
}
.nw-share {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 28px 0;
    padding-top: 20px;
    border-top: 1px solid var(--nw-border);
}
.nw-share a, .nw-share button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--nw-border);
    background: var(--nw-card);
    color: var(--nw-text-2);
    text-decoration: none;
    cursor: pointer;
    transition: var(--nw-transition);
}
.nw-share a:hover, .nw-share button:hover {
    border-color: var(--nw-primary);
    color: var(--nw-primary);
}

/* ---------- Empty & pagination ---------- */
.nw-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--nw-muted);
}
.nw-empty i { font-size: 40px; display: block; margin-bottom: 14px; }
.nw-empty strong { display: block; font-size: 16px; color: var(--nw-text-2); }
.nw-empty p { font-size: 13.5px; margin-top: 6px; }

.nw-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.nw-pagination a, .nw-pagination span {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--nw-border);
    background: var(--nw-card);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--nw-text-2);
    text-decoration: none;
}
.nw-pagination a:hover { border-color: var(--nw-primary); color: var(--nw-primary); }
.nw-pagination .active {
    background: var(--nw-primary);
    border-color: var(--nw-primary);
    color: #fff;
}

/* ---------- Footer ---------- */
.nw-footer {
    background: var(--nw-primary-dark);
    color: rgba(255, 255, 255, .78);
    margin-top: 20px;
}
.nw-footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 34px 16px 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
}
.nw-footer-brand img { height: 28px; display: block; margin-bottom: 10px; }
.nw-footer-brand p { font-size: 13px; line-height: 1.6; margin: 0; max-width: 340px; }
.nw-footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.nw-footer-col strong {
    display: block;
    color: #fff;
    font-size: 13px;
    margin-bottom: 10px;
}
.nw-footer-col a {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    margin-bottom: 7px;
}
.nw-footer-col a:hover { color: var(--nw-accent); }
.nw-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    text-align: center;
    font-size: 12px;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    color: rgba(255, 255, 255, .55);
}

@media (max-width: 640px) {
    .nw-hero-body { padding: 16px; }
    .nw-hero-body p { display: none; }
    .nw-main { padding-top: 16px; }
    .nw-grid { grid-template-columns: 1fr; }
}
