/* Shared footer controls. Existing brands, copyright and backgrounds stay intact. */
.portfolio-footer, .legal-footer {
    --footer-ink: #edf3fc;
    --footer-muted: #afbdd1;
    --footer-line: #aebfd133;
    --footer-accent: #74e1c2;
    --footer-settings: #d2c9ff;
    --footer-settings-line: #b4a3ff66;
    --footer-settings-bg: #a895ff0c;
    --footer-settings-hover: #a895ff20;
}
body.light-theme :is(.portfolio-footer, .legal-footer),
[data-theme="light"] :is(.portfolio-footer, .legal-footer) {
    --footer-ink: #172b35;
    --footer-muted: #52636f;
    --footer-line: #19333c33;
    --footer-accent: #087b68;
    --footer-settings: #564484;
    --footer-settings-line: #74609670;
    --footer-settings-bg: #74609609;
    --footer-settings-hover: #74609618;
}
.portfolio-footer .footer-controls,
.portfolio-footer .footer-controls * { box-sizing: border-box; }
.portfolio-footer .footer-controls {
    flex: 0 1 620px;
    min-width: 0;
    display: grid;
    gap: 23px;
    text-align: left;
}
.portfolio-footer .footer-control-label {
    margin: 0;
    color: var(--footer-muted);
    font: 500 9px/1.6 Consolas, "Liberation Mono", monospace;
    letter-spacing: .105em;
    text-transform: uppercase;
}
.portfolio-footer .footer-documents > .footer-control-label { margin-bottom: 8px; }
.portfolio-footer .footer-links {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 20px;
}
.portfolio-footer .footer-links .footer-document {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    min-height: 47px;
    margin: 0;
    padding: 9px 0 12px;
    border: 0;
    border-bottom: 1px solid var(--footer-line);
    border-radius: 0;
    background: none;
    color: var(--footer-ink);
    font: 500 12px/1.5 Inter, system-ui, sans-serif;
    letter-spacing: -.01em;
    text-align: left;
    text-decoration: none;
    text-transform: none;
    box-shadow: none;
    transform: none;
    transition: color .22s ease;
}
.portfolio-footer .footer-document::before { display: none; }
.portfolio-footer .footer-document::after {
    content: "";
    position: absolute;
    inset: auto 0 -1px;
    height: 1px;
    background: var(--footer-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .28s cubic-bezier(.22,.68,0,1);
}
.portfolio-footer .footer-document-arrow {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    color: var(--footer-accent);
    transition: transform .28s cubic-bezier(.22,.68,0,1);
}
.portfolio-footer .footer-document:focus-visible { color: var(--footer-accent); }
.portfolio-footer .footer-document:focus-visible::after { transform: scaleX(1); }
.portfolio-footer .footer-preferences {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
/* Hide the whole action group if the existing privacy controller is unavailable. */
.portfolio-footer .footer-preferences:has([data-cookie-footer][hidden]) { display: none; }
.portfolio-footer .footer-control-hint {
    margin: 3px 0 0;
    color: var(--footer-muted);
    font: 400 11px/1.6 Inter, system-ui, sans-serif;
}
:is(.portfolio-footer, .legal-footer) .footer-settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    flex: 0 0 auto;
    min-height: 46px;
    max-width: 100%;
    margin: 0;
    padding: 11px 15px;
    border: 1px solid var(--footer-settings-line);
    border-radius: 5px;
    background: var(--footer-settings-bg);
    color: var(--footer-settings);
    font: 500 12px/1.5 Inter, system-ui, sans-serif;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
    transition: background .22s ease, border-color .22s ease;
}
/* A decorative CSS icon survives the privacy controller's translated textContent. */
:is(.portfolio-footer, .legal-footer) .footer-settings::before {
    content: "";
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: currentColor;
    --footer-control-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M3 7h4m6 0h8M3 17h10m6 0h2'/%3E%3Ccircle cx='10' cy='7' r='3'/%3E%3Ccircle cx='16' cy='17' r='3'/%3E%3C/svg%3E");
    -webkit-mask: var(--footer-control-icon) center / contain no-repeat;
    mask: var(--footer-control-icon) center / contain no-repeat;
}
:is(.portfolio-footer, .legal-footer) .footer-settings:focus-visible {
    background: var(--footer-settings-hover);
    border-color: var(--footer-settings);
}
.portfolio-footer .footer-controls :focus-visible {
    outline: 2px solid var(--footer-accent);
    outline-offset: 5px;
}
:is(.portfolio-footer, .legal-footer) .footer-settings:focus-visible { outline: 2px solid var(--footer-settings); outline-offset: 5px; }
.portfolio-footer .footer-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
@media (hover: hover) {
    .portfolio-footer .footer-links .footer-document:hover { color: var(--footer-accent); }
    .portfolio-footer .footer-document:hover::after { transform: scaleX(1); }
    .portfolio-footer .footer-document:hover .footer-document-arrow { transform: translate(2px,-2px); }
    :is(.portfolio-footer, .legal-footer) .footer-settings:hover { background: var(--footer-settings-hover); border-color: var(--footer-settings); }
}
@media (max-width: 1060px) {
    .portfolio-footer .footer-inner { align-items: flex-start; flex-direction: column; gap: 30px; }
    .portfolio-footer .footer-controls { flex-basis: auto; width: 100%; }
}
@media (max-width: 540px) {
    .portfolio-footer .footer-links { grid-template-columns: minmax(0,1fr); gap: 0; }
    .portfolio-footer .footer-links .footer-document { min-height: 48px; padding: 12px 0; font-size: 13px; }
    .portfolio-footer .footer-preferences { align-items: flex-start; flex-direction: column; gap: 14px; }
    :is(.portfolio-footer, .legal-footer) .footer-settings { justify-content: flex-start; min-height: 48px; }
    .portfolio-footer .footer-controls { gap: 25px; }
}
@media (prefers-reduced-motion: reduce) {
    .portfolio-footer .footer-controls *, .portfolio-footer .footer-controls *::after, .legal-footer .footer-settings { transition: none; }
    .portfolio-footer .footer-document:hover .footer-document-arrow { transform: none; }
}
@media (forced-colors: active) {
    .portfolio-footer .footer-document { color: LinkText; border-color: LinkText; }
    .portfolio-footer .footer-document-arrow { color: LinkText; }
    :is(.portfolio-footer, .legal-footer) .footer-settings { color: ButtonText; background: ButtonFace; border-color: ButtonText; }
    :is(.portfolio-footer, .legal-footer) .footer-settings::before { forced-color-adjust: none; background: ButtonText; }
    .portfolio-footer .footer-controls :focus-visible, .legal-footer .footer-settings:focus-visible { outline-color: Highlight; }
}
@media print { .portfolio-footer .footer-preferences { display: none; } }
