.footer {
    container-type: inline-size;
    margin: 24px;
    padding: 28px 32px 32px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #fcfaf7, #faf8f5);
    box-shadow: 0 18px 44px rgba(100, 75, 48, 0.09);
    color: var(--primary-dark);
}

.footer .footer-content {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 340px 52px;
    align-items: center;
    gap: 28px;
    padding-top: 28px;
    border-top: 1px solid #e5d7c7;
    text-align: left;
}

.footer-brand { min-width: 0; }
.footer-name {
    font: 600 30px/1.2 var(--font-heading);
    color: #332218;
}
.footer-subtitle {
    margin-top: 4px;
    font-size: 16px;
    line-height: 1.5;
    color: #8b8279;
    letter-spacing: 0.4px;
}

.footer .footer-copyright {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 72px;
    padding-left: 28px;
    border-left: 1px solid #e5d7c7;
    font-size: 13px;
    line-height: 1.8;
    text-align: left;
}

.footer .footer-legal {
    min-width: 0;
    margin: 0;
    padding-left: 28px;
    border-left: 1px solid #e5d7c7;
    text-align: left;
}
.footer .footer-legal-label {
    margin-bottom: 8px;
    color: #8b6641;
    font-size: 11px;
    line-height: 1.6;
    font-weight: 600;
    letter-spacing: 1.8px;
}
.footer .footer-legal-links {
    align-items: flex-start;
    gap: 2px;
}
.footer .footer-link,
.footer .footer-link:is(:link, :visited, :hover, :focus, :active) {
    color: var(--primary-dark);
    font-size: 13px;
    line-height: 1.6;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.footer .footer-legal-links > .footer-link,
.footer .footer-legal-links > .footer-link:first-child,
.footer .footer-legal-links > .footer-link:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 22px;
    max-width: 100%;
    padding: 0;
    text-align: left;
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 7px 18px rgba(110, 80, 48, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease;
}
.footer-top:hover { transform: translateY(-2px); }
.footer :focus-visible { outline: 2px solid var(--primary-color); outline-offset: 4px; }

@media (min-width: 1440px) {
    .footer { padding-inline: 36px; }
    .footer .footer-content { grid-template-columns: 240px minmax(0, 1fr) 340px 60px; gap: 40px; }
    .footer-name { font-size: 32px; }
    .footer-top { width: 60px; height: 60px; }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .footer .footer-content { grid-template-columns: 180px minmax(0, 1fr) 310px 52px; gap: 20px; }
    .footer-name { font-size: 28px; }
    .footer .footer-legal,
    .footer .footer-copyright { padding-left: 20px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .footer .footer-content {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
        grid-template-areas: "brand copyright" "legal top";
    }
    .footer-brand { grid-area: brand; }
    .footer .footer-copyright { grid-area: copyright; }
    .footer .footer-legal { grid-area: legal; padding-left: 0; border-left: 0; }
    .footer-top { grid-area: top; justify-self: end; }
}

@media (max-width: 767px) {
    .footer { margin: 16px; padding: 24px 20px; }
    .footer .footer-content { display: flex; flex-direction: column; gap: 0; padding-top: 0; border-top: 0; text-align: center; }
    .footer .footer-brand { width: 100%; text-align: center; }
    .footer-name { font-size: 30px; }
    .footer .footer-copyright { width: 100%; min-height: 0; margin-top: 20px; padding: 16px 0 0; border-left: 0; border-top: 1px solid #e5d7c7; text-align: center; }
    .footer .footer-legal { width: 100%; margin-top: 22px; padding: 0; border: 0; text-align: center; }
    .footer .footer-legal-links { align-items: center; gap: 0; }
    .footer .footer-legal-links > .footer-link,
    .footer .footer-legal-links > .footer-link:first-child,
    .footer .footer-legal-links > .footer-link:last-child { width: 100%; min-height: 44px; justify-content: center; text-align: center; }
    .footer .footer-legal-links > .footer-link:first-child { align-items: flex-end; padding-bottom: 3px; }
    .footer .footer-legal-links > .footer-link:last-child { align-items: flex-start; padding-top: 3px; }
    .footer-top { width: 60px; height: 60px; margin-top: 20px; }
}

@media (pointer: coarse) and (min-width: 768px) {
    .footer .footer-legal-links > .footer-link,
    .footer .footer-legal-links > .footer-link:first-child,
    .footer .footer-legal-links > .footer-link:last-child { min-height: 44px; }
}

@container (max-width: 600px) {
    .footer .footer-content { display: flex; flex-direction: column; gap: 0; padding-top: 0; border-top: 0; text-align: center; }
    .footer .footer-brand { width: 100%; text-align: center; }
    .footer .footer-copyright { width: 100%; min-height: 0; margin-top: 20px; padding: 16px 0 0; border-left: 0; border-top: 1px solid #e5d7c7; text-align: center; }
    .footer .footer-legal { width: 100%; margin-top: 22px; padding: 0; border: 0; text-align: center; }
    .footer .footer-legal-links { align-items: center; gap: 0; }
    .footer .footer-legal-links > .footer-link,
    .footer .footer-legal-links > .footer-link:first-child,
    .footer .footer-legal-links > .footer-link:last-child { width: 100%; min-height: 44px; justify-content: center; text-align: center; }
    .footer .footer-legal-links > .footer-link:first-child { align-items: flex-end; padding-bottom: 3px; }
    .footer .footer-legal-links > .footer-link:last-child { align-items: flex-start; padding-top: 3px; }
    .footer-top { width: 60px; height: 60px; margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .footer-top { transition: none; }
}
