/*
Theme Name: The Payments Hub
Theme URI: https://thepaymentshub.com
Author: The Payments Hub
Description: A custom modular theme for The Payments Hub with ACF Flexible Content modules
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-payments-hub
*/

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body{
    padding: 0;
    margin: 0;
}

body {
    color: #050505;
    background-color: #fff;
}

/* Typography Colors (font styles moved to fonts.css) */
h1 {
    color: #053b81;
}

h2 {
    color: #053b81;
}

h3 {
    color: #053b81;
}

p {
    color: #050505;
}

a {
    color: #053b81;
    text-decoration: none;
    transition: color 0.3s ease;
    &:hover {
        text-decoration: none;
    }
}

button{
    border: none;
}

.wp-block-button{
    margin: 0 !important;
    padding: 20px 20px 20px 0 !important;
}

button, .wp-block-button__link{
padding-top: 9px;
padding-right: 18px;
padding-bottom: 7px;
padding-left: 18px;
border-radius: 8px 0 8px 0;
background-color: #053b81;
color: #fff;
font-weight: 600;
font-size: 1.6rem;
line-height: 18px;
letter-spacing: 0px;
/* Subtle hover effect for buttons and wp-block-button__link */
transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s;
}

button:hover a{
    color: #fff;
    text-decoration: none;
    background: none;
}

button:hover, .wp-block-button__link:hover  {
    background-color: #04345c;
    color: #fff;
    box-shadow: 0 8px 32px 0 rgba(7,71,138,0.18);
    text-decoration: none;
    transform: translateY(-2px);
}

.curved-corners{
    border-radius: 8px 0 8px 0;
}

.box-shadow{
    box-shadow: 8px 8px 20px 0px #97979740;
}

/* Container */
.container {
    max-width: 1408px;
    margin: 0 auto;
    padding: 12rem 0 0 0;
    position: relative;
    z-index: 1;
}

/* From 1408px down: add horizontal padding so content doesn't sit on the edge */
@media (max-width: 1408px) {
    .container {
        padding: 10rem 2rem 0 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 6rem 1rem 0 1rem;
    }
}

/* Header & Navigation */
.site-header {
    background: #fff;
    padding: 2rem 0 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.site-header .container {
    position: relative;
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

/* Header Branding */
.site-branding__link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-branding__logo {
    max-width: 400px;
    height: auto;
    width: auto;
    display: block;
}

.site-branding__title {
    display: inline-flex;
    align-items: baseline;
    padding-bottom: 0.3rem;
}

.site-branding__word {
    padding: 2px;
}

.site-branding__word--light {
    color: #053b81;
    font-weight: 200;
    font-size:2.6rem;
}

.site-branding__word--bold {
    color: #053b81;
    font-weight: 700;
    font-size:2.6rem;
}

@media (max-width: 768px) {
    .site-branding__word--light {
        font-size: 1.8rem;
    }
    .site-branding__word--bold {
        font-size: 1.8rem;
    }
}

.site-branding__separator {
    width: 1px;
    height: 2rem;
    background-color: #D0D0D0;
    flex-shrink: 0;
}

.site-branding__powered-by {
    color: #999;
    white-space: nowrap;
}

.site-branding__jcb-logo {
    height: 5.2rem;
    width: auto;
    display: block;
}

.site-branding__jcb-text {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border: 2px solid #053b81;
    color: #053b81;
}

.site-header__nav-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.main-navigation a {
    color: #303340;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
    border-bottom: 2px solid transparent;
    padding-bottom: 0.2rem;
}

.main-navigation a:hover {
    color: #053b81;
    border-bottom-color: rgba(7, 71, 138, 0.4);
}

.main-navigation a:focus-visible {
    color: #053b81;
    outline: 2px solid #053b81;
    outline-offset: 4px;
}

/* Active/current page */
.main-navigation .current-menu-item > a {
    color: #053b81;
    font-weight: 600;
    border-bottom-color: #053b81;
}

/* Desktop dropdown: parent item + submenu */
.main-navigation .menu-item-has-children {
    position: relative;
}

.main-navigation .sub-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    margin: 0;
    padding: 1rem 0;
    list-style: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

.main-navigation .sub-menu li {
    margin: 0;
}

.main-navigation .sub-menu li + li {
    margin-top: 0.25rem;
}

.main-navigation .sub-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    border-bottom: none;
    white-space: nowrap;
}

.main-navigation .sub-menu a:hover {
    background: rgba(5, 59, 129, 0.06);
}

.main-navigation .menu-item-has-children:hover .sub-menu,
.main-navigation .menu-item-has-children:focus-within .sub-menu {
    opacity: 1;
    visibility: visible;
}

/* Search Toggle Button */
.search-toggle {
    background: none !important;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #303340;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
}

.search-toggle:hover {
    color: #000;
    background: none !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.search-toggle:active {
    transform: scale(1.05);
}

.search-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Search Form Wrapper */
.search-form-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12rem 2rem 2rem;
    background: linear-gradient(to right bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 2100;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

.search-form-wrapper.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-form-wrapper__inner {
    width: min(760px, 100%);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 8px 0 8px 0;
    padding: 2rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    position: relative;
    --tph-search-ui-width: min(640px, 100%);
}

.search-overlay-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 44px;
    height: 44px;
    border-radius: 8px 0 8px 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85) !important;
    color: #111827;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: none;
}

.search-overlay-close svg {
    width: 34px;
    height: 34px;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

.search-overlay-close:hover,
.search-overlay-close:active,
.search-overlay-close:focus,
.search-overlay-close:focus-visible {
    background: rgba(255, 255, 255, 0.75) !important;
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: none;
}

.search-form-wrapper .search-form {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: start; /* don't stretch inputs full width */
    gap: 1rem;
    margin: 0;
}

.search-form-wrapper .search-submit {
    display: none;
}

.search-form-wrapper .search-field {
    flex: 1;
    width: 100%;
    /* Use textfield appearance so Safari doesn't reserve space for the built-in cancel UI */
    -webkit-appearance: textfield;
    appearance: textfield;
    padding: 1.25rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px 0 8px 0;
    font-family: "Nunito Sans", sans-serif;
    font-size: 1.7rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Hide the browser's built-in clear "x" for type="search" (we provide our own) */
.search-form-wrapper input[type="search"]::-webkit-search-cancel-button,
.search-form-wrapper input[type="search"]::-webkit-search-decoration,
.search-form-wrapper input[type="search"]::-webkit-search-results-button,
.search-form-wrapper input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.search-form-wrapper .search-field:focus {
    border-color: #053b81;
    box-shadow: 0 0 0 4px rgba(7, 71, 138, 0.18);
}

.search-form-wrapper .search-submit {
    padding: 1.15rem 1.6rem;
    background: #053b81;
    color: #fff;
    border: none;
    border-radius: 8px 0 8px 0;
    cursor: pointer;
    font-size: 1.4rem;
    transition: background 0.3s ease;
    box-shadow: none;
    transform: none;
}

.search-form-wrapper .search-submit:hover {
    background: #063a6d;
}

.search-form-wrapper label {
    flex: 1;
    margin: 0;
    position: relative;
    display: block;
    width: var(--tph-search-ui-width);
}

.search-form-wrapper .tph-search-clear {
    position: absolute;
    top: 50%;
    right: 1.1rem;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.06) !important;
    color: #303340;
    font-size: 1.7rem;
    line-height: 1;
    display: none; /* shown via JS when there is input */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
}

.search-form-wrapper .tph-search-clear:hover,
.search-form-wrapper .tph-search-clear:active,
.search-form-wrapper .tph-search-clear:focus,
.search-form-wrapper .tph-search-clear:focus-visible {
    background: rgba(0, 0, 0, 0.10) !important;
    color: #000;
    box-shadow: none;
    transform: translateY(-50%);
}

.search-form-wrapper .search-field.has-clear {
    padding-right: 4.6rem;
}

.search-form-wrapper .tph-search-results {
    margin-top: 1.6rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px 0 8px 0;
    overflow: hidden;
    width: var(--tph-search-ui-width);
}

.search-form-wrapper .tph-search-results[hidden] {
    display: none;
}

.search-form-wrapper .tph-search-results__section-title {
    padding: 1.2rem 1.4rem;
    font-size: 1.2rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.88);
}

.search-form-wrapper .tph-search-results__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-form-wrapper .tph-search-results__item a {
    display: block;
    padding: 0.9rem 1.4rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.search-form-wrapper .tph-search-results__item:last-child a {
    border-bottom: 0;
}

.search-form-wrapper .tph-search-results__title {
    margin: 0 0 0.25rem;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.25;
    color: #053b81;
}

.search-form-wrapper .tph-search-results__excerpt {
    margin: 0;
    color: #6b7280;
    font-size: 1.35rem;
    line-height: 1.35;
}

.search-form-wrapper .tph-search-results__more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.4rem;
    background: rgba(255, 255, 255, 0.88);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.search-form-wrapper .tph-search-results__more a {
    color: #053b81;
    text-decoration: none;
    font-weight: 600;
}

.search-form-wrapper .tph-search-results__meta {
    color: #6b7280;
    font-size: 1.2rem;
}

.search-form-wrapper .tph-search-results__empty,
.search-form-wrapper .tph-search-results__loading {
    padding: 1.4rem;
    color: #6b7280;
    font-size: 1.4rem;
}

.search-form-wrapper .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Main Content */
.site-main {
    min-height: 60vh;
    padding: 0;
}

/* 404 – global styling, card + search with corner treatment */
.error-404__inner {
    background: #fff;
    border-radius: 8px 0 8px 0;
    box-shadow: 8px 8px 20px 0px #97979740;
    padding: 4rem 3rem;
    max-width: 640px;
}

.error-404 .page-header {
    margin-bottom: 1.5rem;
}

.error-404 .page-title {
    margin: 0;
    font-size: 3rem;
    color: #053b81;
    font-weight: 700;
}

.error-404 .page-content {
    margin: 0;
}

.error-404 .page-content p {
    margin: 0 0 1.5rem;
    color: #050505;
}

.error-404__search .search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: stretch;
    max-width: 100%;
}

.error-404__search .search-form label {
    flex: 1;
    min-width: 0;
}

.error-404__search .search-field {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 8px 0 0 0;
    font-size: 1.6rem;
    font-family: inherit;
}

.error-404__search .search-field:focus {
    border-color: #053b81;
    outline: none;
}

.error-404__search .search-submit {
    padding: 1rem 1.5rem;
    font-size: 1.6rem;
    font-weight: 600;
    background-color: #053b81;
    color: #fff;
    border: 2px solid #053b81;
    border-radius: 0 0 8px 0;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.error-404__search .search-submit:hover {
    background-color: #04345c;
    border-color: #04345c;
    box-shadow: 0 8px 32px 0 rgba(7, 71, 138, 0.18);
}

@media (max-width: 480px) {
    .error-404__search .search-form {
        flex-direction: column;
    }

    .error-404__search .search-field {
        border-right: 2px solid #e0e0e0;
        border-radius: 8px 0 8px 0;
    }

    .error-404__search .search-submit {
        border-radius: 8px 0 8px 0;
    }
}

/* Blog/Archive Styles */
.archive-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.archive-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Search no results - scoped to avoid conflicting with body classes */
.tph-search-no-results {
    background: #fff;
    border-radius: 8px 0 8px 0;
    box-shadow: 8px 8px 20px 0px #97979740;
    padding: 4rem 3rem;
    margin-bottom: 4rem;
    max-width: 640px;
}

.tph-search-no-results__content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tph-search-no-results__message {
    margin: 0;
    color: #050505;
}

.tph-search-no-results__form .search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    max-width: 100%;
}

.tph-search-no-results__form .search-form label {
    flex: 1;
    min-width: 200px;
}

.tph-search-no-results__form .search-field {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px 0 8px 0;
    font-size: 1.6rem;
}

.tph-search-no-results__form .search-field:focus {
    border-color: #053b81;
    outline: none;
}

.tph-search-no-results__form .search-submit {
    padding: 1rem 1.5rem;
    font-size: 1.6rem;
}

.tph-search-no-results__suggestions {
    margin: 0;
    font-size: 1.6rem;
    color: #666;
}

.tph-search-no-results__suggestions a {
    font-weight: 600;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

.post-card {
    background: #fff;
    border-radius: 8px 0 8px 0;
    overflow: hidden;
    box-shadow: 8px 8px 20px 0px #97979740;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.post-card__image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.post-card__content {
    padding: 3rem;
}

.post-card__title {
    margin: 0 0 0.75rem 0;
    font-size: 2.2rem;
    font-weight: 500;
}

.post-card__title a {
    text-decoration: none;
    transition: color 0.3s ease;
    color: inherit;
}

.post-card__title a:hover {
    color: #0052a3;
}

.post-card__meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    font-family: "Nunito Sans", sans-serif;
}

.post-card__excerpt {
    padding: 2rem 0;
    font-size: 1.6rem;
}

.post-card__excerpt p {
    font-size: 1.6rem;
}

.post-card .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 0;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    font-family: "Nunito Sans", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0;
}

.post-card .post-tag {
    display: inline;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.post-card .post-tag:hover {
    color: #0052a3;
}

.post-card .post-tag:not(:last-child)::after {
    content: " • ";
    color: #999;
}

/* Single Post & Standard Page (shared layout) */
.single-post__header {
    text-align: center;
}

.single-post .tph-text-image{
    margin-top: 5rem;
}

.single-post .tph-most-recent-posts{
    padding-top: 16rem;
}

.single-post__header h1{
    font-weight: 800;
}

.single-post__container,
.standard-page {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 12rem;
}
@media (max-width: 768px) {
    .single-post__container,
    .standard-page {
        padding-top: 2rem;
    }
}
.single-post__header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.single-post__title {
    margin-bottom: 1rem;
}

.single-post__reading-time {
    color: #999;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.single-post__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    box-shadow: 8px 8px 20px 0px #97979740;
}

.single-post__tag {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: #ffffff;
    color: #053b81;
    text-decoration: none;
    border-radius: 4px 0 4px 0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.single-post__tag:hover {
    background: #053b81;
    color: #ffffff;
}

.single-post__featured-image {
    width: 100%;
    margin-top: 2rem;
}

.single-post__featured-image .single-post__image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.single-post__meta {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.single-post__content p, li,
.standard-page .entry-content p,
.standard-page .entry-content li {
    line-height: 1.8;
    font-size: 2rem;
    font-weight: 200;
}

.single-post__content p,
.standard-page .entry-content p {
    padding: 1rem 0;
}

#feature-img{
    margin-top: 3rem;
}

#feature-img .feature-img__image{
    width: 100%;
    height: auto;
    border-radius: 8px 0 8px 0;
}

.single-post__content h2,
.standard-page .entry-content h2 {
    color: #053b81;
    font-size: 2.2rem;
    font-weight: 500;
    padding: 3rem 0 2rem;
}

.single-post__content h3,
.standard-page .entry-content h3 {
    color: #053b81;
    font-size: 2rem;
    font-weight: 500;
    padding: 2rem 0 1rem;
}

.single-post__content ul,
.standard-page .entry-content ul {
    padding-left: 2rem;
}

.single-post__content li,
.standard-page .entry-content li {
    padding: 1rem 0;
}

.single-post__content .tph-text-image--download-block p,
.standard-page .entry-content .tph-text-image--download-block p {
    line-height: 1.8;
    font-size: 1.4rem;
}

.single-post__content .tph-text-image--download-block h2,
.standard-page .entry-content .tph-text-image--download-block h2 {
    font-size: 2.2rem;
}

.single-post__content img,
.standard-page .entry-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
}

/* Let certain blocks use full viewport width on single posts and pages (100% at any viewport size) */
.single-post__content .tph-most-recent-posts,
.standard-page .entry-content .tph-most-recent-posts,
.single-post__content .tph-testimonials-carousel,
.standard-page .entry-content .tph-testimonials-carousel {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Allow breakout blocks to extend past the page container */
.standard-page,
.standard-page .entry-content {
    overflow-x: visible;
}

.single-post__content .tph-most-recent-posts__container,
.standard-page .entry-content .tph-most-recent-posts__container {
    padding-left: 2rem;
    padding-right: 2rem;
}

.single-post__content .tph-most-recent-posts img,
.standard-page .entry-content .tph-most-recent-posts img {
    margin: 0;
}

@media (min-width: 1409px) {
    .single-post__content .tph-most-recent-posts__container,
    .standard-page .entry-content .tph-most-recent-posts__container {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Related posts - full site width (outside constrained container) */
.tph-related-posts {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.tph-related-posts .tph-most-recent-posts__container {
    max-width: 1408px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.tph-related-posts img {
    margin: 0;
}

@media (min-width: 1409px) {
    .tph-related-posts .tph-most-recent-posts__container {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Footer */
.site-footer {
    background-color: #303340 !important;
    background-image: none;
    color: #fff;
    margin-top: 10rem;
}

.home .site-footer{
    margin-top: 0;
}

.site-footer h2, .site-footer h3, .site-footer h4, .site-footer h5, .site-footer h6, .site-footer p{
    color: #fff;
}

.site-footer .container {
    padding: 10rem 0 15rem 0;
    width: 100%;
    max-width: 1408px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Match site horizontal padding when viewport is at or below 1408px */
@media (max-width: 1428px) {
    .site-footer .container {
        padding: 10rem 2rem 15rem 2rem;
    }
}

.site-footer__main {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 23.2rem; /* 232px (theme uses 62.5% root: 1rem = 10px) */
    align-items: start;
    width: 100%;
}

/* Footer Branding Section – flex column so copyright can sit at bottom; width matches design (578px) */
.site-footer__branding {
    max-width: 578px;
    display: flex;
    flex-direction: column;
}

.site-footer__logo {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
}

.site-footer__title {
    margin: 0;
    color: #fff;
    font-weight: 200;
    font-size: 2.8rem;
}

.site-footer__title strong {
    color: #fff;
    font-weight: 700;
}

.site-footer__powered-by {
    display: flex;
    align-items: center;
    padding: 0 0 0 1.7rem;
    gap: 1rem;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 300;
    flex-wrap: nowrap;
}

.site-footer__powered-by > span:first-child {
    white-space: nowrap;
}

.site-footer__powered-by-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 0;
    border-radius: 4px;
    flex-shrink: 0;
}

.site-footer__powered-by-logo img,
.site-footer__powered-by-logo .jcb-logo {
    height: 44px;
    width: auto;
    display: block;
}

.site-footer__powered-by-logo .jcb-text-logo {
    font-weight: 700;
    color: #303340;
    font-size: 1.2rem;
}

.site-footer__tagline {
    margin: 0 0 2.5rem 0;
    line-height: 1.5;
}

.site-footer__social {
    display: flex;
    gap: 2rem;
    margin-top: 0;
}

.site-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Footer Navigation Section */
.site-footer__navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5rem;
    min-width: 0;
}

/* Tablet/mid-size: reduce gap and balance footer so content fills width (must come after base styles) */
@media (max-width: 1200px) {
    .site-footer__main {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        gap: 4rem;
        width: 100%;
    }
    .site-footer__branding {
        min-width: 0;
    }
    .site-footer__navigation {
        gap: 2.5rem;
        min-width: 0;
    }
    .site-footer__nav-column {
        min-width: 0;
    }
    .site-footer__nav-title {
        white-space: normal;
        word-break: break-word;
    }
}

.site-footer__nav-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    p{
        font-weight: 400;
    }
}

.site-footer__nav-title {
    color: #fff;
    margin: 0 0 1.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: normal;
}

.site-footer__nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__nav-list li {
    margin-bottom: 0.75rem;
    font-size: 1.6rem;
}

.site-footer__nav-list a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer__nav-list a:hover {
    color: #fff;
}

/* Footer Copyright – fixed generous gap above to match design */
.site-footer__copyright {
    margin-top: 4rem;
    padding-top: 0;
    color: #999;
    font-size: 1.6rem;
}

/* Archive Description */
.archive-description {
    font-size: 1.1rem;
    color: #666;
    margin-top: 1rem;
}

/* Archive Description */
.archive-description {
    font-size: 1.1rem;
    color: #666;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header__nav-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        width: 100%;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-toggle {
        align-self: flex-end;
    }
    
    .search-form-wrapper {
        padding: 10rem 1.2rem 1.2rem;
    }
    
    .search-form-wrapper .search-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-form-wrapper .search-field,
    .search-form-wrapper .search-submit {
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-card__content {
        padding: 2rem;
    }

    
    /* Keep mobile header in one row (logo + Powered by JCB | hamburger) */
    .site-header__inner {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        justify-content: space-between;
    }

    .site-branding__link {
        flex-wrap: nowrap;
    }

    .site-branding__logo {
        max-width: 276px;
    }

    .site-footer__main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .site-footer__navigation {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Footer (mobile) – match compact design and site horizontal padding */
    .site-footer .container {
        padding: 3.2rem 1rem 3.8rem 1rem;
    }

    .site-footer__main {
        padding-bottom: 0;
        gap: 1.2rem;
    }

    .site-footer__branding {
        max-width: none;
    }

    .site-footer__logo {
        margin-bottom: 1.2rem;
        justify-content: space-between;
        width: 100%;
    }

    .site-footer__title {
        font-size: 2.0rem;
    }

    .site-footer__powered-by {
        font-size: 1.2rem;
    }

    .site-footer__powered-by-logo img,
    .site-footer__powered-by-logo .jcb-logo {
        height: 24px;
    }

    .site-footer__tagline,
    .site-footer__social {
        display: none;
    }

    .site-footer__copyright {
        margin-top: 0;
        padding-bottom: 0;
        font-size: 1.1rem;
        line-height: 1.4;
        color: #cfcfcf;
    }

    @media (max-width: 768px) {
        .site-footer__copyright p {
            padding: 3rem 0 1rem 0;
            font-size: 1.4rem;
            line-height: 1.4;
        }
    }

    /* Hide TOPICS + ABOUT on mobile; keep only KEY INFORMATION */
    .site-footer__navigation .site-footer__nav-column:nth-child(1),
    .site-footer__navigation .site-footer__nav-column:nth-child(2) {
        display: none;
    }

    /* Make KEY INFORMATION links flow in two columns */
    .site-footer__navigation .site-footer__nav-column:nth-child(3) .site-footer__nav-title {
        margin-top: 0.8rem;
        margin-bottom: 1.2rem;
        font-size: 1.1rem;
        letter-spacing: 0.06em;
    }

    .site-footer__navigation .site-footer__nav-column:nth-child(3) .site-footer__nav-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1.4rem;
        row-gap: 1.0rem;
    }

    .site-footer__navigation .site-footer__nav-column:nth-child(3) .site-footer__nav-list li {
        margin: 0;
        font-size: 1.3rem;
    }
    
    .site-footer__privacy-bar .container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .site-footer__privacy-link {
        justify-content: center;
    }
}

/* Custom Styles */

body {
    background-image: url('assets/images/parchment.webp');
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    background-attachment: fixed;
}

/* Header Styles - Contained Background with Rounded Corners */
.site-header {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 1rem 0 0;
}

.site-header .container {
    background: #fff;
    border-radius: 8px 0 8px;
    padding: 2rem 2rem;
    box-shadow: 8px 8px 20px 0px #97979740;
}

/* Decorative Image Styles */
/* Position relative to viewport, at site top */
#page {
    position: relative;
}

.decorative-image-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    max-width: 971px;
    z-index: 0;
    pointer-events: none;
    overflow: visible;
}

.decorative-image {
    max-width: 971px;
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Responsive adjustments for decorative image */
@media (max-width: 1024px) {
    .decorative-image-wrapper {
        max-width: 45vw;
    }
    
    .decorative-image {
        max-width: 450px;
    }
    
    article .entry-header,
    article .entry-content,
    article .single-post__header,
    article .single-post__content {
        padding-right: 280px;
    }
    
    /* Standard pages (e.g. Testimonials): no extra right padding – keeps layout even */
    .standard-page .entry-content {
        padding-right: 0;
    }
    
    .page-homepage .entry-content {
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .decorative-image-wrapper {
        position: absolute;
        max-width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 1.5rem;
    }
    
    .decorative-image {
        max-width: 200px;
    }
    
    article .entry-header,
    article .entry-content,
    article .single-post__header,
    article .single-post__content {
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    .decorative-image {
        max-width: 163px;
    }
}

/* Mobile nav: one header (real one) + white overlay below with menu only; no duplicate bar, no header shadow when open */
.mobile-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
    box-sizing: border-box;
}

body.is-mobile-nav-open .mobile-navigation {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s linear 0s;
}

/* When open: header sits on top of overlay, no box shadow */
body.is-mobile-nav-open .site-header {
    z-index: 2001;
}

body.is-mobile-nav-open .site-header .container {
    box-shadow: none;
}

/* Overlay = white bg + menu + search only; content starts below the real header (1rem + 10px + bar) */
.mobile-navigation__container {
    height: 100%;
    padding: calc(1rem + 10px + 2rem + 2rem + 2.5rem) 10px 2.4rem 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* No duplicate top bar – we use the real header only */
.mobile-navigation__top {
    display: none;
}

/* Menu content more in; extra top space below header */
.mobile-navigation__menu {
    margin-top: 2.5rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.mobile-navigation__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2.6rem;
    margin: 0;
    padding: 0;
}

.mobile-navigation__list a {
    color: #303340;
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1.25;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .mobile-navigation__list a:hover {
        color: #053b81;
    }
}

.mobile-navigation__list .current-menu-item > a {
    color: #053b81;
    font-weight: 600;
}

/* Mobile dropdown: parent row – link is primary (clickable); icon just rotates and expands submenu */
.mobile-navigation__list .menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.mobile-navigation__list .menu-item-has-children > a {
    flex: 1;
    min-width: 0;
    padding-right: 0.25rem;
}

.mobile-navigation__list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1.2rem;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    border-left: 2px solid rgba(5, 59, 129, 0.25);
    margin-left: 0.5rem;
}

.mobile-navigation__list .menu-item-has-children.is-open .sub-menu {
    max-height: 500px;
    padding-top: 0.6rem;
    padding-bottom: 0.4rem;
}

.mobile-navigation__list .sub-menu li {
    margin: 0 0 0.5rem 0;
}

.mobile-navigation__list .sub-menu li:last-child {
    margin-bottom: 0;
}

.mobile-navigation__list .sub-menu a {
    font-size: 1.75rem;
    font-weight: 400;
}

/* Dropdown toggle: icon-only, rotates open/closed; comfortable tap area, no CTA styling */
.nav-dropdown-toggle {
    flex-shrink: 0;
    min-width: 56px;
    width: 56px;
    height: 48px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: #303340;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus-visible {
    color: #053b81;
    background: none;
    outline: none;
}

.nav-dropdown-toggle:focus-visible {
    outline: 2px solid #053b81;
    outline-offset: 2px;
}

.nav-dropdown-toggle__icon {
    width: 12px;
    height: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -4px;
    transition: transform 0.25s ease;
}

.mobile-navigation__list .menu-item-has-children.is-open .nav-dropdown-toggle__icon {
    transform: rotate(-135deg);
    margin-top: 4px;
}

/* Hide dropdown toggle on desktop (hover only) */
.main-navigation .nav-dropdown-toggle {
    display: none;
}

.mobile-navigation__footer {
    margin-top: auto;
    padding-top: 2.4rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Mobile search is always visible in the overlay */
.mobile-navigation__search .search-form {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 0.8rem;
    align-items: center;
}

.mobile-navigation__search .search-field {
    width: 100%;
    padding: 1.1rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1.8rem;
    outline: none;
}

.mobile-navigation__search .search-field:focus {
    border-color: #053b81;
}

.mobile-navigation__search .search-submit {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    background: url('assets/images/search-icon.svg') no-repeat center;
    background-size: 18px 18px;
    background-color: transparent !important;
    color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

.mobile-navigation__search .search-submit:hover,
.mobile-navigation__search .search-submit:active,
.mobile-navigation__search .search-submit:focus {
    background-color: transparent !important;
}

/* Mobile menu toggle button + hamburger -> X animation */
.mobile-menu-toggle {
    background: none !important;
    border: none;
    cursor: pointer;
    padding: 0.8rem;
    display: none;
    align-items: center;
    justify-content: center;
    color: #053b81;
    line-height: 1;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:active,
.mobile-menu-toggle:focus,
.mobile-menu-toggle:focus-visible {
    background: none !important;
    transform: none;
    box-shadow: none;
    color: #053b81 !important; /* prevent global button:hover color:#fff making the X invisible */
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid #053b81;
    outline-offset: 4px;
}

.mobile-menu-icon {
    width: 30px;
    height: 22px;
    position: relative;
    display: block;
}

.mobile-menu-icon span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, top 0.25s ease, opacity 0.2s ease;
}

.mobile-menu-icon span:nth-child(1) { top: 0; }
.mobile-menu-icon span:nth-child(2) { top: 10px; }
.mobile-menu-icon span:nth-child(3) { top: 20px; }

/* One mobile nav: header stays visible with hamburger/X; close is the header toggle */
body.is-mobile-nav-open .mobile-menu-icon span:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
}

body.is-mobile-nav-open .mobile-menu-icon span:nth-child(2) {
    opacity: 0;
}

body.is-mobile-nav-open .mobile-menu-icon span:nth-child(3) {
    top: 10px;
    transform: rotate(-45deg);
}

/* Overflow hidden removes scrollbar and causes layout shift; JS adds padding-right to compensate */
body.is-mobile-nav-open {
    overflow: hidden;
}

/* Prevent background scroll while search overlay open */
body.is-search-open {
    overflow: hidden;
}

@media (max-width: 1024px) {
    /* 10px margin around the white header bar; two curved corners (top-left, bottom-right) */
    .site-header .container {
        margin: 10px;
        border-radius: 8px 0 8px 0;
    }

    /* Keep header as a single row on mobile: logo + Powered by JCB | hamburger */
    .site-header__inner {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        justify-content: space-between;
    }

    .site-header__nav-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 0.8rem;
        width: auto;
        flex-shrink: 0;
    }

    /* Single-line branding so hamburger stays on the right */
    .site-branding {
        min-width: 0;
        flex: 1 1 auto;
    }

    .site-branding__link {
        flex-wrap: nowrap;
        min-width: 0;
    }

    .site-branding__logo {
        max-width: 276px;
    }

    .site-branding__separator {
        height: 1.25rem;
        background-color: #053b81;
    }

    .site-branding__powered-by {
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .site-branding__jcb-logo {
        height: 2.4rem;
        flex-shrink: 0;
    }

    /* Hide desktop nav + header search icon; use overlay instead */
    .main-navigation {
        display: none;
    }

    .site-header__nav-wrapper > .search-toggle {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    /* Keep desktop search dropdown disabled on mobile (we show inline search in the overlay) */
    .search-form-wrapper {
        display: none;
    }
}

/* Contact Page - .page-homepage */
.page-id-40 .container{
    margin: 0 !important;
}
.contact-page .contact-content{
    border-radius: 8px 0 8px 0;
    box-shadow: 8px 8px 20px 0px #97979740;
}
.contact-page table td:first-child,
.contact-page table th:first-child {
    font-weight: 600;
}

.contact-page table td:last-child,
.contact-page table th:last-child {
    font-weight: 300;
}

.contact-page table,
.contact-page table td,
.contact-page table th,
.contact-page table tr,
.contact-page table thead,
.contact-page table tbody {
    border: none !important;
    border-collapse: collapse;
}

.contact-page table td,
.contact-page table th {
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* Contact Page - responsive table layout (Gutenberg Table block) */
.contact-page .wp-block-table table {
    width: 100%;
    table-layout: auto;
}

.contact-page .wp-block-table td:first-child,
.contact-page .wp-block-table th:first-child {
    width: 250px;
}

.contact-page .wp-block-table td:last-child,
.contact-page .wp-block-table th:last-child {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.contact-page .wp-block-table td:last-child:empty::before {
    content: "—";
    color: #999;
}

@media (max-width: 600px) {
    .contact-page .wp-block-table table,
    .contact-page .wp-block-table tbody,
    .contact-page .wp-block-table tr,
    .contact-page .wp-block-table td,
    .contact-page .wp-block-table th {
        display: block;
        width: 100%;
    }

    .contact-page .wp-block-table tr {
        padding: 1.2rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .contact-page .wp-block-table tr:last-child {
        border-bottom: none;
    }

    .contact-page .wp-block-table td,
    .contact-page .wp-block-table th {
        padding: 0.2rem 0;
    }

    .contact-page .wp-block-table td:first-child,
    .contact-page .wp-block-table th:first-child {
        margin-bottom: 0.2rem;
    }
}