/* =================================================
   FONTES CUSTOMIZADAS (INALTERADAS)
================================================= */

@font-face {
    font-family: 'GaramondRegular';
    src: url('https://www.vozdivina.online/wp-content/font/GaramondRegular.ttf') format('truetype');
    font-weight: 400;
}

@font-face {
    font-family: 'DidotBold';
    src: url('https://www.vozdivina.online/wp-content/font/DidotBold.otf') format('opentype');
    font-weight: 700;
}

@font-face {
    font-family: 'Merriweather';
    src: url('https://www.vozdivina.online/wp-content/font/Merriweather.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Lora';
    src: url('https://www.vozdivina.online/wp-content/font/Lora.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'PTSerif-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/PTSerif-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'OpenSans';
    src: url('https://www.vozdivina.online/wp-content/font/OpenSans.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Raleway';
    src: url('https://www.vozdivina.online/wp-content/font/Raleway.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Poppins-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/Poppins-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Baskervville-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/Baskervville-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Ubuntu-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/Ubuntu-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Lato-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/Lato-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Montserrat';
    src: url('https://www.vozdivina.online/wp-content/font/Montserrat.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'SourceSansPro-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/SourceSansPro-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Roboto';
    src: url('https://www.vozdivina.online/wp-content/font/Roboto.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Orbitron';
    src: url('https://www.vozdivina.online/wp-content/font/Orbitron.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'CormorantGaramond';
    src: url('https://www.vozdivina.online/wp-content/font/CormorantGaramond.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'PressStart2P-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/PressStart2P-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Pacifico-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/Pacifico-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'PlayfairDisplay-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/PlayfairDisplay-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Bangers-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/Bangers-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Audiowide-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/Audiowide-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'FrederickatheGreat-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/FrederickatheGreat-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'WorkSans';
    src: url('https://www.vozdivina.online/wp-content/font/WorkSans.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Cinzel';
    src: url('https://www.vozdivina.online/wp-content/font/Cinzel.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'LibreBaskerville-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/LibreBaskerville-Regular.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Quicksand';
    src: url('https://www.vozdivina.online/wp-content/font/Quicksand.ttf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'SourceSerifPro-Regular';
    src: url('https://www.vozdivina.online/wp-content/font/SourceSerifPro-Regular.otf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'Domine';
    src: url('https://www.vozdivina.online/wp-content/font/Domine.ttf') format('opentype');
    font-weight: 400;
}

/* =================================================
   VARIÁVEIS DE TEMA (LIGADAS AO applyTheme)
================================================= */

:root {
    --theme-bg: #ffffff;
    --theme-text: #333333;
    --theme-border: #cccccc;

    --theme-button-bg: #fdf6e3;
    --theme-button-text: #5a4636;

    --font-label: 'DidotBold', serif;
    --font-text: 'GaramondRegular', serif;

    --font-size-default: 16px;

    --mode-label-bg: transparent;
    --mode-label-text: var(--theme-text);
    --mode-label-border: var(--theme-border);
}

/* =================================================
   BASE GLOBAL
================================================= */

#ver-container {
    background-color: var(--theme-bg);
    padding: 10px;
}

body {
    color: var(--theme-text);
}

/* =================================================
   VERSE LAYOUT
================================================= */

.verse-line {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 5px;
    max-width: 900px;
    margin: 0 auto;
    padding: 5px;
    border-radius: 5px;
}

.verse-number {
    font-family: 'GaramondRegular', serif;
    font-size: 1rem;
    color: #777;
    margin-right: 3px;
    min-width: 15px;
    text-align: right;
    align-self: flex-start;
    display: inline-block;
    width: 5px;
}

.verse-text {
    flex: 1;
    color: var(--theme-text);
    font-family: var(--font-text);
    font-size: var(--font-size-default);
    align-self: flex-start;
    text-align: justify;
    line-height: 1.2;
}

/* =================================================
   BOTÕES DE NAVEGAÇÃO
================================================= */

#navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.previous-bt,
.next-bt {
    background-color: var(--theme-button-bg);
    color: var(--theme-button-text);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: var(--font-label);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.previous-bt:hover,
.next-bt:hover {
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

.previous-bt:focus,
.next-bt:focus {
    outline: 2px solid var(--theme-border);
    outline-offset: 2px;
}

.previous-bt:disabled,
.next-bt:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* =================================================
   VERSE BUTTONS
================================================= */

.verse-buttons {
    display: flex;
    flex-direction: column;
    align-self: center;
    gap: 8px;
    margin-left: 10px;
    justify-content: flex-start;
    align-items: center;
}

.verse-buttons button {
    background-color: var(--theme-button-bg);
    color: var(--theme-button-text);
    border: 1px solid var(--theme-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    margin: 2px 0;
    font-size: 18px;
    opacity: 0.4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.verse-buttons button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.verse-buttons button:focus {
    outline: 2px solid var(--theme-border);
    outline-offset: 2px;
    opacity: 1;
}

.verse-buttons button:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    box-shadow: none;
}

/* =================================================
   TÍTULOS E LABELS
================================================= */

h1 {
    font-family: var(--font-label);
    font-size: 2.5rem;
    color: var(--theme-text);
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    font-family: var(--font-label);
    font-size: 2rem;
    color: var(--theme-text);
    text-align: left;
    margin-bottom: 20px;
}

label {
    font-family: var(--font-label);
    font-size: 16px;
    font-weight: bold;
    color: var(--theme-text);
    margin-bottom: 4px;
    display: inline-block;
}

/* =================================================
   MENU / SELECTS
================================================= */

select {
    appearance: none;
    background-color: var(--theme-bg);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: var(--font-label);
    font-size: 16px;
    width: 100%;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

select:hover {
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
}

select:focus {
    outline: none;
    border: 1px solid var(--theme-border);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

option {
    background-color: var(--theme-bg);
    color: var(--theme-text);
    font-family: var(--font-label);
    font-size: 16px;
}

/* =================================================
   CONTAINER PRINCIPAL
================================================= */

#ver-container {
    padding: 10px;
    background-color: var(--theme-bg);
}

/* =================================================
   BOTÕES TOPO (TEMA / TAMANHO)
================================================= */

.div-theme-and-size {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-inline: 8px;
}

.btn-fontsize,
.btn-theme {
    background-color: var(--theme-button-bg);
    color: var(--theme-button-text);
    border: 1px solid var(--theme-border);
    border-radius: 25px;
    height: 36px;
    width: 36px;
    padding: 6px;
    font-size: 16px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Ícones via imagem */

#theme-button {
    background-image: url('https://www.vozdivina.online/wp-content/uploads/leitor/theme.png');
    background-size: cover;
    background-position: center;
    color: transparent;
    font-size: 0;
    line-height: 0;
}

#fontsize-button {
    background-image: url('https://www.vozdivina.online/wp-content/uploads/leitor/size.png');
    background-size: cover;
    background-position: center;
    color: transparent;
    font-size: 0;
    line-height: 0;
}

#theme-button,
#btn-verses,
#btn-align,
#btn-border {
    color: transparent;
    font-size: 0;
    line-height: 0;
}

/* ===============================
   MODOS DE VISUALIZAÇÃO
   (LEITURA / CRIAR ARTE)
=============================== */

/* ---------- LABEL DE MODO (BASE) ---------- */
#ver-container .mode-label {
    text-align: center;
    font-family: 'DidotBold', serif;
    font-size: 14px;
    margin: 6px 0 15px 0;
}

/* =================================================
   MODO LEITURA — FOCO TOTAL NO TEXTO
================================================= */

#ver-container.mode-leitura .verse-buttons,
#ver-container.mode-leitura .bt-export,
#ver-container.mode-leitura .bt-export * {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#ver-container.mode-leitura .verse-line {
    display: block;
}

#ver-container.mode-leitura .verse-text {
    width: 100% !important;
    max-width: 100% !important;
}

/* =================================================
   MODO CRIAR ARTE — BOTÕES + LAYOUT ORIGINAL
================================================= */

#ver-container.mode-arte .verse-buttons {
    display: flex;
}

#ver-container.mode-arte .verse-line {
    display: flex;
    align-items: center;
}

#ver-container.mode-arte .verse-text {
    max-width: 600px;
}

/* =================================================
   BOTÃO DE ALTERNAR MODO
================================================= */

#mode-button {
    width: 36px;
    height: 36px;
    padding: 6px;

    border-radius: 25px;
    cursor: pointer;

    background-color: var(--theme-button-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border: 1px solid var(--theme-border);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);

    transition: background-color 0.3s, box-shadow 0.3s, transform 0.2s ease, opacity 0.2s ease;

    appearance: none;
    -webkit-appearance: none;
    
    position: relative;
}

#mode-button:hover {
    transform: scale(1.05);
    opacity: 0.85;
}

/* =================================================
   TOOLTIP
================================================= */

.has-tooltip {
    position: relative;

    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.tooltip {
    position: absolute;
    top: calc(100% + 8px); /* 👈 abaixo do botão */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;

    background-color: #3a2f25;
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9999; /* 👈 garante que fique acima do menu */
}

.has-tooltip:hover .tooltip {
    opacity: 1;
}

.tooltip-left .tooltip {
    left: auto;
    right: 0;
    transform: none;
}

@media (hover: none) and (pointer: coarse) {
    .has-tooltip:hover .tooltip {
        opacity: 0;
    }
}

/* -------------------------------------------------
   ÍCONE DO BOTÃO (SEMPRE MOSTRA O MODO OPOSTO)
------------------------------------------------- */

/* Está em MODO LEITURA → mostra ícone de CRIAR ARTE */
#ver-container.mode-leitura #mode-button {
    background-image: url('https://www.vozdivina.online/wp-content/uploads/leitor/art-mode.png') !important;
}

/* Está em MODO CRIAR ARTE → mostra ícone de LEITURA */
#ver-container.mode-arte #mode-button {
    background-image: url('https://www.vozdivina.online/wp-content/uploads/leitor/leitura.png') !important;
}

/* =================================================
   MODE LABEL (TAG FINAL COM OUTLINE DINÂMICO)
================================================= */

.mode-label {
    display: inline-block;
    margin-top: 6px;
    margin-bottom: 20px;

    padding: 4px 10px;
    border-radius: 12px;

    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;

    /* 🔑 AGORA TOTALMENTE TEMÁTICO */
    background-color: var(--mode-label-bg);
    color: var(--mode-label-text);
    border: 1px solid var(--mode-label-border);

    font-family: var(--font-label);
}

/*
#ver-container.mode-leitura .mode-label {
    background: rgba(58, 92, 122, 0.08);
    color: #3a5c7a;
}

#ver-container.mode-arte .mode-label {
    background: rgba(138, 90, 43, 0.10);
    color: #8a5a2b;
}
*/

/* =================================================
   RESPONSIVO — MOBILE
================================================= */

@media (max-width: 768px) {

    label {
        font-size: 14px;
    }

    select {
        font-size: 14px;
    }

    .verse-buttons button {
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 50%;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #ver-container.mode-leitura .verse-line {
        padding: 3px 0;
    }

}

/* =================================================
   RESPONSIVO — DESKTOP
================================================= */

@media (min-width: 1024px) {

    .verse-line {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 15px;
        max-width: 900px;
        margin: 0 auto;
    }

    .verse-number {
        width: auto;
        margin-right: 10px;
        font-size: 1rem;
    }

    .verse-text {
        max-width: 600px;
        line-height: 1.6;
        text-align: justify;
    }

    .verse-buttons {
        flex-direction: row;
        gap: 15px;
        margin-left: auto;
    }

    .verse-buttons button {
        width: 32px;
        height: 32px;
        padding: 0;
        border-radius: 50%;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
}