/**
 * Footer Component Styles
 * Stone-950 dark footer with red/gold accents
 * Natural History Museum aesthetic
 */

/* ===== FOOTER CONTAINER ===== */
.site-footer {
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    margin-top: auto;
    border-top: 3px solid var(--color-primary);
    padding-top: var(--space-8);
}

/* ===== FOOTER GRID ===== */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--color-dark-border);
}

@media (min-width: 576px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }
}

@media (min-width: 992px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: var(--space-6);
    }
}

@media (min-width: 1200px) {
    .footer-grid {
        grid-template-columns: 2fr repeat(5, 1fr);
        gap: var(--space-8);
    }
}

/* ===== FOOTER COLUMNS ===== */
.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col--about {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .footer-col--about {
        grid-column: auto;
    }

    .footer-about {
        max-width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .footer-social__link {
        width: 60px;
        height: 60px;
    }

    .footer-social__link svg {
        width: 28px;
        height: 28px;
    }

    .footer-badges__img {
        height: 60px;
    }

    .footer-badges__img--facebook {
        width: calc(130px + var(--space-4));
    }
}

.footer-col__title {
    color: var(--color-footer-heading);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
    padding-bottom: var(--space-2);
}

.footer-col__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background-color: var(--color-primary);
}

/* ===== FOOTER COLUMN SUBTITLE ===== */
.footer-col__subtitle {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    margin: var(--space-4) 0 var(--space-2) 0;
}

.footer-col__subtitle:first-of-type {
    margin-top: 0;
}

.footer-col__subtitle a {
    color: var(--color-footer-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-col__subtitle a:hover {
    color: #f4c542;
}

.footer-links--nested {
    padding-left: var(--space-4);
}

.footer-links--nested li {
    margin-bottom: var(--space-2);
}

/* ===== FOOTER LOGO ===== */
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    margin-bottom: var(--space-4);
    transition: opacity var(--transition-fast);
}

.footer-logo:hover {
    text-decoration: none;
    opacity: 0.9;
}

.footer-logo__image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.footer-logo__icon {
    font-size: 2rem;
    line-height: 1;
}

.footer-logo__text {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    font-family: var(--font-family-heading);
}

.footer-logo__tld {
    color: var(--color-primary);
}

/* ===== FOOTER ABOUT ===== */
.footer-about {
    color: var(--color-footer-text);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-5);
    max-width: 320px;
}

/* ===== FOOTER SOCIAL ===== */
.footer-social {
    display: flex;
    gap: var(--space-4);
}

.footer-social__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: var(--color-dark-surface);
    color: var(--color-footer-text);
    border: 1px solid var(--color-dark-border);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.footer-social__link svg {
    width: 36px;
    height: 36px;
}

.footer-social__link:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* ===== FOOTER LINKS ===== */
.footer-links {
    list-style: none;
    padding: 0 0 0 var(--space-4);
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links li:last-child {
    margin-bottom: 0;
}

.footer-links a {
    color: var(--color-footer-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    padding-left: 0;
}

.footer-links a::before {
    content: '';
    position: absolute;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-primary);
    bottom: -2px;
    transition: width var(--transition-fast);
}

.footer-links a:hover {
    color: #f4c542;
    text-decoration: none;
}

.footer-links a:hover::before {
    width: 100%;
}

/* ===== ACTIVE FOOTER LINK ===== */
.footer-link--active {
    color: #f4c542 !important;
    font-weight: var(--font-weight-semibold, 600);
}

.footer-link--active::before {
    width: 100% !important;
}

.footer-col__title--active {
    color: var(--color-accent, #f4c542) !important;
}

.footer-col__title--active::after {
    width: 100%;
    background-color: #f4c542;
}

/* ===== FOOTER BADGES ===== */
.footer-badges {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
}

.footer-badges__img {
    height: 80px;
    width: auto;
    border-radius: var(--border-radius-sm);
    transition: transform var(--transition-fast);
}

.footer-badges__img_pwo {
    height: 100px;
    width: auto;
    border-radius: var(--border-radius-sm);
    transition: transform var(--transition-fast);
}

.footer-badges--homepage .footer-badges__img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.footer-badges__img:hover {
    transform: scale(1.05);
}

.footer-badges__img--facebook {
    height: auto;
    width: calc(160px + var(--space-4));
}

@media (max-width: 576px) {
    .footer-badges {
        justify-content: center;
    }

    .footer-badges__img {
        height: 65px;
    }

    .footer-badges--homepage .footer-badges__img {
        width: 65px;
        height: 65px;
    }

    .footer-badges__img--facebook {
        width: calc(130px + var(--space-4));
    }

    .footer-social__link {
        width: 65px;
        height: 65px;
    }

    .footer-social__link svg {
        width: 28px;
        height: 28px;
    }
}

/* ===== FOOTER BOTTOM ===== */
.footer-bottom {
    padding: var(--space-5) 0;
    background-color: rgba(0, 0, 0, 0.3);
}

.footer-bottom__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom__content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-copyright {
    font-size: var(--font-size-sm);
    color: var(--color-footer-text);
    margin: 0;
}

.footer-copyright a {
    color: var(--color-text-on-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-copyright a:hover {
  /*  color: var(--color-primary-light); */
    color: var(--color-primary-email);
}

.footer-bottom__links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--font-size-sm);
}

.footer-bottom__links a {
    color: var(--color-footer-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-bottom__links a:hover {
    color: #f4c542;
}

.footer-bottom__divider {
    color: var(--color-dark-border);
}

/* ===== FOOTER DEVELOPER CREDIT ===== */
.footer-developer {
    font-size: var(--font-size-xs);
    color: var(--color-text-on-dark-muted);
    text-align: center;
    margin: var(--space-4) 0 0 0;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-dark-border);
    letter-spacing: 0.02em;
}

.footer-developer a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
}

.footer-developer a:hover {
    color: var(--color-accent-light);
    text-decoration: underline;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--back-to-top-right, var(--space-6));
    width: 48px;
    height: 48px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--hp-yellow, #d4a72c);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(165, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: var(--z-fixed);
}

.back-to-top:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(165, 0, 0, 0.4);
}

.back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Smaller button on mobile */
@media (max-width: 576px) {
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: var(--space-4);
        right: var(--back-to-top-right, var(--space-4));
    }

    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 576px) {
    .site-footer {
        padding-top: var(--space-6);
    }

    .footer-grid {
        gap: var(--space-5);
        padding-bottom: var(--space-6);
    }

    .footer-col__title {
        margin-bottom: var(--space-3);
    }

    .footer-about {
        max-width: 100%;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .site-footer {
        background-color: var(--color-white);
        color: var(--color-gray-900);
        padding: var(--space-4) 0;
        border-top: 1px solid var(--color-gray-300);
    }

    .back-to-top {
        display: none;
    }

    .footer-social {
        display: none;
    }

    .footer-col__title {
        color: var(--color-gray-900);
    }

    .footer-links a {
        color: var(--color-gray-700);
    }
}
