/* FTS Customization – custom frontend styles */

.et_builder_inner_content .et_pb_section {
    padding: 0;
}

.et_pb_post_content p img {
    margin-block: 15px;
}

#main-content:has([class^="post-"]) {
    margin-bottom: 30px;
}

/* ================================================================
   Video / Image Wrapbox – structural layout (fts- prefix)
   ================================================================ */
.fts-wrapbox {
    position: relative;
    margin-bottom: 1.421em;
}

.fts-wrapbox-position-left  { float: left;  }
.fts-wrapbox-position-right { float: right; }

.fts-wrapbox-position-below,
.fts-wrapbox-position-centered {
    display: block;
}

.fts-wrapbox-inner {
    position: relative;
    overflow: hidden;
}

.fts-wrapbox-element {
    display: block;
    width: 100%;
}

/* ----------------------------------------------------------------
   YouTube / Vimeo embeds – responsive fluid 16:9
   The shortcode (shortcodes.php) always emits:
     <div class="fts-youtube fts-wrapbox …">
       <div class="fts-wrapbox-inner fts-ratio-style" style="padding-top:NN%">
         <iframe class="fts-wrapbox-element …"></iframe>
       </div>
     </div>
   No inline width/height on the outer div, so no !important needed.
   ---------------------------------------------------------------- */
.fts-youtube,
.fts-vimeo {
    display: block;
    width: 100%;
    margin: 1.5em auto;
}

.fts-youtube .fts-wrapbox-inner,
.fts-vimeo  .fts-wrapbox-inner {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%; /* fallback 16:9; inline style="padding-top:NN%" overrides */
    overflow: hidden;
}

.fts-youtube .fts-wrapbox-element,
.fts-vimeo  .fts-wrapbox-element,
.fts-youtube iframe,
.fts-vimeo  iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ================================================================
   Post featured image injected by fts_inject_featured_image
   ================================================================ */
.fts-featured-image-block {
    margin: 1.5em auto;
    text-align: center;
}

.fts-featured-image-block img,
.fts-post-featured-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* ================================================================
   Colour / border overrides (theme-independent)
   ================================================================ */
.fts-wrapbox-style-12 .fts-wrapbox-inner {
    background-color: #ffffff;
}

.fts-wrapbox-style-7 .fts-wrapbox-inner,
body .fts-table-style-2 tr td:nth-child(2n) {
    background-color: #f1f5f8;
}

.fts-wrapbox-style-2,
.fts-wrapbox-style-3,
.fts-wrapbox-style-6,
.fts-wrapbox-style-8,
.fts-wrapbox-style-9,
.fts-wrapbox-style-10 {
    border-color: #f1f5f8;
}

.fts-wrapbox-style-1,
.fts-wrapbox-style-4,
.fts-wrapbox-style-5,
.fts-wrapbox-style-7 {
    border: 1px solid #D2DAE1;
}

.shadow-box,
.fts-wrapbox-style-1 {
    box-shadow: 0 3px 0 0 rgba(98, 112, 128, 0.1);
    -moz-box-shadow: 0 3px 0 0 rgba(98, 112, 128, 0.1);
    -webkit-box-shadow: 0 3px 0 0 rgba(98, 112, 128, 0.1);
}

.fts-wrapbox-style-6 {
    box-shadow: 0 0 5px 3px rgba(98, 112, 128, 0.1);
    -moz-box-shadow: 0 0 5px 3px rgba(98, 112, 128, 0.1);
    -webkit-box-shadow: 0 0 5px 3px rgba(98, 112, 128, 0.1);
}

.img-responsive.img-circle.wp-post-image {
    margin: 0 auto;
}

.img-responsive {
    display: block;
    max-width: 100%;
    height: auto;
}

.rounded-corners {
    border-radius: 4px;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    overflow: hidden;
}

.fts-table thead th,
.fts-table-responsive .tabletolist.rh > li > .titles {
    font-weight: 300;
    font-size: 24px;
    line-height: 34px;
}


.fts-table {
    border: 1px solid #D2DAE1;
    border-radius: 4px;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    overflow: hidden;
}

.fts-table table {
    width: 100%;
}

.fts-table td {
    padding: 15px;
}

.fts-table thead th {
    padding: 15px;
    text-transform: uppercase;
}

.fts-table-style-2 tbody * + td,
.fts-table-style-2 tbody * + th {
    border-left: 1px solid #D2DAE1;
}

.fts-table-style-2 thead + tbody tr:first-child td,
.fts-table-style-2 thead + tbody tr:first-child th,
.fts-table-style-2 tbody tr + tr td,
.fts-table-style-2 tbody tr + tr th {
    border-top: 1px solid #D2DAE1;
}

.fts-table thead + tbody tr:first-child td {
    box-shadow: inset 0 3px 0 0 rgba(98, 112, 128, 0.1);
    -moz-box-shadow: inset 0 3px 0 0 rgba(98, 112, 128, 0.1);
    -webkit-box-shadow: inset 0 3px 0 0 rgba(98, 112, 128, 0.1);
}

@media (max-width: 768px) {
    .fts-table.fts-table-responsive {
        border: 0 none;
        box-shadow: none;
        -moz-box-shadow: none;
        -webkit-box-shadow: none;
        border-radius: 0;
        -moz-border-radius: 0;
        -webkit-border-radius: 0;
    }

    .fts-table-responsive .tabletolist,
    .fts-table-responsive .tabletolist > li > ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .fts-table-responsive .tabletolist > li > ul {
        display: table;
        width: 100%;
    }

    .fts-table-responsive .tabletolist > li > ul > li {
        display: table-row;
    }

    .fts-table-responsive .tabletolist .row_headers,
    .fts-table-responsive .tabletolist .row_data {
        display: table-cell;
        padding: 20px;
        vertical-align: middle;
    }

    .fts-table-responsive .tabletolist .row_headers {
        width: 30%;
    }

    .fts-table-responsive .tabletolist .row_data {
        width: 70%;
    }

    .fts-table-responsive .tabletolist.nrh > li > ul {
        margin-bottom: 1.421em;
    }

    .fts-table-responsive .tabletolist.rh > li > .titles {
        display: block;
        padding: 20px;
        text-align: center;
        text-transform: uppercase;
    }

    .fts-table-style-2 .tabletolist .row_headers {
        font-weight: bold;
    }
}

/* ================================================================
   et_pb_video_box fallback
   (Divi loads these only on pages built with Divi Builder;
    this ensures they are always available for shortcode-generated embeds)
   ================================================================ */
.et_pb_video_box {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 1.5em 0;
}
.et_pb_video_box iframe,
.et_pb_video_box object,
.et_pb_video_box embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ================================================================
   fts-tabs – vc_tta_tabs rendered as Divi-style tabs
   ================================================================ */
.fts-tabs {
    border: 1px solid #d9d9d9;
    margin: 1.5em 0;
}

.et_pb_post_content .fts-tabs .fts-tabs-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    background: #f5f5f5;
    border-bottom: 1px solid #d9d9d9;
}

.fts-tab-nav-item {
    margin: 0;
    list-style: none !important;
    padding: 0;
}

.fts-tab-nav-item a {
    display: block;
    padding: 14px 20px;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
    text-decoration: none;
    border-right: 1px solid #d9d9d9;
    transition: color 0.2s;
}
.fts-tab-nav-item a .fts-tta-icon {
    margin-right: 14px;
}

.fts-tab-nav-item.active {
    background: #fff;
}

.fts-tab-nav-item.active a,
.fts-tab-nav-item a:hover {
    color: #e02b20;
}

.fts-tabs-content {
    padding: 15px 20px 5px;
    background: #fff;
}

.fts-tab-panel {
    display: none;
}

.fts-tab-panel.active {
    display: block;
}

.fts-tab-panel > p:first-child:empty,
.fts-tab-panel > p:last-child:empty {
    display: none;
}

/* ================================================================
   Magnific Popup counter fix – prevent "1 / 11" from wrapping vertically
   ================================================================ */
.mfp-counter {
    display: inline-block !important;
    white-space: nowrap !important;
    font-size: 12px;
    line-height: 1.5;
}

/* ================================================================
   fts-media-grid – vc_media_grid rendered as a responsive CSS grid
   ================================================================ */
.fts-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 1.5em 0;
}

.fts-media-grid-item {
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 1 / 1;
}

.fts-media-grid-link {
    display: block;
    width: 100%;
    height: 100%;
}

.fts-media-grid-img,
.fts-media-grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.2s;
}

.fts-media-grid-link:hover .fts-media-grid-img,
.fts-media-grid-link:hover img {
    opacity: 0.85;
}

@media (max-width: 600px) {
    .fts-media-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}