/* ===========================================================
   TipsKopi — Tema Frontend
   Diadaptasi dari desain awal Hendra (palet kopi premium).
   Variabel warna bisa di-override nanti dari Pengaturan Situs.
   =========================================================== */

:root {
    --bg-color: #faf8f5;
    --text-color: #26211e;
    --primary-coffee: #3d2e24;
    --accent-orange: #e07a16;
    --border-color: #e6dfd9;
    --card-bg: #ffffff;
    --muted: #665e57;
    --shadow-sm: 0 4px 12px rgba(61, 46, 36, 0.03);
    --shadow-md: 0 12px 30px rgba(61, 46, 36, 0.06);
    --shadow-lg: 0 24px 50px rgba(61, 46, 36, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    /* Sticky footer: body setinggi layar, konten mengisi sisa ruang */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Pembungkus konten halaman — mendorong footer ke bawah pada halaman pendek */
.page-content {
    flex: 1 0 auto;
}

a { color: inherit; }

/* --- HEADER GLASSMORPHISM --- */
header.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-coffee);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
}

.logo-img {
    height: 42px;
    width: auto;
    display: block;
}

.nav-menu { display: flex; flex-wrap: wrap; }

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.25s ease;
    padding: 8px 14px;
    border-radius: 8px;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--accent-orange);
    background-color: rgba(224, 122, 22, 0.06);
}

/* --- HERO SLIDER --- */
.hero-slider {
    position: relative;
    min-height: 78vh;
    background-color: var(--primary-coffee);
    overflow: hidden;
}

.hero-slider::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 12px;
    background-color: var(--accent-orange);
    z-index: 5;
}

.hero-track { position: absolute; inset: 0; }

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background-image: linear-gradient(rgba(38, 33, 30, 0.55), rgba(38, 33, 30, 0.8));
    background-color: var(--primary-coffee);
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.hero-slide.is-active { opacity: 1; pointer-events: auto; }

.hero-card {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    max-width: 820px;
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.hero-slide h1 {
    font-size: 42px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--primary-coffee);
    margin-bottom: 20px;
    letter-spacing: -1.5px;
}

.hero-slide p {
    font-size: 18px;
    color: #544941;
    margin-bottom: 35px;
    line-height: 1.6;
}

.hero-dots {
    position: absolute;
    bottom: 32px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 6;
}

.hero-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.hero-dot.is-active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    transform: scale(1.2);
}

.btn-primary {
    display: inline-block;
    background-color: var(--accent-orange);
    color: #ffffff;
    text-decoration: none;
    padding: 16px 40px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16.5px;
    box-shadow: 0 6px 20px rgba(224, 122, 22, 0.35);
    transition: all 0.25s ease;
}

.btn-primary:hover {
    background-color: #c6670e;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(224, 122, 22, 0.5);
}

/* --- CONTAINER --- */
.container {
    max-width: 1140px;
    margin: 50px auto;
    padding: 0 20px;
}

.archive-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 60px 20px;
    text-align: center;
}

.archive-header h1 {
    font-size: 36px;
    color: var(--primary-coffee);
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.archive-header p {
    font-size: 17px;
    color: var(--muted);
    max-width: 700px;
    margin: 0 auto;
}

.section-title {
    font-size: 28px;
    color: var(--primary-coffee);
    margin-bottom: 35px;
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 10px;
    text-align: center;
}

.section-title::after {
    content: '';
    width: 50px; height: 3px;
    background-color: var(--accent-orange);
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
}

/* --- KATEGORI GRID --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 80px;
}

.category-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-orange);
}

.category-icon { font-size: 42px; margin-bottom: 18px; display: block; }
.category-card h3 { font-size: 21px; color: var(--primary-coffee); margin-bottom: 12px; font-weight: 700; }
.category-card p { font-size: 15px; color: var(--muted); line-height: 1.5; }

/* --- GRID KARTU PANDUAN --- */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.guide-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-orange);
}

.card-image-box {
    width: 100%;
    height: 200px;
    background-color: #eae5e0;
    overflow: hidden;
    position: relative;
}

.card-image-box img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.guide-card:hover .card-image-box img { transform: scale(1.05); }

.card-image-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; color: #c9bfb6;
    background: linear-gradient(135deg, #efe9e3, #e3d8cf);
}

.card-badge {
    position: absolute;
    bottom: 15px; left: 15px;
    background-color: rgba(61, 46, 36, 0.9);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h2 { font-size: 21px; color: var(--primary-coffee); margin-bottom: 12px; font-weight: 700; line-height: 1.3; }
.card-content h2 a { color: inherit; text-decoration: none; }
.card-content p { font-size: 15.5px; color: #544941; margin-bottom: 20px; flex-grow: 1; }

.guide-specs {
    display: flex;
    justify-content: space-between;
    background-color: #faf8f5;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13.5px;
    border: 1px dashed var(--border-color);
}

.spec-item { display: flex; flex-direction: column; color: var(--muted); }
.spec-item strong { color: var(--primary-coffee); font-weight: 700; }

.btn-read {
    display: block;
    background-color: transparent;
    color: var(--primary-coffee);
    border: 2px solid var(--primary-coffee);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14.5px;
    text-align: center;
    transition: all 0.2s ease;
}

.guide-card:hover .btn-read { background-color: var(--primary-coffee); color: #ffffff; }

/* --- LAYOUT KONTEN + SIDEBAR --- */
.content-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
}

.article-list { display: flex; flex-direction: column; gap: 30px; }

.article-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: 240px 1fr;
    transition: all 0.3s ease;
}

.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.article-img { background-color: #eae5e0; overflow: hidden; }
.article-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.article-card:hover .article-img img { transform: scale(1.05); }
.article-img .card-image-placeholder { font-size: 40px; }

.article-details { padding: 30px; display: flex; flex-direction: column; justify-content: center; }
.article-tag { font-size: 12px; text-transform: uppercase; color: var(--accent-orange); font-weight: 700; letter-spacing: 0.5px; margin-bottom: 10px; }
.article-details h2 { font-size: 22px; color: var(--primary-coffee); margin-bottom: 12px; font-weight: 700; line-height: 1.35; }
.article-details h2 a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
.article-details h2 a:hover { color: var(--accent-orange); }
.article-details p { font-size: 16px; color: #544941; margin-bottom: 0; }

/* --- SIDEBAR --- */
aside.sidebar { display: flex; flex-direction: column; gap: 35px; }

.widget {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.widget h4 {
    font-size: 15px;
    color: var(--primary-coffee);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-coffee);
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
}

.widget ul { list-style: none; }
.widget ul li { margin-bottom: 14px; border-bottom: 1px dashed var(--border-color); padding-bottom: 12px; }
.widget ul li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.widget ul li a { text-decoration: none; color: #473f3a; font-weight: 500; font-size: 15.5px; transition: color 0.2s; }
.widget ul li a:hover { color: var(--accent-orange); }

/* --- ARTIKEL DETAIL --- */
.article-meta { font-size: 13px; color: #8c7d73; margin-bottom: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.article-body h1 { font-size: 38px; line-height: 1.25; color: var(--primary-coffee); margin-bottom: 25px; letter-spacing: -1px; font-weight: 800; }
.article-body h2 { font-size: 25px; color: var(--primary-coffee); margin: 40px 0 18px 0; font-weight: 700; letter-spacing: -0.5px; }
.article-body h3 { font-size: 20px; color: var(--primary-coffee); margin: 28px 0 14px; font-weight: 700; }
.article-body p { margin-bottom: 22px; font-size: 17.5px; color: #473f3a; }
.article-body ul, .article-body ol { margin: 0 0 22px 24px; font-size: 17.5px; color: #473f3a; }
.article-body li { margin-bottom: 8px; }
.article-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 20px 0; }
.article-body a { color: var(--accent-orange); }

.image-wrapper {
    width: 100%;
    margin: 30px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background-color: #eae5e0;
    border: 1px solid var(--border-color);
}
.image-wrapper img { width: 100%; height: auto; display: block; }

.specs-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #fffaf5;
    border: 1px dashed var(--accent-orange);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 25px 0 30px;
}
.specs-banner .spec {
    display: flex; flex-direction: column;
    font-size: 14px; color: var(--muted);
}
.specs-banner .spec strong { color: var(--primary-coffee); font-size: 16px; }

/* --- FOOTER --- */
footer.site-footer {
    background-color: var(--primary-coffee);
    color: #f3f4f6;
    text-align: center;
    padding: 55px 20px;
    margin-top: auto; /* selalu menempel di bawah */
    flex-shrink: 0;
    font-size: 15px;
    border-top: 6px solid var(--accent-orange);
}
footer.site-footer a { color: #e9c08a; text-decoration: none; }
footer.site-footer .footer-links { margin-bottom: 14px; }
footer.site-footer .footer-links a { margin: 0 10px; }
footer.site-footer .copyright { color: #bcaf67; }

/* --- SEARCH --- */
.search-box { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; }
.search-box input {
    flex: 1;
    padding: 13px 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
}
.search-box button {
    background: var(--accent-orange);
    color: #fff; border: none;
    padding: 0 24px; border-radius: 10px;
    font-weight: 700; cursor: pointer; font-size: 15px;
}

.empty-state { text-align: center; color: var(--muted); padding: 40px 0; font-size: 16px; }

/* --- STATIC PAGE --- */
.static-page { max-width: 800px; }
.static-page h1 { font-size: 34px; color: var(--primary-coffee); font-weight: 800; margin-bottom: 24px; letter-spacing: -0.5px; }

/* --- SIDEBAR PRODUCT WIDGET --- */
.product-list li a { display: flex; flex-direction: column; gap: 2px; }
.product-list .product-name { font-weight: 600; }
.product-list .product-price { font-size: 13px; color: var(--accent-orange); font-weight: 700; }
.product-list .product-badge {
    display: inline-block; align-self: flex-start; margin-top: 3px;
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px;
    background: rgba(224,122,22,0.12); color: #b5610f;
    padding: 2px 8px; border-radius: 20px; font-weight: 700;
}

/* --- RELATED PRODUCTS (dalam artikel) --- */
.related-products {
    margin: 40px 0;
    padding: 26px;
    background: #fffaf5;
    border: 1px solid var(--border-color);
    border-radius: 16px;
}
.related-products h3 { color: var(--primary-coffee); margin-bottom: 18px; font-size: 20px; }
.product-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.product-card {
    display: flex; gap: 14px; align-items: center;
    background: #fff; border: 1px solid var(--border-color);
    border-radius: 12px; padding: 14px; text-decoration: none;
    transition: all 0.2s ease;
}
.product-card:hover { border-color: var(--accent-orange); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card-img {
    width: 64px; height: 64px; flex-shrink: 0;
    border-radius: 10px; overflow: hidden; background: #efe9e3;
    display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { display: flex; flex-direction: column; gap: 2px; }
.product-card-body strong { color: var(--primary-coffee); font-size: 15.5px; line-height: 1.3; }
.product-card-body .price { color: var(--accent-orange); font-weight: 700; font-size: 14px; }
.product-card-body .cta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.product-badge {
    align-self: flex-start; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px;
    background: rgba(224,122,22,0.12); color: #b5610f; padding: 2px 8px; border-radius: 20px; font-weight: 700;
}
.affiliate-note { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.affiliate-note a { color: var(--accent-orange); }

/* --- KOMENTAR --- */
.comments { margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.comments h3 { color: var(--primary-coffee); font-size: 22px; margin-bottom: 22px; }
.comment-item { display: flex; gap: 14px; margin-bottom: 22px; }
.comment-avatar {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
    background: var(--primary-coffee); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
}
.comment-content { flex: 1; background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 14px 18px; }
.comment-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.comment-head strong { color: var(--primary-coffee); }
.comment-head span { font-size: 12.5px; color: var(--muted); }
.comment-content p { margin: 0; font-size: 15.5px; color: #473f3a; }

.comment-form-wrap { margin-top: 30px; background: #fff; border: 1px solid var(--border-color); border-radius: 16px; padding: 26px; }
.comment-form-wrap h4 { color: var(--primary-coffee); margin-bottom: 16px; font-size: 17px; }
.comment-form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.comment-form input, .comment-form textarea {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--border-color); border-radius: 10px;
    font-family: inherit; font-size: 15px; background: #faf8f5;
}
.comment-form textarea { resize: vertical; }
.comment-form .btn-primary { cursor: pointer; border: none; }
.moderation-note { font-size: 12.5px; color: var(--muted); margin: 0; }

.alert-success {
    background: #e9f9ee; border: 1px solid #b6e6c5; color: #1f7a3d;
    padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 15px;
}
.alert-error {
    background: #fdecec; border: 1px solid #f5c2c2; color: #b42318;
    padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; font-size: 14.5px;
}

/* --- BANNER PRATINJAU --- */
.preview-banner {
    background: #fff3cd;
    border: 1px solid #ffe08a;
    color: #7a5d00;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-size: 14.5px;
}

/* --- FILTER CHIPS (Artikel Seduh) --- */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 35px;
    justify-content: center;
}
.chip {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--primary-coffee);
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    transition: all 0.2s ease;
}
.chip:hover { border-color: var(--accent-orange); color: var(--accent-orange); }
.chip.is-active {
    background: var(--primary-coffee);
    color: #fff;
    border-color: var(--primary-coffee);
}

/* --- ERROR PAGE --- */
.error-page { text-align: center; padding: 60px 20px; max-width: 560px; margin: 0 auto; }
.error-page .error-emoji { font-size: 64px; margin-bottom: 10px; }
.error-page h1 { font-size: 30px; color: var(--primary-coffee); font-weight: 800; margin-bottom: 14px; }
.error-page p { color: var(--muted); margin-bottom: 28px; font-size: 16px; }

/* --- IKLAN & FOOTER TAMBAHAN --- */
.ad-slot { text-align: center; overflow: hidden; }
.ad-sidebar { margin-bottom: 35px; }
.ad-in-article { margin: 30px 0; padding: 10px 0; }
footer.site-footer .footer-tagline { font-size: 16px; color: #e9c08a; margin-bottom: 14px; font-weight: 600; }
footer.site-footer .footer-social { margin-bottom: 14px; }
footer.site-footer .footer-social a { margin: 0 10px; color: #e9c08a; font-weight: 600; }

/* --- RESPONSIVE --- */
@media (max-width: 950px) {
    .guides-grid { grid-template-columns: repeat(2, 1fr); }
    .content-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .category-grid { grid-template-columns: 1fr; }
    .hero-slider { min-height: 70vh; }
    .hero-slide h1 { font-size: 30px; }
    .hero-card { padding: 36px 26px; }
}
@media (max-width: 600px) {
    .guides-grid { grid-template-columns: 1fr; }
    .article-card { grid-template-columns: 1fr; }
    .article-img { height: 200px; }
    .nav-container { flex-direction: column; gap: 10px; }
    .product-cards { grid-template-columns: 1fr; }
}
