/* Keep these refinements separate from the imported HTML project's compiled CSS. */

/* Remove default link underlines throughout the site; retain designed borders. */
.stom-page-wrapper a,
.stom-page-wrapper a:hover,
.stom-page-wrapper a:focus {
    text-decoration: none;
}

/* All rows use the height required by the longest clinic card. */
/* Preserve the original specialist-name typography over generic framework styles. */
.stom-specialists .name .text a,
.stom-specialists-timetable .name .text a {
    font-family: UniversityText, sans-serif;
    font-weight: 300;
    font-size: 1.375rem;
    line-height: 1.875rem;
    color: #9e0039;
}

.stom-specialists .name .text a:hover,
.stom-specialists-timetable .name .text a:hover {
    color: #000;
}

.stom-categories .item-list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 1fr;
}

.stom-categories .item {
    width: auto;
    min-width: 0;
}

.stom-categories .item a {
    min-height: 0;
    overflow-wrap: anywhere;
}

@media only screen and (min-width: 1400px) and (max-width: 1600px) {
    .stom-categories .item a {
        padding-inline: 20px;
    }
}

/* Home1: image, date and heading, with content-driven height. */
.stom-news-slider .slider {
    align-items: flex-start;
}

.stom-news-slider .slider .stom-news-card {
    height: auto;
}

.stom-news-slider .stom-news-card .image {
    flex-shrink: 0;
}

.stom-news-slider .stom-news-card .image > a:not(.tag) {
    display: block;
    height: 100%;
}

.stom-news-slider .stom-news-card .text {
    min-height: 214px;
}

.stom-news-slider .stom-news-card .heading h3 {
    margin: 0;
}

/* Cancellation form: external spacing and a single label-to-field gap. */
#nf-form-1-cont {
    margin-bottom: 80px !important;
}

#nf-form-1-cont .label-above .nf-field-label {
    margin-bottom: 5px;
}

#nf-form-1-cont .label-above .nf-field-label label {
    margin-bottom: 0 !important;
}

/* Specificity also overrides the site's legacy Custom CSS submit rule. */
#nf-form-1-cont .submit-wrap input[type="submit"],
#nf-form-1-cont .submit-wrap input[type="button"] {
    background-color: #5f002d !important;
    border-radius: 18px !important;
}

#nf-form-1-cont .submit-wrap input[type="submit"]:hover,
#nf-form-1-cont .submit-wrap input[type="button"]:hover {
    background-color: #ff4b50 !important;
}

body.is-high-contrast #nf-form-1-cont .submit-wrap input {
    background-color: #000 !important;
    color: #ff0 !important;
}

body.is-high-contrast #nf-form-1-cont .submit-wrap input:hover {
    background-color: #ff0 !important;
    color: #000 !important;
    outline: 2px solid #000;
}

.stom-header .top-bar .cancel-visit {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    color: #5f002d;
    font-family: UniversityText, sans-serif;
    font-size: .938rem;
    line-height: 1.25rem;
    white-space: nowrap;
    text-decoration: none;
}

.stom-header .top-bar .cancel-visit:hover {
    color: #ff4b50;
}

.cancel-visit-icon {
    display: block;
    flex-shrink: 0;
    transform: scaleY(-1);
}

body.is-high-contrast .stom-header .top-bar .cancel-visit {
    color: #000;
}

body.is-high-contrast .cancel-visit-icon {
    filter: brightness(0);
}

@media only screen and (max-width: 1399px) {
    .stom-categories .item-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 767px) {
    .stom-categories .item-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #nf-form-1-cont {
        margin-bottom: 60px !important;
    }

    .stom-news-slider .stom-news-card .text {
        min-height: 0;
    }
}

/* Links within editorial text use the brand accent colour. */
.entry-content p a,
.entry-content .wp-block-list a,
.entry-content .wp-block-table a,
.entry-content .wp-block-quote a {
    color: #ff4b50;
}

body.is-high-contrast .entry-content p a,
body.is-high-contrast .entry-content .wp-block-list a,
body.is-high-contrast .entry-content .wp-block-table a,
body.is-high-contrast .entry-content .wp-block-quote a {
    color: #000;
}

/* Small spacing adjustments for the specialists heading and home form. */
.post-type-archive-specialists .stom-page-title .content {
    padding-bottom: 50px;
}

.home #nf-form-1-cont .label-above .nf-field-label {
    line-height: 18px;
    margin-bottom: 2px;
}

.home #nf-form-1-cont .label-above .nf-field-label label {
    display: block;
}

/* The embedded home form does not need the standalone form's footer gap. */
.home .stom-booking-form #nf-form-1-cont {
    margin-bottom: 0 !important;
}

.stom-specialists-timetable .heading h2 { margin: 0; }
.stom-specialists-timetable .specialists-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.stom-specialists-timetable .specialists-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 6px;
}
.stom-specialists-timetable .specialists-chevron {
    width: 14px;
    height: 8px;
    flex: 0 0 14px;
    background: currentColor;
    clip-path: polygon(0 13%, 8% 0, 50% 75%, 92% 0, 100% 13%, 50% 100%);
    transition: transform 300ms ease;
}
.stom-specialists-timetable [aria-expanded="true"] .specialists-chevron { transform: rotate(180deg); }
.stom-specialists-timetable .specialists-panel .is-subtitle { position: static !important; }
@media (prefers-reduced-motion: reduce) {
    .stom-specialists-timetable .specialists-chevron { transition: none; }
}

/* A separate weekday overlay avoids clipping by the mobile table scroller. */
.stom-specialists-timetable .specialists-floating-weekdays {
    position: fixed;
    top: 0;
    z-index: 1000;
    background: #292929;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 120ms ease;
}
.stom-specialists-timetable .specialists-floating-weekdays.is-visible { opacity: 1; }
.stom-specialists-timetable .specialists-floating-weekdays .inner { display: flex; }
.stom-specialists-timetable .specialists-floating-weekdays .is-col { flex: 1; padding: 20px 0; }
.stom-specialists-timetable .specialists-floating-weekdays .is-col:first-child { flex: 0 0 30%; }
@media (prefers-reduced-motion: reduce) {
    .stom-specialists-timetable .specialists-floating-weekdays { transition: none; }
}

/* No trailing content gap; separate neighbouring accordion sections by 1px. */
#specialists-timetable {
    margin-bottom: 0 !important;
}
.stom-specialists-timetable > .specialists-panel + .heading {
    margin-top: 1px;
}
