/* Overrides for requested visual fixes */

/* Footer alignment consolidated into styles/main.css */

/* 2) Reduce space between CPM title and its explanation (hero) */
.hero-content h1,
.hero-content .hero-title {
    margin-bottom: 0.5rem;
}
.hero-content p,
.hero-content .hero-subtitle {
    margin-top: 0;
    max-width: 900px;
}

/* 3) Small screens: center value / 'Excelência' cards when stacked */
@media (max-width: 767px) {
    .value-card {
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* 4) Hero blue background: use the intended team/time image if available */
.hero {
    background-color: var(--color-primary);
    background-image: url('/assets/images/time3.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* 5) Team members: center the third person when grid wraps */
@media (max-width: 991px) {
    .team-member-card {
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }
    .team-members,
    .team-grid,
    .team-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1rem;
        justify-items: center;
    }
}

/* 6) 'Mais popular' badge: avoid clipping and ensure text wraps/visibility */
.plan-badge,
.badge-popular,
.badge--popular {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
    overflow: visible;
}

/* Values grid: center items when there are fewer children than columns */
.values-grid {
    justify-items: center; /* center each card */
}

@media (min-width: 1024px) {
    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 2rem;
        justify-items: center;
    }
}

/* Brand acronym styling: make CPM red where shown (footer, headers) */
.brand-acronym {
    color: var(--color-secondary);
    font-weight: 800;
}

/* Generic centered grid utility to match the Values layout */
.centered-grid {
    justify-items: center;
}

/* Make centered-grid behave like values-grid on larger screens: auto-fit columns and center tracks */
@media (min-width: 768px) {
    .centered-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1.5rem;
        justify-items: center;
        justify-content: center;
    }
}

/* Footer logo acronym: ensure the small square/acronym inside the logo is red */
.footer-logo .logo-icon span,
.logo-icon .brand-acronym {
    color: var(--color-secondary);
    font-weight: 800;
}

/* Fix popular badge clipping on highlighted cards */
.card-highlight {
    overflow: visible; /* allow ::before badge to be visible outside the card */
    z-index: 1; /* keep card above background */
}

.card-highlight::before {
    z-index: 20; /* ensure badge sits above other elements */
}

/* Ensure footer CPM uses brand red even if other rules exist */
.footer .footer-logo .logo-icon .brand-acronym,
.footer .footer-logo .logo-icon span.brand-acronym {
    color: var(--color-secondary) !important;
}

/* Extra safeguard: ensure footer logo text does not inherit white from .footer when we only want the acronym red */
.footer .footer-logo .logo-text {
    color: var(--color-blue-100); /* keep description tone for text */
}

/* If any other rule forces color on the span, set display and color explicitly */
.footer .footer-logo .logo-icon span.brand-acronym {
    display: inline-block !important;
    color: var(--color-secondary) !important;
}

/* Prevent 'MAIS POPULAR' from overlapping the card header: add top padding and adjust badge position */
.card-highlight .card-header {
    padding-top: 2.25rem; /* make room for the badge */
}

.card-highlight::before {
    top: 0; /* align to the top edge and translate up half its height */
    transform: translateX(-50%) translateY(-50%);
    padding: 0.4rem 0.9rem;
    font-size: 0.7rem;
}

@media (max-width: 480px) {
    .card-highlight .card-header {
        padding-top: 1.75rem;
    }
    .card-highlight::before {
        font-size: 0.65rem;
        padding: 0.35rem 0.7rem;
    }
}

/* Reduce spacing in footer: tighten gap between logo and description */
.footer-content {
    padding-top: 0.625rem; /* reduced further (half) */
    padding-bottom: 0.625rem;
}

.footer-logo {
    margin-bottom: 0.125rem; /* half the previous gap */
}

.footer-description {
    margin-top: 0.125rem;
    line-height: 1.4; /* slightly tighter */
}
