/*
Theme Name: EMDC Blog 2026 Theme
Description: Child theme for EMDC.blog homepage revamp - carousels, 3x3 category digest, and full sidebar preservation. Built to the official EMDC Brand Expression Guide.
Template: neve
Version: 1.2.0
Author: Joshy Kurian / FCBH Digital Engagement
*/

/* -------------------------------------------------
   0. EMDC Brand tokens (from EMDC Brand Expression Guide)
------------------------------------------------- */
:root {
    --emdc-black: #111827;      /* EMDC Main Black - primary text and titles */
    --emdc-orange: #ea580c;     /* EMDC Main Orange - buttons, banners/headers, logo icons */
    --emdc-orange-deep: #c2410c; /* darker orange for hover/gradient use, not in guide but derived */
    --emdc-bg: #f9fafb;         /* EMDC Page Backgrounds */
    --emdc-light-gray: #d2d5da; /* EMDC Light Gray - accents, icons, dividers, borders */
    --emdc-dark-gray: #6d7280;  /* EMDC Dark Gray - secondary text */
    --emdc-white: #ffffff;
    --emdc-font: 'DM Sans', Arial, Helvetica, sans-serif; /* official EMDC font, Google Font */
}

body.emdc-brand-scope,
.emdc-home-section {
    font-family: var(--emdc-font);
}

/* -------------------------------------------------
   0b. Layout: main content + existing sidebar
------------------------------------------------- */
.emdc-layout-row {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    gap: 0;
}

.emdc-main-col {
    flex: 1 1 100%;
    min-width: 0;
}

.emdc-sidebar-col {
    flex: 1 1 100%;
    padding: 24px 20px;
}

@media (min-width: 960px) {
    .emdc-main-col {
        flex: 1 1 70%;
        max-width: 70%;
    }
    .emdc-sidebar-col {
        flex: 1 1 30%;
        max-width: 30%;
    }
}

/* -------------------------------------------------
   0c. Site Header (logo + menu, orange brand bar)
------------------------------------------------- */
.emdc-site-header {
    background: var(--emdc-orange);
    width: 100%;
}

.emdc-site-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.emdc-site-header__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.emdc-site-header__logo img {
    height: 40px;
    width: auto;
    display: block;
}

/* Mobile hamburger toggle - hidden on desktop */
.emdc-site-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
}

.emdc-site-header__toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--emdc-white);
    border-radius: 2px;
}

/* Primary nav menu */
.emdc-nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding: 0;
    font-family: var(--emdc-font);
}

.emdc-nav-menu li {
    position: relative;
}

.emdc-nav-menu > li > a {
    color: var(--emdc-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.emdc-nav-menu > li > a:hover {
    opacity: 0.85;
}

/* Dropdown arrow for items with children */
.emdc-nav-menu li.menu-item-has-children > a::after {
    content: '\25BE';
    font-size: 0.7em;
    margin-left: 2px;
}

/* Submenu (Categories, EMDC Links dropdowns) */
.emdc-nav-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--emdc-white);
    border: 1px solid var(--emdc-light-gray);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(17,24,39,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 100;
}

.emdc-nav-menu li:hover > .sub-menu,
.emdc-nav-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.emdc-nav-menu .sub-menu a {
    display: block;
    padding: 9px 18px;
    color: var(--emdc-black);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    white-space: nowrap;
}

.emdc-nav-menu .sub-menu a:hover {
    background: var(--emdc-bg);
    color: var(--emdc-orange);
}

/* Mobile layout */
@media (max-width: 880px) {
    .emdc-site-header__toggle {
        display: flex;
    }

    .emdc-site-header__nav {
        display: none;
        width: 100%;
        order: 3;
    }

    .emdc-site-header__nav.is-open {
        display: block;
    }

    .emdc-site-header__inner {
        flex-wrap: wrap;
    }

    .emdc-nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding-top: 12px;
    }

    .emdc-nav-menu li {
        width: 100%;
    }

    .emdc-nav-menu > li > a {
        width: 100%;
        padding: 12px 0;
        border-top: 1px solid rgba(255,255,255,0.2);
    }

    .emdc-nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(255,255,255,0.08);
        display: none;
        padding-left: 12px;
    }

    .emdc-nav-menu li.emdc-submenu-open > .sub-menu {
        display: block;
    }

    .emdc-nav-menu .sub-menu a {
        color: var(--emdc-white);
    }

    .emdc-nav-menu .sub-menu a:hover {
        background: rgba(255,255,255,0.12);
        color: var(--emdc-white);
    }
}

/* -------------------------------------------------
   1. Section wrappers
------------------------------------------------- */
.emdc-home-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px;
    background: var(--emdc-bg);
}

.emdc-home-section + .emdc-home-section {
    border-top: 1px solid var(--emdc-light-gray);
}

.emdc-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
}

.emdc-section-header h2 {
    font-family: var(--emdc-font);
    font-weight: 700; /* DM Sans Bold for headlines, per brand guide */
    font-size: 1.5rem; /* text-2xl per EMDC type scale */
    line-height: 2rem;
    margin: 0;
    color: var(--emdc-black);
}

.emdc-section-header a.emdc-view-all {
    font-family: var(--emdc-font);
    font-size: 0.875rem; /* text-sm */
    color: var(--emdc-orange);
    text-decoration: none;
    font-weight: 700;
}

.emdc-section-header a.emdc-view-all:hover {
    text-decoration: underline;
}

/* -------------------------------------------------
   2. Swiper carousel base
------------------------------------------------- */
.emdc-carousel {
    position: relative;
    padding-bottom: 40px;
}

.emdc-carousel .swiper-slide {
    height: auto;
    display: flex;
}

.emdc-carousel .swiper-button-next,
.emdc-carousel .swiper-button-prev {
    color: var(--emdc-orange);
    width: 36px;
    height: 36px;
    background: var(--emdc-white);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(17,24,39,0.12);
}

.emdc-carousel .swiper-button-next::after,
.emdc-carousel .swiper-button-prev::after {
    font-size: 14px;
    font-weight: 700;
}

.emdc-carousel .swiper-pagination-bullet-active {
    background: var(--emdc-orange);
}

/* -------------------------------------------------
   3. Post cards (used in All Posts / Popular / Recent)
------------------------------------------------- */
.emdc-post-card {
    background: var(--emdc-white);
    border: 1px solid var(--emdc-light-gray);
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.emdc-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(17,24,39,0.10);
}

.emdc-post-card__thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--emdc-light-gray);
}

.emdc-post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.emdc-post-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    font-family: var(--emdc-font);
}

.emdc-post-card__category {
    font-size: 0.75rem; /* text-xs */
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--emdc-orange);
    font-weight: 700;
    margin-bottom: 6px;
}

.emdc-post-card__title {
    font-weight: 700; /* DM Sans Bold for headlines */
    font-size: 1.125rem; /* text-lg */
    line-height: 1.75rem;
    margin: 0 0 8px;
    color: var(--emdc-black);
}

.emdc-post-card__title a {
    color: inherit;
    text-decoration: none;
}

.emdc-post-card__title a:hover {
    color: var(--emdc-orange);
}

.emdc-post-card__meta {
    margin-top: auto;
    font-size: 0.75rem; /* text-xs */
    color: var(--emdc-dark-gray);
}

/* -------------------------------------------------
   3b. 3-column category digest
------------------------------------------------- */
.emdc-col-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 600px) {
    .emdc-col-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .emdc-col-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.emdc-col {
    display: flex;
    flex-direction: column;
    font-family: var(--emdc-font);
}

.emdc-col__header {
    border-bottom: 3px solid var(--emdc-orange);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.emdc-col__header h3 {
    margin: 0;
    font-weight: 700; /* DM Sans Bold */
    font-size: 1.125rem; /* text-lg */
    color: var(--emdc-black);
}

.emdc-col-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--emdc-light-gray);
}

.emdc-col-item:first-of-type {
    padding-top: 0;
}

.emdc-col-item__title {
    margin: 0 0 6px;
    font-weight: 700; /* DM Sans Bold for headlines */
    font-size: 1rem; /* text-base */
    line-height: 1.5rem;
}

.emdc-col-item__title a {
    color: var(--emdc-black);
    text-decoration: none;
}

.emdc-col-item__title a:hover {
    color: var(--emdc-orange);
}

.emdc-col-item__excerpt {
    margin: 0 0 6px;
    font-weight: 400; /* DM Sans Regular for body */
    font-size: 0.875rem; /* text-sm */
    color: var(--emdc-dark-gray);
    line-height: 1.5;
}

.emdc-col-item__readmore {
    font-size: 0.75rem; /* text-xs */
    font-weight: 700;
    color: var(--emdc-orange);
    text-decoration: none;
}

.emdc-col-item__readmore:hover {
    text-decoration: underline;
}

.emdc-col-empty {
    font-size: 0.875rem;
    color: var(--emdc-dark-gray);
    font-style: italic;
}

.emdc-col__more {
    margin-top: 12px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--emdc-orange-deep);
    text-decoration: none;
}

.emdc-col__more:hover {
    text-decoration: underline;
}

/* -------------------------------------------------
   4. Category cards (circular / pill style)
------------------------------------------------- */
.emdc-category-card {
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: block;
    font-family: var(--emdc-font);
}

.emdc-category-card__icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: var(--emdc-orange); /* EMDC guide: solid Main Orange for logo/icon fills, not a gradient */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emdc-white);
    font-size: 1.6rem;
    font-weight: 700;
}

.emdc-category-card__name {
    font-weight: 700; /* DM Sans Bold */
    color: var(--emdc-black);
    font-size: 0.9375rem;
}

.emdc-category-card__count {
    font-weight: 400;
    font-size: 0.75rem; /* text-xs */
    color: var(--emdc-dark-gray);
}

/* -------------------------------------------------
   5. Responsive tweaks
------------------------------------------------- */
@media (max-width: 600px) {
    .emdc-section-header h2 {
        font-size: 1.25rem;
    }
    .emdc-category-card__icon {
        width: 64px;
        height: 64px;
        font-size: 1.2rem;
    }
}
