/*
Theme Name: IOT Data Connect
Theme URI: https://iotdataconnect.com
Author: Angelus Ellis
Template: twentytwentyfive
Version: 1.0 Description: Custom child theme for IoT Data Connect. */

.center-img {
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-img img {
    display: block;
    margin: auto;
}

.wp-block-template-part {
    position: sticky;
    top: 0;
    z-index: 999999;
    overflow: visible !important;
}

/* Mobile: stack and force image first */
@media (max-width: 782px) {
    .wp-block-columns.reverse {
        flex-direction: column !important;
    }

    .wp-block-columns.reverse>.wp-block-column:first-child {
        order: 2;
    }

    /* text */
    .wp-block-columns.reverse>.wp-block-column:last-child {
        order: 1;
    }

    /* image */

    /* Make both columns full-width stacked */
    .wp-block-columns.reverse>.wp-block-column {
        flex-basis: auto !important;
        width: 100%;
    }

    .mobile-no-display {
        display: none !important;
        flex-basis: 0 !important;
        max-width: 0 !important;
    }
}


/* === IoT Data Connect - Contact Form 7 Styling === */

/* Main wrapper */
.wpcf7 {
    background: #fcfcfd;
    /* Off-white card */
    border: 1px solid #d1d9e0;
    /* Mid grey border */
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 0 auto;
}

/* Remove unwanted spacing inside paragraphs */
.wpcf7 p {
    margin: 0 0 1rem 0;
    padding: 0;
}

/* Hide hidden fieldset CF7 adds at the top */
.wpcf7 form fieldset.hidden-fields-container {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Labels */
.wpcf7 label {
    display: block;
    color: #2b2b2b;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

/* Input fields, selects, textarea */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea,
.wpcf7 select,
.wpcf7 input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    background: #ffffff;
    color: #2b2b2b;
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    margin: 0;
}

/* Reduce large default CF7 spacing */
.wpcf7-form-control-wrap {
    display: block;
    margin: 0;
}

/* Focus states */
.wpcf7 input:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
    border-color: #0072e0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 94, 184, 0.15);
}

/* Submit button */
.wpcf7 input[type="submit"] {
    background: #005eb8;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    display: inline-block;
}

.wpcf7 input[type="submit"]:hover {
    background: #0072e0;
}

.wpcf7 input[type="submit"]:active {
    background: #004a91;
    transform: scale(0.98);
}

/* === IoT Data Connect - Contact Form 7 Messages === */

/* Shared message style */
.wpcf7-response-output {
    margin-top: 1.25rem;
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    border-left: 5px solid transparent;
    transition: all 0.2s ease-in-out;
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInMessage 0.3s ease forwards;
}

/* Success */
.wpcf7 form.sent .wpcf7-response-output {
    background: #e8f1fc;
    border-color: #005eb8;
    color: #005eb8;
    box-shadow: 0 0 6px rgba(0, 94, 184, 0.1);
}

/* Validation error */
.wpcf7 form.invalid .wpcf7-response-output {
    background: #fffbe0;
    border-color: #ffc107;
    color: #2b2b2b;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.1);
}

/* Submission failed */
.wpcf7 form.failed .wpcf7-response-output {
    background: #fdeaea;
    border-color: #dc3545;
    color: #dc3545;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.1);
}

/* Spam or timeout */
.wpcf7 form.spam .wpcf7-response-output {
    background: #fffbe0;
    border-color: #ffc107;
    color: #2b2b2b;
}

@keyframes fadeInMessage {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Optional icon before messages */
.wpcf7 form.sent .wpcf7-response-output::before {
    content: "✓ ";
    font-weight: bold;
    margin-right: 4px;
}

.wpcf7 form.failed .wpcf7-response-output::before,
.wpcf7 form.invalid .wpcf7-response-output::before {
    content: "⚠ ";
    font-weight: bold;
    margin-right: 4px;
}


/* === Fix extra spacing above Contact Form 7 fields === */

/* Remove <br> spacing entirely */
.wpcf7 p br {
    display: none !important;
}

/* Tighten paragraph margins inside form */
.wpcf7 p {
    margin: 0 0 0.75rem 0 !important;
    padding: 0 !important;
}

/* Optional: slightly reduce top padding of the form wrapper */
.wpcf7 {
    padding-top: 0rem !important;
    /* was 2rem */
}

/* Adjust first label spacing if needed */
.wpcf7 label:first-of-type {
    margin-top: 0 !important;
}



/* === IoT Data Connect - Inline Field Validation Messages === */

/* Smaller red text for invalid required fields */
.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.25rem;
    display: block;
}

/* Highlight invalid input borders */
.wpcf7-not-valid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15) !important;
}

/* Hide default validation messages */
ul li[id^="wpcf7-f"][id*="-ve-"] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
}




/*  mobile full site styles  */
@media (max-width: 900px) {
    .mobile-reduced-padding {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    .mobile-no-padding {
        padding-left: 0px !important;
        padding-right: 0px !important;
    }
    .reverse-mobile {
        flex-direction: column-reverse;
    }
    .hide-on-mobile {
        display: none;
    }
}
@media (min-width: 900px) {
    .hide-on-desktop {
        display: none;
    }
}




/* ----------------------------------------
   Comparison Table Styling
   ---------------------------------------- */

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 16px;
    border: 2px solid #005EB8;
}

/* Header */
.comparison-table thead th {
    background: #005EB8;
    color: #ffffff;
    padding: 14px 10px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #005EB8;
}

/* Cells */
.comparison-table td {
    border: 1px solid #005EB8;
    padding: 12px 10px;
    vertical-align: middle;
}

/* First column (feature names) */
.comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
    background: #f8faff;
}

/* Tick/Partial/Empty columns */
.comparison-table td:not(:first-child) {
    text-align: center;
    width: 140px;
}

/* Row hover */
.comparison-table tbody tr:hover td {
    background: rgba(0, 94, 184, 0.08);
}

/* Make tick symbols look good */
.comparison-table td {
    font-size: 18px;
}

/* Optional: rounded corners */
.comparison-table {
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table td:contains("✓") {
    color: #2ecc71;
    font-weight: 700;
}

.comparison-table td:contains("~") {
    color: #f1c40f;
    font-weight: 700;
}

/* Mobile table container */
.comparison-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Prevent table from stretching layout */
.comparison-table {
    width: 100%;
    min-width: 700px; /* prevents squashing and breaking */
    border-collapse: collapse;
}


/* MOBILE: shrink table to 90% and center it */
@media (max-width: 768px) {

    .comparison-table-wrapper {
        width: 100%;
        display: flex;
        /* enables centering */
        justify-content: center;
        /* centers the table */
        overflow-x: auto;
        /* still scrollable if needed */
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table {
        width: 90% !important;
        /* shrink */
        min-width: unset !important;
        /* remove forced 700px width */
    }

    /* Reduce padding and font size to help it fit */
    .comparison-table th,
    .comparison-table td {
        padding: 10px 6px;
        font-size: 14px;
        white-space: normal;
        /* allow wrapping */
        word-break: break-word;
        /* force long words to wrap */
    }

    /* Tick column stays neat */
    .comparison-table td:last-child {
        width: 40px !important;
        text-align: center;
        font-size: 18px;
    }
}

.comparison-table td.tick {
    color: #005eb8;
    font-weight: 700;
}


/* Sticky A–Z sidebar inside glossary layout */
.sticky-az {
    position: sticky;
    top: 100px;
    /* adjust depending on your header height */
    align-self: flex-start;
    /* prevents stretching in flexbox */
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* scrolls to just above the anchor element to make up for the sticky header */
[id] {
    scroll-margin-top: 70px;
}
@media (max-width: 768px) {
    [id] {
            scroll-margin-top: 45px;
        }
}