/**
 * HIB Footer Manager - Frontend Stylesheet
 */

.fm-footer {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1.6;
    clear: both;
}

.fm-footer * {
    box-sizing: border-box;
}

.fm-footer__container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Rows & Grid System */
.fm-footer__row {
    display: grid;
    gap: 32px;
    margin-bottom: 32px;
    width: 100%;
}

.fm-footer__row:last-child {
    margin-bottom: 0;
}

.fm-footer__row--cols-1 { grid-template-columns: 1fr; }
.fm-footer__row--cols-2 { grid-template-columns: repeat(2, 1fr); }
.fm-footer__row--cols-3 { grid-template-columns: repeat(3, 1fr); }
.fm-footer__row--cols-4 { grid-template-columns: repeat(4, 1fr); }
.fm-footer__row--cols-5 { grid-template-columns: repeat(5, 1fr); }
.fm-footer__row--cols-6 { grid-template-columns: repeat(6, 1fr); }

.fm-footer__column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Headings */
.fm-heading {
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.3;
}

/* Text */
.fm-text p {
    margin-top: 0;
    margin-bottom: 12px;
}
.fm-text p:last-child {
    margin-bottom: 0;
}

/* Link Lists */
.fm-link-list ul,
.fm-wp-menu ul,
.fm-legal-links ul,
.fm-contact-info {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fm-link-list li,
.fm-wp-menu li {
    margin-bottom: 10px;
}

.fm-link-list li:last-child,
.fm-wp-menu li:last-child {
    margin-bottom: 0;
}

.fm-link-list a,
.fm-wp-menu a {
    display: inline-block;
    padding: 2px 0;
    min-height: 24px;
}

/* Social Icons */
.fm-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.fm-social-icons--align-left {
    justify-content: flex-start;
}

.fm-social-icons--align-center {
    justify-content: center;
}

.fm-social-icons--align-right {
    justify-content: flex-end;
}

.fm-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.fm-social-icon:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.fm-social-icons--circle .fm-social-icon {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.fm-social-icons--rounded .fm-social-icon {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.fm-social-icons--simple .fm-social-icon {
    width: auto;
    height: auto;
    background: transparent;
}

/* Contact Info */
.fm-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.fm-contact-item:last-child {
    margin-bottom: 0;
}

.fm-contact-icon {
    flex-shrink: 0;
    margin-top: 3px;
    opacity: 0.8;
}

/* Buttons & CTA */
.fm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 44px; /* WCAG touch target */
}

.fm-btn--primary {
    background-color: var(--fm-link-hover);
    color: #ffffff;
}

.fm-btn--banner {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 700;
}

.fm-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.fm-cta-banner {
    padding: 36px 28px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--fm-border);
}

.fm-cta-banner__heading {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
}

.fm-cta-banner__text {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 16px;
    opacity: 0.9;
}

/* Legal Links */
.fm-legal-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

/* Separator & Spacer */
.fm-separator {
    width: 100%;
}

.fm-spacer {
    width: 100%;
}

/* Designer Signature */
.fm-designer-signature {
    font-size: 13px;
    line-height: 1.5;
    color: var(--fm-text, #94a3b8);
    display: block;
}

.fm-designer-signature .fm-signature-prefix {
    opacity: 0.85;
}

.fm-designer-signature .fm-signature-link {
    color: var(--fm-link, #cbd5e1);
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.fm-designer-signature .fm-signature-link:hover {
    color: var(--fm-link-hover, #38bdf8);
    text-decoration: underline;
    opacity: 1;
}

.fm-designer-signature .fm-signature-link--has-logo {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    text-decoration: none !important;
}

.fm-designer-signature .fm-signature-link--has-logo img {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.fm-designer-signature .fm-signature-link--has-logo:hover img {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Site Tagline */
.fm-site-tagline {
    font-style: italic;
    color: var(--fm-text, #94a3b8);
    line-height: 1.5;
    margin: 0 0 10px 0;
}

/* Sticky Bottom Dock Bar on Mobile */
.fm-sticky-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--fm-dock-bg, #0f172a);
    color: var(--fm-dock-color, #cbd5e1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999999;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
    display: none;
}

.fm-sticky-dock.fm-dock-hidden {
    transform: translateY(100%);
}

.fm-sticky-dock__inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px;
    max-width: 600px;
    margin: 0 auto;
}

.fm-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--fm-dock-color, #cbd5e1);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    min-height: 48px;
    min-width: 48px;
    position: relative;
    transition: color 0.15s ease;
}

.fm-dock-item:hover, .fm-dock-item:focus {
    color: var(--fm-dock-active, #38bdf8);
}

.fm-dock-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-dock-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
}

.fm-footer__column {
    order: var(--fm-col-order-desk, 0);
}

/* Visibility Utilities */
@media (min-width: 1024px) {
    .fm-hide-desktop { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .fm-hide-tablet { display: none !important; }
    .fm-footer__column {
        order: var(--fm-col-order-tab, var(--fm-col-order-desk, 0));
    }
    .fm-footer__row--cols-3,
    .fm-footer__row--cols-4,
    .fm-footer__row--cols-5,
    .fm-footer__row--cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    .fm-footer--tablet-span-odd .fm-footer__row--cols-3 > .fm-footer__column:last-child:nth-child(odd),
    .fm-footer--tablet-span-odd .fm-footer__row--cols-5 > .fm-footer__column:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .fm-hide-mobile { display: none !important; }
    .fm-footer__column {
        order: var(--fm-col-order-mob, var(--fm-col-order-desk, 0));
    }
    
    .fm-footer__row {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }

    .fm-legal-links ul {
        justify-content: flex-start !important;
    }

    .fm-sticky-dock {
        display: block;
    }

    /* Mobile Accordion Mode */
    .fm-footer--mobile-accordion .fm-accordion-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        padding: 10px 0;
        margin-bottom: 0;
        border-bottom: 1px solid var(--fm-border);
        user-select: none;
    }

    .fm-footer--mobile-accordion .fm-accordion-icon {
        font-size: 20px;
        font-weight: 400;
        transition: transform 0.2s ease;
    }

    .fm-footer--mobile-accordion .fm-accordion-toggle[aria-expanded="true"] .fm-accordion-icon {
        transform: rotate(45deg);
    }

    .fm-footer--mobile-accordion .fm-heading.fm-accordion-toggle + .fm-footer__element {
        display: none;
        padding-top: 14px;
    }

    .fm-footer--mobile-accordion .fm-accordion-toggle[aria-expanded="true"] ~ .fm-footer__element {
        display: block;
    }
}
