/*
Theme Name: DTS International
Theme URI: https://www.dts-international.com/
Description: Child theme for DTS International, built on the PB Boilerplate parent theme.
Author: Publishing Bureau
Author URI: https://publishingbureau.co.uk
Template: pb-boilerplate
Version: 1.1.3
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Text Domain: dts-international
*/

/* ==========================================================================
   CSS Variables - Customise for Your Project
   Override parent theme defaults here to match your design
   ========================================================================== */

:root {
    /* Remap parent theme's --highlight, --dark-grey and --grey references to --charcoal */
    --wp--preset--color--highlight: var(--wp--preset--color--charcoal);
    --wp--preset--color--dark-grey: var(--wp--preset--color--charcoal);
    --wp--preset--color--grey: var(--wp--preset--color--charcoal);

    /* Remap parent theme's --blue and --navy references to --cobalt */
    --wp--preset--color--blue: var(--wp--preset--color--cobalt);
    --wp--preset--color--navy: var(--wp--preset--color--cobalt);

    /* Layout - Customise dimensions and spacing */
    --header-height: 110px;
    /* --content-width: 1200px; */
    /* --content-padding: 20px; */

    --header--nav--font-size: 14px;

    /* Typography - Define fonts in theme.json
       To customize fonts for your project, edit the child theme's theme.json file:
       settings.custom.typography.heading.fontFamily
       settings.custom.typography.body.fontFamily
    */
    /* --line-height-base: 1.6; */
    /* --line-height-heading: 1.2; */
    /* --font-weight-normal: 400; */
    /* --font-weight-bold: 600; */

    /* Font Sizes - Customise heading and text sizes
       Use theme.json for font sizes - it applies to both front end and editor */

    /* Spacing - Customise spacing scale */
    /* --spacing-xs: 0.5em; */
    /* --spacing-sm: 1em; */
    /* --spacing-md: 1.5em; */
    /* --spacing-lg: 2em; */
    /* --spacing-xl: 3em; */

    /* Border Radius - Customise corner roundness */
    /* --border-radius-sm: 3px; */
    /* --border-radius-md: 4px; */

    /* Transitions - Customise animation speed */
    /* --transition-speed: 0.2s; */

    /* Social Media Links - Defined in theme.json
       To customise social link appearance, edit the child theme's theme.json file:
       settings.custom.socialLinks

       Available options:
       - iconSize: Size of the icon SVG (default: 20px)
       - circleSize: Size of the circular button (default: 40px)
       - background: Background colour of the circle (default: #2C3E50)
       - iconColor: Colour of the icon (default: #FFFFFF)
       - backgroundHover: Background colour on hover (default: #3498DB)
       - iconColorHover: Icon colour on hover (default: #FFFFFF)
    */
}

/* ==========================================================================
   Child Theme Custom Styles
   Add your additional CSS below
   ========================================================================== */

/*
 * Add any custom styles that aren't variable overrides here.
 * These will be loaded after the parent theme styles.
 */

/* ==========================================================================
   Layout
   ========================================================================== */
.site-main {
   padding-top: 0;
}
.entry-content {
   margin-bottom: 0;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.main-navigation {
   justify-content: flex-end;
}
.main-navigation a {
   font-family: var(--wp--preset--font-family--heading);
   font-weight: 700;
}
.main-navigation a:hover {
   color: var(--wp--preset--color--cobalt);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.dts-breadcrumbs {
    background-color: var(--wp--preset--color--off-white);
    padding: 0;
    margin-left: calc(-1 * var(--wp--style--root--padding-left));
    margin-right: calc(-1 * var(--wp--style--root--padding-right));
}

.dts-breadcrumbs .breadcrumb-container {
    height: 44px;
    display: flex;
    align-items: center;
    border: none;
}

.dts-breadcrumbs .breadcrumb-item a {
    color: var(--wp--preset--color--cobalt);
}

.dts-breadcrumbs .breadcrumb-item a:hover {
    opacity: 0.7;
}

.dts-breadcrumbs .breadcrumb-item--current span,
.dts-breadcrumbs .breadcrumb-separator {
    color: var(--wp--preset--color--charcoal);
    opacity: 1;
}

/* ==========================================================================
   Page Header Banner
   ========================================================================== */

.page-header-banner {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: 20px;
    overflow: hidden;
    margin-top: var(--wp--preset--spacing--80);
    margin-bottom: var(--wp--preset--spacing--80);
    max-width: var(--wp--style--global--content-size);
    margin-left: auto;
    margin-right: auto;
    background-color: var(--wp--preset--color--black);
}

.page-header-content {
    background-color: var(--wp--preset--color--black);
    color: var(--wp--preset--color--white);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-header-content .entry-title {
    color: var(--wp--preset--color--white);
    margin: 0;
}

.page-header-content .page-intro {
    margin-top: 1rem;
    font-size: 16px;
    font-weight: 300;
}

.page-header-content .page-intro p:last-child {
    margin-bottom: 0;
}

.page-header-image {
    min-height: 250px;
}

.page-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 992px) {
    .page-header-banner {
        grid-template-columns: 1fr 1fr;
    }

    .page-header-content {
        padding: 3rem;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background-color: var(--wp--preset--color--black);
    color: var(--wp--preset--color--white);
    margin-top: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.footer-contact h3,
.footer-navigation h3,
.footer-social h3 {
    color: var(--wp--preset--color--white);
    text-transform: none;
}

.footer-contact a,
.footer-navigation a {
    color: var(--wp--preset--color--white);
}

.footer-contact a:hover,
.footer-navigation a:hover {
    color: var(--wp--preset--color--off-white);
}

.footer-contact .contact-email,
.footer-contact .contact-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact .contact-email svg,
.footer-contact .contact-phone svg {
    flex-shrink: 0;
}

.footer-spacer {
    height: 2rem;
}

.site-info {
    color: var(--wp--preset--color--white);
    text-align: left;
    padding: 0;
}

.site-info > p:not(:last-child) {
    margin-bottom: var(--wp--preset--spacing--60);
}
.site-info a {
    color: var(--wp--preset--color--white);
    text-decoration: underline;
}

.site-info a:hover {
    color: var(--wp--preset--color--off-white);
}

.footer-navigation ul {
    columns: 2;
    column-gap: 2rem;
}

.footer-navigation li {
    break-inside: avoid;
}

.social-link {
    background-color: transparent;
    border: none;
    width: auto;
    height: auto;
    border-radius: 0;
}

.social-link:hover {
    opacity: 0.7;
    transform: none;
}

@media (min-width: 992px) {
    .footer-content {
        grid-template-columns: 5fr 5fr 2fr;
    }

    .footer-contact,
    .footer-navigation {
        border-right: 1px solid var(--wp--preset--color--white);
        padding-right: 2rem;
    }
}

/* ==========================================================================
   Single Product
   ========================================================================== */

.product-single .product {
    margin-top: var(--wp--preset--spacing--80);
    margin-bottom: var(--wp--preset--spacing--80);
}

/* ----- Hero (image + title + content) ----- */

.product__hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: var(--wp--preset--spacing--80);
}

.product__hero-image img,
.product__hero-img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    display: block;
}

.product__hero-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product__title {
    margin: 0 0 var(--wp--preset--spacing--80);
}

.product__content > *:first-child {
    margin-top: 0;
}

.product__content > *:last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .product__hero {
        grid-template-columns: 33% 1fr;
        gap: 3rem;
        align-items: start;
    }
}

/* ----- Ratings bar ----- */

.product__ratings {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 20px;
    background-color: #1A1A1A;
    background-image: url("assets/images/rating-background.png");
    background-size: cover;
    background-position: center;
    color: var(--wp--preset--color--white);
    margin-bottom: var(--wp--preset--spacing--80);
}

.product-rating {
    flex: 1 1 200px;
    max-width: 200px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.18);
    border: 2px solid var(--wp--preset--color--white);
    border-radius: 20px;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-sizing: border-box;
}

.product-rating__icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.product-rating__label {
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.product-rating__scale {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    color: var(--wp--preset--color--white);
}

.product-rating__star {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--wp--preset--color--white);
}

@media (min-width: 768px) {
    .product__ratings {
        padding: 2.5rem;
        gap: 40px;
    }
    .product-rating {
        flex: 0 0 200px;
        width: 200px;
        height: 200px;
        max-width: 200px;
        padding: 1.5rem 1rem;
    }
    .product-rating__icon {
        width: 56px;
        height: 56px;
    }
    .product-rating__label {
        font-size: 16px;
    }
    .product-rating__star {
        width: 22px;
        height: 22px;
    }
}

/* ----- Accordions (Product info / Related documents) ----- */

.product__accordions {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--wp--preset--spacing--80);
}

.product__accordion {
    border-bottom: 1px solid var(--wp--preset--color--charcoal);
}

.product__accordion-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0.5rem;
    color: var(--wp--preset--color--black);
}

.product__accordion-title {
    margin: 0;
}

.product__accordion-summary::-webkit-details-marker {
    display: none;
}

.product__accordion-summary:hover .product__accordion-title,
.product__accordion-summary:focus-visible .product__accordion-title {
    color: var(--wp--preset--color--cobalt);
}

.product__accordion-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    position: relative;
}

.product__accordion-icon::before,
.product__accordion-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: currentColor;
    transition: transform 0.2s ease;
}

.product__accordion-icon::before {
    width: 16px;
    height: 2px;
    transform: translate(-50%, -50%);
}

.product__accordion-icon::after {
    width: 2px;
    height: 16px;
    transform: translate(-50%, -50%);
}

.product__accordion[open] > .product__accordion-summary .product__accordion-icon::after {
    transform: translate(-50%, -50%) scaleY(0);
}

.product__accordion-content {
    padding: 0 0.5rem 1.5rem;
}

/* ----- Product information table ----- */

.product-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    border-top: 1px solid var(--wp--preset--color--charcoal);
}

.product-info-table th,
.product-info-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: top;
    border: none;
}

.product-info-table th {
    font-weight: 700;
    width: 35%;
    color: var(--wp--preset--color--black);
}

.product-info-table tr {
    border-bottom: 1px solid var(--wp--preset--color--charcoal);
}

.product-info-table tbody tr:nth-child(odd) {
    background-color: var(--wp--preset--color--off-white);
}

@media (max-width: 599px) {
    .product-info-table th,
    .product-info-table td {
        display: block;
        width: 100%;
        padding: 0.5rem 1rem;
    }
    .product-info-table th {
        padding-top: 0.85rem;
    }
    .product-info-table td {
        padding-bottom: 0.85rem;
    }
}

/* ----- Related documents cards ----- */

.related-documents {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-documents__item {
    margin: 0;
}

.related-documents__card {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background-color: var(--wp--preset--color--off-white);
    border: none;
    border-radius: 12px;
    color: var(--wp--preset--color--black);
    text-align: left;
    text-decoration: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.related-documents__card:hover,
.related-documents__card:focus-visible {
    background-color: #E7EFF4;
}

.related-documents__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wp--preset--color--cobalt);
}

.related-documents__icon svg,
.related-documents__icon img {
    width: 28px;
    height: 28px;
}

.related-documents__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.related-documents__title {
    font-weight: 700;
    color: var(--wp--preset--color--black);
}

.related-documents__cta {
    color: var(--wp--preset--color--cobalt);
    font-size: 14px;
}

.related-documents__card:hover .related-documents__cta,
.related-documents__card:focus-visible .related-documents__cta {
    text-decoration: underline;
}

/* ----- Explore product categories ----- */

.explore-categories {
    margin-left: calc(var(--wp--style--root--padding-left) * -1);
    margin-right: calc(var(--wp--style--root--padding-right) * -1);
    background-color: #1A1A1A;
    background-image: url("assets/images/explore-banner.png");
    background-size: cover;
    background-position: center;
    color: var(--wp--preset--color--white);
    padding-block: 3rem 3.5rem;
}

.explore-categories__banner {
    text-align: center;
    margin-bottom: 2rem;
}

.explore-categories__title {
    margin: 0;
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--heading);
}

.explore-categories__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
}

.explore-categories__item {
    margin: 0;
    flex: 0 0 calc((100% - 1.5rem) / 2);
}

.explore-categories__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    color: var(--wp--preset--color--white);
    text-decoration: none;
    text-align: center;
}

.explore-categories__link:hover .explore-categories__name,
.explore-categories__link:focus-visible .explore-categories__name {
    text-decoration: underline;
}

.explore-categories__icon {
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--wp--preset--color--white);
    border-radius: 50%;
    padding: 1rem;
    box-sizing: border-box;
    color: var(--wp--preset--color--black);
}

.explore-categories__icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.explore-categories__name {
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--wp--preset--color--white);
}

@media (min-width: 600px) {
    .explore-categories {
        padding-block: 3.5rem 4rem;
    }
    .explore-categories__grid {
        gap: 2rem;
    }
    .explore-categories__item {
        flex-basis: calc((100% - 2rem) / 2);
    }
    .explore-categories__icon {
        width: 96px;
        height: 96px;
    }
}

@media (min-width: 992px) {
    .explore-categories__item {
        flex-basis: calc((100% - 8rem) / 5);
    }
}

/* ==========================================================================
   Video Lightbox
   ========================================================================== */

.dts-lightbox {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: min(90vw, 1100px);
    width: 100%;
}

.dts-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

.dts-lightbox__inner {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.dts-lightbox iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.dts-lightbox__close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--charcoal, #2B2B2B);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.dts-lightbox__close:hover,
.dts-lightbox__close:focus {
    background: var(--wp--preset--color--charcoal, #2B2B2B);
    color: var(--wp--preset--color--white);
}

/* ==========================================================================
   Resources — filter bar + grid + card
   ========================================================================== */

.resources {
    margin-block: var(--wp--preset--spacing--40, 1.5rem);
}

/* ----- Filter bar ----- */

.resources-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 3.5rem;
}

.resources-filter__label {
    font-family: var(--wp--preset--font-family--body);
    font-weight: 500;
    color: var(--wp--preset--color--charcoal);
}

.resources-filter__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resources-filter__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--wp--preset--color--cobalt);
    border-radius: 999px;
    background: transparent;
    color: var(--wp--preset--color--black);
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.resources-filter__button:hover,
.resources-filter__button:focus-visible,
.resources-filter__button[aria-pressed="true"] {
    background-color: var(--wp--preset--color--cobalt);
    color: var(--wp--preset--color--white);
}

.resources-filter__button:focus-visible {
    outline: 2px solid var(--wp--preset--color--cobalt);
    outline-offset: 2px;
}

/* ----- Grid ----- */

.resource-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 3rem;
    }
}

/* ----- Card ----- */

.resource-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin: 0;
    border-radius: 0 20px 20px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.resource-card:hover,
.resource-card:focus-within {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Explicit rule so [hidden] beats the .resource-card display above. */
.resource-card[hidden] {
    display: none;
}

.resource-card__media {
    flex: 0 0 150px;
    overflow: hidden;
}

.resource-card__image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border: 1px solid var(--wp--preset--color--off-white);
}

.resource-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 15px;
    padding-left: 0;
    min-width: 0;
}

.resource-card__category {
    margin: 0;
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wp--preset--color--charcoal);
}

.resource-card__title {
    margin: 0;
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.35;
    color: var(--wp--preset--color--black);
}

.resource-card__action,
.resource-card__action:hover,
.resource-card__action:focus,
.resource-card__action:focus-visible {
    align-self: start;
    margin-top: 0.25rem;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: var(--wp--preset--font-family--body);
    font-weight: 400;
    font-size: inherit;
    color: var(--wp--preset--color--cobalt);
    text-decoration: none;
    cursor: pointer;
}

.resource-card__action:focus-visible {
    outline: 2px solid var(--wp--preset--color--cobalt);
    outline-offset: 2px;
    border-radius: 2px;
}

.resources-empty {
    margin-block: 2rem;
    font-style: italic;
    color: var(--wp--preset--color--charcoal);
}

/* ==========================================================================
   PB Contact Form
   ========================================================================== */

.wp-block-pb-contact-form .wp-block-pb-contact-form--fieldset > label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--wp--preset--color--black);
}

.wp-block-pb-contact-form
    .wp-block-pb-contact-form--fieldset:has(.wp-block-pb-contact-form--input[required])
    > label::after {
    content: " *";
}

.wp-block-pb-contact-form .wp-block-pb-contact-form--input,
.wp-block-pb-contact-form .wp-block-pb-contact-form--input[required] {
    border: 1px solid #C3C3C3;
    border-radius: 0;
}

/* ==========================================================================
   404 page
   ========================================================================== */

.site-main--404 {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-block: var(--wp--preset--spacing--80);
    min-height: 60vh;
}

.dts-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding-inline: var(--wp--style--root--padding-left, 1rem);
}

.dts-404__code {
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    font-size: clamp(96px, 18vw, 160px);
    line-height: 1;
    margin: 0;
    color: rgba(3, 83, 139, 0.25);
    letter-spacing: -0.02em;
}

.dts-404__title {
    margin: 1rem 0 0.75rem;
}

.dts-404__message {
    margin: 0 0 2rem;
    color: var(--wp--preset--color--charcoal);
    font-size: 18px;
    line-height: 1.5;
}

.dts-404__home-link {
    align-self: center;
}