/* ===========================================
   MASJID JAMI DARUL MU'MININ - FINAL CSS
   Clean, Consolidated, Conflict-Free
   =========================================== */

/* ===== VARIABLES ===== */
:root {
    --primary: #1a4d2e;
    --primary-dark: #0d3320;
    --accent: #c9a961;
    --bg: #f8f9fa;
    --text: #2c3e50;
    --white: #ffffff;
}

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    color: var(--text); 
    background: var(--bg); 
    line-height: 1.6; 
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== NAVBAR ===== */
.navbar { 
    background: var(--white); 
    box-shadow: 0 2px 15px rgba(0,0,0,0.05); 
    position: fixed; 
    width: 100%; 
    top: 0; 
    z-index: 3000; 
}
.nav-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    height: 65px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.nav-logo { 
    font-size: 1.2rem; 
    font-weight: 700; 
    color: var(--primary); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    text-decoration: none; 
    white-space: nowrap; 
    z-index: 1001;
}
.nav-logo img { 
    height: 40px; 
    width: auto; 
    border-radius: 6px; 
}
.nav-logo span { 
    font-size: 0.75rem; 
    color: #666; 
    font-weight: 400; 
    display: block; 
    line-height: 1.2; 
}

.nav-toggle { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 1.6rem; 
    color: var(--primary); 
    cursor: pointer; 
    padding: 5px; 
    z-index: 2002 !important;
}

.nav-menu { 
    display: flex; 
    list-style: none; 
    gap: 6px; 
    margin: 0; 
    padding: 0; 
    align-items: center; 
    position: fixed;       /* WAJIB */
  
}
.nav-link { 
    padding: 8px 12px; 
    border-radius: 8px; 
    font-weight: 500; 
    transition: 0.2s; 
    color: var(--text); 
    text-decoration: none; 
    font-size: 0.95rem; 
    white-space: nowrap;
    position: relative;
    z-index: auto;
    touch-action:manipulation;
}
.nav-link:hover, .nav-link.active { 
    background: rgba(26,77,46,0.08); 
    color: var(--primary); 
}
.btn-donasi { 
    background: var(--primary); 
    color: #fff !important; 
    padding: 8px 16px; 
    border-radius: 20px;
    z-index: 2001;
}
.btn-donasi:hover { background: var(--primary-dark); }

.nav-overlay { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 1999; 
    opacity: 0; 
    visibility: hidden; 
    transition: 0.3s;
    pointer-events: none;
}
.nav-overlay.active { 
    opacity: 1; 
    visibility: visible;
    pointer-events: none;
}

/* ===== HERO SLIDER ===== */
.hero-wrapper {
    position: relative;
    height: 85vh;
    overflow: hidden;
    margin-top: 65px;
}
.hero-slider-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
}
.slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0;
    transition: opacity 2s ease-in-out, transform 6s ease-out;
    transform: scale(1.1);
}
.slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(26,77,46,0.85), rgba(13,51,32,0.9));
    z-index: 2;
}
.hero-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}
.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    text-align: left;
    padding-left: 20px;
}
.hero-inner h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 15px;
    line-height: 1.2;
    font-weight: 800;
}
.hero-inner p {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.95);
    margin-bottom: 30px;
    max-width: 600px;
    line-height: 1.6;
}
.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 50px;
    border-top: 1px solid rgba(255,255,255,0.25);
    padding-top: 20px;
    flex-wrap: wrap;
}
.hero-stats .stat-num {
    font-size: 2rem;
    color: var(--accent);
    font-weight: 700;
}
.hero-stats .stat-label {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
}

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.anim-left {
    opacity: 0;
    animation: slideInLeft 1s ease-out forwards;
}
.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 0.9s; }

/* ===== PRAYER SECTION ===== */
.prayer-section-full { 
    padding: 0; 
    background: transparent; 
}
.prayer-grid-full {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}
.prayer-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(26, 77, 46, 0.15);
    border-radius: 16px;
    padding: 25px 15px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}
.prayer-box:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 25px rgba(26, 77, 46, 0.15);
    border-color: var(--accent);
}
.prayer-box.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(26, 77, 46, 0.4);
    z-index: 2;
}
.prayer-box.active .prayer-name,
.prayer-box.active .prayer-time { color: white; }
.prayer-name { 
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--primary); 
    margin-bottom: 8px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}
.prayer-time { 
    font-size: 1.6rem; 
    font-weight: 800; 
    color: var(--text); 
    font-variant-numeric: tabular-nums; 
}
#live-wit { 
    font-size: 1.1rem; 
    color: var(--primary); 
    font-weight: 600; 
    letter-spacing: 0.5px; 
}
#countdown-box { 
    background: rgba(26, 77, 46, 0.08); 
    padding: 15px; 
    border-radius: 12px; 
    margin: 20px auto 0; 
    text-align: center;
    border: 1px dashed rgba(26, 77, 46, 0.2);
    max-width: 800px;
}
#countdown-timer { 
    font-size: 2rem; 
    font-weight: 800; 
    color: var(--primary); 
    font-family: 'Courier New', monospace; 
    letter-spacing: 3px; 
}

/* ===== SECTIONS ===== */
.home-section {
    padding: 70px 20px;
    border-bottom: 1px solid rgba(26, 77, 46, 0.1);
    position: relative;
}
.home-section:last-child {
    border-bottom: none;
}
.home-section:nth-child(even) { background: #f8f9fa; }
.home-section:nth-child(odd) { background: #ffffff; }
.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.section-title { 
    text-align: center; 
    font-size: 1.6rem; 
    color: var(--primary); 
    margin-bottom: 8px; 
}
.section-sub { 
    text-align: center; 
    color: #666; 
    margin-bottom: 30px; 
}
.bg-hijau-tipis {
    background-color: rgba(26, 77, 46, 0.04);
}

/* ===== CARDS (Berita, Artikel, Galeri) ===== */
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 20px; 
}
.card { 
    background: var(--white); 
    border-radius: 10px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.06); 
    transition: transform 0.2s; 
}
.card:hover { transform: translateY(-4px); }
.card-body { padding: 16px; }
.card-tag { 
    display: inline-block; 
    background: rgba(26,77,46,0.1); 
    color: var(--primary); 
    padding: 4px 10px; 
    border-radius: 12px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    margin-bottom: 8px; 
}
.card h3 { 
    font-size: 1.1rem; 
    margin-bottom: 8px; 
    line-height: 1.4; 
}
.card p { 
    font-size: 0.9rem; 
    color: #555; 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}
.card-meta { 
    font-size: 0.8rem; 
    color: #888; 
    margin-top: 10px; 
    display: flex; 
    gap: 12px; 
}

/* ===== RELATED ARTICLES (Card Style) ===== */
.related-section { 
    padding: 60px 20px; 
    background: #f8f9fa; 
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1100px;
    margin: 40px auto 0;
}
.related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}
.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.related-card .card-thumb {
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    overflow: hidden;
}
.related-card .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.related-card:hover .card-thumb img {
    transform: scale(1.05);
}
.related-card .card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.related-card .card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.4;
    color: #2c3e50;
}
.related-card .card-cat {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(26,77,46,0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: auto;
    width: fit-content;
}

/* ===== ARTICLE DETAIL HEADER (Istiqlal Style) ===== */
.article-detail-header {
    background: linear-gradient(135deg, #0d3320 0%, #1a4d2e 100%);
    color: white;
    padding: 120px 20px 60px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
}
.article-detail-header.has-image {
    background-size: cover;
    background-position: center;
    min-height: 500px;
}
.article-detail-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(13,51,32,0.3), rgba(13,51,32,0.9));
    z-index: 1;
}
.article-header-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
.article-breadcrumb {
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
    opacity: 0.9;
    text-transform: uppercase;
}
.article-detail-header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 700;
}
.article-meta-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    opacity: 0.95;
}
.article-meta-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== FOOTER ===== */
.footer { 
    background: var(--primary-dark); 
    color: white; 
    padding: 40px 20px 20px; 
    margin-top: 50px; 
}
.footer-grid { 
    max-width: 1100px; 
    margin: 0 auto; 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 35px; 
}
.footer h4 { 
    color: var(--accent); 
    margin-bottom: 15px; 
    font-size: 1.1rem; 
    font-weight: 600; 
}
.footer a { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 14px; 
    opacity: 0.95; 
    text-decoration: none; 
    color: inherit; 
    transition: opacity 0.2s, transform 0.2s; 
}
.footer a:hover { 
    opacity: 1; 
    transform: translateX(3px); 
}
.footer-bottom { 
    text-align: center; 
    padding-top: 25px; 
    margin-top: 35px; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    font-size: 0.85rem; 
    opacity: 0.8; 
}

/* ===== QURBAN TABLE ===== */
.qurban-table th, .qurban-table td {
    min-width: 120px;
    transition: background 0.2s;
}
.qurban-table tr:hover td {
    background: rgba(26,77,46,0.03);
}

/* ===== RESPONSIVE (TABLET) ===== */
@media (max-width: 992px) {
    .nav-logo span { display: none; }
    .nav-link { padding: 8px 10px; font-size: 0.9rem; }
    .prayer-grid-full { grid-template-columns: repeat(3, 1fr); }
}

/* ===== RESPONSIVE (MOBILE) - SATU BLOK SAJA ===== */
@media (max-width: 768px) {
    /* Navbar Mobile */
    .nav-toggle { 
        display: block !important; 
        z-index: 9999 !important; 
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0.3);
    }
    .nav-menu { 
        position: fixed; 
        top: 0; right: -100%; 
        width: 75%; max-width: 280px; 
        height: 100vh;
        background: #fff; 
        flex-direction: column; 
        padding: 80px 20px 30px;
        box-shadow: -5px 0 25px rgba(0,0,0,0.2); 
        transition: right 0.3s ease;
        z-index: 9998 !important; 
        gap: 0; 
        overflow-y: auto;
        align-items: stretch !important;
    }
    .nav-menu.active { right: 0; }
    .nav-link { 
        padding: 15px 10px; 
        border-bottom: 1px solid #eee; 
        font-size: 1rem; 
        width: 100%; 
        text-align: left !important;
        display: block !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(26,77,46,0.2);
        touch-action: manipulation !important;
    }
    .nav-menu li:last-child .nav-link { border-bottom: none; }
    .btn-donasi { 
        text-align: center; 
        margin-top: 15px; 
        display: block !important;
        width: 100%;
    }
    .nav-logo img { height: 36px; }
    .nav-overlay.active {
        z-index: 9997 !important;
    }
    
    /* Hero Mobile */
    .hero-inner h1 { font-size: 1.8rem !important; text-align: center !important; }
    .hero-inner p { font-size: 1rem !important; text-align: center !important; }
    .hero-stats { gap: 20px !important; justify-content: center !important; }
    .hero-stats .stat-num { font-size: 1.5rem !important; }
    
    /* Prayer Mobile */
    .prayer-grid-full { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
    .prayer-box { padding: 12px 8px !important; }
    .prayer-name { font-size: 0.9rem !important; }
    .prayer-time { font-size: 1.2rem !important; }
    
    /* Section Mobile */
    .home-section { padding: 50px 15px !important; }
    .section-title { font-size: 1.5rem !important; text-align: center !important; }
    .section-sub { font-size: 0.9rem !important; text-align: center !important; }
    .grid { grid-template-columns: 1fr !important; gap: 15px !important; }
    .card { margin-bottom: 15px; }
    
    /* Article Detail Mobile */
    .article-detail-header { padding: 100px 15px 40px !important; min-height: 350px !important; }
    .article-detail-header h1 { font-size: 1.8rem !important; }
    .article-detail-header.has-image { min-height: 400px !important; }
    .related-grid { grid-template-columns: 1fr !important; }
    
    /* Footer Mobile */
    .footer-grid { grid-template-columns: 1fr !important; text-align: center !important; }
    .footer a, .footer div[style*="display:flex"] { justify-content: center !important; }
    
    /* Qurban Table Mobile */
    .qurban-table th, .qurban-table td {
        padding: 10px 8px !important;
        font-size: 0.9rem !important;
        min-width: 90px !important;
    }
}

/* ===== SMALL MOBILE ===== */
@media (max-width: 480px) {
    .prayer-grid-full { grid-template-columns: repeat(2, 1fr) !important; }
    .prayer-time { font-size: 1.1rem !important; }
    .article-detail-header h1 { font-size: 1.5rem !important; }
}

/* ===== TOUCH DEVICE OPTIMIZATION ===== */
@media (hover: none) and (pointer: coarse) {
    .nav-link:active {
        background: rgba(26,77,46,0.15) !important;
    }
    .btn:active, .card:active {
        transform: scale(0.98) !important;
    }
}

/* ===== HERO RUNNING TEXT / TICKER ===== */
.hero-ticker-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    overflow: hidden;
    height: 48px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ticker-label {
    flex-shrink: 0;
    padding: 0 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.2);
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
    letter-spacing: 0.5px;
}

.ticker-wrap {
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
}

.ticker {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    /* Posisi awal di kanan */
    transform: translateX(0);
    will-change: transform;
}

.ticker-item {
    padding: 0 2.5rem;
    font-size: 0.95rem;
    color: #ffffff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.ticker-item i {
    color: var(--accent);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-ticker-container {
        flex-direction: column;
        height: auto;
        align-items: stretch;
        margin-top: 20px;
        border-radius: 10px;
    }
    .ticker-label {
        justify-content: center;
        padding: 10px 15px;
        font-size: 0.85rem;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }
    .ticker-wrap {
        height: 40px;
    }
    .ticker-item {
        font-size: 0.85rem;
        padding: 0 1.5rem;
    }
}