@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,600;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400..700&family=Spectral:wght@400;500;700&display=swap');

body, dialog {
    font-family: 'Lora', Georgia, serif;
    color: #2c2c2c;
    background: #f5f5f5;
}

html, body {
    height: 100%;
}

footer {
    text-align: center;
    font-size: .8rem;
}

footer, .main-container {
    padding: 1rem;
}

a, a:visited {
    color: inherit;
    text-decoration: none;
}

.underline {
    box-shadow: 0 1px #777;
}

.underline:hover {
    box-shadow: 0 2px #777;
}

.capitulo {
    margin: 0;

    font-family: 'Spectral', serif;
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
}

.numero-estrofa {
    font-size: 1.5rem;
    font-weight: bold;
}

.estrofa, .capitulo, .numero-estrofa {
    line-height: 1.3;
}

.estrofa {
    font-family: 'Spectral', serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    padding-bottom: 2rem;
    white-space: pre;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#loading {
    text-align: center;
}

.main-container, #loading {
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: center;
    margin: 0 auto;
    max-width: 800px;
}

.info-container {
    display: block;
    max-width: 800px;
}

.info-container h1 {
    margin-bottom: .5em;
    text-align: center;
}

.info-container h2 {
    margin-block: .6em;
}

.info-container p {
    margin-bottom: 1em;
    hyphens: auto;
    text-align: justify;
    font-weight: 500;
}

.estrofa-container {
    display: grid;
    gap: 0 1rem;
    grid-template-columns: auto auto;
    margin: 0 auto;
    max-width: fit-content;
}

.estrofa-footer {
    display: flex;
    align-items: center;
}

.estrofa-footer > * {
    flex: 1;
}

.estrofa-footer-libro {
    font-size: .8rem;
}

.icons-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: right;
}

.icons-container > * {
    transition: transform 200ms;
    transition-timing-function: cubic-bezier(.68,-0.55,.27,1.55);
}
.icons-container > *:hover {
    transform: scale(1.2);
}

dialog {
    left: 50%;
    margin: 0;
    position: fixed;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    border-radius: 8px;
    border: none;
    padding: 1.5rem;
}

.share-dialog {
    min-width: 420px;
}

.share-dialog h2 {
    margin: 0;

    margin-bottom: 1rem;
    text-align: center;
}

dialog::backdrop {
    background: #0009;
}

.info-dialog {
    width: max-content;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.close-dialog {
    position: absolute;
    top: 0.35rem;
    right: 0.7rem;
    background: none;
    border: none;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    color: #777;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.close-dialog:hover {
    color: #000;
    background: #f0f0f0;
}

.share-buttons, .link-list {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0.4rem;
}

.link-list > *, .copy-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.92rem;
    color: #333;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-weight: 500;
}

.copy-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.6rem;
    background: #333;
    color: #fff;
    border-color: #333;
}

.copy-btn:hover {
    background: #000;
    border-color: #000;
}

.link-list > *:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.link-list > * svg, .copy-btn svg {
    flex-shrink: 0;
    height: 20px;
    overflow: visible;
    width: 20px;
}

@media (max-width: 564px) {
    .main-container {
        margin-inline: 0;
    }

    .share-dialog, .info-dialog {
        min-width: unset;
        width: 100%;
    }

    .share-buttons, .link-list {
        grid-template-columns: 1fr;
    }

    .capitulo {
        font-size: 2.5rem;
    }

    .estrofa-footer {
        align-items: baseline;
        flex-direction: column;
        gap: 1rem;
    }

    .estrofa, .numero-estrofa {
        font-size: 5vw;
    }

    .estrofa-footer-libro {
        font-size: 3.4vw;
        text-align: center;
        width: 100%;
    }

    .icons-container {
        gap: 12vw;
        justify-content: center;
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
    }

    .icons-container > * {
        padding: 1rem;
    }
}

.hidden {
    display: none;
}
