/* Restrict height of the website logo. */

.n3inhs-header__logo {
    width: auto;
    max-height: 200px;
}

/* Make the current menu item bold. */

.nhsuk-header__navigation-item.current-page-ancestor a,
.nhsuk-header__navigation-item.current-menu-item a {
    font-weight: 700;
}

/* Ensure the search box does not shrink to below recommended size. */

.nhsuk-input-wrapper input,
.nhsuk-input-wrapper button {
    min-height: 44px;
}

/* Remove spacing below card groups on mobile views. */

@media (max-width: 48.0525em) {
    .nhsuk-card-group {
        margin-bottom: 16px;
    }
}

/* Improve display of iframes. */

iframe {
    width: 100%;
    border: 1px solid #D8DDE0;
    margin-bottom: 16px;
}

@media (min-width: 40.0625em) {
    iframe {
        margin-bottom: 24px;
    }
}

/* Fix website logo not having enough space. */

@media (min-width: 40.0625em) {
    .nhsuk-header__container {
        justify-content: space-between;
        /* Vertically centre the service name/logo against the taller search
           box; without this the flex row stretches both sides and the logo
           sits top-aligned, ~10px above the search box centre (issue #84). */
        align-items: center;
    }

    .nhsuk-header__content {
        width: auto;
    }
}

/* Add margin below website logo on smaller screens. */

@media (max-width: 40.0525em) {
    .nhsuk-header__logo {
        margin-bottom: 1rem;
    }
}

.nhsuk-main-wrapper:has(.nhsuk-hero) {
    padding-top: 0;
}

/* Stack action-link blocks vertically (block-level), matching the editor.
   .nhsuk-action-link is display:inline-block upstream, so adjacent blocks
   would otherwise flow side by side on the front-end (issue #83).
   width:fit-content keeps the focus/hover highlight hugging the content. */

.wp-block-n3inhs-action-link {
    display: block;
    width: fit-content;
}

/* NHS table styles for core table block. */

.wp-block-table {
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    margin: 0 0 40px;
}

@media (min-width: 40.0625em) {
    .wp-block-table {
        margin-bottom: 48px;
    }
}

.wp-block-table table {
    border-collapse: collapse;
    border-spacing: 0;
    box-sizing: border-box;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    width: 100%;
    margin: 0;
}

/* Override WP core inline block styles which load after this file and set
   .wp-block-table td/th { border: 1px solid; padding: 0.5em }. */

.wp-block-table td,
.wp-block-table th {
    border-color: #d8dde0 !important;
    border-style: solid !important;
    border-width: 0 0 1px !important;
    padding-top: 8px !important;
    padding-right: 16px !important;
    padding-bottom: 8px !important;
    padding-left: 0 !important;
    text-align: left;
    vertical-align: top;
}

.wp-block-table td:last-child,
.wp-block-table th:last-child {
    padding-right: 0 !important;
}

.wp-block-table thead {
    border-bottom: none !important;
}

.wp-block-table thead th {
    border-bottom-width: 2px !important;
    font-weight: 600;
}

@media (min-width: 40.0625em) {
    .wp-block-table table {
        font-size: 1.1875rem;
        line-height: 1.4736842105;
    }
}

/* Caption above the table, styled as nhsuk-table__caption. */

.wp-block-table figcaption {
    order: -1;
    display: block;
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.4210526316;
    text-align: left;
    color: #212b32;
    margin-bottom: 8px;
}

@media (min-width: 40.0625em) {
    .wp-block-table figcaption {
        font-size: 1.375rem;
        line-height: 1.3636363636;
    }
}
