/* * WP Plugin CSS Scoping 
 * Prefix: .mc-
 */

/* Base Variables */
:root {
    --mc-primary: #3870c8;
    /* Blue-600 */
    --mc-primary-dark: #1c5bab;
    /* Blue-800 */
    --mc-bg-light: #f8fafc;
    /* Slate-50 */
    --mc-text-main: #1e293b;
    /* Slate-800 */
    --mc-text-muted: #64748b;
    /* Slate-500 */
    --mc-border: #e2e8f0;
    /* Slate-200 */
    --mc-white: #ffffff;
    --mc-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --mc-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --mc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --mc-radius: 1rem;
    /* 16px */
    --mc-font: 'Inter', sans-serif;
}

/* Scoped Container Reset */
.mc-glossary-wrapper {
    font-family: var(--mc-font);
    color: var(--mc-text-main);
    line-height: 1.6;
    box-sizing: border-box;
    background-color: transparent;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.mc-glossary-wrapper * {
    box-sizing: border-box;
}

.mc-glossary-wrapper a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* --- Common Components --- */

/* Breadcrumb */
.mc-breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--mc-text-muted);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
}

.mc-breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.mc-breadcrumb-item a:hover {
    color: var(--mc-primary);
}

.mc-breadcrumb-separator {
    margin: 0 0.5rem;
    font-size: 0.75rem;
    color: #cbd5e1;
}

.mc-breadcrumb-current {
    color: var(--mc-text-main);
    font-weight: 500;
}

/* Header */
header.mc-header {
    background-color: white;
}

.mc-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--mc-border);
    padding-bottom: 1.5rem;
}

.mc-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--mc-primary);
    margin: 0;
    line-height: 1.2;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--mc-border);
}

.mc-subtitle {
    margin-top: 0.5rem;
    color: var(--mc-text-muted);
    font-size: 1.125rem;
}

/* Base Card Style */
.mc-card {
    background-color: var(--mc-white);
    border-radius: var(--mc-radius);
    box-shadow: var(--mc-shadow);
    border: 1px solid var(--mc-border);
    overflow: hidden;
}

/* Layout Grid (Single Page) */
.mc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .mc-grid {
        grid-template-columns: 8fr 4fr;
        /* 2/3 Content, 1/3 Sidebar */
        gap: 3rem;
    }

    .mc-main-content {
        order: 1;
    }

    .mc-sidebar {
        order: 2;
    }

    .mc-title {
        font-size: 2.2rem;
    }
}

/* --- Single Page Specific Components --- */

/* Featured Image (Single) */
.mc-image-wrapper {
    width: 100%;
    position: relative;
    background-color: #f1f5f9;
    aspect-ratio: 16 / 9;
}

@media (min-width: 768px) {
    .mc-image-wrapper {
        aspect-ratio: 21 / 9;
    }
}

.mc-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.mc-image-wrapper:hover img {
    transform: scale(1.02);
}

/* Content Body */
.mc-body {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .mc-body {
        padding: 2.5rem;
    }
}

/* Typography inside body */
.mc-prose p {
    margin-bottom: 1.5rem;
    color: #475569;
    font-size: 1.05rem;
}

/* Dropcap targeting the first paragraph of the body content */
.mc-body>p:first-of-type::first-letter {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--mc-primary);
    float: left;
    line-height: 0.8;
    margin-right: 0.75rem;
    margin-top: 0.66rem;
}

.mc-highlight-box {
    background-color: #eff6ff;
    border-left: 4px solid var(--mc-primary);
    padding: 1.25rem;
    margin: 2rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.mc-highlight-title {
    color: #1e40af;
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    display: block;
}

.mc-highlight-text {
    color: #1e3a8a;
    margin: 0;
    font-size: 0.95rem;
}

.mc-card-footer {
    background-color: #f8fafc;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--mc-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--mc-text-muted);
}

.mc-btn-share {
    color: var(--mc-primary);
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.mc-btn-share:hover {
    text-decoration: underline;
}

/* Sidebar Widgets (Single) */
.mc-sidebar-sticky {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mc-widget-category,
.mc-widget-related {
    position: relative;
    background: var(--mc-white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--mc-border);
    box-shadow: var(--mc-shadow);
}

.mc-cat-bg-decor {
    position: absolute;
    top: -3rem;
    right: -3rem;
    width: 6rem;
    height: 6rem;
    background-color: #dbeafe;
    border-radius: 50%;
    z-index: 0;
}

.mc-widget-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.mc-cat-flex {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.mc-cat-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--mc-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.mc-cat-name {
    margin-left: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #334155;
}

/* Related Terms Widget */
.mc-related-header {
    display: flex;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--mc-border);
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--mc-text-main);
}

.mc-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mc-related-item a {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.mc-related-item a:hover {
    background-color: #f8fafc;
}

.mc-term-icon {
    width: 2rem;
    height: 2rem;
    background-color: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    margin-right: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.mc-related-item a:hover .mc-term-icon {
    background-color: #eff6ff;
    color: var(--mc-primary);
}

.mc-term-text {
    font-weight: 500;
    color: #475569;
    flex-grow: 1;
}

.mc-term-arrow {
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* CTA Widget */
.mc-widget-cta {
    background: linear-gradient(135deg, #96ceb8 0%, #3d72b8 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    color: white;
    text-align: center;
    box-shadow: var(--mc-shadow-lg);
}

.mc-cta-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    display: block;
}

.mc-cta-desc {
    font-size: 0.875rem;
    color: #dbeafe;
    margin-bottom: 1rem;
    display: block;
}

.mc-cta-button {
    display: block;
    width: 100%;
    background-color: white;
    color: var(--mc-primary);
    font-weight: 700;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    transition: background-color 0.2s;
}

a.mc-cta-button {
    color: var(--mc-primary);
}


.mc-cta-button:hover {
    background-color: #f8fafc;
}

/* --- Archive Page Specific Styles --- */

/* 1. Archive Welcome Section */
.mc-welcome-section {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2rem 1rem;
    background: linear-gradient(to bottom, #eff6ff, #ffffff);
    border-radius: var(--mc-radius);
    border: 1px solid var(--mc-border);
}

.mc-welcome-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 1rem 0;
    letter-spacing: -0.025em;
}

.mc-welcome-desc {
    font-size: 1.125rem;
    color: var(--mc-text-muted);
    max-width: 700px;
    margin: 0 auto 1.5rem auto;
}

/* 2. Search Bar */
.mc-search-container {
    position: relative;
    max-width: 600px;
    margin: -3.5rem auto 3rem auto;
    /* Overlap effect */
    padding: 0 1rem;
}

.mc-search-input-wrapper {
    position: relative;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    border-radius: 3rem;
    background: white;
}

.mc-search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
}

.mc-search-input {
    width: 100%;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    border: 1px solid var(--mc-border);
    border-radius: 3rem;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: var(--mc-font);
}

.mc-search-input:focus {
    border-color: var(--mc-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* 3. Alphabet Nav */
.mc-alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--mc-border);
}

.mc-alpha-link {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background-color: white;
    border: 1px solid var(--mc-border);
    font-weight: 600;
    color: var(--mc-text-muted);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.mc-alpha-link:hover,
.mc-alpha-link.active {
    background-color: var(--mc-primary);
    color: white;
    border-color: var(--mc-primary);
    transform: translateY(-2px);
}

.mc-alpha-link.disabled {
    opacity: 0.4;
    pointer-events: none;
    background-color: #f1f5f9;
}

/* 4. Archive Categories */
.mc-category-section {
    margin-bottom: 3rem;
}

.mc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--mc-primary);
}

.mc-cat-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mc-text-main);
    margin: 0 0 0 1rem;
}

.mc-view-all-btn {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mc-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background-color: #eff6ff;
    transition: background 0.2s;
}

.mc-view-all-btn:hover {
    background-color: #dbeafe;
}

/* 5. Archive Term Cards */
.mc-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.mc-term-card {
    display: flex;
    background: var(--mc-white);
    border: 1px solid var(--mc-border);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
}

.mc-term-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--mc-shadow);
    transform: translateY(-2px);
}

.mc-term-content {
    flex-grow: 1;
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mc-term-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

.mc-term-link::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.mc-term-excerpt {
    font-size: 0.925rem;
    color: var(--mc-text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.mc-term-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #f1f5f9;
}

.mc-term-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mc-no-results {
    display: none;
    text-align: center;
    padding: 2rem;
    color: var(--mc-text-muted);
    font-style: italic;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .mc-term-thumb {
        width: 64px;
        height: 64px;
    }

    .mc-welcome-title {
        font-size: 1.5rem;
    }
}

/* Category Page Header Flex */
.mc-cat-header-flex {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mc-cat-icon-lg {
    width: 4rem;
    height: 4rem;
    background-color: var(--mc-primary);
    color: white;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Sidebar Glossary (All Categories) Grid */
.mc-sidebar-glossary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: start;
}

.mc-sidebar-glossary-grid a {
    color: white;
}

.mc-sidebar-glossary-item {
    width: 2.25rem;
    height: 2.25rem;
    background-color: var(--mc-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mc-sidebar-glossary-item:hover {
    transform: scale(1.1);
    background-color: var(--mc-primary-dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Search Dropdown */
.mc-search-input-wrapper {
    position: relative;
    /* Anchor for dropdown */
}

.mc-search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 50;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    /* Ensure text alignment */
}

.mc-search-loading {
    padding: 1rem;
    color: #64748b;
    text-align: center;
    font-size: 0.9rem;
}

.mc-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mc-search-list li {
    margin: 0;
    border-bottom: 1px solid #f1f5f9;
}

.mc-search-list li:last-child {
    border-bottom: none;
}

.mc-search-list li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #334155;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.mc-search-list li a:hover {
    background: #f8fafc;
    color: var(--mc-primary);
}

/* No Results / Suggestions */
.mc-no-results {
    padding: 1rem;
}

.mc-no-match-msg {
    margin: 0 0 0.5rem 0;
    color: #ef4444;
    /* Red for warning/no match */
    font-size: 0.9rem;
    font-weight: 500;
}

.mc-suggestions-label {
    margin: 0 0 0.5rem 0;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.mc-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mc-suggestions-list li {
    margin-bottom: 0.25rem;
}

.mc-suggestions-list li a {
    color: var(--mc-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.mc-suggestions-list li a:hover {
    text-decoration: underline;
}