/**
 * LNMC Community Partners Directory Styles
 * Mobile-first responsive design with BEM-ish classes
 * 
 * Updated: December 2024
 * Color Palette: Navy (#002868) + Gold (#FFCD00)
 */

/* CSS Variables - Inherit from global styles when available */
.lnmc-dir {
    --lnmc-navy: #1B5E20; /* Harmonized with Theme Green */
    --lnmc-navy-light: #2E7D32; /* Lighter Green */
    --lnmc-gold: #FFB300; /* Theme Warm Gold */
    --lnmc-gold-dark: #FF8F00; /* Theme Dark Gold */
    font-family: 'Space Grotesk', 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 2rem 0;
}

/* Filters */
.lnmc-filters {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.lnmc-filter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lnmc-filter-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lnmc-filter-col {
    flex: 1;
}

.lnmc-filter-col label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.lnmc-filter-col input,
.lnmc-filter-col select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lnmc-filter-col input:focus,
.lnmc-filter-col select:focus {
    outline: none;
    border-color: var(--lnmc-navy);
    box-shadow: 0 0 0 3px rgba(0, 40, 104, 0.1);
}

.lnmc-filter-submit {
    background: linear-gradient(135deg, var(--lnmc-gold) 0%, #e6b800 100%);
    color: var(--lnmc-navy);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px; /* Match Theme Button Radius */
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 120px;
    box-shadow: 0 2px 10px rgba(255, 205, 0, 0.3);
}

.lnmc-filter-submit:hover {
    background: linear-gradient(135deg, #FFE066 0%, var(--lnmc-gold) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 205, 0, 0.5);
}

.lnmc-filter-submit:active {
    transform: translateY(0);
}

.lnmc-filter-clear {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
    min-width: 120px;
    text-align: center;
}

.lnmc-filter-clear:hover {
    background: #5a6268;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Results */
.lnmc-results {
    margin-top: 2rem;
}

.lnmc-results-header {
    margin-bottom: 2rem;
    text-align: center;
}

.lnmc-results-header h2 {
    color: var(--lnmc-navy);
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Playfair Display', Georgia, serif;
}

.lnmc-results-count {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

/* Grid */
.lnmc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Cards */
.lnmc-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lnmc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--lnmc-navy), var(--lnmc-gold));
}

.lnmc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lnmc-card-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.lnmc-card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
}

.lnmc-card-title a {
    color: var(--lnmc-navy);
    text-decoration: none;
    transition: color 0.3s ease;
}

.lnmc-card-title a:hover {
    color: var(--lnmc-gold-dark);
    text-decoration: underline;
}

.lnmc-card-acronym {
    background: var(--lnmc-navy);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.lnmc-card-body {
    margin-bottom: 1rem;
}

.lnmc-card-location,
.lnmc-card-founded {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.lnmc-icon-location::before {
    content: '📍';
    font-size: 1rem;
}

.lnmc-icon-calendar::before {
    content: '📅';
    font-size: 1rem;
}

.lnmc-card-excerpt {
    color: #495057;
    line-height: 1.5;
    margin-top: 1rem;
    font-size: 0.95rem;
}

/* Tags */
.lnmc-card-tags {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lnmc-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.lnmc-tag-region {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.lnmc-tag-type {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.lnmc-tag-service {
    background: #e8f5e8;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.lnmc-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Footer */
.lnmc-card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lnmc-card-link,
.lnmc-card-website {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
}

.lnmc-card-link {
    background: linear-gradient(135deg, var(--lnmc-gold) 0%, #e6b800 100%);
    color: var(--lnmc-navy);
    border-radius: 25px; /* Match Theme Button Radius */
    box-shadow: 0 2px 8px rgba(255, 205, 0, 0.3);
}

.lnmc-card-link:hover {
    background: linear-gradient(135deg, #FFE066 0%, var(--lnmc-gold) 100%);
    color: var(--lnmc-navy);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 205, 0, 0.5);
}

.lnmc-card-website {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.lnmc-card-website:hover {
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    transform: translateY(-1px);
}

/* No results */
.lnmc-no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.lnmc-no-results h3 {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.lnmc-no-results p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Pagination */
.lnmc-pagination {
    margin: 2rem 0;
    text-align: center;
}

.lnmc-pagination-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.lnmc-pagination-list li {
    margin: 0;
}

.lnmc-pagination-list a,
.lnmc-pagination-list span {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.lnmc-pagination-list a:hover {
    background: var(--lnmc-gold);
    color: var(--lnmc-navy);
    border-color: var(--lnmc-gold);
    text-decoration: none;
}

.lnmc-pagination-list .current {
    background: var(--lnmc-navy);
    color: white;
    border-color: var(--lnmc-navy);
}

/* Tablet styles */
@media (min-width: 768px) {
    .lnmc-filter-form {
        flex-direction: row;
        align-items: end;
    }

    .lnmc-filter-row {
        flex-direction: row;
        align-items: end;
    }

    .lnmc-filter-col {
        min-width: 200px;
    }

    .lnmc-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .lnmc-card-footer {
        flex-direction: row;
        gap: 1rem;
    }

    .lnmc-card-link,
    .lnmc-card-website {
        flex: 1;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .lnmc-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .lnmc-card-header {
        flex-direction: row;
        align-items: center;
    }

    .lnmc-card-acronym {
        font-size: 0.9rem;
        padding: 0.35rem 0.75rem;
    }
}

/* Large desktop styles */
@media (min-width: 1200px) {
    .lnmc-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print styles */
@media print {

    .lnmc-filters,
    .lnmc-pagination {
        display: none !important;
    }

    .lnmc-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .lnmc-card::before {
        display: none;
    }

    .lnmc-card-footer {
        border-top: 1px solid #ccc;
    }

    .lnmc-card-link,
    .lnmc-card-website {
        background: none !important;
        color: #000 !important;
        border: 1px solid #ccc !important;
    }
}

/* Accessibility improvements */
.lnmc-filter-col input:focus,
.lnmc-filter-col select:focus,
.lnmc-card-link:focus,
.lnmc-card-website:focus,
.lnmc-filter-submit:focus,
.lnmc-filter-clear:focus {
    outline: 2px solid var(--lnmc-gold);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .lnmc-card {
        border: 2px solid #000;
    }

    .lnmc-filter-col input,
    .lnmc-filter-col select {
        border: 2px solid #000;
    }

    .lnmc-tag {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .lnmc-card,
    .lnmc-card-link,
    .lnmc-card-website,
    .lnmc-filter-submit,
    .lnmc-filter-clear,
    .lnmc-tag {
        transition: none;
    }

    .lnmc-card:hover,
    .lnmc-card-link:hover,
    .lnmc-card-website:hover,
    .lnmc-filter-submit:hover,
    .lnmc-filter-clear:hover,
    .lnmc-tag:hover {
        transform: none;
    }
}

/* =========================================================================
   PAGE SPECIFIC FIXES (Sister Organizations)
   ========================================================================= */

.lnmc-sister-hub {
    --lnmc-hub-green: #1B5E20;
    --lnmc-hub-green-soft: #EAF4EC;
    --lnmc-hub-gold: #FFB300;
    --lnmc-hub-ink: #1E2A21;
    --lnmc-hub-muted: #5E6B62;
    color: var(--lnmc-hub-ink);
    font-family: 'Space Grotesk', 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 100vw;
    overflow-x: hidden;
}

.lnmc-sister-hero {
    background:
        linear-gradient(90deg, rgba(10, 45, 22, 0.92), rgba(10, 45, 22, 0.72)),
        url('/wp-content/uploads/2026/04/heritage-preservation-project.jpg') center/cover;
    color: #fff;
    padding: clamp(4rem, 8vw, 7rem) 1.5rem;
}

.lnmc-sister-wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.lnmc-sister-eyebrow {
    color: var(--lnmc-hub-gold);
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
}

.lnmc-sister-hero h1 {
    color: #fff !important;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 1;
    margin: 0 0 1rem;
    max-width: 850px;
    overflow-wrap: anywhere;
}

.lnmc-sister-lede {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.7;
    margin: 0;
    max-width: 780px;
}

.lnmc-sister-section {
    padding: clamp(3rem, 6vw, 5rem) 0;
}

.lnmc-sister-section.alt {
    background: var(--lnmc-hub-green-soft);
}

.lnmc-sister-section h2 {
    color: var(--lnmc-hub-green);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.08;
    margin: 0 0 1rem;
    overflow-wrap: anywhere;
}

.lnmc-sister-section p {
    color: var(--lnmc-hub-muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

.lnmc-sister-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 2rem;
}

.lnmc-sister-stat,
.lnmc-sister-note,
.lnmc-sister-region {
    background: #fff;
    border: 1px solid rgba(27, 94, 32, 0.12);
    border-radius: 8px;
    padding: 1.25rem;
}

.lnmc-sister-stat strong {
    color: var(--lnmc-hub-green);
    display: block;
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.lnmc-sister-stat span,
.lnmc-sister-region span {
    color: var(--lnmc-hub-muted);
    display: block;
    line-height: 1.55;
}

.lnmc-sister-region h3,
.lnmc-sister-note h3 {
    color: var(--lnmc-hub-green);
    font-size: 1.15rem;
    margin: 0 0 0.45rem;
}

.lnmc-sister-note {
    border-left: 5px solid var(--lnmc-hub-gold);
}

.lnmc-sister-directory {
    padding-bottom: clamp(3rem, 6vw, 5rem);
}

@media (max-width: 900px) {
    .lnmc-sister-hero,
    .lnmc-sister-section,
    .lnmc-sister-directory {
        max-width: 100vw;
        width: 100vw;
    }

    .lnmc-sister-hero {
        padding: 4rem 0;
    }

    .lnmc-sister-wrap {
        max-width: calc(100vw - 32px);
        width: min(100% - 32px, 100%);
    }

    .lnmc-sister-hero h1 {
        font-size: clamp(1.8rem, 10vw, 2.2rem);
        line-height: 1.08;
        max-width: min(340px, calc(100vw - 32px));
    }

    .lnmc-sister-section h2 {
        font-size: clamp(1.6rem, 8vw, 2rem);
        line-height: 1.15;
        max-width: min(340px, calc(100vw - 32px));
    }

    .lnmc-sister-lede,
    .lnmc-sister-section p {
        font-size: 1rem;
        max-width: min(340px, calc(100vw - 32px));
    }

    .lnmc-sister-stat,
    .lnmc-sister-note,
    .lnmc-sister-region {
        max-width: min(340px, calc(100vw - 32px));
    }
}

/* Hero Section Legibility Fix */
body.page-sister-organizations,
body.page-sister-organizations #page-container,
body.page-sister-organizations #et-main-area,
body.page-sister-organizations #main-content {
    max-width: 100vw;
    overflow-x: hidden;
}

body.page-sister-organizations .et_pb_section:first-of-type .et_pb_text_inner,
body.page-sister-organizations .et_pb_section:first-of-type p {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-size: 1.1rem;
    line-height: 1.6;
}

body.page-sister-organizations .et_pb_section:first-of-type h1 {
    color: #FFCD00 !important;
    /* Gold */
}

/* Card Grid Improvements */
@media (min-width: 1024px) {
    .lnmc-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        /* Force 3 columns max for better readability */
    }
}

@media (min-width: 1200px) {
    .lnmc-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        /* Keep 3 even on large screens */
        gap: 2rem;
    }
}

/* Card Alignment & Typography */
.lnmc-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Equal height cards */
    padding: 1.25rem;
}

.lnmc-card-body {
    flex: 1;
    /* Pushes footer to bottom */
}

.lnmc-card-title {
    font-size: 1.15rem;
    /* Slightly smaller for better fit */
    margin-bottom: 0.5rem;
    min-height: 3rem;
    /* Align titles */
    display: flex;
    align-items: center;
}

/* Updated Tag Colors (Brand Aligned) */
.lnmc-tag-region {
    background: var(--lnmc-navy-light);
    color: #ffffff;
    border: 1px solid var(--lnmc-navy);
}

.lnmc-tag-type {
    background: #f0f0f0;
    color: var(--lnmc-navy);
    border: 1px solid #dcdcdc;
}

.lnmc-tag-service {
    background: rgba(255, 205, 0, 0.15);
    /* Soft gold */
    color: #8a6d00;
    border: 1px solid rgba(255, 205, 0, 0.3);
}

/* Card Footer Alignment */
.lnmc-card-footer {
    margin-top: auto;
    /* Ensure footer stays at bottom */
    padding-top: 1.25rem;
}
