/*
Theme Name: Agha Care Theme
Theme URI: https://aghacare.com.br
Author: Carlos Gama
Author URI: https://aghacare.com.br
Description: Tema mínimo e limpo desenvolvido exclusivamente para o plugin Agha Care. Fornece apenas configurações globais de cores, fontes e botões, sem elementos visuais que possam conflitar com o plugin.
Version: 1.3.45
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: Proprietary
License URI: https://aghacare.com.br
Text Domain: aghacare-theme
Tags: custom-colors, custom-logo, full-width-template, one-column
*/

/* ================================================================= */
/* RESET & BASE                                                      */
/* ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');

:root,
html,
body {
    /* Cores globais */
    --color-black: #000000;
    --color-white: #ffffff;
    --color-border: rgba(213,220,223,0.75);
    --color-gray-light: #F8F9FA;
    --color-gray: #6B7280;
    --color-primary: #2568EF; /* padrão — sobrescrito pelo plugin Identidade Visual */
    --color-text: #4F585A;
    --color-title: #050505;
    --color-title-dark: #F5F5F5;
    --color-gray-dark: #4D5F64;
    --color-muted: #f5f5f5;
    --font-family-base: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Layout — menu (fonte canônica, usada pelo menu.css e layout) */
    --agha-header-height: 60px;
    --agha-menu-width: 250px;
    --agha-admin-bar-offset: 0px;

    /* Layout legado — espelha variáveis canônicas para snippets antigos */
    --header-height: var(--agha-header-height, 60px);
    --menu-width-desktop: var(--agha-menu-width, 250px);
    --admin-bar-offset: var(--agha-admin-bar-offset, 0px);
}

:root.dark-mode,
html.dark-mode,
html.dark-mode body,
body.dark-mode,
body.dark-mode main,
[data-theme="dark"],
[data-theme="dark"] body,
[data-theme="dark"] main {
    --color-title: var(--color-title-dark, #F5F5F5) !important;
}

body.admin-bar {
    --agha-admin-bar-offset: 32px;
    --admin-bar-offset: var(--agha-admin-bar-offset, 32px);
}

html:has(.agha-sidebar.is-collapsed),
body:has(.agha-sidebar.is-collapsed) {
    --agha-menu-width: 55px;
    --menu-width-desktop: 55px;
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        --agha-admin-bar-offset: 46px;
        --admin-bar-offset: var(--agha-admin-bar-offset, 46px);
    }
}

/* ================================================================= */
/* RESET MÍNIMO                                                      */
/* ================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-base);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================================= */
/* TIPOGRAFIA                                                        */
/* ================================================================= */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em 0;
    font-family: var(--font-family-base);
    font-weight: 500;
    line-height: 1.3;
    color: var(--color-title, var(--color-black));
}

h1 {
    font-size: 24px;
    font-weight: 500;
    color: var(--color-title, var(--color-black));
}
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 13px; }

p {
    margin: 0 0 1em 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--color-primary);
    filter: none !important;
    opacity: 1 !important;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ================================================================= */
/* FORMULÁRIOS BASE                                                  */
/* ================================================================= */

input,
select,
textarea,
button {
    font-family: var(--font-family-base);
    font-size: 14px;
}

/* ================================================================= */
/* LAYOUT PRINCIPAL                                                  */
/* ================================================================= */

/* Base: sem menu (visitantes, login, etc.) */
main.site-content {
    min-height: 100vh;
    box-sizing: border-box;
}

/* Desktop logado: empurra conteúdo para a direita do sidebar.
   Usa var(--agha-menu-width) que é atualizada pelo JS ao colapsar/expandir. */
body.layout-desktop-ativo main.site-content,
.agha-sidebar ~ main.site-content {
    width: calc(100% - var(--agha-menu-width, 250px));
    max-width: calc(100% - var(--agha-menu-width, 250px));
    margin-left: var(--agha-menu-width, 250px);
    padding-top: calc(var(--agha-header-height, 60px) + 20px);
    padding-bottom: 40px;
    transition: width 250ms ease, max-width 250ms ease, margin-left 250ms ease;
}

/* Conteúdo interno: 95% do espaço disponível, centralizado */
body.layout-desktop-ativo main.site-content .entry-content,
.agha-sidebar ~ main.site-content .entry-content {
    width: 95%;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Exceção: páginas sem menu (login, seleção de ambiente, front page) */
body.page-slug-login main.site-content,
body.page-slug-painel main.site-content,
body.home main.site-content {
    margin-left: 0;
    padding-top: 0;
}

body.page-slug-login main.site-content .entry-content,
body.page-slug-painel main.site-content .entry-content,
body.home main.site-content .entry-content {
    width: 100%;
    max-width: 100%;
}

/* Ocultar título padrão do WordPress */
.entry-title,
.page-title,
.wp-block-post-title {
    display: none;
}

/* ================================================================= */
/* MOBILE                                                            */
/* ================================================================= */

@media (max-width: 767px) {
    body.layout-desktop-ativo main.site-content,
    .agha-sidebar ~ main.site-content {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        padding-top: calc(var(--agha-header-height, 60px) + var(--agha-admin-bar-offset, 0px) + 20px);
        transition: none;
    }

    /* Mobile logado: empurra conteúdo para baixo do header fixo */
    body.logged-in main.site-content {
        padding-top: calc(var(--agha-header-height, 60px) + var(--agha-admin-bar-offset, 0px) + 20px);
    }

    /* Exceção: páginas sem menu (login, seleção de ambiente, front page) */
    body.logged-in.page-slug-login main.site-content,
    body.logged-in.page-slug-painel main.site-content,
    body.logged-in.home main.site-content {
        padding-top: 0;
    }

    main.site-content .entry-content {
        width: 100%;
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 50px;
    }
}

/* ================================================================= */
/* UTILITÁRIOS                                                       */
/* ================================================================= */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}
