/* =========================================================
   HIDE THEME HEADER (Bridge Image + "Explore" Title)
   Only when plugin is active
   ========================================================= */

/* Hide only the carousel slider with the bridge image */
.ms-explore-override-active #webplus_slider {
    display: none !important;
}


/* =========================================================
   End of header hiding styles
   ========================================================= */

/* =========================================================
   Marllon Explore Override Styles (scoped: .ms-*)
   Version: 0.6.0 - Subcategory Flip Cards Redesign
   ========================================================= */

:root {
    --ms-ink: #1b1f2a;
    --ms-muted: #667085;

    /* Official Marllon colors */
    --ms-cornflower: #2C4190;
    --ms-slate-blue: #284163;
    --ms-warm-gold: #E1A951;
    --ms-footer-blue: #393e47;

    --ms-page-bg: #f6f7f9;
    --ms-surface: #ffffff;

    --ms-border: rgba(17, 24, 39, 0.12);
    --ms-border-2: rgba(40, 65, 99, 0.22);

    --ms-shadow: 0 4px 12px rgba(16, 24, 40, 0.10);
    --ms-shadow-soft: 0 2px 8px rgba(16, 24, 40, 0.08);

    /* NO border radius - sharp corners */
    --ms-radius: 0px;
}

/* ---------------------------------------------------------
     Page container
  --------------------------------------------------------- */
.ms-explore {
    padding: 0 0 56px;
    background: var(--ms-page-bg);
    color: var(--ms-ink);
}

.ms-explore__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Banner image (replaces old intro header) */
.ms-explore__banner {
    max-width: 1200px;
    margin: 8px auto 24px;
    padding: 0;
}

.ms-explore__banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* =========================================================
     MAIN PILLAR TABS (at the top)
     TODO 6: Use footer blue (--ms-slate-blue) instead of cornflower
  ========================================================= */
.ms-pillar-tabs-wrapper {
    background: #ffffff;
    padding: 0;
    margin-bottom: 0;
}

/* TODO 3: gap between pillar tabs */
.ms-pillar-tabs {
    display: flex;
    gap: 8px;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.ms-pillar-tab {
    flex: 1;
    border: none;
    background: var(--ms-slate-blue);
    color: rgba(255, 255, 255, 0.85);
    padding: 20px 24px;
    cursor: pointer;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: background 200ms ease, color 200ms ease;
    position: relative;
}

/* TODO 2: Gold background on hover */
.ms-pillar-tab:hover {
    background: var(--ms-warm-gold);
    color: #ffffff;
}

/* TODO 2: Gold background when active */
.ms-pillar-tab.is-active {
    background: var(--ms-warm-gold);
    color: #ffffff;
}

/* Remove underline indicator - gold bg replaces it */
.ms-pillar-tab.is-active::after {
    content: none;
}

@media (max-width: 640px) {
    .ms-pillar-tab {
        font-size: 16px;
        padding: 16px 12px;
    }

    .ms-pillar-tabs {
        gap: 4px;
    }
}

/* =========================================================
     PILLAR SECTIONS (content areas)
  ========================================================= */
.ms-pillar-section {
    display: none;
}

.ms-pillar-section.is-active {
    display: block;
}

.ms-pillar {
    margin-top: 0;
}

.ms-pillar__header {
    margin-bottom: 0;
}

.ms-pillar__title {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: -0.015em;
}

.ms-pillar__subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.85;
}

/* =========================================================
     CARDS + FLIP - SHARP CORNERS
  ========================================================= */
.ms-cards--flip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

@media (max-width: 980px) {
    .ms-cards--flip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ms-cards--flip {
        grid-template-columns: 1fr;
    }
}

/* TODO 7: Placeholder for pillars with < 3 subcategories */
.ms-cards--with-placeholder {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ms-cards__placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    background: var(--ms-surface);
    border: 1px solid var(--ms-border);
    box-shadow: var(--ms-shadow-soft);
    min-height: 260px;
}

.ms-cards__placeholder-title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--ms-ink);
    letter-spacing: -0.01em;
}

.ms-cards__placeholder-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ms-muted);
}

@media (min-width: 980px) {
    .ms-cards__placeholder {
        min-height: 280px;
    }
}

@media (max-width: 980px) {
    .ms-cards--with-placeholder {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ms-cards__placeholder {
        grid-column: 1 / -1;
        min-height: auto;
        padding: 24px 20px;
    }
}

@media (max-width: 640px) {
    .ms-cards--with-placeholder {
        grid-template-columns: 1fr;
    }
}

.ms-flipcard {
    perspective: 1200px;
    cursor: pointer;
    outline: none;
    min-height: 260px;
}

@media (min-width: 980px) {
    .ms-flipcard {
        min-height: 280px;
    }
}

.ms-flipcard__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover:hover) {
    .ms-flipcard:hover .ms-flipcard__inner {
        transform: rotateY(180deg);
    }
}

.ms-flipcard:focus-within .ms-flipcard__inner,
.ms-flipcard.is-flipped .ms-flipcard__inner {
    transform: rotateY(180deg);
}

/* SHARP CORNERS on cards */
.ms-flipcard__face {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    backface-visibility: hidden;
    border: 1px solid var(--ms-border);
    background: var(--ms-surface);
    overflow: hidden;
    box-shadow: var(--ms-shadow-soft);
    border-radius: 0;
    /* SHARP CORNERS */
}

.ms-flipcard__front {
    transform: rotateY(0deg);
}

.ms-flipcard__back {
    transform: rotateY(180deg);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

/* Front: full-bleed image */
.ms-flipcard__front .ms-card__media {
    position: absolute;
    inset: 0;
    margin: 0;
    background: linear-gradient(135deg,
            rgba(44, 65, 144, 0.22),
            rgba(44, 65, 144, 0.06));
}

.ms-flipcard__front .ms-card__img,
.ms-flipcard__front .ms-card__img--placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ms-flipcard__front::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.00) 38%,
            rgba(0, 0, 0, 0.45) 78%,
            rgba(0, 0, 0, 0.62) 100%);
}

.ms-flipcard__front {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
}

.ms-flipcard__front .ms-card__title,
.ms-flipcard__front .ms-card__text,
.ms-flipcard__front .ms-card__hint {
    position: relative;
    z-index: 2;
    color: #fff;
}

.ms-flipcard__front .ms-card__title {
    margin: 0;
    padding: 0 16px 4px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.08;
}

/* TODO 1: Show description text on card front */
.ms-flipcard__front .ms-card__text {
    display: block;
    padding: 0 16px 4px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.ms-flipcard__front .ms-card__hint {
    padding: 0 16px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.80);
}

@media (hover:none) {
    .ms-flipcard__front .ms-card__hint {
        display: none;
    }
}

/* Back: details */
.ms-flipcard__back .ms-card__title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 750;
    color: #2a3140;
    letter-spacing: -0.01em;
}

.ms-card__bullets {
    margin: 0 0 14px;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ms-muted);
}

.ms-card__bullets li {
    margin: 7px 0;
}

.ms-card__link {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--ms-border);
    color: var(--ms-slate-blue);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: color 180ms ease;
}

.ms-card__link:hover {
    color: var(--ms-warm-gold);
    text-decoration: underline;
}

/* =========================================================
     CONTACT CTA SECTION - TODO 4: White background + larger elements
  ========================================================= */
.ms-contact-cta {
    margin: 48px 0 40px;
    background: var(--ms-surface);
    padding: 28px 32px;
    border: 1px solid var(--ms-border);
    box-shadow: var(--ms-shadow-soft);
}

.ms-contact-cta__intro {
    text-align: center;
    margin-bottom: 28px;
}

.ms-contact-cta__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--ms-muted);
    margin: 0 0 8px;
    letter-spacing: 0;
}

.ms-contact-cta__text {
    font-size: 13px;
    color: var(--ms-muted);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ms-contact-cta__link,
.ms-contact-cta__card-link {
    color: var(--ms-slate-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color 180ms ease;
}

.ms-contact-cta__link:hover,
.ms-contact-cta__card-link:hover {
    color: var(--ms-warm-gold);
}

.ms-contact-cta__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.ms-contact-cta__card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    background: transparent;
    border: none;
    padding: 20px 16px;
    box-shadow: none;
    text-align: left;
}

.ms-contact-cta__card-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ms-slate-blue);
    background: transparent;
    transition: color 200ms ease;
}

.ms-contact-cta__card-icon:hover {
    color: var(--ms-warm-gold);
}

.ms-contact-cta__card-icon svg {
    width: 48px;
    height: 48px;
}

.ms-contact-cta__card-body {
    flex: 1;
    min-width: 0;
}

.ms-contact-cta__card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ms-ink);
    margin: 0 0 10px;
    letter-spacing: 0;
}

.ms-contact-cta__card-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ms-muted);
    margin: 0;
}

@media (max-width: 980px) {
    .ms-contact-cta__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .ms-contact-cta {
        margin: 40px 0 32px;
        padding: 24px 16px;
    }

    .ms-contact-cta__intro {
        margin-bottom: 24px;
    }

    .ms-contact-cta__title {
        font-size: 16px;
    }

    .ms-contact-cta__text {
        font-size: 13px;
    }

    .ms-contact-cta__card {
        flex-direction: column;
        padding: 16px 12px;
        gap: 12px;
    }

    .ms-contact-cta__card-title {
        font-size: 18px;
    }

    .ms-contact-cta__card-text {
        font-size: 14px;
    }
}

/* =========================================================
   Latest posts - TODO 5: White background + SHARP CORNERS
   ========================================================= */
.ms-latest {
    margin-top: 48px;
    padding: 32px;
    background: var(--ms-surface);
    border: 1px solid var(--ms-border);
    box-shadow: var(--ms-shadow-soft);
}

.ms-latest__header {
    margin-bottom: 20px;
}

.ms-latest__title {
    margin: 0 0 6px;
    font-size: 26px;
}

.ms-latest__subtitle {
    margin: 0;
    font-size: 16px;
    color: var(--ms-muted);
    line-height: 1.6;
}

.ms-latest__subtitle-link {
    color: var(--ms-slate-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color 180ms ease;
}

.ms-latest__subtitle-link:hover {
    color: var(--ms-warm-gold);
}

.ms-latest__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Featured Post - SHARP CORNERS */
.ms-latest__featured {
    background: var(--ms-surface);
    border: 1px solid var(--ms-border);
    overflow: hidden;
    box-shadow: var(--ms-shadow-soft);
    display: flex;
    flex-direction: column;
    border-radius: 0;
    /* SHARP CORNERS */
}

.ms-latest__featured-image {
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(44, 65, 144, 0.08), rgba(44, 65, 144, 0.04));
}

.ms-latest__featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ms-latest__featured-content {
    padding: 20px 24px 24px;
}

.ms-latest__featured-title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.ms-latest__featured-title a {
    color: var(--ms-ink);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ms-latest__featured-title a:hover {
    color: var(--ms-slate-blue);
}

.ms-latest__featured-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ms-muted);
    margin-bottom: 16px;
}

.ms-latest__featured-link {
    display: inline-block;
    color: var(--ms-warm-gold);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ms-latest__featured-link:hover {
    color: #c89440;
    text-decoration: underline;
}

/* Top Stories - NO white background, SHARP CORNERS */
.ms-latest__sidebar {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.ms-latest__sidebar-title {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ms-ink);
    padding-bottom: 12px;
    border-bottom: 3px solid var(--ms-warm-gold);
}

.ms-latest__list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: story-counter;
}

.ms-latest__list-item {
    position: relative;
    padding: 18px 0 18px 40px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.12);
    counter-increment: story-counter;
}

.ms-latest__list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ms-latest__list-item:first-child {
    padding-top: 0;
}

.ms-latest__list-item::before {
    content: counter(story-counter) ".";
    position: absolute;
    left: 0;
    top: 18px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ms-ink);
    width: 28px;
}

.ms-latest__list-item:first-child::before {
    top: 0;
}

.ms-latest__list-link {
    color: var(--ms-ink);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    display: block;
    transition: color 0.2s ease;
}

.ms-latest__list-link:hover {
    color: var(--ms-slate-blue);
}

.ms-latest__empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--ms-muted);
    font-size: 15px;
}

@media (max-width: 980px) {
    .ms-latest__layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ms-latest__featured-image {
        height: 280px;
    }

    .ms-latest {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .ms-latest__featured-image {
        height: 220px;
    }

    .ms-latest__featured-content {
        padding: 16px 18px 20px;
    }

    .ms-latest__featured-title {
        font-size: 20px;
    }

    .ms-latest__list-item {
        padding-left: 35px;
    }

    .ms-latest__list-link {
        font-size: 15px;
    }

    .ms-latest {
        padding: 20px 16px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .ms-flipcard__inner,
    .ms-pillar-tab {
        transition: none;
    }
}

/* Optional theme cleanup */
.ms-explore-override-active .searchform,
.ms-explore-override-active .categories-box {
    display: none !important;
}

/* Remove theme wrapper padding/margin between header and main content */
.ms-explore-override-active .its--blog_content,
.ms-explore-override-active main,
.ms-explore-override-active .its--container,
.ms-explore-override-active .its--row {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Tags section */
.ms-latest__tags {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--ms-border);
}

.ms-latest__tags-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--ms-ink);
    margin-bottom: 16px;
}

.ms-latest__tags-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ms-latest__tag {
    font-size: 15px;
    color: var(--ms-ink);
    text-decoration: none;
    transition: color 180ms ease;
    position: relative;
}

.ms-latest__tag:not(:last-child)::after {
    content: "\00b7";
    margin-left: 12px;
    color: var(--ms-muted);
    font-weight: 700;
}

.ms-latest__tag:hover {
    color: var(--ms-warm-gold);
}

/* Non-linked tags (spans) */
span.ms-latest__tag {
    cursor: default;
}

span.ms-latest__tag:hover {
    color: var(--ms-ink);
}

@media (max-width: 640px) {
    .ms-latest__tags {
        margin-top: 32px;
        padding-top: 24px;
    }

    .ms-latest__tag {
        font-size: 14px;
    }
}
