/**
 * Public community partner directory screen.
 *
 * @package local_cms
 */

/* Partner need: success is rendered here (under hero) so the banner is not split by course_content_header. */
body.path-local-cms-category.local-cms-community-directory-page .local-cms-partner-need-post-alert {
    max-width: 1200px;
    margin: 0 auto 0.75rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

.path-local-cms-category.local-cms-community-directory-page .cms-hero-slider {
    text-align: left;
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero-slider {
    width: 100%;
    max-width: none;
    margin: 0;
    margin-bottom: 0;
    box-sizing: border-box;
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero {
    width: 100%;
    height: min(48vh, 480px);
    min-height: 300px;
    border-radius: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

@supports (height: 100dvh) {
    body.path-local-cms-category.local-cms-community-directory-page .cms-hero {
        height: min(48dvh, 480px);
    }
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero.cms-hero--has-image {
    padding: 0;
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero.cms-hero--has-image .cms-hero__bg {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero .cms-hero__content {
    position: absolute;
    z-index: 1;
    inset: auto 0 0 0;
    width: 100%;
    min-height: 153px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
    text-align: left;
    overflow: hidden;
    padding: 40px 80px 40px;
    color: #fff;
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero.cms-hero--has-image .cms-hero__content {
    top: auto;
    bottom: 0;
    left: 0;
    max-width: none;
    color: #fff;
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero.cms-hero--has-image .cms-hero__title,
body.path-local-cms-category.local-cms-community-directory-page .cms-hero.cms-hero--has-image .cms-hero__desc {
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.95);
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero__title {
    color: #fff;
    font-size: 64px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    margin: 0 0 0.5rem;
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero__desc {
    color: rgba(255, 255, 255, 0.92);
    font-size: 20px;
    line-height: 1.5;
    text-align: left;
    margin: 0;
}

body.path-local-cms-category.local-cms-community-directory-page .cms-hero__desc p {
    margin: 0;
}

body.path-local-cms-category.local-cms-community-directory-page .page-header-headings,
body.path-local-cms-category.local-cms-community-directory-page .page-header-headings h1 {
    display: none !important;
}

@media (max-width: 768px) {
    body.path-local-cms-category.local-cms-community-directory-page .cms-hero,
    body.path-local-cms-category.local-cms-community-directory-page .cms-hero.cms-hero--has-image {
        height: min(42vh, 380px);
        min-height: 240px;
    }

    @supports (height: 100dvh) {
        body.path-local-cms-category.local-cms-community-directory-page .cms-hero,
        body.path-local-cms-category.local-cms-community-directory-page .cms-hero.cms-hero--has-image {
            height: min(42dvh, 380px);
        }
    }

    body.path-local-cms-category.local-cms-community-directory-page .cms-hero .cms-hero__content {
        padding: 24px 20px 24px;
    }

    body.path-local-cms-category.local-cms-community-directory-page .cms-hero__title {
        font-size: 2rem;
    }

    body.path-local-cms-category.local-cms-community-directory-page .cms-hero__desc {
        font-size: 1rem;
    }
}

.local-cms-community-directory .community-content-inner {
    padding-top: 2rem;
    border: 1px solid #e8e8e8;
}

.local-cms-community-directory .community-content {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 1.5rem 0 2.5rem;
    border: 1px solid #e8e8e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    background: #fff;
}

.local-cms-community-directory .community-content-inner {
    margin: 0 auto;
    padding: 48px 64px 48px;
    box-sizing: border-box;
}

.local-cms-community-directory__back {
    margin: 0 0 1.75rem;
}

.local-cms-community-directory__back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #ef2b2d;
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
}

.local-cms-community-directory__back-link:hover,
.local-cms-community-directory__back-link:focus {
    color: #c9161b;
    text-decoration: none;
}

.local-cms-community-directory__partner-detail {
    max-width: 1120px;
    margin: 0;
}

.local-cms-community-directory__partner-detail-head {
    display: block;
    margin-bottom: 1.25rem;
}

.local-cms-community-directory__partner-detail-head-copy {
    min-width: 0;
}

.local-cms-community-directory__partner-detail-title {
    margin: 0 0 0.35rem;
    color: #111827;
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.local-cms-community-directory__partner-detail-section {
    padding: 1.2rem 0;
    border-top: 1px solid #e5e7eb;
}

.local-cms-community-directory__partner-detail-section-title {
    margin: 0 0 0.9rem;
    color: #111827;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
}

.local-cms-community-directory__partner-detail-text {
    color: #111827;
    font-size: 1rem;
    line-height: 1.7;
}

.local-cms-community-directory__partner-detail-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #111827;
}

.local-cms-community-directory__partner-detail-list li + li {
    margin-top: 0.5rem;
}

.local-cms-community-directory__partner-detail-contact {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.7rem 1rem;
    color: #111827;
}

.local-cms-community-directory__partner-detail-contact dt {
    font-weight: 800;
}

.local-cms-community-directory__partner-detail-contact dd {
    margin: 0;
}

.local-cms-community-directory__partner-detail-contact dd a,
.local-cms-community-directory__partner-detail-contact dd a:link,
.local-cms-community-directory__partner-detail-contact dd a:visited {
    color: #111827;
    text-decoration: none;
}

.local-cms-community-directory__partner-detail-contact dd a:hover,
.local-cms-community-directory__partner-detail-contact dd a:focus {
    color: #111827;
    text-decoration: underline;
}

.local-cms-community-directory__detail-return {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Danh mục lĩnh vực (trang Kết nối và hợp tác): 4 thẻ/hàng trên desktop rộng */
.local-cms-community-directory__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 1199.98px) {
    .local-cms-community-directory__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .local-cms-community-directory__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .local-cms-community-directory__grid {
        grid-template-columns: 1fr;
    }
}

.local-cms-community-directory__card {
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #ead6d6;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.local-cms-community-directory__card:hover,
.local-cms-community-directory__card:focus-within {
    z-index: 2;
    transform: translateY(-8px);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.14);
}

.local-cms-community-directory__card-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1.35rem;
    color: #fff;
    flex-shrink: 0;
}

.local-cms-community-directory__card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    min-height: 2.25rem;
}

.local-cms-community-directory__card-top .fa {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.local-cms-community-directory__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.20);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    hyphens: auto;
    overflow-wrap: anywhere;
}

.local-cms-community-directory__card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.35rem 1.7rem 1.75rem;
    gap: 0.85rem;
}

.local-cms-community-directory__card-body:not(.local-cms-community-directory__card-body--has-desc) {
    justify-content: center;
    align-items: flex-start;
}

.local-cms-community-directory__card-title {
    margin: 0;
    color: #fff;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
    word-break: break-word;
    /* Same colored header height on every card: title band = exactly 2 lines. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.12rem * 1.3 * 2);
    max-height: calc(1.12rem * 1.3 * 2);
    flex-shrink: 0;
}

.local-cms-community-directory__card-desc-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.local-cms-community-directory__card-body--has-desc .local-cms-community-directory__card-link {
    margin-top: auto;
}

.local-cms-community-directory__card-desc {
    width: 100%;
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.65;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
}

/* JS (community_directory_desc.js) replaces line-clamp with word-boundary truncation. */
.local-cms-community-directory__desc--word-clamp {
    display: block !important;
    -webkit-box-orient: unset !important;
    -webkit-line-clamp: unset !important;
    word-break: normal;
}

/* Let multi-paragraph HTML from format_text clamp as one flow. */
.local-cms-community-directory__card-desc p {
    margin: 0;
    display: inline;
}

.local-cms-community-directory__card-desc p:not(:last-child)::after {
    content: ' ';
}

.local-cms-community-directory__card-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-top: 0;
    padding-top: 0.15rem;
    color: #ef2b2d;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
}

.local-cms-community-directory__card--blue .local-cms-community-directory__card-top { background: linear-gradient(135deg, #3973ff 0%, #264dcf 100%); }
.local-cms-community-directory__card--green .local-cms-community-directory__card-top { background: linear-gradient(135deg, #1fb653 0%, #198f42 100%); }
.local-cms-community-directory__card--orange .local-cms-community-directory__card-top { background: linear-gradient(135deg, #ff6a00 0%, #cc4b00 100%); }
.local-cms-community-directory__card--purple .local-cms-community-directory__card-top { background: linear-gradient(135deg, #a63df1 0%, #7021b6 100%); }
.local-cms-community-directory__card--red .local-cms-community-directory__card-top { background: linear-gradient(135deg, #ef2b2d 0%, #c9161b 100%); }
.local-cms-community-directory__card--teal .local-cms-community-directory__card-top { background: linear-gradient(135deg, #0ea5a4 0%, #0b7c7b 100%); }

.local-cms-community-directory__cta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 991.98px) {
    .local-cms-community-directory__cta-grid {
        grid-template-columns: 1fr;
    }
}

.local-cms-community-directory__cta {
    min-height: 200px;
    padding: 2rem 2.15rem;
    border-radius: 1.35rem;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.local-cms-community-directory__cta--search {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
    border-color: #d42b28;
    background: linear-gradient(135deg, #e10600 0%, #1f1114 100%);
    color: #fff;
}

.local-cms-community-directory__cta--register {
    background: #fff;
    color: #111827;
}

.local-cms-community-directory__cta-title {
    margin: 0 0 1rem;
    font-size: 1.95rem;
    font-weight: 800;
    line-height: 1.18;
}

.local-cms-community-directory__cta-text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.65;
}

.local-cms-community-directory__cta--search .local-cms-community-directory__cta-text {
    color: rgba(255, 255, 255, 0.96);
}

.local-cms-community-directory__cta--register .local-cms-community-directory__cta-text {
    color: #4b5563;
}

.local-cms-community-directory__cta-link,
.local-cms-community-directory__cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    margin-top: 1.75rem;
    padding: 0.85rem 1.35rem;
    border-radius: 0.95rem;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.local-cms-community-directory__cta-link {
    color: #fff;
    text-decoration: none;
    padding: 0;
    margin-top: 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    align-self: center;
}

.local-cms-community-directory__cta-link:hover,
.local-cms-community-directory__cta-link:focus,
.local-cms-community-directory__cta-link:active,
.local-cms-community-directory__cta-link:visited {
    color: #fff;
    text-decoration: none;
}

.local-cms-community-directory__cta-button {
    background: #e10600;
    color: #fff;
}

.local-cms-community-directory__chips-section {
    margin-bottom: 2.5rem;
}

.local-cms-community-directory__chips-title {
    margin: 0 0 1.1rem;
    color: #0f172a;
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1.18;
}

.local-cms-community-directory__chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.local-cms-community-directory__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.15rem;
    border: 1px solid #e3e6eb;
    border-radius: 0.95rem;
    background: #f8f8f8;
    color: #111827;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.local-cms-community-directory__chip:hover,
.local-cms-community-directory__chip:focus {
    text-decoration: none;
    color: #111827;
    background: #fff;
    border-color: #cfd6df;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.local-cms-community-directory__chip.is-active {
    background: #fff;
    border-color: #ef2b2d;
    box-shadow: 0 0 0 1px rgba(239, 43, 45, 0.08);
}

.local-cms-community-directory__chip .fa {
    font-size: 1.05rem;
    width: 1.05rem;
    text-align: center;
}

.local-cms-community-directory__chip--blue .fa { color: #3b82f6; }
.local-cms-community-directory__chip--green .fa { color: #16a34a; }
.local-cms-community-directory__chip--orange .fa { color: #ea580c; }
.local-cms-community-directory__chip--purple .fa { color: #9333ea; }
.local-cms-community-directory__chip--red .fa { color: #ef2b2d; }
.local-cms-community-directory__chip--teal .fa { color: #0f9488; }

.local-cms-community-directory__partner-section {
    margin-top: 3rem;
}

.local-cms-community-directory__partner-section-title {
    margin: 0;
    color: #0f172a;
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.14;
}

.local-cms-community-directory__partner-section-subtitle {
    margin: 0.8rem 0 2rem;
    color: #475569;
    font-size: 1.15rem;
    line-height: 1.55;
}

/* Lưới thẻ doanh nghiệp: 4 cột/hàng trên desktop rộng (cùng logic với __grid) */
.local-cms-community-directory__partner-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

@media (max-width: 1199.98px) {
    .local-cms-community-directory__partner-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .local-cms-community-directory__partner-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .local-cms-community-directory__partner-grid {
        grid-template-columns: 1fr;
    }
}

.local-cms-community-directory__partner-card {
    position: relative;
    z-index: 0;
    padding: 1.45rem 1.45rem 1.4rem;
    border: 1px solid #d9dde3;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.local-cms-community-directory__partner-card:hover,
.local-cms-community-directory__partner-card:focus-within {
    z-index: 2;
    transform: translateY(-8px);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
}

.local-cms-community-directory__partner-card-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.local-cms-community-directory__partner-card-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.local-cms-community-directory__partner-logo {
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1rem;
    object-fit: cover;
    background: #f3f4f6;
}

.local-cms-community-directory__partner-card-title {
    margin: 0 0 0.2rem;
    color: #111827;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.25;
}

.local-cms-community-directory__partner-card-desc {
    color: #475569;
    font-size: 1rem;
    line-height: 1.65;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
}

.local-cms-community-directory__partner-card-desc p {
    margin: 0;
    display: inline;
}

.local-cms-community-directory__partner-card-desc p:not(:last-child)::after {
    content: ' ';
}

.local-cms-community-directory__partner-meta {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0.25rem 0 0;
    color: #475569;
    font-size: 0.97rem;
    line-height: 1.55;
}

.local-cms-community-directory__partner-meta .fa {
    margin-top: 0.15rem;
    color: #ef2b2d;
}

.local-cms-community-directory__partner-divider {
    height: 1px;
    margin: 1rem 0 1.05rem;
    background: #e5e7eb;
}

.local-cms-community-directory__partner-card-link,
.local-cms-community-directory__partner-card-link:link,
.local-cms-community-directory__partner-card-link:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #ef2b2d;
    font-size: 1.02rem;
    font-weight: 800;
    text-decoration: none;
}

.local-cms-community-directory__partner-card-link--disabled {
    color: #9ca3af;
}

@media (prefers-reduced-motion: reduce) {
    .local-cms-community-directory__card,
    .local-cms-community-directory__partner-card {
        transition: none;
    }

    .local-cms-community-directory__card:hover,
    .local-cms-community-directory__card:focus-within,
    .local-cms-community-directory__partner-card:hover,
    .local-cms-community-directory__partner-card:focus-within {
        transform: none;
    }
}
