/*
 * HOLYCHILD HOMEPAGE LAYOUT FIX
 * Scoped layout corrections for the homepage leadership and values sections.
 * Load this stylesheet AFTER style.css and homepage-additions.css.
 */

/* Prevent children from stretching outside their parent containers. */
.leadership-section,
.values-section,
.leadership-section *,
.values-section * {
    box-sizing: border-box;
}

.leadership-section .container,
.values-section .container {
    width: min(1180px, calc(100% - 40px));
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.leadership-section {
    display: block;
    clear: both;
    padding: 76px 0 82px;
    background: #f7f8f4;
    overflow: hidden;
}

.leadership-section .leadership-heading {
    display: block;
    width: 100%;
    max-width: 760px;
    margin: 0 auto 38px;
    text-align: center;
}

.leadership-section .leadership-heading h2 {
    margin: 12px 0 14px;
    line-height: 1.18;
}

.leadership-section .leadership-heading p {
    margin: 0 auto;
    line-height: 1.8;
}

.leadership-section .leadership-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
    width: 100%;
}

.leadership-section .leader-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e9e3;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(8, 53, 37, .08);
    transform: none;
}

.leadership-section .leader-card:hover {
    transform: translateY(-4px);
}

.leadership-section .leader-photo {
    position: relative;
    display: block;
    width: 100%;
    height: 300px;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    background: #e6ece6;
}

.leadership-section .leader-photo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center top;
}

.leadership-section .leader-info {
    display: block;
    flex: 1 0 auto;
    padding: 24px 24px 26px;
    border-top: 3px solid #c9a653;
}

.leadership-section .leader-role {
    display: block;
    margin: 0 0 8px;
    line-height: 1.4;
}

.leadership-section .leader-info h3 {
    margin: 0 0 10px;
    font-size: 21px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.leadership-section .leader-info p {
    margin: 0;
    line-height: 1.8;
}

/* Three balanced value cards; remove the fourth card without leaving an empty column. */
.values-section {
    clear: both;
    overflow: hidden;
}

.values-section .section-heading {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.values-section .section-heading p {
    margin-top: 16px;
    line-height: 1.8;
}

.values-section .value-grid-three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    width: 100%;
}

.values-section .value-grid-three .value-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 275px;
    margin: 0;
    padding: 32px 28px;
    border-radius: 12px;
}

.values-section .value-grid-three .value-icon {
    flex: 0 0 auto;
    margin-bottom: 20px;
}

.values-section .value-grid-three .value-card h3 {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.35;
}

.values-section .value-grid-three .value-card p {
    flex: 1 0 auto;
    min-height: 0;
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.8;
}

.values-section .value-grid-three .value-card a {
    align-self: flex-start;
    margin-top: auto;
}

/* Avoid unexpected inherited floats or fixed widths affecting following sections. */
.leadership-section + .values-section,
.values-section + .news-section {
    position: relative;
    width: 100%;
}

/* Tablet */
@media (max-width: 900px) {
    .leadership-section .leadership-grid,
    .values-section .value-grid-three {
        gap: 16px;
    }

    .leadership-section .leader-photo {
        height: 240px;
    }

    .leadership-section .leader-info {
        padding: 20px 18px 22px;
    }

    .leadership-section .leader-info h3 {
        font-size: 18px;
    }

    .values-section .value-grid-three .value-card {
        padding: 26px 20px;
    }

    .values-section .value-grid-three .value-card h3 {
        font-size: 18px;
    }
}

/* Phone */
@media (max-width: 640px) {
    .leadership-section {
        padding: 52px 0 56px;
    }

    .leadership-section .container,
    .values-section .container {
        width: calc(100% - 32px);
    }

    .leadership-section .leadership-heading {
        margin-bottom: 26px;
    }

    .leadership-section .leadership-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 420px;
        margin: 0 auto;
        gap: 20px;
    }

    .leadership-section .leader-photo {
        height: 320px;
    }

    .leadership-section .leader-info {
        padding: 22px 22px 24px;
    }

    .leadership-section .leader-info h3 {
        font-size: 21px;
    }

    .values-section .value-grid-three {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .values-section .value-grid-three .value-card {
        min-height: 0;
        padding: 25px 23px;
    }

    .values-section .value-grid-three .value-card p {
        margin-bottom: 18px;
    }
}
