/* Chicontepec Public Theme - Bootstrap 5.3.3 Customization */

:root {
    --ch-primary: #9d3663;
    --ch-primary-dark: #7a2a4d;
    --ch-primary-light: #b84575;
    --ch-gold: #d4b387;
    --ch-gold-dark: #b89668;
    --ch-gold-light: #e5c9a0;
}

/* Primary color overrides */
.bg-primary {
    background-color: var(--ch-primary) !important;
}

.btn-primary {
    background-color: var(--ch-primary);
    border-color: var(--ch-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ch-primary-dark);
    border-color: var(--ch-primary-dark);
}

.text-primary {
    color: var(--ch-primary) !important;
}

.border-primary {
    border-color: var(--ch-primary) !important;
}

/* Gold accent */
.bg-gold {
    background-color: var(--ch-gold);
}

.bg-gold-light {
    background-color: rgba(212, 179, 135, 0.1);
}

.text-gold {
    color: var(--ch-gold);
}

.border-gold {
    border-color: var(--ch-gold);
}

/* Custom utilities */
.fs-7 {
    font-size: 0.875rem;
}

.fs-8 {
    font-size: 0.75rem;
}

.fs-9 {
    font-size: 0.625rem;
}

.tracking-widest {
    letter-spacing: 0.15em;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

/* Hero section */
.hero-section {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 400px;
    position: relative;
}

/* Responsive hero heights */
@media (min-width: 576px) {
    .hero-section {
        min-height: 500px;
    }
}

@media (min-width: 768px) {
    .hero-section {
        min-height: 600px;
    }
}

@media (min-width: 992px) {
    .hero-section {
        min-height: 700px;
    }
}

/* Carousel controls improvement */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

/* Carousel indicators */
.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px;
}

/* Hero logo responsive sizing */
.hero-section img {
    max-width: 90%;
    height: auto;
}

@media (min-width: 576px) {
    .hero-section img {
        max-width: 500px;
    }
}

@media (min-width: 768px) {
    .hero-section img {
        max-width: 600px;
    }
}

/* Quick access cards */
.quick-access-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-access-card:hover {
    background-color: rgba(212, 179, 135, 0.2) !important;
    transform: translateY(-4px);
    border-color: var(--ch-gold);
}

/* News cards */
.news-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.news-card img {
    transition: transform 0.5s ease;
}

.news-card:hover img {
    transform: scale(1.1);
}

/* Social icons */
.social-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Citizen hotline banner */
.citizen-hotlines-section {
    background-color: #fdf9f5;
    border-top: 1px solid rgba(157, 54, 99, 0.08);
    border-bottom: 1px solid rgba(157, 54, 99, 0.08);
}

.citizen-hotline-card {
    background-color: #f6f0ea;
    border-radius: 1.25rem;
    border-bottom: 6px solid var(--ch-primary);
    box-shadow: 0 8px 20px rgba(157, 54, 99, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.citizen-hotline-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(157, 54, 99, 0.15);
}

/* Transparency portal cards and subdivision cards hover effect */
.hover-shadow {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    border: 1px solid transparent !important;
}

.hover-shadow:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(157, 54, 99, 0.14) !important;
    border-color: rgba(157, 54, 99, 0.18) !important;
}

/* Sticky header */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Nav links: underline slides from center on hover — no rounded background */
.sticky-header .nav-link {
    position: relative;
    padding-bottom: 6px;
    border-radius: 0 !important;
    background-color: transparent !important;
    transition: color 0.2s ease;
}

.sticky-header .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background-color: var(--ch-primary);
    transition: left 0.2s ease, right 0.2s ease;
}

.sticky-header .nav-link:hover,
.sticky-header .nav-link:focus {
    color: var(--ch-primary) !important;
    background-color: transparent !important;
}

.sticky-header .nav-link:hover::after,
.sticky-header .nav-link:focus::after {
    left: 0;
    right: 0;
}

/* Footer */
.footer-primary {
    background-color: var(--ch-primary);
}

.footer-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* ============================================================================
   Accessibility: text size and pointer target size
   ----------------------------------------------------------------------------
   Two rules from .claude/rules/frontend/public-ui.md were unmet. An audit at
   390px found 27 text nodes under 14px (down to 10.4px) and 55 pointer targets
   under 44x44 -- the navigation toggle among them, at 22x22.

   The sizing is arranged in two tiers so each device gets the right rule:

     Base      every pointer, including a mouse: 24x24 minimum, which is what
               WCAG 2.2 AA (2.5.8 Target Size Minimum) asks for. Links sitting
               inside a sentence are exempt by the criterion itself and are
               left alone, so paragraph flow is untouched.
     Coarse    finger-driven devices: 44x44, WCAG 2.5.5 AAA and the size this
               project's own rule requires. Keyed off "pointer: coarse" rather
               than viewport width, so a narrow desktop window keeps its
               compact layout while a landscape tablet still gets real targets.

   Text uses max() so the relative scale survives and only the floor rises: a
   badge inside small text still shrinks against its parent, it just never
   lands under 14px.
   ========================================================================== */

/* --- Base tier: WCAG 2.2 AA, 24x24 ------------------------------------- */

.footer-link,
footer a,
a.d-flex,
a.d-inline-flex,
a.d-sm-flex,
a.d-md-flex {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

/* Carousel indicators are deliberately small dots. Rather than inflate them
   and spoil the design, an invisible overlay carries the clickable area. */
.carousel-indicators [data-bs-target] {
    position: relative;
}

.carousel-indicators [data-bs-target]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}

/* --- Touch tier: WCAG 2.5.5 AAA, 44x44 --------------------------------- */

@media (pointer: coarse) {
    .navbar-toggler,
    .social-icon,
    .btn,
    .btn-sm,
    .footer-link,
    footer a,
    .nav-link,
    a.d-flex,
    a.d-inline-flex,
    a.d-sm-flex,
    a.d-md-flex {
        min-width: 44px;
        min-height: 44px;
    }

    /* Buttons centre their own content once they are told to lay it out. */
    .btn,
    .btn-sm {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .carousel-control-prev,
    .carousel-control-next {
        min-width: 44px;
    }
}

/* --- Text floor on mobile ---------------------------------------------- */

@media (max-width: 767.98px) {
    .fs-8,
    .fs-9,
    .form-label.small,
    small,
    .small {
        font-size: max(0.875rem, 1em);
    }

    /* The badge scale is relative to its parent, so it needs its own floor. */
    .badge {
        font-size: max(0.875rem, 0.75em);
    }

    /* Faded helper text stays secondary without becoming unreadable. */
    .opacity-25 {
        opacity: 0.55;
    }
}
