/* =========================================
   ROOT.CSS - Shared Styles Across All Pages
   Components, forms, footer, utilities
   ========================================= */

/* =========================================
   1. GLOBAL SECTIONS
   ========================================= */
.cs-section {
    padding: var(--sectionPadding);
    position: relative;
    overflow: hidden;
}

.cs-section .cs-container {
    position: relative;
    z-index: 1;
}

.cs-section.cs-dark {
    background: linear-gradient(135deg, #121212, #050505);
}

.cs-section.cs-dark .cs-title,
.cs-section.cs-dark .cs-text {
    color: #f8fafc;
}

/* =========================================
   2. CARDS & COMPONENTS
   ========================================= */
   
/* Card Accent - Signature Left Border with Gradient */
.cs-card-accent {
    position: relative;
    overflow: hidden;
}

.cs-card-accent::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--card-accent-width, 5px);
    background: var(--card-accent-gradient);
    border-radius: 16px 0 0 16px;
}

/* Top-left corner gradient glow */
.cs-card-accent::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 60%;
    background: var(--card-accent-glow);
    pointer-events: none;
    border-radius: inherit;
}

/* Base Card Style */
.cs-card-v2 {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-left: 5px solid var(--primary);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Card Accent Styling for cs-card-v2 */
.cs-card-v2::before {
    content: '';
    position: absolute;
    inset: -40% auto auto -35%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, var(--glass-highlight), transparent 65%);
    opacity: 0.4;
    pointer-events: none;
    transform: rotate(8deg);
}

.cs-card-v2::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 60%;
    background: var(--card-accent-glow);
    pointer-events: none;
    border-radius: inherit;
}

.cs-hover-lift {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.cs-hover-lift:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 40px 70px rgba(0, 0, 0, 0.25);
}

.cs-card-v2 h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--headerColor);
    position: relative;
    z-index: 1;
}

.cs-card-v2 p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--bodyTextColor);
    position: relative;
    z-index: 1;
}

/* =========================================
   3. SECTION HEADER LAYOUTS
   ========================================= */
/* Left-aligned header with right-aligned CTA */
.section-header-left {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 3rem;
}

.section-header-content {
    flex: 1;
    max-width: 800px;
}

.section-header-content .cs-topper {
    margin-bottom: 0.25rem;
    text-align: left;
}

.section-header-content .cs-title {
    margin-bottom: 0;
    text-align: left;
}

.section-header-cta {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 0.5rem;
}

/* Centered intro - for sections with subtext in header */
.section-intro {
    max-width: 800px;
    margin-bottom: 3rem;
}

.section-intro--centered {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-intro--centered .cs-title {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-intro--centered .cs-text {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-intro .cs-title {
    margin-bottom: 1rem;
}

.section-intro .cs-text {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .section-header-left {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header-cta {
        padding-top: 0;
        width: 100%;
    }
    
    .section-header-cta .cs-button-solid {
        width: 100%;
        max-width: 320px;
    }
}

/* =========================================
   4. GRIDS
   ========================================= */
.cs-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.cs-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.cs-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .cs-grid-3,
    .cs-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .cs-grid-2,
    .cs-grid-3,
    .cs-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   5. SPLIT CONTENT LAYOUTS
   ========================================= */
.cs-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.cs-split--reverse {
    direction: rtl;
}

.cs-split--reverse > * {
    direction: ltr;
}

.split-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.split-content .cs-text {
    margin: 0;
    text-align: left;
    color: var(--bodyTextColor);
}

.split-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--headerColor);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.split-content .benefit-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.split-content .benefit-list li {
    position: relative;
    padding-left: 1.5rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.split-content .benefit-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 0.5rem;
    height: 0.5rem;
    background: var(--primary);
    border-radius: 50%;
}

.split-content .benefit-list li strong {
    color: var(--headerColor);
}

.split-media {
    border-radius: 16px;
    overflow: hidden;
}

.split-media img {
    width: 100%;
    height: auto;
    display: block;
}

/* Section CTA - centered button below content */
.section-cta {
    margin-top: 3rem;
    text-align: center;
}

@media (max-width: 1023px) {
    .cs-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cs-split--reverse {
        direction: ltr;
    }
    
    .split-media {
        order: -1;
    }
    
    .section-cta {
        margin-top: 2rem;
    }
}

/* Dark section text colors */
.cs-section.cs-dark .split-content .cs-text,
.cs-section.cs-dark .split-content h4,
.cs-section.cs-dark .split-content .benefit-list li,
.cs-section.cs-dark .split-content .benefit-list li strong {
    color: #f8fafc;
}

/* =========================================
   6. CONTACT PANEL
   ========================================= */
.contact-panel {
    padding: var(--sectionPadding);
    background: var(--bg-offset);
    overflow-x: hidden;
}

.contact-panel .cs-container {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(2rem, 4vw, 4rem);
}

.contact-info {
    grid-column: span 5;
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
}

.contact-info ul {
    margin-top: 1.5rem;
}

.contact-info ul li {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.contact-info ul li strong {
    display: block;
    color: var(--headerColor);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

/* Forms */
.cs-form {
    grid-column: span 7;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.cs-label {
    position: relative;
}

.cs-label:nth-child(3),
.cs-label:nth-child(4) {
    grid-column: span 2;
}

.cs-input,
.cs-textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--card-border);
    padding: 18px 0 8px;
    font-size: 1rem;
    color: var(--headerColor);
    font-family: inherit;
    box-sizing: border-box;
}

.cs-input::placeholder,
.cs-textarea::placeholder {
    color: transparent;
}

.cs-input:focus,
.cs-textarea:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.cs-label label {
    position: absolute;
    top: 18px;
    left: 0;
    color: var(--bodyTextColor);
    pointer-events: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.cs-label:has(.cs-input:focus) label,
.cs-label:has(.cs-input:not(:placeholder-shown)) label,
.cs-label:has(.cs-textarea:focus) label,
.cs-label:has(.cs-textarea:not(:placeholder-shown)) label {
    top: -5px;
    font-size: 0.75rem;
    color: var(--primary);
}

.cs-textarea {
    resize: vertical;
    min-height: 100px;
    grid-column: span 2;
}

.cs-submit {
    grid-column: span 2;
    width: 100%;
}

#form-message {
    grid-column: span 2;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: none;
}

#form-message.success {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: block;
}

#form-message.error {
    color: #f87171;
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    display: block;
}

/* Map */
.cs-picture-group {
    grid-column: span 12;
    margin-top: 2rem;
}

.cs-iframe {
    width: 100%;
    height: 400px;
    border-radius: 24px;
    border: 1px solid var(--card-border);
}

@media (max-width: 1023px) {
    .contact-panel {
        padding-left: var(--container-padding);
        padding-right: var(--container-padding);
    }
    
    .contact-panel .cs-container {
        grid-template-columns: 1fr;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
    }
    
    .contact-info,
    .cs-form {
        grid-column: span 12;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .cs-form {
        grid-template-columns: 1fr;
    }
    
    .cs-label:nth-child(3),
    .cs-label:nth-child(4),
    .cs-textarea,
    .cs-submit,
    #form-message {
        grid-column: span 1;
    }
}

/* =========================================
   7. FOOTER
   ========================================= */
#footer {
    background-color: var(--footer-bg);
    padding: clamp(3.5rem, 5vw, 4.5rem) 1rem clamp(2.5rem, 4vw, 3rem);
    color: var(--footer-text);
    position: relative;
    z-index: 5;
    border-top: 1px solid var(--footer-border);
    overflow: visible;
}

#footer .cs-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3rem;
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

#footer .cs-col {
    grid-column: span 12;
}

#footer .cs-links {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
}

#footer h3 {
    font-family: var(--headerFont);
    color: var(--footer-heading);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

#footer ul li {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--footer-text);
}

#footer ul li a {
    color: var(--footer-link);
    transition: color 0.3s ease;
}

#footer ul li a:hover {
    color: var(--footer-link-hover);
}

.cs-logo-footer {
    font-family: var(--headerFont);
    font-size: 2rem;
    color: var(--footer-heading);
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
    max-width: 200px;
    /* Container maintains original size to prevent layout shift */
    position: relative;
    overflow: visible;
}

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

.cs-logo-footer-img {
    display: block;
    height: auto;
    width: 100%;
    max-width: 200px;
    object-fit: contain;
    /* Scale the logo larger without affecting layout */
    transform: scale(1.5);
    transform-origin: center center;
    transition: transform 0.3s ease;
}

.cs-logo-footer:hover .cs-logo-footer-img {
    transform: scale(1.55);
}

@media (min-width: 768px) {
    .cs-logo-footer-img {
        transform: scale(1.75);
    }
    
    .cs-logo-footer:hover .cs-logo-footer-img {
        transform: scale(1.8);
    }
    
    /* Move logo to the right on desktop */
    .cs-logo-footer {
        margin-left: 3.9rem;
    }
}

.cs-logo-footer .cs-logo-img--light {
    display: none;
}

body.cs-dark-mode .cs-logo-footer .cs-logo-img--light {
    display: block;
}

body.cs-dark-mode .cs-logo-footer .cs-logo-img--dark {
    display: none;
}

.cs-footer-description {
    color: var(--footer-text);
    margin-top: 1rem;
    margin-bottom: .5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    /* Bring text closer to logo on desktop */
    .cs-footer-description {
        margin-top: -1rem;
    }
}

.cs-footer-cta {
    margin-top: 1rem;
    display: inline-block;
    color: #fff !important;
    max-width: 100%;
    box-sizing: border-box;
}

.cs-footer-cta:hover {
    color: var(--primary) !important;
}

.cs-footer-subline {
    text-align: center;
    color: var(--footer-text);
    padding-top: 1rem;
    margin: 0;
    line-height: .65;
    font-size: 0.75rem;
}

.cs-footer-subline a {
    color: var(--footer-link);
}

.cs-footer-subline a:hover {
    color: var(--footer-link-hover);
}

@media (min-width: 768px) {
    /* Footer: First column (logo/text) is double width, other 3 columns evenly spaced */
    /* Using 10-column grid: first = 4 columns (double), others = 2 columns each */
    #footer .cs-container {
        grid-template-columns: repeat(10, 1fr);
        max-width: 1280px;
    }
    
    #footer .cs-intro {
        grid-column: span 4;
    }
    
    #footer .cs-links {
        grid-template-columns: repeat(6, 1fr);
        grid-column: span 6;
        gap: 2rem;
    }
    
    #footer .cs-links .cs-col {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    #footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #footer .cs-container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    #footer .cs-col {
        text-align: center;
        width: 100%;
    }
    
    #footer .cs-intro {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        box-sizing: border-box;
    }
    
    #footer .cs-logo-footer {
        margin-left: 0;
        max-width: 160px;
    }
    
    #footer .cs-logo-footer-img {
        height: auto;
        width: 100%;
        max-width: 160px;
        /* Scale larger on mobile */
        transform: scale(2);
        transform-origin: center center;
    }
    
    #footer .cs-logo-footer:hover .cs-logo-footer-img {
        transform: scale(2.05);
    }
    
    #footer .cs-footer-cta {
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }
    
    #footer .cs-footer-description {
        text-align: center;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    #footer .cs-links {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* =========================================
   8. MEDIA FRAMES
   ========================================= */
.cs-media-frame {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.cs-media-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Float animation for images */
@keyframes floaty {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.cs-float {
    animation: floaty 6s ease-in-out infinite;
}

/* =========================================
   9. UTILITIES
   ========================================= */
.content-block {
    max-width: 800px;
}

.content-block--centered {
    text-align: center;
    margin: 0 auto;
}

.benefit-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.benefit-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.benefit-list li strong {
    color: var(--headerColor);
}

.benefit-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* CTA Split */
.cta-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

.cta-content {
    max-width: 600px;
}

@media (min-width: 768px) {
    .cta-split {
        grid-template-columns: 1fr 1fr;
    }
}

/* Go to top button */
.cs-go-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 999;
}

.cs-go-top.visible {
    opacity: 1;
    visibility: visible;
}

.cs-go-top:hover {
    transform: translateY(-4px);
}

.cs-go-top svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* =========================================
   10. STATS BAND
   ========================================= */
.stats-band {
    padding: clamp(4rem, 8vw, 6rem) 1rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 50%, #1a1a1a 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stats-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(255,255,255,0.02) 0%, transparent 50%);
    pointer-events: none;
}

.stats-band .cs-container {
    position: relative;
    z-index: 1;
}

.stats-band__header {
    text-align: center;
    margin-bottom: 3rem;
}

.stats-band__topper {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    color: #fff;
}

.stats-band__title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 700;
    margin: 0;
    font-family: var(--headerFont);
    color: #fff;
}

.stats-band__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.stats-band__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stats-band__icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-band__icon svg {
    width: 100%;
    height: 100%;
}

.stats-band__number {
    display: block;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    font-family: var(--headerFont);
    line-height: 1.1;
    margin-bottom: 0.25rem;
    color: #fff;
}

.stats-band__label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
    color: #fff;
}

@media (max-width: 768px) {
    .stats-band__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 1.5rem;
    }
    
    .stats-band__header { margin-bottom: 2.5rem; }
}

@media (max-width: 480px) {
    .stats-band__icon { width: 2.5rem; height: 2.5rem; }
}

/* Skip link */
.skip {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: -1111111;
}
