/* ========================================
   Pemetaan Budaya Malaysia - Main Stylesheet
   Mobile-first, responsive design
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

a {
    color: #00a651;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #008c44;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ========================================
   Header
   ======================================== */
.site-header {
    background: linear-gradient(135deg, #00a651, #008c44);
    padding: 10px 0;
    position: relative;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-area img {
    height: 50px;
    width: auto;
}

.logo-area .site-title {
    font-family: 'Georgia', serif;
    font-size: 1.8rem;
    color: #fff;
    font-style: italic;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.header-flags {
    display: flex;
    gap: 5px;
    align-items: center;
}

.header-flags .flag {
    display: inline-block;
    padding: 3px 10px;
    color: #fff;
    font-weight: bold;
    font-size: 0.85rem;
    border-radius: 3px;
}

.flag-my { background: #0052b4; }
.flag-sg { background: #e8112d; }
.flag-id { background: #ce1126; }
.flag-th { background: #a51931; }

/* ========================================
   Navigation
   ======================================== */
.main-nav {
    background: #222;
    border-top: 3px solid #00a651;
}

.main-nav ul {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    display: block;
    padding: 12px 18px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    background: #00a651;
    text-decoration: none;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: #00a651;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

/* ========================================
   Category Icons Grid (Homepage)
   ======================================== */
.categories-section {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.category-card {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.category-card:hover {
    border-color: #00a651;
    box-shadow: 0 4px 15px rgba(0,166,81,0.3);
    transform: translateY(-3px);
}

.category-card img {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    object-fit: contain;
}

.category-card .cat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.category-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Search Bar
   ======================================== */
.search-section {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 15px;
}

.search-form {
    display: flex;
    border: 2px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 15px;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-form button {
    background: #00a651;
    color: #fff;
    border: none;
    padding: 10px 25px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #008c44;
}

/* ========================================
   Latest Updates / Article Cards
   ======================================== */
.latest-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 15px;
}

.latest-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-decoration: underline;
    color: #333;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.article-card {
    border: 2px solid #00a651;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.3s;
    background: #fff;
}

.article-card:hover {
    box-shadow: 0 5px 20px rgba(0,166,81,0.2);
}

.article-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #004d40, #00796b);
}

.article-card-body {
    padding: 15px;
    border-top: 3px solid #00a651;
}

.article-card-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.article-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #00a651;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-card-title a {
    color: #00a651;
}

.article-card-excerpt {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 6px 20px;
    border-radius: 3px;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.read-more-btn:hover {
    background: #00a651;
    color: #fff;
    text-decoration: none;
}

/* ========================================
   Hero Banner (Subpages)
   ======================================== */
.hero-banner {
    position: relative;
    height: 350px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.hero-banner h1 {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 2.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    padding: 0 20px;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #00a651;
    z-index: 2;
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb-nav {
    background: #f5f5f5;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}

.breadcrumb-nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.breadcrumb-list li::after {
    content: '→';
    margin-left: 8px;
    color: #999;
}

.breadcrumb-list li:last-child::after {
    content: '';
}

.breadcrumb-list li:last-child {
    color: #333;
    font-weight: 600;
}

.breadcrumb-list a {
    color: #00a651;
}

/* ========================================
   Content Layout (Two Column)
   ======================================== */
.content-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.main-content {
    min-width: 0;
}

.main-content h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #00a651;
}

.main-content p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #444;
}

.main-content .featured-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.jkkn-info {
    background: #f9f9f9;
    border-left: 4px solid #00a651;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 5px 5px 0;
}

.jkkn-info h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.jkkn-info p {
    margin-bottom: 5px;
    font-size: 0.95rem;
    color: #555;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    min-width: 0;
}

.sidebar-widget {
    margin-bottom: 25px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-widget-title {
    background: #00a651;
    color: #fff;
    padding: 12px 15px;
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-menu {
    padding: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #eee;
}

.sidebar-menu li:last-child {
    border-bottom: none;
}

.sidebar-menu a {
    display: block;
    padding: 10px 15px;
    color: #555;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #f0faf4;
    color: #00a651;
    padding-left: 20px;
    text-decoration: none;
}

/* ========================================
   Related Articles Carousel
   ======================================== */
.related-section {
    margin-top: 40px;
}

.related-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.related-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 180px;
    border: 2px dashed #e74c3c;
}

.related-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 15px 10px 10px;
    text-align: center;
}

.related-card .overlay span {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* ========================================
   State Page Grid
   ======================================== */
.state-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.state-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.state-card:hover {
    border-color: #00a651;
    box-shadow: 0 5px 15px rgba(0,166,81,0.2);
}

.state-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.state-card h3 {
    padding: 12px;
    font-size: 1rem;
    text-align: center;
    color: #333;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: #111;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    text-align: center;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 900;
    color: #00a651;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.footer-logo span {
    display: block;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    border: 2px dashed #00a651;
    border-radius: 8px;
}

.footer-links a {
    color: #aaa;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #00a651;
}

.footer-disclaimer {
    font-size: 0.8rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #00a651;
    color: #fff;
    border-color: #00a651;
    text-decoration: none;
}

.pagination .current {
    background: #00a651;
    color: #fff;
    border-color: #00a651;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .state-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
    }

    .main-nav ul.active {
        display: flex;
    }

    .main-nav a {
        text-align: center;
        border-bottom: 1px solid #333;
    }

    .header-inner {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-banner {
        height: 250px;
    }

    .hero-banner h1 {
        font-size: 1.8rem;
    }

    .related-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .category-card {
        padding: 10px 5px;
    }

    .category-card h3 {
        font-size: 0.75rem;
    }

    .hero-banner h1 {
        font-size: 1.4rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .state-grid {
        grid-template-columns: 1fr;
    }

    .logo-area .site-title {
        font-size: 1.3rem;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
