/* =============================================================================
 * Cotton & Gates — Formspree contact form styling
 * Loaded site-wide via cgc-stabilization.php mu-plugin.
 * Targets only forms wrapped with .cgc-formspree (the intake + footer CTA forms).
 * ========================================================================== */

.cgc-formspree {
    max-width: 640px;
    margin: 0;
    font-family: inherit;
    color: #333;
    line-height: 1.5;
}

/* Tight per-field spacing. Divi's `.et_pb_text p` adds margin too — reset it. */
form.cgc-formspree p {
    margin: 0 0 0.65em 0 !important;
}

/* Reset Divi's default input/select/textarea bottom margin (commonly 22px+) */
form.cgc-formspree input,
form.cgc-formspree select,
form.cgc-formspree textarea {
    margin: 0 !important;
}

/* Specificity: Divi's `.et_pb_text` rules apply low-contrast gray to labels;
   `form.cgc-formspree label` + !important reliably wins. */
form.cgc-formspree label,
form.cgc-formspree fieldset legend {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25em;
    color: #1a1a1a !important;
    font-size: 0.95em;
    opacity: 1 !important;
}

.cgc-formspree input[type="text"],
.cgc-formspree input[type="email"],
.cgc-formspree input[type="tel"],
.cgc-formspree select,
.cgc-formspree textarea {
    width: 100%;
    padding: 0.75em 0.9em;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    color: #222;
    font-size: 1em;
    font-family: inherit;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Reset native select arrow then add a clean custom one */
.cgc-formspree select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='none' stroke='%23666' stroke-width='1.5' d='M1 1l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.85em center;
    background-size: 12px 8px;
    padding-right: 2.5em;
}

.cgc-formspree input:focus,
.cgc-formspree select:focus,
.cgc-formspree textarea:focus {
    border-color: #1e5fa3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 95, 163, 0.18);
}

.cgc-formspree textarea {
    min-height: 140px;
    resize: vertical;
}

form.cgc-formspree fieldset {
    border: none;
    padding: 0;
    margin: 0 0 0.65em 0 !important;
}

/* Stronger specificity for inline checkbox labels inside fieldsets */
form.cgc-formspree fieldset label {
    display: inline-block;
    font-weight: normal !important;
    margin-right: 1.5em;
    margin-bottom: 0;
    cursor: pointer;
    color: #1a1a1a !important;
    opacity: 1 !important;
}

.cgc-formspree input[type="checkbox"] {
    margin-right: 0.5em;
    vertical-align: middle;
    width: auto;
    transform: scale(1.1);
}

/* Disclaimer / consent — quieter typography but still readable contrast.
   Use stronger specificity to beat Divi's faded label color. */
form.cgc-formspree .cgc-formspree__disclaimer label,
form.cgc-formspree .cgc-formspree__consent {
    display: block;
    font-weight: normal !important;
    font-size: 0.9em;
    line-height: 1.5;
    color: #3a3a3a !important;
    cursor: pointer;
    padding: 0.25em 0;
    opacity: 1 !important;
}

/* Slight margin override so the disclaimer paragraph is closer to the
   field above and the submit below */
form.cgc-formspree p.cgc-formspree__disclaimer {
    margin-top: 0.4em !important;
    margin-bottom: 0.65em !important;
}

.cgc-formspree__disclaimer label input[type="checkbox"],
.cgc-formspree__consent input[type="checkbox"] {
    float: left;
    margin-top: 0.2em;
    margin-right: 0.7em;
}

.cgc-formspree__disclaimer label::after,
.cgc-formspree__consent::after {
    content: "";
    display: block;
    clear: both;
}

.cgc-formspree .cgc-req {
    color: #c0392b;
    font-weight: bold;
    margin-left: 0.15em;
}

/* Submit button — Divi-aligned, professional */
.cgc-formspree__submit {
    display: inline-block;
    padding: 0.85em 2.5em;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background-color: #1e5fa3;
    border: 2px solid #1e5fa3;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.cgc-formspree__submit:hover,
.cgc-formspree__submit:focus {
    background-color: #154577;
    border-color: #154577;
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.cgc-formspree__submit:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Compact CTA variant — narrower, tighter, but same idiom */
.cgc-formspree--cta {
    max-width: 480px;
}

.cgc-formspree--cta p:first-of-type {
    font-size: 1.05em;
    color: #2a2a2a;
    margin-bottom: 1em;
}

.cgc-formspree--cta input[type="text"],
.cgc-formspree--cta input[type="email"],
.cgc-formspree--cta input[type="tel"] {
    padding: 0.65em 0.85em;
}

/* Honor parent context: footer's dark background, lighten the text labels */
[class*="footer"] .cgc-formspree label,
.et_pb_section[admin_label*="FOOTER"] .cgc-formspree label,
.et_pb_section[admin_label*="footer"] .cgc-formspree label {
    color: #f0f0f0;
}

[class*="footer"] .cgc-formspree__consent,
.et_pb_section[admin_label*="FOOTER"] .cgc-formspree__consent,
.et_pb_section[admin_label*="footer"] .cgc-formspree__consent {
    color: #d0d0d0;
}

/* Mobile */
@media (max-width: 640px) {
    .cgc-formspree {
        margin: 1em 0;
    }
    .cgc-formspree label,
    .cgc-formspree fieldset legend {
        font-size: 1em;
    }
    .cgc-formspree__submit {
        width: 100%;
        text-align: center;
    }
    .cgc-formspree fieldset label {
        display: block;
        margin-right: 0;
        margin-bottom: 0.5em;
    }
}

/* =============================================================================
 * CTA block — replaces the duplicate footer contact form. Single prominent
 * button + phone number, centered. Lives in footer's "Contact Our Law Firm"
 * section but easily reusable elsewhere if needed.
 * ========================================================================== */
.cgc-cta-block {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 0.5em 1em;
}

.cgc-cta-block .cgc-cta-block__lead {
    font-size: 1.15em !important;
    font-weight: 500;
    color: #2a2a2a !important;
    margin: 0 0 1em 0 !important;
    line-height: 1.45;
    opacity: 1 !important;
}

.cgc-cta-block .cgc-cta-block__action {
    margin: 0 0 1em 0 !important;
}

.cgc-cta-block .cgc-cta-block__phone {
    margin: 0 !important;
    font-size: 0.95em;
    color: #555 !important;
    opacity: 1 !important;
}

.cgc-cta-block .cgc-cta-block__phone a {
    font-weight: 600;
    color: #1e5fa3;
    text-decoration: none;
}

.cgc-cta-block .cgc-cta-block__phone a:hover {
    text-decoration: underline;
}

a.cgc-cta-button {
    display: inline-block;
    padding: 0.95em 2.5em;
    font-size: 1em;
    font-weight: 600;
    color: #fff !important;
    background-color: #1e5fa3;
    border: 2px solid #1e5fa3;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none !important;
    line-height: 1.2;
}

a.cgc-cta-button:hover,
a.cgc-cta-button:focus {
    background-color: #154577;
    border-color: #154577;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

a.cgc-cta-button:active {
    transform: translateY(0);
    box-shadow: none;
}

@media (max-width: 640px) {
    a.cgc-cta-button {
        display: block;
        max-width: 320px;
        margin: 0 auto;
    }
}

/* =============================================================================
 * Footer text-alignment backstop. Divi 4.16 modules with text_orientation
 * sometimes don't render with the expected et_pb_text_align_center class
 * after a Divi version upgrade. This block forces center alignment on the
 * footer's column text modules — body text (paragraphs, spans) included.
 * ========================================================================== */

/* "Contact Our Law Firm" heading + the CTA block beneath it (text_0 + text_1) */
.et_pb_text_0_tb_footer,
.et_pb_text_0_tb_footer .et_pb_text_inner,
.et_pb_text_0_tb_footer h1,
.et_pb_text_0_tb_footer h2,
.et_pb_text_0_tb_footer h3,
.et_pb_text_1_tb_footer,
.et_pb_text_1_tb_footer .et_pb_text_inner,
.et_pb_text_1_tb_footer p {
    text-align: center !important;
}

/* "Office Address" heading + address paragraph (text_2 + text_3) */
.et_pb_text_2_tb_footer,
.et_pb_text_2_tb_footer .et_pb_text_inner,
.et_pb_text_2_tb_footer h1,
.et_pb_text_2_tb_footer h2,
.et_pb_text_2_tb_footer h3,
.et_pb_text_3_tb_footer,
.et_pb_text_3_tb_footer .et_pb_text_inner,
.et_pb_text_3_tb_footer p,
.et_pb_text_3_tb_footer span {
    text-align: center !important;
}

/* "Connect With Us" heading (text_4) */
.et_pb_text_4_tb_footer,
.et_pb_text_4_tb_footer .et_pb_text_inner,
.et_pb_text_4_tb_footer h1,
.et_pb_text_4_tb_footer h2,
.et_pb_text_4_tb_footer h3 {
    text-align: center !important;
}

/* "Office Numbers" heading + Phone + Fax paragraphs (text_5, text_6, text_7) */
.et_pb_text_5_tb_footer,
.et_pb_text_5_tb_footer .et_pb_text_inner,
.et_pb_text_5_tb_footer h1,
.et_pb_text_5_tb_footer h2,
.et_pb_text_5_tb_footer h3,
.et_pb_text_6_tb_footer,
.et_pb_text_6_tb_footer .et_pb_text_inner,
.et_pb_text_6_tb_footer p,
.et_pb_text_6_tb_footer span,
.et_pb_text_7_tb_footer,
.et_pb_text_7_tb_footer .et_pb_text_inner,
.et_pb_text_7_tb_footer p,
.et_pb_text_7_tb_footer span {
    text-align: center !important;
}

/* "Closing Appeal" CTA — "Put a strong advocate on your side. Call 850-651-9900" (text_8) */
.et_pb_text_8_tb_footer,
.et_pb_text_8_tb_footer .et_pb_text_inner,
.et_pb_text_8_tb_footer h1,
.et_pb_text_8_tb_footer h2,
.et_pb_text_8_tb_footer h3,
.et_pb_text_8_tb_footer p {
    text-align: center !important;
}

/* =============================================================================
 * Footer 3-column row vertical alignment
 * Row 2 has Office Address / Connect With Us / Office Numbers columns. Each
 * column has different inner-content height (address vs social icons vs phone),
 * which left the gold buttons (Map & Directions / Review Us) at different
 * vertical positions. Make each column a flex-column so the button (or last
 * child) gets pushed to the bottom uniformly across the row.
 * ========================================================================== */
@media (min-width: 981px) {
    .et_pb_row_2_tb_footer {
        align-items: stretch !important;
    }
    .et_pb_row_2_tb_footer > .et_pb_column {
        display: flex !important;
        flex-direction: column !important;
    }
    /* Push the bottom-most button-wrapper (or social-follow + button stack)
       to the bottom of its column for a clean baseline alignment. */
    .et_pb_row_2_tb_footer > .et_pb_column > .et_pb_button_module_wrapper:last-child {
        margin-top: auto !important;
    }
}

/* Tighten the Office Numbers column — Phone + Fax shouldn't have big vertical gaps */
.et_pb_text_6_tb_footer p,
.et_pb_text_7_tb_footer p {
    margin: 0.25em 0 !important;
}

/* Match heading rhythm across the 3 footer columns. text_2 (Office Address) had
 * less bottom padding than text_4 (Connect With Us) / text_5 (Office Numbers).
 * Force consistent spacing below each H3 heading in row 2. */
.et_pb_text_2_tb_footer .et_pb_text_inner h3,
.et_pb_text_4_tb_footer .et_pb_text_inner h3,
.et_pb_text_5_tb_footer .et_pb_text_inner h3 {
    margin-bottom: 0.6em !important;
    line-height: 1.25 !important;
}

/* =============================================================================
 * Homepage practice-area grid
 *
 * Native replacement for the deprecated Modula gallery (post 48848). Lives in
 * an et_pb_code module on the home page (post 12). Uses CSS Grid with !important
 * on the layout properties because Divi's reset/normalizer rules can otherwise
 * strip `display: grid` from raw markup inside et_pb_code at certain viewports.
 * ========================================================================== */
.cgc-practice-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    list-style: none !important;
    max-width: 1100px;
}
/* WordPress's wpautop filter can inject <br> tags between block-level
 * children of et_pb_code modules whenever there is whitespace between the
 * tiles in the post_content. CSS Grid would otherwise treat each <br> as an
 * additional grid item, breaking the layout into a 2-1-2-1 pattern. */
.cgc-practice-grid > br {
    display: none !important;
}
.cgc-practice-grid .cgc-practice-grid__tile {
    display: block !important;
    position: relative !important;
    overflow: hidden !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cgc-practice-grid .cgc-practice-grid__tile:hover,
.cgc-practice-grid .cgc-practice-grid__tile:focus {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
    text-decoration: none !important;
    color: #fff !important;
}
.cgc-practice-grid .cgc-practice-grid__img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: opacity 0.25s ease;
}
.cgc-practice-grid .cgc-practice-grid__tile:hover .cgc-practice-grid__img {
    opacity: 0.78;
}
.cgc-practice-grid .cgc-practice-grid__caption {
    position: absolute !important;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 20px !important;
    margin: 0 !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.78) 65%, rgba(0, 0, 0, 0.92) 100%);
}
.cgc-practice-grid .cgc-practice-grid__title {
    margin: 0 0 6px !important;
    padding: 0 !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    color: #fff !important;
}
.cgc-practice-grid .cgc-practice-grid__desc {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #f1f1f1 !important;
}

@media (max-width: 980px) {
    .cgc-practice-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .cgc-practice-grid .cgc-practice-grid__title {
        font-size: 20px !important;
    }
}
@media (max-width: 600px) {
    .cgc-practice-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}
