/* Phase 3 visual consistency, accessibility, map, and newsletter layer. */
:root {
    --tisa-blue: #0059a9;
    --tisa-blue-dark: #003f78;
    --tisa-yellow: #f6bd0c;
    --tisa-green: #71c402;
    --tisa-ink: #26313a;
    --tisa-muted: #5d6770;
    --tisa-border: #c8d2dc;
    --tisa-surface: #f4f7fa;
    --tisa-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body,
button,
input,
select,
textarea {
    font-family: var(--tisa-font);
}

body {
    margin: 0;
    color: var(--tisa-ink);
    font-size: 15px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font-size: 1rem;
    line-height: 1.35;
}

a {
    color: #075f9f;
}

a:hover,
a:focus-visible {
    color: var(--tisa-blue-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--tisa-yellow);
    outline-offset: 2px;
}

#wrap {
    min-height: 1px;
}

#cont {
    color: var(--tisa-ink);
}

#cont .page-heading {
    margin: 0 0 16px;
    padding: 0 0 8px;
    border-bottom: 2px solid #a8bdd1;
    color: var(--tisa-blue-dark);
    font-family: var(--tisa-font);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -.01em;
}

.titu {
    font-family: var(--tisa-font);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.subtitu,
.lema {
    font-family: var(--tisa-font);
    line-height: 1.4;
}

.subtitu {
    font-size: 16px;
}

.lema {
    font-size: 16px;
}

#cont p,
.wrapcont ul li {
    font-size: 15px;
    line-height: 1.55;
}

.wrapcont ul li {
    margin-top: 5px;
    margin-bottom: 5px;
}

#menu {
    border-color: var(--tisa-blue-dark);
    font-family: var(--tisa-font);
    font-size: 13px;
    line-height: 1.25;
}

#menu li {
    margin: 0;
    border-bottom-color: #d5e0ea;
    background: var(--tisa-blue);
}

#menu li a:link,
#menu li a:visited,
#menu li a:active {
    box-sizing: border-box;
    min-height: 30px;
    padding: 7px 8px;
    color: #fff;
}

#menu li a:hover,
#menu li a:focus-visible {
    color: #10212f;
    background: #e3f1dc;
}

.ruta,
#ruta {
    font-size: 13px;
    line-height: 1.45;
}

#footer p,
.contact-privacy-notice {
    font-size: 13px;
    line-height: 1.55;
}

.fbt,
.tisa-button {
    box-sizing: border-box;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--tisa-blue-dark);
    border-radius: 4px;
    color: #fff;
    background: var(--tisa-blue);
    font-family: var(--tisa-font);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
}

.fbt:hover,
.fbt:focus-visible,
.tisa-button:hover,
.tisa-button:focus-visible {
    color: #fff;
    background: var(--tisa-blue-dark);
}

img {
    height: auto;
}

/* Compact language and social controls over the legacy header image. */
#ar_log_pub {
    position: relative;
}

.header-utilities {
    position: absolute;
    z-index: 40;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 7px;
    align-items: flex-start;
}

.header-social-link,
.language-switcher summary {
    display: flex;
    box-sizing: border-box;
    min-width: 40px;
    min-height: 40px;
    padding: 7px 9px;
    border: 1px solid rgba(0, 63, 120, .35);
    border-radius: 5px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
    color: var(--tisa-blue-dark);
    background: rgba(255, 255, 255, .94);
}

.header-social-link:hover,
.header-social-link:focus-visible,
.language-switcher summary:hover,
.language-switcher summary:focus-visible,
.language-switcher[open] summary {
    color: #fff;
    background: var(--tisa-blue-dark);
}

.header-social-link svg,
.language-switcher summary svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.language-switcher {
    position: relative;
}

.language-switcher summary {
    min-width: 62px;
    list-style: none;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.language-switcher summary::-webkit-details-marker {
    display: none;
}

.language-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 168px;
    padding: 5px;
    border: 1px solid var(--tisa-border);
    border-radius: 5px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
    background: #fff;
}

.language-menu a {
    display: block;
    padding: 9px 10px;
    border-radius: 3px;
    color: var(--tisa-ink);
    font-size: 14px;
}

.language-menu a:hover,
.language-menu a:focus-visible,
.language-menu a[aria-current="page"] {
    color: #fff;
    background: var(--tisa-blue);
}

.social-callout {
    clear: both;
    margin: 24px 0 12px;
    padding: 18px;
    border: 1px solid #b8cad9;
    border-left: 5px solid var(--tisa-yellow);
    border-radius: 5px;
    background: var(--tisa-surface);
}

.social-callout h2 {
    margin: 0 0 6px;
    color: var(--tisa-blue-dark);
    font-size: 20px;
    line-height: 1.3;
}

.social-button {
    display: inline-block;
    margin-top: 6px;
    color: #fff !important;
    text-decoration: none;
}

p.imgrigth img,
p.imgleft img,
p.imgleftp img,
.wrapcont img {
    height: auto;
}

/* Contact-page map: the third-party frame is created only after a visitor asks for it. */
.location-section {
    clear: both;
    margin: 24px 0 12px;
    padding-top: 18px;
    border-top: 1px solid var(--tisa-border);
}

.location-section h2 {
    margin: 0 0 8px;
    color: var(--tisa-blue-dark);
    font-size: 20px;
    line-height: 1.3;
}

.map-shell {
    box-sizing: border-box;
    min-height: 260px;
    margin-top: 12px;
    border: 1px solid var(--tisa-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--tisa-surface);
}

.map-placeholder {
    box-sizing: border-box;
    display: flex;
    min-height: 260px;
    padding: 24px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.map-placeholder p {
    max-width: 470px;
    margin: 0 0 14px;
}

.map-shell iframe {
    display: block;
    width: 100%;
    min-height: 320px;
    border: 0;
}

/* Newsletter dialog */
.newsletter-dialog[hidden] {
    display: none;
}

.newsletter-dialog {
    position: fixed;
    z-index: 10020;
    inset: 0;
    display: flex;
    box-sizing: border-box;
    padding: 18px;
    align-items: center;
    justify-content: center;
    background: rgba(12, 25, 36, .72);
    text-align: left;
}

.newsletter-card {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 36px);
    padding: 30px;
    border: 1px solid #d9e1e8;
    border-top: 6px solid var(--tisa-yellow);
    border-radius: 8px;
    overflow-y: auto;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    color: var(--tisa-ink);
    background: #fff;
}

.newsletter-card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 42%;
    height: 6px;
    background: var(--tisa-green);
    content: "";
}

.newsletter-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #33414d;
    background: #eef2f5;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.newsletter-card h2 {
    max-width: 420px;
    margin: 0 42px 10px 0;
    color: var(--tisa-blue-dark);
    font-size: 25px;
    line-height: 1.2;
}

.newsletter-intro {
    margin: 0 0 18px;
    color: #42515d;
    font-size: 15px;
    line-height: 1.55;
}

.newsletter-field {
    margin: 13px 0;
}

.newsletter-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.newsletter-field input[type="text"],
.newsletter-field input[type="email"] {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid #8b99a5;
    border-radius: 4px;
}

.newsletter-consent {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    margin: 16px 0;
    color: #45535e;
    font-size: 13px;
    line-height: 1.45;
}

.newsletter-consent input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
}

.newsletter-submit {
    width: 100%;
}

.newsletter-fine-print {
    margin: 12px 0 0;
    color: var(--tisa-muted);
    font-size: 12px;
    line-height: 1.45;
}

.newsletter-trap {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.site-notice {
    box-sizing: border-box;
    width: min(955px, calc(100% - 20px));
    margin: 8px auto;
    padding: 11px 14px;
    border: 1px solid #add8b6;
    border-radius: 4px;
    color: #155724;
    background: #e0f3e4;
    font-size: 14px;
    text-align: left;
}

.site-notice-error {
    border-color: #e2b8bd;
    color: #721c24;
    background: #f8e2e4;
}

body.has-modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    #cont .page-heading {
        font-size: 22px;
    }

    .newsletter-dialog {
        padding: 8px;
    }

    .newsletter-card {
        max-height: calc(100vh - 16px);
        padding: 24px 18px 20px;
    }

    .newsletter-card h2 {
        font-size: 22px;
    }

    .map-shell,
    .map-placeholder {
        min-height: 230px;
    }

    .header-utilities {
        top: 6px;
        right: 6px;
        gap: 5px;
    }

    .header-social-link,
    .language-switcher summary {
        min-width: 36px;
        min-height: 36px;
        padding: 6px 7px;
    }

    .language-switcher summary {
        min-width: 54px;
    }

    .header-social-link svg,
    .language-switcher summary svg {
        width: 20px;
        height: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}
