/*
Theme Name:   Go Child Theme - Terrapin Corporate Services
Theme URI:    https://terrapincorporateservices.com
Description:  Custom child theme for Terrapin Corporate Services based on Go by GoDaddy
Author:       Databasedat
Author URI:   https://terrapincorporateservices.com
Template:     go
Version:      1.1.0
License:      GPL-2.0+
License URI:  http://www.gnu.org/licenses/gpl-2.0.txt
Text Domain:  go-child
*/

/* ==========================================================================
   Custom Styles for Terrapin Corporate Services
   ========================================================================== */

/* Import Parent Theme Styles */
/* Parent styles are enqueued in functions.php */

/* ==========================================================================
   Brand Colors & Variables
   (Update these after reviewing your Brand Guidelines)
   ========================================================================== */

:root {
    /* Primary Brand Colors - Terrapin Corporate Services Green */
    --brand-primary: #004627;
    --brand-secondary: #003820;
    --brand-accent: #10b981;

    /* Complement Colors from Logo */
    --color-sage: #A8C4B0;
    --color-sage-light: #c4dccb;
    --color-sage-dark: #8ab199;
    --color-warm-gray: #8B8680;
    --color-warm-gray-light: #a39e99;
    --color-warm-gray-dark: #6d6964;

    /* Grayscale */
    --brand-dark: #1e293b;
    --brand-gray: #64748b;
    --brand-light: #f8fafc;

    /* Matching the modern plugin design */
    --color-primary-500: #004627;
    --color-emerald-500: #10b981;
    --color-gray-800: #1e293b;
    --color-gray-50: #f8fafc;

    /* Shadows with green tint */
    --shadow-sm: 0 1px 3px 0 rgba(0, 70, 39, 0.05), 0 1px 2px 0 rgba(0, 70, 39, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 70, 39, 0.1), 0 2px 4px -1px rgba(0, 70, 39, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 70, 39, 0.15), 0 4px 6px -2px rgba(0, 70, 39, 0.1);

    /* Typography */
    --font-heading: 'Addington CF', 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ==========================================================================
   Background & Body Styling
   ========================================================================== */

body.terrapin-corporate-services {
    background: linear-gradient(135deg, rgba(168, 196, 176, 0.15) 0%, rgba(248, 250, 252, 1) 100%);
    background-attachment: fixed;
    font-family: var(--font-body);
    letter-spacing: -0.02em;
}

/* ==========================================================================
   Site Header
   ========================================================================== */

.site-header {
    background: linear-gradient(135deg, #ffffff 0%, rgba(168, 196, 176, 0.08) 100%);
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--color-sage-light);
}

/* Logo Styling */
.site-logo,
.custom-logo-link {
    display: block;
}

.custom-logo {
    max-height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.custom-logo:hover {
    transform: scale(1.05);
}

/* Site Title / Branding - Force Heading Font */
.site-title,
.site-branding .site-title,
.site-branding a,
.site-header .site-title,
.header-titles .site-title {
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Ensure site branding container has consistent alignment */
.site-branding,
.site-header .site-branding,
.header-titles {
    display: flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

/* Site Description / Tagline - Removed hard-coding to allow WordPress editing */

/* ==========================================================================
   Navigation Menu
   ========================================================================== */

.main-navigation a {
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--color-sage-dark);
}

/* ==========================================================================
   Content Area
   ========================================================================== */

.site-content {
    background: linear-gradient(135deg, #ffffff 0%, rgba(168, 196, 176, 0.08) 100%);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--color-sage-light);
    padding: 40px;
    margin: 32px auto;
    max-width: 1400px;
}

/* Entry Content */
.entry-content {
    line-height: 1.7;
    color: var(--color-gray-800);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

/* Button styles removed - now controlled through WordPress Customizer */
/* Client Portal buttons use portal-specific CSS in BEPM plugin */

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--color-gray-800);
    color: white;
    padding: 48px 24px;
    margin-top: 64px;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: white;
}

/* ==========================================================================
   Logo Usage Examples (Update paths after copying logos)
   ========================================================================== */

/* Header Logo - Main logo in navigation */
/*
.site-header .custom-logo {
    content: url('../assets/images/logos/terrapin-logo-main.png');
}
*/

/* Footer Logo - Alternative logo for dark background */
/*
.site-footer .footer-logo {
    content: url('../assets/images/logos/terrapin-logo-white.png');
    max-width: 200px;
    opacity: 0.9;
}
*/

/* Hero Section Background Pattern */
/*
.hero-section {
    background-image: url('../assets/images/logos/pattern-or-watermark.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
*/

/* Client Logos / Partner Logos Section */
/*
.partner-logos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    padding: 48px 0;
}

.partner-logos img {
    max-width: 150px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    filter: grayscale(100%);
}

.partner-logos img:hover {
    opacity: 1;
    filter: grayscale(0%);
}
*/

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .site-content {
        padding: 24px;
        margin: 16px;
        border-radius: 12px;
    }

    .custom-logo {
        max-height: 48px;
    }

    /* Stack columns on mobile */
    .wp-block-columns {
        flex-direction: column;
    }

    .wp-block-column {
        flex-basis: 100% !important;
        margin-bottom: 1.5rem;
    }
}

/* ==========================================================================
   CRITICAL FIX: Force horizontal text in all columns
   Override any block editor or inline styles causing vertical text

   This section fixes the issue where text in 4-column layouts appears
   stretched vertically instead of displaying normally horizontally.
   The fix includes:
   - Forcing writing-mode to horizontal
   - Setting proper column widths (25% each for 4 columns)
   - Removing height constraints
   - Ensuring content flows normally
   ========================================================================== */

/* Nuclear option - force everything to be horizontal */
.wp-block-columns *,
.wp-block-column *,
[class*="wp-block-column"] *,
.has-4-columns * {
    writing-mode: horizontal-tb !important;
    -webkit-writing-mode: horizontal-tb !important;
    -ms-writing-mode: lr-tb !important;
    text-orientation: mixed !important;
}

/* Specific fix for narrow bordered columns that appear stretched */
.wp-block-column.is-vertically-aligned-top,
.wp-block-column.is-vertically-aligned-center,
.wp-block-column.is-vertically-aligned-bottom {
    align-items: flex-start !important;
}

/* Override WordPress core block styles if they exist */
.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
    flex-grow: 1 !important;
    flex-basis: 0 !important;
    min-width: 200px !important;
}

/* Fix for grouped content within columns */
.wp-block-column .wp-block-group__inner-container,
.wp-block-column .wp-block-group,
.wp-block-column > div {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 1rem !important;
}

/* Ensure text doesn't break awkwardly */
.wp-block-column h1,
.wp-block-column h2,
.wp-block-column h3,
.wp-block-column h4,
.wp-block-column h5,
.wp-block-column h6 {
    hyphens: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
    line-height: 1.3 !important;
}

.wp-block-column p {
    hyphens: none !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* Remove any height constraints that might cause text stacking */
.wp-block-column,
.wp-block-column > *,
.wp-block-column h4,
.wp-block-column p {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

/* ==========================================================================
   Global Font Override - Removed hard-coding
   ========================================================================== */

/* Inter font removed - now controlled through WordPress Customizer */
/* Client Portal uses portal-specific Inter font in BEPM plugin */

/* Ensure Dashicons remain intact */
.dashicons,
.dashicons-before:before {
    font-family: dashicons !important;
}

/* ==========================================================================
   Links & Interactive Elements
   ========================================================================== */

a {
    color: var(--brand-primary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--brand-secondary);
}

/* Primary action links */
.wp-block-button.is-style-fill a,
.has-primary-color {
    color: var(--brand-primary);
}

/* Headings with accent color */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--brand-dark);
}

.entry-title,
.page-title {
    font-family: var(--font-heading);
    color: var(--brand-dark);
}

/* WordPress Block Columns - Fix narrow stretched columns */
.wp-block-columns {
    gap: 2rem;
    margin-bottom: 2rem;
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure the container holding columns is full width */
.entry-content .wp-block-columns,
.site-content .wp-block-columns {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.wp-block-column {
    flex-basis: 0;
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    writing-mode: horizontal-tb !important;
}

/* Ensure 4-column layout has proper spacing and sizing */
.wp-block-columns.has-4-columns {
    justify-content: space-between;
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 1.5rem !important;
}

.wp-block-columns.has-4-columns .wp-block-column {
    flex: 1 1 0 !important;
    flex-basis: 0 !important;
    flex-grow: 1 !important;
    max-width: none !important;
    min-width: 0 !important;
    width: auto !important;
}

/* Override any inline width styles that might be making columns narrow */
.wp-block-column[style*="flex-basis"],
.wp-block-column[style*="width"] {
    flex-basis: 0 !important;
    flex-grow: 1 !important;
    max-width: none !important;
}

.wp-block-columns.has-4-columns > * {
    flex: 1 1 0 !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* Fix heading width in columns - prevent vertical text */
.wp-block-column .wp-block-heading,
.wp-block-column h1,
.wp-block-column h2,
.wp-block-column h3,
.wp-block-column h4,
.wp-block-column h5,
.wp-block-column h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    white-space: normal;
}

/* Fix any paragraph or content stretching in columns */
.wp-block-column p,
.wp-block-column div {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    white-space: normal;
}

/* Reset any vertical text transforms that might be applied */
.wp-block-column *,
.wp-block-column,
.wp-block-columns .wp-block-column,
.has-4-columns .wp-block-column {
    writing-mode: horizontal-tb !important;
    -webkit-writing-mode: horizontal-tb !important;
    -ms-writing-mode: lr-tb !important;
}

/* Force normal text flow in bordered boxes */
.wp-block-column.has-border,
.wp-block-column [class*="border"],
.wp-block-column .wp-block-group,
.wp-block-column .wp-block-group.has-border {
    writing-mode: horizontal-tb !important;
    text-orientation: upright !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    box-sizing: border-box !important;
}

/* If columns have borders, give them proper padding */
.wp-block-column.has-border,
.wp-block-column .has-border {
    padding: 1.5rem !important;
}

/* Ensure bordered groups inside columns take full width */
.wp-block-column .wp-block-group.has-border {
    margin: 0 !important;
}

/* Responsive layout for columns - stack on smaller screens */
@media (min-width: 1024px) {
    /* On larger screens, ensure columns stay side by side */
    .wp-block-columns.has-4-columns {
        flex-wrap: nowrap !important;
    }

    .wp-block-columns.has-4-columns .wp-block-column {
        flex: 1 1 0 !important;
        max-width: none !important;
    }
}

@media (max-width: 1023px) {
    /* Tablets - 2 columns */
    .wp-block-columns.has-4-columns {
        flex-wrap: wrap !important;
    }

    .wp-block-columns.has-4-columns .wp-block-column {
        flex: 1 1 calc(50% - 1rem) !important;
        max-width: calc(50% - 1rem) !important;
        margin-bottom: 2rem;
    }
}

@media (max-width: 640px) {
    /* Mobile - stack vertically */
    .wp-block-columns.has-4-columns .wp-block-column {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* Focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Integration with Plugin Styles
   Ensures consistency between site and Entity Manager plugin
   ========================================================================== */

.entity-manager-wrap {
    /* Inherits site styles automatically */
}

/* Match plugin color scheme to site */
.entity-manager-container {
    /* Uses same design tokens defined in :root */
}

/* ==========================================================================
   Equal Height Feature Boxes - Uniform Column Heights
   Makes all WordPress block columns the same height to match the tallest one
   ========================================================================== */

/* Make all columns in a row equal height */
.wp-block-columns {
    display: flex !important;
    align-items: stretch !important;
}

/* Make individual columns stretch to fill container */
.wp-block-column {
    display: flex !important;
    flex-direction: column !important;
}

/* Inner content of columns should NOT stretch, only the column container */
.wp-block-column > * {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

/* Bordered groups inside columns should stretch to full height */
.wp-block-column .wp-block-group.has-border,
.wp-block-column > .wp-block-group {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ==========================================================================
   Hero Section & Cover Blocks - Add Sage Tint
   ========================================================================== */

.wp-block-cover,
.wp-block-cover__background {
    background: linear-gradient(135deg, rgba(139, 134, 128, 0.95) 0%, rgba(168, 196, 176, 0.15) 100%);
}

/* Feature boxes and content blocks - Let them use their default styles */
.wp-block-group.has-border,
.wp-block-column .wp-block-group.has-border {
    border-color: var(--color-sage-light);
}

/* Main wrapper - ensure sage background shows */
.site,
.site-container,
#page {
    background: linear-gradient(135deg, rgba(168, 196, 176, 0.12) 0%, #ffffff 100%);
}

/* Buttons get sage hover */
.wp-block-button__link:hover,
button:hover {
    background: linear-gradient(135deg, var(--color-sage-dark) 0%, var(--brand-primary) 100%);
}
