/* HubSpot-Ready Contact Form Styling for Walt Opie Meditation Teacher */
/* Brand Colors: Primary #8B4513, Secondary #2E8B57, Accent #DAA520, Neutral #6B7280 */

/* ROOT CAUSE FIX: Reduced padding and improved spacing integration with WordPress blocks */
.meditation-contact-form-wrapper {
    max-width: 600px;
    margin: 0 auto 2rem auto; /* Added bottom margin for proper block spacing */
    padding: 1.5rem; /* Reduced from 2rem to better integrate with content flow */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(139, 69, 19, 0.15);
}

/* Form Layout - ROOT CAUSE FIX: Improved element spacing and positioning */
.form-row {
    margin-bottom: 1.25rem; /* Reduced from 1.5rem for tighter spacing */
}

.form-row-split {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem; /* Consistent spacing with other form rows */
}

.form-col-half {
    flex: 1;
    min-width: 0; /* Prevent flex overflow issues */
}

/* Improve spacing between form intro and first form field */
.meditation-intro + .wpcf7 {
    margin-top: 1.5rem; /* Reduced from 2rem to bring form closer to intro */
}

/* Better spacing for form sections - handled below in dedicated newsletter section */

/* Labels */
.meditation-contact-form-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--wp--preset--color--primary, #8B4513);
    font-weight: 600; /* Increased from 500 for better visual hierarchy */
    font-size: 1rem; /* Slightly larger for better readability */
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #fefefe;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--wp--preset--color--secondary, #2E8B57);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
}

/* Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Select Dropdown */
select.form-control {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23555' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 0.75rem auto; /* Slightly larger dropdown arrow */
    padding-right: 2.5rem;
}

/* Checkbox Styling */
.newsletter-signup {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.newsletter-signup .wpcf7-form-control-wrap {
    flex-shrink: 0;
    margin-top: 0.25rem; /* Better vertical alignment with text baseline */
    order: 1; /* Ensure checkbox appears first */
}

.newsletter-checkbox {
    accent-color: var(--wp--preset--color--secondary, #2E8B57);
    margin: 0 !important;
    width: 18px;
    height: 18px;
}

.newsletter-signup label {
    color: var(--wp--preset--color--neutral, #6B7280);
    font-size: 0.95rem; /* Slightly larger for better readability */
    margin-bottom: 0 !important;
    cursor: pointer;
    line-height: 1.4;
    flex: 1;
    font-weight: 500; /* Make newsletter text more prominent */
    order: 2; /* Ensure label appears after checkbox */
    margin-left: 0.5rem; /* Add space between checkbox and label */
}

/* Contact Form 7 specific checkbox wrapper fixes */
.newsletter-signup .wpcf7-acceptance {
    display: flex;
    margin: 0;
    align-items: flex-start;
}

.newsletter-signup .wpcf7-list-item {
    margin: 0 !important;
    display: flex;
    align-items: flex-start;
}

/* Ensure proper checkbox positioning */
.form-row.newsletter-signup {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 69, 19, 0.1);
}

.form-row.newsletter-signup p {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
}

/* Submit Button */
.meditation-submit-btn {
    background: linear-gradient(135deg, var(--wp--preset--color--primary, #8B4513), var(--wp--preset--color--secondary, #2E8B57));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(139, 69, 19, 0.2);
    min-width: 140px;
    display: block; /* Make button a block element for centering */
    margin: 1.5rem auto 0 auto; /* Center the button with top margin */
}

.meditation-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.3);
    background: linear-gradient(135deg, var(--wp--preset--color--secondary, #2E8B57), var(--wp--preset--color--primary, #8B4513));
}

.meditation-submit-btn:active {
    transform: translateY(0);
}

/* Success/Error Messages */
.wpcf7-response-output {
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.wpcf7-mail-sent-ok {
    background: rgba(46, 139, 87, 0.1);
    border: 1px solid rgba(46, 139, 87, 0.3);
    color: var(--wp--preset--color--secondary, #2E8B57);
}

.wpcf7-mail-sent-ng, .wpcf7-validation-errors {
    background: rgba(207, 46, 46, 0.1);
    border: 1px solid rgba(207, 46, 46, 0.3);
    color: #cf2e2e;
}

/* Form Validation */
.wpcf7-not-valid {
    border-color: #cf2e2e !important;
    box-shadow: 0 0 0 3px rgba(207, 46, 46, 0.1) !important;
}

.wpcf7-not-valid-tip {
    color: #cf2e2e;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Mobile Responsiveness - ROOT CAUSE FIX: Improved mobile spacing and touch targets */
@media (max-width: 768px) {
    .meditation-contact-form-wrapper {
        padding: 1.25rem 1rem; /* Optimized mobile padding */
        margin: 1rem 0.5rem 2rem 0.5rem; /* Better mobile margins */
    }

    .form-row-split {
        flex-direction: column;
        gap: 0;
        margin-bottom: 1rem; /* Reduced mobile spacing */
    }

    .form-col-half {
        margin-bottom: 1.25rem; /* Consistent with updated form-row spacing */
    }

    .meditation-submit-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem; /* Larger text for better mobile UX */
    }

    /* Mobile-specific contact page fixes */
    .page-id-26 .wp-block-post-content .meditation-contact-form-wrapper {
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }

    /* Better mobile typography for form labels */
    .meditation-contact-form-wrapper label {
        font-size: 1rem; /* Slightly larger on mobile */
    }

    /* Improved mobile touch targets for form controls */
    .form-control {
        padding: 0.875rem; /* Larger touch target */
        font-size: 1rem; /* Prevent zoom on iOS */
    }
}

/* Meditation Theme Enhancements */
.meditation-contact-form-wrapper::before {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--wp--preset--color--primary, #8B4513), var(--wp--preset--color--accent, #DAA520));
    margin: 0 auto 2rem auto;
    border-radius: 2px;
}

/* Loading State */
.wpcf7-form.submitting .meditation-submit-btn {
    opacity: 0.7;
    cursor: not-allowed;
}

.wpcf7-form.submitting .meditation-submit-btn::after {
    content: " Sending...";
}

/* HOME PAGE TEMPLATE STRUCTURE FOR CONTACT PAGE */
/* Implementing same hero section as home page with proper spacing */

/* Hero section - gray background matching home page */
.page-id-26 main {
    background-color: #f9fafb !important;
    padding: 5rem 1rem !important;
    text-align: center !important;
    margin-top: 0 !important;
}

/* Contact title - matching home page Walt Opie heading style */
.page-id-26 .wp-block-post-title {
    font-family: Manrope, sans-serif !important;
    font-size: 3.5rem !important;
    font-weight: 300 !important;
    color: #8b4513 !important;
    margin-bottom: 2rem !important;
    background: none !important;
    padding: 0 !important;
}

/* Walt's photo - matching home page photo styling */
.page-id-26 .walt-photo {
    width: 280px;
    border-radius: 12px;
    margin: 0 auto 2rem auto;
    display: block;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Connect with Walt Opie - matching home page subtitle style */
.page-id-26 .meditation-page-title {
    font-family: Manrope, sans-serif !important;
    font-size: 1.25rem !important;
    color: #9ca3af !important;
    margin-bottom: 2rem !important;
    font-weight: 400 !important;
    margin-top: 0 !important;
    text-align: center !important;
}

/* Intro text - matching home page description */
.page-id-26 .meditation-intro {
    font-family: Manrope, sans-serif !important;
    font-size: 1.125rem !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    max-width: 600px !important;
    margin: 0 auto 3rem auto !important;
    text-align: center !important;
}

/* Contact form section - white background like home page secondary section */
.page-id-26 .wp-block-post-content {
    background-color: white !important;
    padding: 4rem 1rem !important;
    margin-top: 0 !important;
    text-align: center !important;
}

/* JavaScript-injected photo styling */
.page-id-26 .contact-walt-photo {
    width: 280px;
    border-radius: 12px;
    margin: 0 auto 2rem auto;
    display: block;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Fix WordPress block spacing conflicts with contact form */
.page-id-26 .wp-block-post-content .meditation-contact-form-wrapper {
    margin-top: 1rem; /* Controlled spacing from intro text */
    margin-bottom: 3rem; /* Proper spacing to "Other Ways to Connect" */
}

/* Ensure consistent background band flow */
.page-id-26 h1.wp-block-post-title {
    padding-bottom: 1rem; /* Reduced from 2rem to eliminate gap */
}

/* Fix block spacing around "Other Ways to Connect" section */
.page-id-26 .meditation-section-title {
    margin-top: 3rem !important; /* Increased from 2rem for better separation */
    margin-bottom: 1.5rem !important;
    text-align: center; /* Center align to match page layout */
    color: var(--wp--preset--color--primary, #8B4513);
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 500;
}

/* Improve spacing for contact methods columns */
.contact-methods.wp-block-columns {
    margin-top: 1rem;
    margin-bottom: 2rem;
    max-width: 700px; /* Match the intro text width for visual consistency */
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
}

/* Ensure two-column layout is properly centered */
.contact-methods .wp-block-columns-is-layout-flex {
    justify-content: center !important;
    gap: 2rem !important;
}

/* Better spacing for contact method items */
.contact-methods .wp-block-column {
    text-align: center !important; /* Center align column content */
    padding: 1.5rem 1rem; /* Add padding for better visual separation */
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(139, 69, 19, 0.1);
    flex: 1 1 300px; /* Ensure columns are evenly distributed */
    max-width: 320px; /* Prevent columns from getting too wide */
}

.contact-methods .wp-block-column h4 {
    margin-bottom: 0.75rem;
    color: var(--wp--preset--color--primary, #8B4513);
    font-weight: 600;
    margin-top: 0;
}

.contact-methods .wp-block-column p {
    margin-bottom: 0;
    line-height: 1.5;
    color: var(--wp--preset--color--neutral, #6B7280);
}

/* Enhance email link styling */
.contact-methods a[href^="mailto:"] {
    color: var(--wp--preset--color--secondary, #2E8B57);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-methods a[href^="mailto:"]:hover {
    color: var(--wp--preset--color--primary, #8B4513);
    text-decoration: underline;
}

/* Improve meditation blessing alignment and spacing */
.page-id-26 .meditation-blessing {
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--wp--preset--color--primary, #8B4513);
    font-style: italic;
}

/* Ensure meditation divider is properly centered */
.page-id-26 .meditation-divider {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    border-color: rgba(139, 69, 19, 0.2);
}

/* High specificity overrides for contact methods alignment */
.page-id-26 .contact-methods.wp-block-columns.is-layout-flex {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 2rem !important;
    margin: 1rem auto 2rem auto !important;
    max-width: 700px !important;
}

.page-id-26 .contact-methods .wp-block-column.is-layout-flow {
    text-align: center !important;
    flex: 1 1 300px !important;
    max-width: 320px !important;
}

/* Mobile responsive improvements for contact methods */
@media (max-width: 768px) {
    .contact-methods .wp-block-column {
        margin-bottom: 1rem;
        padding: 1.25rem 0.75rem;
        max-width: 100% !important;
    }

    .page-id-26 .meditation-intro {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .contact-methods.wp-block-columns {
        padding: 0 1rem;
        flex-direction: column !important;
    }

    .page-id-26 .contact-methods.wp-block-columns.is-layout-flex {
        flex-direction: column !important;
        gap: 1rem !important;
    }
}