@import url("https://fonts.googleapis.com/css?family=Figtree&display=swap");

html,
body {
    background-color: color-mix(in srgb, var(--theme-foreground) 2%, var(--theme-background-a));
}

body {
    padding: 0;
    font-family: "Figtree";
}

#observablehq-center {
    margin: 0;
}

.header,
.listado,
.tablaContenedor,
.busquedaContenedor {
    justify-content: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    margin: 4rem 2rem 2rem 2rem;

    .title,
    .subtitle {
        text-align: center;
        line-height: 1.1;
    }

    .title {
        font-size: 3.7rem;
        font-weight: 700;
        margin-bottom: 1.5rem;
    }

    .subtitle {
        font-weight: 300;
        font-size: 1.5rem;
    }
}

.listado {

    .tablaContenedor,
    .busquedaContenedor {
        max-width: 700px;
    }

    .busquedaContenedor {
        padding: 2rem;

        input {
            border-radius: 10px;
            border: 1px solid var(--theme-background-b);
            background-color: var(--theme-background-a);
            padding: 10px 15px;
        }

        output {
            font-size: 0.8rem;
            opacity: 0.5;
        }
    }

    .tablaContenedor:has(form) {
        padding: 0 1rem;
        border: 1px solid var(--theme-background-b);
        border-radius: 10px;
        background-color: var(--theme-background-a);

        form {
            scrollbar-width: none;
        }
    }

    .tablaContenedor observablehq-loading::before {
        display: none;
    }

    table {
        thead {
            border: 0;
        }

        input[type="checkbox"] {
            visibility: hidden;
        }

        thead {
            display: none;

            th {
                border-bottom: none;
                z-index: 10;
            }
        }

        tr:not(:last-child) td {
            border-bottom: 1px solid var(--theme-background-b);
        }
    }

    .capa {

        margin: 1.3rem 0;
        font-size: 1rem;
        display: flex;

        .imagenContenedor {
            margin: 15px 15px 10px 0px;
        }

        .imagen {
            width: 80px;
            height: 80px;
            border-radius: 5px;
        }

        .detalles {
            max-width: calc(100% - 100px);
        }

        .titulo {
            font-size: 1.2rem;
        }

        .nombreTexto,
        .descripcion,
        .geoserver,
        .fecha {
            font-size: .8rem;
        }

        .nombreContenedor {
            margin: 10px 0px;

            .titulo,
            .nombreTexto,
            .descripcion,
            .geoserver {
                margin: 8px 0;
            }

            .nombre {
                display: flex;
                align-items: baseline;
                column-gap: 10px;
                max-width: 500px;
                flex-wrap: wrap;
            }

            .titulo {
                font-weight: 700;
            }

            .nombreTexto {
                opacity: 0.6;
            }

            .descripcion {
                max-width: 500px;
                white-space: normal;
                font-style: italic;
            }

            .geoserver {
                max-width: 500px;
                white-space: normal;

                span {
                    opacity: .6;
                }
            }
        }

        .fechas {
            margin: 8px 0px;
            display: flex;
            flex-direction: row;
            gap: 10px;
        }

        .fecha {
            opacity: 0.6;
        }

        .enlaces {
            margin: 10px 0px;
            font-size: 0.7rem;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .enlace {
            padding: 5px;
            border-radius: 4px;
            color: inherit;
            border: 1px solid #dadee7;
            background: #dadee7aa;
            opacity: .8;
        }

        .enlace:hover {
            opacity: 1;
            text-decoration: none;
        }

        .enlaceWms {
            border: 1px solid #b7dbcb;
            background: #b7dbcbaa;
        }

        .enlaceWfs {
            border: 1px solid #b7daeb;
            background: #b7daebaa;
        }
    }

    .capa {
        padding: 0 !important;
        position: relative;
    }

    td {
        padding: 0 !important;
    }

    tr:not(:has(.capa)) {
        td:nth-of-type(2) {
            visibility: hidden;
        }

        td:nth-of-type(2):after {
            visibility: visible;
            display: block;
            padding-top: 5px;
            text-align: center;
            font-style: normal;
            content: "ʘ⁠‿⁠ʘ"
        }
    }
}

.footer {
    font-size: .9rem;
    text-align: center;
    margin: 3rem 0;

    .plant {
        margin: 2rem;
    }

    .footerEntry {
        margin: .5rem;

        a {
            font-weight: 700;
        }
    }
}

@media (prefers-color-scheme: dark) {
    .capa .enlace {
        color: #1f2022 !important;
        border: 1px solid rgb(0, 0, 0, 0) !important;
    }
}

@media only screen and (max-width: 600px) {

    #observablehq-center,
    #observablehq-main,
    .grid {
        margin: 0;
    }

    .card {
        border-radius: 0px;
    }

    tr> :first-of-type {
        display: none;
    }

    td {
        overflow: scroll !important;
    }
}

@media only screen and (min-width: 600px) {
    .capa::after {
        top: 0;
        background: linear-gradient(to right, transparent 80%, var(--theme-background-a));
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        pointer-events: none;
        z-index: 8;
        bottom: 0;
    }
}