/* ============================================================
   Polygon Capital — Custom Responsive Overrides
   Loaded after responsive.css to fix site-specific issues
   ============================================================ */

/* -----------------------------------------------------------
   Service process steps — reduce gap between timeline items
   ----------------------------------------------------------- */
.timeline-content {
    padding-bottom: 8px !important;
}
.timeline-item.last .timeline-content {
    padding-bottom: 0 !important;
}

/* -----------------------------------------------------------
   0. Inner page header — solid brand blue matching top bar
      (all pages except home which uses the revolution slider)
   ----------------------------------------------------------- */
.page-header.header-background {
    background-color: #3d7ef5;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}
.page-header.header-background.fp-overlay::before {
    background: rgba(0, 0, 0, 0.45) !important;
}
.page-header.header-background .bread-crumb a,
.page-header.header-background .bread-crumb li,
.page-header.header-background h1 {
    color: #ffffff !important;
    text-shadow: none;
}

/* -----------------------------------------------------------
   1. Flex stretch rows (Services grid on Home page)
      Replace inline display:flex so media-queries can override
   ----------------------------------------------------------- */
.fp-flex-stretch {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: stretch;
        -ms-flex-align: stretch;
            align-items: stretch;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
}

@media screen and (max-width: 767px) {
    .fp-flex-stretch {
        display: block;
    }
    .fp-flex-stretch > .column {
        margin-top: 25px !important;
    }
    .fp-flex-stretch > .column:first-child {
        margin-top: 0 !important;
    }
}

/* -----------------------------------------------------------
   2. Full-width Contact Map — responsive height
      The theme sets 693px; we want 450px desktop and smaller
      on mobile. The theme only adjusts for maps inside columns.
   ----------------------------------------------------------- */
.contact-map {
    height: 450px;
}
@media screen and (max-width: 767px) {
    .contact-map {
        height: 320px !important;
    }
}
@media screen and (max-width: 479px) {
    .contact-map {
        height: 240px !important;
    }
}

/* -----------------------------------------------------------
   3. Logo — scale down on very small screens
   ----------------------------------------------------------- */
@media screen and (max-width: 479px) {
    .logo .primary-logo,
    .logo .secondary-logo {
        max-height: 32px !important;
    }
}

/* -----------------------------------------------------------
   4. Prevent site-wide horizontal overflow on mobile
   ----------------------------------------------------------- */
body {
    overflow-x: hidden;
}
.site-container {
    overflow-x: hidden;
}

/* -----------------------------------------------------------
   4b. Justify paragraph text across all screen sizes
   ----------------------------------------------------------- */
p,
.post-content-container p,
.blog-content-paragraphs,
.blog-content-paragraphs p,
.item-content p,
.service-details p,
.contact-details-content p,
.features-list .item-content p,
.column p,
.row p,
.theme-page p,
.site-container p,
.content-box p,
.post-content p,
.timeline-content p,
.testimonial-content p,
.about-content p,
.service-content p,
.page-content p,
.entry-content p,
.section-content p {
    text-align: justify !important;
}

/* -----------------------------------------------------------
   4c. Justify list items with text content (service pages, about, home)
   ----------------------------------------------------------- */
li.template-check6 {
    text-align: justify !important;
}

/* -----------------------------------------------------------
   5. Ensure all images never exceed their container
   ----------------------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
}

/* -----------------------------------------------------------
   6. Responsive Revolution Slider text — prevent overflow
   ----------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .revolution-slider .tp-caption h2,
    .revolution-slider .tp-caption h4 {
        white-space: normal !important;
        word-break: break-word;
    }
}

/* -----------------------------------------------------------
   7. Footer column email/address — break long strings
   ----------------------------------------------------------- */
.footer-row .column-1-4 h5,
.footer-row .column-1-4 a {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* -----------------------------------------------------------
   8. Mobile: stack "more" button and phone box vertically
      (home/about about-section floated row)
   ----------------------------------------------------------- */
@media screen and (max-width: 479px) {
    .column-1-1 .more.float {
        float: none;
        display: inline-block;
        margin-right: 0;
        margin-bottom: 20px;
    }
    .column-1-1 .features-list.float {
        float: none;
        display: block;
        clear: both;
    }
}

/* -----------------------------------------------------------
   9. Contact map details box — don't overflow on mobile
   ----------------------------------------------------------- */
@media screen and (max-width: 479px) {
    .contact-map-details {
        width: 220px !important;
    }
    .contact-details-content {
        padding: 15px !important;
    }
}

/* -----------------------------------------------------------
  10. WhatsApp FAB & scroll-top — keep visible on all screens
   ----------------------------------------------------------- */
@media screen and (max-width: 479px) {
    .scroll-top.animated-element {
        right: 14px !important;
        bottom: 76px !important;
    }
}

/* -----------------------------------------------------------
  11. Slider counters top-row — uniform spacing on mobile
   ----------------------------------------------------------- */
@media screen and (max-width: 479px) {
    .slider-top-row {
        margin-top: 0 !important;
    }
}

/* -----------------------------------------------------------
  12. Blog / sidebar smart column — full width on mobile
   ----------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .fp-smart-column {
        margin-top: 40px;
    }
}

/* -----------------------------------------------------------
  13. Pagination — scale nicely on very narrow screens
   ----------------------------------------------------------- */
@media screen and (max-width: 479px) {
    .pagination {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
            flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }
}

/* -----------------------------------------------------------
  14. Services vertical menu in sidebar — readable on mobile
   ----------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .vertical-menu li a {
        padding: 18px 20px;
        word-break: break-word;
    }
}

/* -----------------------------------------------------------
  15. Google Map iframe — always fill its wrapper
   ----------------------------------------------------------- */
.contact-map iframe {
    width: 100% !important;
    display: block;
}
@media screen and (max-width: 767px) {
    .contact-map iframe {
        height: 320px !important;
    }
}
@media screen and (max-width: 479px) {
    .contact-map iframe {
        height: 240px !important;
    }
}

/* -----------------------------------------------------------
   16. Revolution Slider Banner Buttons — stack and space on mobile
   ----------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .revolution-slider .tp-static-layers {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        min-height: 320px;
        padding: 32px 16px 0 16px;
    }
    .revolution-slider .tp-static-layer {
        position: static !important;
        width: 100% !important;
        margin-bottom: 12px;
        text-align: left !important;
    }
    .revolution-slider .tp-static-layer .more,
    .revolution-slider .tp-static-layer .more.style-4 {
        display: block;
        width: 100%;
        max-width: 320px;
        margin-bottom: 10px;
        font-size: 1rem;
        text-align: center;
    }
}
@media screen and (max-width: 479px) {
    .revolution-slider .tp-static-layers {
        min-height: 220px;
        padding-top: 18px;
    }
    .revolution-slider .tp-static-layer .more,
    .revolution-slider .tp-static-layer .more.style-4 {
        max-width: 100%;
        font-size: 0.98rem;
    }
}

/* Add extra gap below text before first button in banner */
@media screen and (max-width: 767px) {
    .revolution-slider .tp-static-layer h4 {
        margin-bottom: 22px !important;
    }
}
@media screen and (max-width: 479px) {
    .revolution-slider .tp-static-layer h4 {
        margin-bottom: 18px !important;
    }
}

/* -----------------------------------------------------------
   17. Home hero final mobile correction
   ----------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .revolution-slider,
    .revolution-slider > ul,
    .revolution-slider > ul > li {
        height: 430px !important;
    }
    .revolution-slider .tp-static-layers {
        display: block !important;
        box-sizing: border-box;
        height: 430px !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        position: absolute !important;
        inset: 0 auto auto 0 !important;
        width: 100% !important;
    }
    .revolution-slider .tp-static-layer {
        position: absolute !important;
        width: 100% !important;
        max-width: 300px !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        text-align: left !important;
        white-space: normal !important;
    }
    .revolution-slider .tp-static-layer:nth-child(1) {
        top: 115px !important;
        left: 45px !important;
    }
    .revolution-slider .tp-static-layer:nth-child(2) {
        top: 205px !important;
        left: 45px !important;
    }
    .revolution-slider .tp-static-layer:nth-child(3) {
        top: 340px !important;
        left: 45px !important;
    }
    .revolution-slider .tp-static-layer:nth-child(4) {
        display: none !important;
    }
    .revolution-slider .tp-static-layer h2 {
        font-size: 22px !important;
        line-height: 28px !important;
        margin: 0 !important;
        white-space: normal !important;
    }
    .revolution-slider .tp-static-layer h4 {
        font-size: 16px !important;
        line-height: 23px !important;
        margin: 0 !important;
        white-space: normal !important;
    }
    .revolution-slider .tp-static-layer .more,
    .revolution-slider .tp-static-layer .more.style-4 {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: auto !important;
        min-width: 230px !important;
        max-width: 100% !important;
        min-height: 56px;
        margin: 0 !important;
        padding: 18px 24px !important;
        font-size: 15px !important;
        line-height: 20px !important;
        text-align: center;
    }
    .slider-top-row {
        margin-top: 0 !important;
    }
}
@media screen and (max-width: 479px) {
    .revolution-slider,
    .revolution-slider > ul,
    .revolution-slider > ul > li,
    .revolution-slider .tp-static-layers {
        height: 400px !important;
    }
    .revolution-slider .tp-static-layers {
        padding: 0 !important;
    }
    .revolution-slider .tp-static-layer {
        width: calc(100vw - 60px) !important;
        min-width: calc(100vw - 60px) !important;
        max-width: calc(100vw - 60px) !important;
    }
    .revolution-slider .tp-static-layer:nth-child(1) {
        top: 100px !important;
        left: 30px !important;
    }
    .revolution-slider .tp-static-layer:nth-child(2) {
        top: 178px !important;
        left: 30px !important;
    }
    .revolution-slider .tp-static-layer:nth-child(3) {
        top: 322px !important;
        left: 30px !important;
    }
    .revolution-slider .tp-static-layer .more,
    .revolution-slider .tp-static-layer .more.style-4 {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 15px !important;
    }
}

@media screen and (max-width: 767px) {
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-title {
        top: 115px !important;
        left: 45px !important;
    }
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-copy {
        top: 205px !important;
        left: 45px !important;
    }
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-primary {
        top: 340px !important;
        left: 45px !important;
    }
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-secondary {
        display: none !important;
    }
}

@media screen and (max-width: 479px) {
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-title {
        top: -28px !important;
        left: -15px !important;
    }
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-copy {
        top: -35px !important;
        left: -15px !important;
    }
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-primary {
        top: 18px !important;
        left: -15px !important;
    }
}

@media screen and (max-width: 340px) {
    .revolution-slider .tp-static-layer {
        width: calc(100vw - 40px) !important;
        min-width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
    }
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-title,
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-copy,
    .revolution-slider .tp-static-layers .tp-static-layer.fp-hero-primary {
        left: 10px !important;
    }
}
