/*
 * Perpukadesi Theme Styles
 */

:root {
    --white-primary: #FFFFFF;
    --gold-accent: #C9A84C;
    --light-bg: #FAFAFA;
    --charcoal-txt: #1F2937;
    --white-surface: #FFFFFF;
    --border-color: #E5E7EB;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--charcoal-txt);
    background-color: var(--light-bg);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--charcoal-txt);
    font-weight: 700;
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color, var(--gold-accent));
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--charcoal-txt);
}

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

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 500;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.button-primary {
    background-color: var(--accent-color, var(--gold-accent));
    color: var(--white-surface);
}

.button-primary:hover {
    background-color: var(--charcoal-txt);
    color: var(--white-surface);
}

.button-secondary {
    background-color: transparent;
    color: var(--white-surface);
    border: 2px solid var(--white-surface);
}

.button-secondary:hover {
    background-color: var(--white-surface);
    color: var(--charcoal-txt);
    border-color: var(--charcoal-txt);
}

.button-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color, var(--gold-accent));
    margin: 1rem auto 0;
}
.section-title:not(.text-center)::after {
    margin-left: 0;
}

section {
    padding: 5rem 0;
}

/* Header */
.site-header {
    background-color: var(--white-surface);
    color: var(--charcoal-txt);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 15px rgba(0,0,0,0.05); /* Soft shadow for white header */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding {
    flex: 1; /* Pushes menu to center */
}

.main-navigation {
    flex: 2;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Pseudo element to balance the flex if needed, or just let space-between handle it */
.header-container::after {
    content: '';
    flex: 1;
    display: none; /* Only enable if perfect center is needed, but logo usually anchors left nicely */
}

@media (min-width: 993px) {
    .header-container::after {
        display: block;
    }
}

.site-title a {
    color: var(--charcoal-txt);
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.site-description {
    font-size: 0.875rem;
    color: #666;
}
.custom-logo {
    max-height: 50px;
    width: auto;
}

/* ============================================
   Navigation + Mega Menu
   ============================================ */
.main-navigation {
    position: relative;
}

/* Primary horizontal menu */
.primary-menu {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}
.primary-menu > li {
    position: relative;
}

.primary-menu > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--charcoal-txt);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 1.25rem 1rem;
    white-space: nowrap;
    transition: color 0.25s ease, background-color 0.25s ease;
    position: relative;
}

.primary-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 3px;
    background-color: var(--accent-color, var(--gold-accent));
    transition: left 0.25s ease, right 0.25s ease;
}

.primary-menu > li:hover > a,
.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a {
    color: var(--accent-color, var(--gold-accent));
}

.primary-menu > li:hover > a::after,
.primary-menu > li.current-menu-item > a::after {
    left: 0; right: 0;
}

/* Dropdown arrow indicator */
.dropdown-arrow {
    font-size: 0.65rem;
    opacity: 0.7;
    transition: transform 0.25s ease;
}
.has-dropdown.dropdown-open > a .dropdown-arrow {
    transform: rotate(180deg);
}

/* ── Dropdown Container ── */
.dropdown-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background-color: var(--white-surface);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-top: 3px solid var(--accent-color, var(--gold-accent));
    border-radius: 0 0 6px 6px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.has-dropdown.dropdown-open > .dropdown-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

/* Sub-menu items */
.dropdown-wrapper .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.dropdown-wrapper .sub-menu li a {
    display: block;
    padding: 0.65rem 1.25rem;
    color: var(--charcoal-txt);
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-wrapper .sub-menu li a:hover {
    background-color: var(--ivory-bg);
    color: var(--primary-color, var(--navy-primary));
    border-left-color: var(--accent-color, var(--gold-accent));
    padding-left: 1.5rem;
}

/* ── Mega Menu ── */
/* Add class "mega-menu" to a top-level menu item in WP Admin to enable mega layout */
.is-mega > .dropdown-wrapper {
    min-width: min(900px, 90vw);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
}

.is-mega.dropdown-open > .dropdown-wrapper {
    transform: translateX(-50%) translateY(0);
}

.is-mega > .dropdown-wrapper > .sub-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    padding: 1.5rem;
    gap: 0.5rem;
}

.is-mega > .dropdown-wrapper > .sub-menu > li {
    border-right: 1px solid #f0ede8;
}

.is-mega > .dropdown-wrapper > .sub-menu > li:last-child {
    border-right: none;
}

.is-mega > .dropdown-wrapper > .sub-menu li a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.is-mega > .dropdown-wrapper > .sub-menu > li > a {
    font-weight: 600;
    color: var(--primary-color, var(--navy-primary));
    font-family: var(--font-heading);
    border-left: none;
    border-bottom: 2px solid var(--ivory-bg);
    margin-bottom: 0.5rem;
}

.is-mega > .dropdown-wrapper > .sub-menu > li > a:hover {
    background: var(--ivory-bg);
    border-left: none;
    padding-left: 1rem;
    border-bottom-color: var(--accent-color, var(--gold-accent));
}

/* ── Hamburger ── */
.menu-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    transition: border-color 0.2s;
}

.menu-toggle:hover {
    border-color: var(--accent-color, var(--gold-accent));
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger-icon span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate to X when open */
.site-header.menu-open .hamburger-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.site-header.menu-open .hamburger-icon span:nth-child(2) {
    opacity: 0;
}
.site-header.menu-open .hamburger-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Hero Section */
.hero-section {
    position: relative;
    background-size: cover;
    background-position: center;
    color: var(--white-surface);
    padding: 8rem 0;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    color: var(--white-surface);
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* About Section */
.about-section {
    background-color: var(--white-surface);
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-description {
    margin-bottom: 2rem;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.placeholder-image {
    width: 100%;
    height: 400px;
    background-color: var(--ivory-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    border-radius: 8px;
}

/* Stats Section */
.stats-section {
    background-color: var(--primary-color, var(--navy-primary));
    color: var(--white-surface);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--accent-color, var(--gold-accent));
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Officers Section */
.officers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.officer-card {
    background-color: var(--white-surface);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.officer-photo img, .placeholder-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
}
.placeholder-photo {
    background-color: var(--ivory-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.officer-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.officer-title {
    color: var(--navy-secondary);
    font-size: 0.9rem;
}

/* Programs Section */
.programs-section {
    background-color: var(--white-surface);
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.program-card {
    padding: 2.5rem;
    background-color: var(--ivory-bg);
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease;
}

.program-card:hover {
    transform: translateY(-5px);
}

.program-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color, var(--navy-primary));
    color: var(--accent-color, var(--gold-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.program-icon .dashicons {
    font-size: 30px;
    width: 30px; height: 30px;
}

/* News Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.news-card {
    background-color: var(--white-surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.news-thumbnail img, .placeholder-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.placeholder-thumbnail {
    background-color: var(--ivory-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.news-content {
    padding: 1.5rem;
}

.news-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: block;
}

.news-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.news-title a {
    color: var(--charcoal-txt);
}
.news-title a:hover {
    color: var(--accent-color, var(--gold-accent));
}

.news-excerpt {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: #555;
}

.read-more {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Gallery Slider */
.gallery-slider {
    margin: 0 -10px;
}
.gallery-item {
    padding: 0 10px;
}
.gallery-item img {
    width: 100%;
    border-radius: 8px;
    height: 250px;
    object-fit: cover;
}

/* CTA Section */
.cta-section {
    background-color: var(--primary-color, var(--navy-primary));
    color: var(--white-surface);
}

.cta-title {
    color: var(--white-surface);
    margin-bottom: 2rem;
}

/* Footer */
.site-footer {
    background-color: var(--charcoal-txt);
    color: var(--white-surface);
    padding-top: 4rem;
}

.footer-widget-area {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    color: var(--white-surface);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.footer-address {
    margin-top: 1rem;
    color: #ccc;
}

.footer-menu {
    list-style: none;
}
.footer-menu li { margin-bottom: 0.5rem; }
.footer-menu a { color: #ccc; }
.footer-menu a:hover { color: var(--accent-color, var(--gold-accent)); }

.contact-list {
    list-style: none;
    color: #ccc;
    margin-bottom: 1.5rem;
}
.contact-list li { margin-bottom: 0.5rem; }
.contact-list a { color: #ccc; }

.social-links a {
    display: inline-block;
    width: 36px; height: 36px;
    background-color: rgba(255,255,255,0.1);
    text-align: center;
    line-height: 36px;
    border-radius: 50%;
    margin-right: 0.5rem;
    color: var(--white-surface);
}

.site-info {
    background-color: #1a1a1a;
    padding: 1.5rem 0;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
    .about-container { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .officers-grid, .programs-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-widget-area { grid-template-columns: 1fr 1fr; }

    /* Mobile menu toggle visible */
    .menu-toggle { display: flex; }

    /* Mobile: stacked vertical menu */
    .primary-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--primary-color, var(--navy-primary));
        padding: 1rem 0;
        box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        z-index: 3000;
    }

    .primary-menu.is-open {
        display: flex;
    }

    .primary-menu > li > a {
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .primary-menu > li > a::after { display: none; }

    /* Mobile dropdowns — inline, slide down */
    .dropdown-wrapper {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid var(--accent-color, var(--gold-accent));
        border-radius: 0;
        pointer-events: all;
        display: none;
        background-color: rgba(0,0,0,0.15);
    }

    .has-dropdown.dropdown-open > .dropdown-wrapper {
        display: block;
    }

    .dropdown-wrapper .sub-menu li a {
        color: rgba(255,255,255,0.85);
        padding-left: 2rem;
        border-left: none;
    }

    .dropdown-wrapper .sub-menu li a:hover {
        background-color: rgba(255,255,255,0.1);
        color: var(--accent-color, var(--gold-accent));
        padding-left: 2.25rem;
    }

    /* Override mega grid on mobile */
    .is-mega > .dropdown-wrapper {
        min-width: 100%;
        left: 0;
        transform: none;
    }
    .is-mega > .dropdown-wrapper > .sub-menu {
        display: block;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .officers-grid, .programs-grid, .news-grid, .stats-grid, .footer-widget-area {
        grid-template-columns: 1fr;
    }
    .hero-title { font-size: 2.5rem; }
    .hero-cta-group { flex-direction: column; align-items: flex-start; }

    .section-title { font-size: 2rem; }
}

/* ============================================
   NEW CLEAN WHITE & GOLD CORE THEME UPDATES
   ============================================ */

/* Menu Hamburger Fix */
.menu-toggle {
    border-color: var(--charcoal-txt);
    color: var(--charcoal-txt);
}
.hamburger-icon span {
    background-color: var(--charcoal-txt);
}

/* Secondary Button (Hero) Fix */
.button-secondary {
    color: var(--charcoal-txt);
    border-color: var(--charcoal-txt);
}

/* Hero Section */
.hero-section {
    color: var(--charcoal-txt);
}
.hero-title {
    color: var(--charcoal-txt);
}
.hero-overlay {
    background-color: rgba(255, 255, 255, 0.85); /* Light overlay instead of dark */
}

/* Stats Section */
.stats-section {
    background-color: var(--light-bg);
    color: var(--charcoal-txt);
}
.stat-label {
    color: #666;
}

/* CTA Section */
.cta-section {
    background-color: var(--light-bg);
    color: var(--charcoal-txt);
    border-top: 1px solid var(--border-color);
}
.cta-title {
    color: var(--charcoal-txt);
}

/* Footer Section */
.site-footer {
    background-color: var(--white-surface);
    color: #555;
    border-top: 1px solid var(--border-color);
}
.footer-col h3 {
    color: var(--charcoal-txt);
}
.footer-address, .footer-menu a, .contact-list a {
    color: #666;
}
.social-links a {
    background-color: var(--light-bg);
    color: var(--charcoal-txt);
    border: 1px solid var(--border-color);
}
.social-links a:hover {
    background-color: var(--gold-accent);
    color: #fff;
    border-color: var(--gold-accent);
}
.site-info {
    background-color: var(--light-bg);
    color: #888;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   MODERN ARTICLE LAYOUT (single.php)
   ============================================ */
.article-modern {
    padding: 3rem 0 6rem;
    background-color: var(--white-surface);
}

.modern-single-post {
    max-width: 800px;
    margin: 0 auto;
}

.entry-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.category-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: var(--light-bg);
    color: var(--gold-accent);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    transition: background-color 0.2s;
}

.category-badge:hover {
    background-color: var(--gold-accent);
    color: white;
}

.article-title {
    font-size: 3rem;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    color: var(--charcoal-txt);
}

.entry-meta-details {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    color: #777;
    font-size: 0.95rem;
}

.meta-divider {
    color: #ccc;
}

.post-thumbnail-wrapper {
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Nice drop shadow */
}

.article-featured-image {
    width: 100%;
    height: auto;
    display: block;
}

.article-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #333;
}

.article-content p {
    margin-bottom: 1.8rem;
}

.article-content h2, .article-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--charcoal-txt);
}

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    background-color: var(--light-bg);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
    transition: all 0.2s;
}

.tag-link:hover {
    background-color: var(--gold-accent);
    color: white;
}

/* Share Buttons */
.article-share-box {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--border-color);
}
.share-title {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--charcoal-txt);
}
.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: white !important;
    transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; }
.share-fb { background-color: #1877F2; }
.share-tw { background-color: #1DA1F2; }
.share-wa { background-color: #25D366; }

/* Comments Area */
.modern-comments {
    max-width: 800px;
    margin: 4rem auto 0;
    padding: 3rem;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.comments-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--charcoal-txt);
}
.comment-list {
    list-style: none;
    margin: 0 0 3rem 0;
    padding: 0;
}
.comment-list .comment {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.comment-body {
    display: flex;
    gap: 1.5rem;
}
.comment-author .avatar {
    border-radius: 50%;
    width: 60px;
    height: 60px;
}
.comment-meta {
    margin-bottom: 0.5rem;
}
.comment-meta a {
    color: #888;
    font-size: 0.85rem;
}
.comment-content {
    color: #444;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.comment-reply-link {
    font-size: 0.85rem;
    font-weight: 600;
}
/* Comment Form */
.comment-respond {
    margin-top: 2rem;
}
.comment-reply-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}
.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-family: inherit;
}
.comment-form-comment textarea:focus,
.comment-form-author input:focus,
.comment-form-email input:focus {
    outline: none;
    border-color: var(--gold-accent);
}

/* Related Articles */
.related-articles-section {
    max-width: 1200px;
    margin: 4rem auto 0;
    padding-top: 4rem;
    border-top: 1px solid var(--border-color);
}
.related-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--charcoal-txt);
}
