:root {
    color-scheme: light dark;

    --background: light-dark(white, #111);
    --text: light-dark(black, white);
    --muted: light-dark(#666, #aaa);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--text);
    font-family: system-ui;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

#bloquecito {
    width: min(50vw, 13em);
    border: currentColor;
    border-style: solid;
    border-width: thin;
    padding: 1vw;
    /* Opcional para que no pegue el texto al borde */
}

.title {
    font-family: Garamond, serif;
    font-size: min(2em, 4cqw);

    /* Forzamos la justificación global y de la última línea en cada renglón */
    text-align: justify;
    text-align-last: justify;
    text-justify: inter-character;
}

/* Hacemos que cada span baje a su propia línea */
.title span {
    display: block;
}

.title span:nth-child(1) {
    font-size: 1.25em;
    line-height: 1;
}

.title span:nth-child(2) {
    font-size: .8em;
}

.title span:nth-child(3) {
    color: grey;
    font-variant: small-caps;
    font-size: 0.5em;
}

.title span:nth-child(4) {
    color: grey;
    font-size: 0.5em;
}

.map-container {
    width: 85vw;
    max-width: 1100px;
}

.map-container svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}

/* Cambia esto en tu style.css */
.map-container svg a text {
    fill: white !important;
}

.links a {
    color: var(--text);
    text-decoration: underline;
}

.route-link {
    font-weight: 600;
}

.last-update {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.2;
    margin-top: -0.3rem;
}

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.emergency-number {
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.emergency-number a {
    color: inherit;
    text-decoration: underline;
}

@supports not (text-justify: inter-character) {
    .title {
        text-align: center;
        text-align-last: center;
        text-anchor: middle;
    }
}

@media (orientation: portrait) {
    main {
        position: relative;
        align-items: flex-end;
        padding-left: 20vw;
        padding-right: 5vw;
    }

    .map-container {
        position: absolute;
        left: 0;
        top: 50%;
        width: 90vh;
        max-width: none;
        transform: translate(-38%, -50%) rotate(90deg);
    }

    #link-basilica text {
        transform: rotate(-90deg);
        transform-origin: 27px 29px;
    }

    #link-gral-rodriguez text {
        transform: rotate(-90deg);
        transform-origin: 246px 86px;
    }

    #link-moreno text {
        transform: rotate(-90deg);
        transform-origin: 457px 141px;
    }

    #link-merlo text {
        transform: rotate(-90deg);
        transform-origin: 538px 159px;
    }

    #link-moron text {
        transform: rotate(-90deg);
        transform-origin: 681px 147px;
    }

    #link-liniers text {
        transform: rotate(-90deg);
        transform-origin: 799px 125px;
    }

    .title,
    .links {
        width: 75vw;
    }
}