/* Define the primary light blue colour for reuse */
:root {
    --pbuk-blue-light: #79D3F6;
    --pbuk-text-dark: #333; /* Darker text for headings/icons */
    --pbuk-text-medium: #555; /* Medium text for body/links */
    --pbuk-text-black: #000000; /* Black for max contrast on buttons */
}

/* --- CONTACT PAGE SPECIFIC STYLES --- */

/* Hero Section Styles (unchanged) */
#hero {
    background: url('https://postboxesukltd.co.uk/images/contactusheader.png') no-repeat center center; 
    background-size: cover;
    position: relative;
    padding: 100px 0; 
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); 
    z-index: 1;
}

#hero .wrapper, #contact-page-intro {
    position: relative;
    z-index: 2;
}

#hero .wrapper { 
    text-align: center; 
}

#contact-page-intro h1 { 
    font-size: 3em;
    color: white;
}

/* Hero Description Styling and Alignment */
.header-description-container {
    text-align: center
}

.header-description-container p {
    font-size: 1em; /* FIXED: Larger text size */
    color: white; /* FIXED: Ensures text is white */
    line-height: 1.2;
    font-weight: 500;
    margin-left: auto;
    margin-right: auto;
    max-width: 90%; /* Keeps the line length readable if the text is long */
}

/* --- CRITICAL WIDTH AND INDENTATION FIXES --- */

/* 1. Set max width and centering for the entire content block. 
   We use 1200px and !important to match and override the max-width: 1200px set on .wrapper in main.css. */
#contact-page-wrapper {
    max-width: 1200px !important; 
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 2. CRITICAL FIX: Zero out inherited -15px margins from the top-level .row class. 
   This ensures the content fits perfectly inside the 1200px wrapper. */
#contact-page-wrapper .contact-content-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 3. CRITICAL FIX: Custom padding to create gutter while keeping outer edges flush */
/* Left Column: Outer edge flush (left: 0), Gutter (right: 15px) */
.contact-panel-container {
    padding-left: 0 !important;
    padding-right: 15px !important; /* REINTRODUCED: 15px padding on the right for the gutter */
    margin-bottom: 0 !important;
}

/* Right Column: Gutter (left: 15px), Outer edge flush (right: 0) */
.form-panel-container {
    padding-left: 15px !important; /* REINTRODUCED: 15px padding on the left for the gutter */
    padding-right: 0 !important;
    margin-bottom: 10px !important; /* FIXED: Reduced the external margin from 40px to 10px */
}


/* --- Contact Information Panel (Left Column) --- */


.contact-panel {
    background-color: #f5f5f5;
    padding: 30px; /* CORRECT: Padding is correct */
    border-radius: 4px; 
    margin-bottom: 0; 
    height: auto; 
}

.contact-panel h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--pbuk-text-black); /* FIXED: Ensures the title is BLACK */
    padding-bottom: 0;
    margin-bottom: 25px; /* FIXED: Increased space below the title */
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px; /* FIXED: Doubled the vertical gap */
}

/* --- FONT AWESOME ICON FIX (Subtle and smaller) --- */
.contact-detail i {
    font-size: 1.1em;
    color: #999; /* FIXED: Subtler grey colour for icons */
    margin-right: 15px; 
    width: 15px; 
    text-align: center;
    padding-top: 2px; 
}

.contact-detail p {
    font-size: 1.0em; 
    line-height: 1.4;
    color: var(--pbuk-text-medium);
    margin: 0; 
}

.contact-detail p a {
    color: var(--pbuk-text-medium) !important; 
    text-decoration: none !important;
    transition: color 0.2s;
}

.contact-detail p a:hover {
    color: var(--pbuk-blue-light) !important;
}

.contact-panel .contact-detail:last-of-type {
    padding-bottom: 0; 
    margin-bottom: 0; 
    border-bottom: none;
}

.contact-panel hr {
    height: 1px;
    background-color: #DDDDDD; /* FIXED: Set to desired line colour */
    border: none;
    margin-top: 60px; /* FIXED: Doubled space above the line (30px -> 60px) */
    margin-bottom: 30px;
    width: 100%;
}

.project-cta {
    padding-top: 0; 
}

.project-cta p:first-child { 
    font-size: 1.0em;
    font-weight: 700;
    color: var(--pbuk-text-medium);
    margin-bottom: 12px; 
}

.project-cta p strong {
    font-weight: 700; 
}

.project-cta p {
    font-size: 1.0em; 
    line-height: 1.4;
    color: var(--pbuk-text-medium); 
    margin-bottom: 18px; 
}

.project-cta p:last-child {
    margin-bottom: 0;
}

/* --- BUTTON STYLING (Targeted with high specificity) --- */

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-transform: none; 
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    text-decoration: none;
    box-sizing: border-box; 
    line-height: 1.2; 
}

.project-cta-button {
    background-color: var(--pbuk-blue-light);
    border: none;
    color: white; 
    text-transform: none; 
    font-weight: 500; 
    padding: 10px 20px; 
}

.project-cta-button:hover {
    background-color: var(--pbuk-text-dark); 
    color: white; 
}


.btn-solid-fill {
    background-color: var(--pbuk-blue-light);
    border: none; 
    color: white; 
    text-transform: none;
    font-weight: 500;
    padding: 10px 20px;
}

.btn-solid-fill:hover {
    background-color: var(--pbuk-text-dark);
    border-color: var(--pbuk-text-dark);
    color: white;
}

/* Form Panel (Right Column) - Removed height matching */

.form-container {
    padding: 30px;
    border-radius: 4px;
    border: 1px solid #ddd; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); 
    height: auto; /* Ensure height is content-driven */
    padding-bottom: 0px !important; /* Keeps container padding tight */
}

/* Form Title and Intro */
.form-panel-title { 
    font-size: 1.8em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    border-bottom: 2px solid var(--pbuk-blue-light); 
    display: inline-block;
    padding-bottom: 5px;
}

.form-intro {
    font-size: 0.95em;
    color: #777;
    margin-bottom: 20px; 
}

/* Form field styling */
#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form input[type="tel"],
#contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s;
}

#contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

/* Form row structure */
#contact-form .row {
    margin-bottom: 10px; /* Slight reduction from 12px, but safer for general rows */
    overflow: hidden; 
}

/* NEW FIXES FOR TIGHTER VERTICAL RHYTHM */
/* Custom Fix: Reduce space above Email/Phone row (2nd row) */
#contact-form .row:nth-child(2) {
    margin-top: -6px; /* Aggressive negative margin to pull the row up */
    margin-bottom: 6px;
}

/* Custom Fix: Reduce space above How Can We Help (Textarea) row - 4th row */
#contact-form .row:nth-child(4) {
    margin-top: -6px; /* Aggressive negative margin to pull the row up */
    margin-bottom: 6px;
}

.form-submit {
    text-align: right;
    margin-top: 15px; 
}


/* Status Alert Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 500;
}

/* Responsive adjustments for mobile (max-width: 767px) */
@media (max-width: 767px) {
    /* Ensure the content container takes full width on mobile by adding back padding */
    #contact-page-wrapper {
        padding: 0 15px !important;
    }
    
    /* Ensure the main columns stack nicely */
    .grid_4, .grid_8 {
        width: 100%;
        float: none;
        margin-bottom: 20px;
    }

    /* Target the grid_6 within a form row to force full width on mobile */
    #contact-form .row .grid_6 {
        width: 100% !important; 
        float: none !important;
        margin-right: 0 !important;
        margin-bottom: 15px;
    }
    
    /* Force button to full width on mobile */
    .btn {
        width: 100% !important;
    }

    /* Remove the padding-left/right override for mobile, allowing the columns to use their standard 15px padding for inner content spacing */
    .contact-panel-container,
    .form-panel-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* 1. Target the main contact form element to remove any default bottom spacing it inherits */
#contact-form {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* 3. Target the button wrapper to reduce space above the button */
.form-submit {
    margin-top: 5px !important; /* Reduce space above the button (was 15px) */
    padding-bottom: 0 !important;
}

/* 4. Target the text area to ensure it's not adding too much height */
#contact-form textarea {
    margin-bottom: 15px !important; /* Keep a small margin below the text area */
}