/* Editor overflow fix for accreditations approvals block */
.block-editor-block-list__layout .accreditations-approvals-block,
.editor-styles-wrapper .accreditations-approvals-block,
.wp-block-acf-accreditations-approvals .accreditations-approvals-block {
    max-width: 100%;
    overflow-x: hidden;
}

/* Accreditations & Approvals Block Styles */
.accreditations-approvals-block {
    width: 100%;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    padding: 7.5rem 0;
    color: #333333;
    box-sizing: border-box;
}

.accreditations-approvals-content {
    max-width: 1728px;
    margin: 0 auto;
    padding: 0 9.375rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
    box-sizing: border-box;
}

.accreditations-approvals-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
    box-sizing: border-box;
}

.accreditations-approvals-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    font-style: normal;
    line-height: 2.5rem;
    letter-spacing: 0;
    color: #28323C;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 17.5rem;
    white-space: normal;
    /* margin-top: 40px; */
}

.accreditations-approvals-description {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    font-style: normal;
    line-height: 1.5rem;
    letter-spacing: 0;
    color: #28323C;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.accreditations-approvals-right {
    position: relative;
    min-width: 0;
    box-sizing: border-box;
}

.accreditations-approvals-view-all {
    position: absolute;
    top: -3.125rem;
    right: 0;
    z-index: 10;
}

.accreditations-approvals-view-all a {
    color: #007ACC;
    /* Primary Two per Figma */
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-style: normal;
    font-weight: 500;
    line-height: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    /* Match Figma spacing */
}



.accreditations-approvals-view-all a i {
    font-size: 1rem;
    display: inline-block;
    vertical-align: middle;
}

.accreditations-approvals-items {
    display: flex;
    flex-direction: row;
    gap: 0;
    /* margin-top: 40px; */
    box-sizing: border-box;
}

.accreditations-approvals-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* padding: 20px 30px; */
    padding: 0 2.5rem 0 1.5rem;
    position: relative;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

/* .accreditations-approvals-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20px;
    bottom: 20px;
    width: 1px;
    background-color: #ACB4BC;
} */

.accreditations-approvals-item-logo {
    margin-bottom: 1.5rem;
    max-width: 100%;
    height: auto;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
}

.accreditations-approvals-item-logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

/* Desktop-only: add initial left divider on the first item */
@media (min-width: 871px) {
    .accreditations-approvals-content {
        align-items: stretch;
    }

    .accreditations-approvals-right {
        border-left: 0.0625rem solid #ACB4BC;
        height: 100%;
    }

    .accreditations-approvals-items .accreditations-approvals-item {
        height: 100%;
        border-right: 0.0625rem solid #ACB4BC;
    }

    .accreditations-approvals-items .accreditations-approvals-item:last-child {
        border-right: none;
    }

    .accreditations-approvals-items {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        height: 100%;
    }
}

.accreditations-approvals-item-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    font-style: normal;
    line-height: 1.25rem;
    letter-spacing: 0;
    color: #28323C;
    margin: 0;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.accreditations-approvals-item-description {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: #666666;
    margin: 0;
    line-height: 1.4;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Block Alignment Support */
.accreditations-approvals-block.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.accreditations-approvals-block.alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Fix for editor - prevent overflow */
.block-editor-block-list__layout .accreditations-approvals-block.alignfull,
.editor-styles-wrapper .accreditations-approvals-block.alignfull,
.wp-block-acf-accreditations-approvals .accreditations-approvals-block.alignfull {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Responsive Design */
/* Desktop 1541px and above - Dynamic container alignment logic */
@media (min-width: 1541px) {
    .accreditations-approvals-content {
        padding-left: clamp(6rem, 15.046vw, 16.25rem);
        padding-right: clamp(6rem, 15.046vw, 16.25rem);
    }
}

/* Desktop 1281px - 1540px */
@media (min-width: 1281px) and (max-width: 1540px) {
    .accreditations-approvals-content {
        padding: 0 9.375rem;
    }
}

/* Desktop 1025px - 1280px */
@media (min-width: 1025px) and (max-width: 1280px) {
    .accreditations-approvals-content {
        padding: 0 5rem;
    }
}

/* Tablet 871px - 1024px */
@media (min-width: 871px) and (max-width: 1024px) {
    .accreditations-approvals-content {
        padding: 0 3.125rem;
    }
}

/* Tablet/Mobile - 870px and below */
@media (max-width: 870px) {
    .accreditations-approvals-block {
        padding: 3.75rem 0 5rem 0;
        background-color: #F0F1F2;
        /* Figma Base UI-One */
    }

    .accreditations-approvals-content {
        padding: 0 2rem;
        grid-template-columns: 1fr;
        gap: 2.1875rem;
    }

    /* Stack right column content so we can move the view-all to the bottom */
    .accreditations-approvals-right {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .accreditations-approvals-title {
        font-size: 2rem;
        font-weight: 600;
        font-style: normal;
        line-height: 2.5rem;
        letter-spacing: 0;
        max-width: 17.5rem;
        white-space: normal;
    }

    .accreditations-approvals-view-all {
        order: 2;
        /* Place after items */
        position: static;
        margin: 0;
        /* reset */
        text-align: left;
        /* Bottom-left alignment */
    }

    .accreditations-approvals-items {
        order: 1;
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-top: 1.25rem;
    }

    .accreditations-approvals-item:not(:last-child)::after {
        display: none;
    }

    .accreditations-approvals-item {
        padding: 1.25rem 0;
        border-bottom: 0.0625rem solid #ACB4BC;
        align-items: flex-start;
    }

    /* Add initial divider line before the first item */
    .accreditations-approvals-item:first-child {
        border-top: 0.0625rem solid #ACB4BC;
    }

    .accreditations-approvals-item:last-child {
        border-bottom: none;
    }

    .accreditations-approvals-item-logo {
        justify-content: flex-start;
        text-align: left;
        margin-bottom: 1rem;
    }

    .accreditations-approvals-item-logo img {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .accreditations-approvals-block {
        padding: 3.75rem 0 5rem 0;

    }

    .accreditations-approvals-content {
        padding: 0 2rem;
        gap: 2.5rem;
    }

    .accreditations-approvals-left {
        gap: 2rem;
        /* Figma gap between title and copy */
    }

    .accreditations-approvals-title {
        font-size: 2rem;
        font-weight: 600;
        font-style: normal;
        line-height: 2.5rem;
        letter-spacing: 0;
        color: #28323C;
        max-width: 17.5rem;
        white-space: normal;
    }

    .accreditations-approvals-description {
        font-size: 1rem;
        font-weight: 300;
        font-style: normal;
        line-height: 1.5rem;
        letter-spacing: 0;
        color: #28323C;
    }

    .accreditations-approvals-item {
        padding: 1rem 0;
        align-items: flex-start;
    }

    .accreditations-approvals-item-logo {
        /* max-width: 184px; */
        margin-bottom: 0.75rem;
    }

    .accreditations-approvals-item-logo img {
        max-height: 5rem;
        /* Match Figma logo height */
        width: auto;
    }

    .accreditations-approvals-item-title,
    .accreditations-approvals-item-description {
        font-size: 0.875rem;
        /* Action 14 per Figma */
        line-height: 1.4285714286em;
        color: #28323C;
        /* Base UI-Four */
        font-weight: 500;
        /* Action weight */
        text-align: left;
        width: 11.5rem;
    }
}

/* Editor Preview Styles */
.wp-block-acf-accreditations-approvals .accreditations-approvals-block {
    border: 0.125rem dashed #ccc;
    position: relative;
}

.wp-block-acf-accreditations-approvals .accreditations-approvals-block::after {
    content: "🏆 Accreditations & Approvals - Institution credentials & logos";
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    border-radius: 0.25rem;
    z-index: 10;
    font-weight: 500;
    max-width: 17.5rem;
    text-align: center;
    line-height: 1.3;
}