/* --- Sections [itx_acf_sections] / [itx_acf_sections_contents] --- */

.itx-section {
    --itx-section-separator-spacing: 1.75rem;
    margin-bottom: var(--itx-section-separator-spacing);
    /* Offsets the jump-to target so it isn't hidden behind Impreza's sticky
       header (and the WP admin bar, when logged in) when using #anchor links. */
    scroll-margin-top: calc( var(--header-sticky-height, var(--header-height, 0px)) + var(--wp-admin--admin-bar--height, 0px) );
}

.itx-section:not(:last-child) {
    padding-bottom: var(--itx-section-separator-spacing);
    border-bottom: 1px solid #DCDCDC;
}

.itx-section:last-child {
    margin-bottom: 0;
}

.itx-section__block + .itx-section__block {
    margin-top: 1.5rem;
}

.itx-section__block-heading {
    margin-bottom: 0.5rem;
}

.itx-section-contents__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.itx-section-contents__item > a {
    color: #111111;
    text-decoration: none;
}

.itx-section-contents__item > a:hover,
.itx-section-contents__item.is-active > a {
    color: var(--color-content-link);
    font-weight: bold;
}

.itx-section-contents__item--cta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.itx-section-contents__item--cta > a {
    font-weight: bold !important;
    color: var(--color-brand-contact) !important;
}

/* --- Product Standards: space the list from the content before and after it.
   Impreza zeroes the last paragraph's margin in each content div, so the gap
   has to come from here. Matches the gap between Section blocks. --- */

.itx-section__block--product_standards .itx-section__content + .itx-bullet-list,
.itx-section__block--product_standards .itx-bullet-list + .itx-section__content {
    margin-top: 1.5rem;
}

/* --- Bulleted lists: Rich Text block lists and .itx-bullet-list (Bullet List
   and Product Standards blocks) share the brand-coloured dot. --- */

.itx-section__block--wysiwyg .itx-section__content ul,
.itx-bullet-list {
    list-style: none;
    margin-inline-start: 0;
    padding-left: 0;
}

.itx-section__block--wysiwyg .itx-section__content ul li,
.itx-bullet-list li {
    position: relative;
    padding-left: 1.4rem;
}

.itx-section__block--wysiwyg .itx-section__content ul li::before,
.itx-bullet-list li::before {
    position: absolute;
    left: 0;
    color: var(--color-content-primary, #e60012);
    content: "\f111";
    font-family: "Font Awesome 7 Free";
    font-size: 0.56rem;
    font-weight: 900;
}

/* ---------------------------------------------------------
   Table [itx_acf_sections block: table]
   --------------------------------------------------------- */

/* Horizontal scroll container. */
.itx-table-scroll {
    margin-bottom: 1.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.itx-table-scroll:focus-visible {
    outline: 2px solid var(--color-content-primary, #e60012);
    outline-offset: 2px;
}

.itx-table-scroll > .itx-table {
    margin-bottom: 0;
    border-top: 1px solid #eaeaea;
    font-size: 0.85rem;
    /* Never let a column get narrower than ~8rem; wider containers still
       stretch the table to 100%. */
    min-width: calc(var(--itx-table-cols, 1) * 8rem);
}

/* Impreza "Table Button" style (Theme Options > Buttons, id 16). The
   compact padding comes from Impreza; keeping the label on one line here
   stops the auto-sized column squeezing it into a two-line blob. The
   column widens instead and the scroller takes up the overflow. */
.itx-table .us-btn-style_16 {
    white-space: nowrap;
}

/* "View full screen table" button above each table. Hidden unless
   js/sections.js flags the table as horizontally scrollable. */
.itx-table-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.itx-table-block:not(.is-scrollable) > .itx-table-toolbar {
    display: none;
}

.itx-table-expand {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.3rem 0.64rem;
    background: none;
    border: 1px solid var(--color-content-border, #e8e8e8);
    color: inherit;
    font-size: 0.85rem;
    line-height: 1.4;
    cursor: pointer;
}

.itx-table-expand:hover,
.itx-table-expand:focus-visible {
    border-color: var(--color-content-primary, #e60012);
    color: var(--color-content-primary, #e60012);
}

/* Near-fullscreen table modal (native <dialog>, built by js/sections.js). */
.itx-table-modal {
    width: calc(100vw - 2rem);
    max-width: none;
    height: calc(100dvh - 2rem);
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    background: var(--color-content-bg, #fff);
    color: var(--color-content-text, inherit);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
}

.itx-table-modal[open] {
    display: flex;
    flex-direction: column;
}

.itx-table-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.itx-table-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-content-border, #e8e8e8);
}

.itx-table-modal__title {
    margin: 0;
    font-size: 1.1rem;
}

.itx-table-modal__close {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
}

.itx-table-modal__close:hover,
.itx-table-modal__close:focus-visible {
    color: var(--color-content-primary, #e60012);
}

/* The body scrolls both ways, so the table's own scroll wrapper is
   flattened and the header row stays pinned while scrolling down. */
.itx-table-modal__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem;
}

.itx-table-modal__body .itx-table-scroll {
    overflow: visible;
}

.itx-table-modal__body thead th {
    position: sticky;
    top: -1rem;
    z-index: 1;
    background: var(--color-content-bg, #fff);
}

/* Stop the page behind the modal scrolling. */
html.itx-table-modal-open {
    overflow: hidden;
}

.itx-table__footnote {
    margin-top: 0;
    font-size: 0.85rem;
    padding-left: 0.64rem;
    padding-right: 0.64rem;
}

/* ---------------------------------------------------------
   Downloads [itx_acf_sections block: downloads]
   --------------------------------------------------------- */

/* Same type size and top rule as the table block. */
.itx-downloads {
    width: 100%;
    margin-bottom: 1.5rem;
    border-top: 1px solid #eaeaea;
    font-size: 0.85rem;
}

.itx-downloads td {
    vertical-align: middle;
}

/* Matches the site-wide running-text link hover, which skips classed links. */
.itx-downloads__link {
    color: var(--color-content-link);
    font-weight: 700;
    text-decoration: none;
}

.itx-downloads__link:hover,
.itx-downloads__link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Size / file type on its own line under the filename. */
.itx-downloads__meta {
    display: block;
    margin-top: 0.15rem;
    color: var(--color-content-faded, #888);
    font-size: 0.75rem;
}

/* Narrow, centred icon column. */
.itx-downloads .itx-downloads__action {
    width: 1%;
    text-align: center;
    white-space: nowrap;
}

/* Round icon control, like the gallery expand and carousel arrows:
   fills with the brand colour on hover. White with a hairline border so
   it stands out on both plain and striped (even) rows. */
.itx-downloads .itx-downloads__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--color-content-border, #e8e8e8);
    border-radius: 50%;
    background: var(--color-content-bg, #fff);
    color: var(--color-content-primary, #e60012);
    font-size: 0.9rem;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* Three classes so this beats Impreza's .no-touch a:hover link colour,
   which would otherwise turn the icon red on the red fill. */
.itx-downloads .itx-downloads__button:hover,
.itx-downloads .itx-downloads__button:focus-visible {
    border-color: var(--color-content-primary, #e60012);
    background: var(--color-content-primary, #e60012);
    color: #fff;
}

.itx-downloads .itx-downloads__button:focus-visible {
    outline: 2px solid var(--color-content-primary, #e60012);
    outline-offset: 2px;
}

/* ---------------------------------------------------------
   Video card [itx_acf_sections block: video]
   --------------------------------------------------------- */

.itx-video-card {
    display: flex;
    align-items: stretch;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.itx-video-card__thumb {
    position: relative;
    flex: 0 0 33%;
    width: 33%;
    min-height: 180px;
    padding: 0;
    border: 0;
    background: #000;
    cursor: pointer;
    overflow: hidden;
    display: block;
}

.itx-video-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.25s ease;
}

.itx-video-card__thumb:hover img,
.itx-video-card__thumb:focus-visible img {
    opacity: 0.8;
}

.itx-video-card__thumb:focus-visible {
    outline: 3px solid var(--color-content-primary, #e95095);
    outline-offset: -3px;
}

.itx-video-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: #f5a623;
    color: #fff;
    font-size: 1.25rem;
    pointer-events: none;
    transition: transform 0.2s ease, background 0.2s ease;
    padding-left: 0.15em; /* nudge play triangle to visual centre */
}

.itx-video-card__thumb:hover .itx-video-card__play,
.itx-video-card__thumb:focus-visible .itx-video-card__play {
    transform: translate(-50%, -50%) scale(1.1);
    background: #e09415;
}

.itx-video-card__content {
    flex: 1 1 auto;
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
}

.itx-video-card__heading {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.itx-video-card__description {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-content-text, #555);
}

@media (max-width: 640px) {
    .itx-video-card {
        flex-direction: column;
    }

    .itx-video-card__thumb {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 0;
    }

    .itx-video-card__content {
        padding: 1.25rem;
    }
}

/* ---------------------------------------------------------
   Linked content card [itx_acf_sections block: linked_content]
   --------------------------------------------------------- */

.itx-linked-card {
    display: flex;
    align-items: stretch;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.itx-linked-card__thumb {
    position: relative;
    flex: 0 0 33%;
    width: 33%;
    min-height: 180px;
    background: #dcdfe3;
    overflow: hidden;
    display: block;
}

.itx-linked-card__thumb:focus-visible {
    outline: 3px solid var(--color-content-primary, #e95095);
    outline-offset: -3px;
}

.itx-linked-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.itx-linked-card__image--placeholder {
    background: linear-gradient(140deg, #d7dce1, #f1f3f5);
}

.itx-linked-card__thumb:hover .itx-linked-card__image,
.itx-linked-card__thumb:focus-visible .itx-linked-card__image {
    transform: scale(1.03);
}

.itx-linked-card__content {
    flex: 1 1 auto;
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
}

.itx-linked-card__heading {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.itx-linked-card__heading a {
    color: inherit;
    text-decoration: none;
}

.itx-linked-card__heading a:hover,
.itx-linked-card__heading a:focus-visible {
    color: var(--color-content-link);
}

.itx-linked-card__description {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-content-text, #555);
}

@media (max-width: 640px) {
    .itx-linked-card {
        flex-direction: column;
    }

    .itx-linked-card__thumb {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 0;
    }

    .itx-linked-card__content {
        padding: 1.25rem;
    }
}
