/* ==========================================================================
   OfficeGest Modern - Custom CSS v4 (Page polish)
   ========================================================================== */

/* Tokens base ---------------------------------------------------------- */
:root {
    --og-r-sm: 6px;
    --og-r-md: 10px;
    --og-r-lg: 14px;
    --og-r-xl: 20px;
    --og-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.15);
    --og-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --og-shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.35), 0 4px 8px rgba(0, 0, 0, 0.2);

    --og-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    --og-header-bg: 11, 22, 32;
}

/* LIGHT MODE override -------------------------------------------------- */
:root[data-theme="light"] {
    --wp--preset--color--bg: #FAFBFC;
    --wp--preset--color--surface: #FFFFFF;
    --wp--preset--color--elevated: #F5F7FA;
    --wp--preset--color--border: #E1E7EE;
    --wp--preset--color--text: #0F1B26;
    --wp--preset--color--muted: #5A6B7E;
    --og-header-bg: 250, 251, 252;
    --og-shadow-sm: 0 1px 2px rgba(15, 27, 38, 0.05), 0 1px 3px rgba(15, 27, 38, 0.04);
    --og-shadow-md: 0 4px 12px rgba(15, 27, 38, 0.08), 0 2px 4px rgba(15, 27, 38, 0.04);
    --og-shadow-lg: 0 16px 40px rgba(15, 27, 38, 0.10), 0 4px 12px rgba(15, 27, 38, 0.06);
}

:root[data-theme="light"] body {
    background-color: var(--wp--preset--color--bg);
    color: var(--wp--preset--color--text);
}

:root[data-theme="light"] .has-bg-background-color {
    background-color: var(--wp--preset--color--bg) !important;
}

:root[data-theme="light"] .has-surface-background-color {
    background-color: var(--wp--preset--color--surface) !important;
}

/* BASE ----------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 200ms ease, color 200ms ease;
}

img { max-width: 100%; height: auto; }

::selection {
    background: var(--wp--preset--color--brand-secondary);
    color: var(--wp--preset--color--white);
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--wp--preset--color--bg); }
::-webkit-scrollbar-thumb {
    background: var(--wp--preset--color--border);
    border-radius: 6px;
    border: 2px solid var(--wp--preset--color--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--wp--preset--color--muted); }

/* HEADER --------------------------------------------------------------- */
.wp-block-template-part[data-area="header"],
header.wp-block-template-part {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(var(--og-header-bg), 0.85);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--wp--preset--color--border);
    transition: background-color 200ms ease, border-color 200ms ease;
}

.wp-block-site-logo img {
    max-height: 36px !important;
    width: auto !important;
    height: auto !important;
    display: block;
}

:root[data-theme="light"] .wp-block-site-logo img {
    filter: brightness(0) saturate(100%) invert(11%) sepia(45%) saturate(2300%) hue-rotate(178deg) brightness(96%) contrast(101%);
}

/* THEME TOGGLE --------------------------------------------------------- */
.og-theme-toggle {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--og-r-md);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--wp--preset--color--text);
    transition: all var(--og-transition);
    padding: 0;
}

.og-theme-toggle:hover {
    border-color: var(--wp--preset--color--brand-secondary);
    background-color: var(--wp--preset--color--surface);
    color: var(--wp--preset--color--brand-secondary);
}

.og-theme-toggle:focus-visible {
    outline: 2px solid var(--wp--preset--color--brand-secondary);
    outline-offset: 2px;
}

.og-theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.og-theme-toggle .og-icon-sun { display: none; }
.og-theme-toggle .og-icon-moon { display: inline-block; }
:root[data-theme="light"] .og-theme-toggle .og-icon-sun { display: inline-block; }
:root[data-theme="light"] .og-theme-toggle .og-icon-moon { display: none; }

/* BOTOES --------------------------------------------------------------- */
.wp-block-button__link {
    transition: all var(--og-transition);
    text-decoration: none;
    font-weight: 500;
}

.wp-block-button__link:hover {
    transform: translateY(-1px);
    box-shadow: var(--og-shadow-md);
}

.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-secondary .wp-block-button__link {
    background-color: transparent !important;
    border-color: var(--wp--preset--color--border) !important;
    color: var(--wp--preset--color--text) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-secondary .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--surface) !important;
    border-color: var(--wp--preset--color--brand-secondary) !important;
}

/* EYEBROW -------------------------------------------------------------- */
.og-eyebrow {
    display: inline-block;
    font-family: var(--wp--preset--font-family--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--brand-secondary);
    margin-bottom: 0;
}

/* CARDS ---------------------------------------------------------------- */
.og-card {
    transition: border-color var(--og-transition), transform var(--og-transition), box-shadow var(--og-transition);
}

.og-card:hover {
    border-color: var(--wp--preset--color--brand-secondary) !important;
    transform: translateY(-2px);
    box-shadow: var(--og-shadow-md);
}

.og-card-featured { position: relative; }

.og-card-featured::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--wp--preset--color--brand-secondary), var(--wp--preset--color--brand-accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

.og-card-featured > * { position: relative; z-index: 1; }

/* BULLETS -------------------------------------------------------------- */
.og-bullets {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.og-bullets li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--wp--preset--color--text);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.og-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 0.875rem;
    height: 0.875rem;
    background: linear-gradient(135deg, var(--wp--preset--color--brand-secondary), var(--wp--preset--color--brand-accent));
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
}

/* HERO ----------------------------------------------------------------- */
.og-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.og-hero::before {
    content: "";
    position: absolute;
    inset: -10% -10% auto auto;
    width: 60%;
    height: 70%;
    background: radial-gradient(ellipse at top right, rgba(0, 169, 209, 0.08) 0%, rgba(0, 169, 209, 0.02) 40%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

:root[data-theme="light"] .og-hero::before {
    background: radial-gradient(ellipse at top right, rgba(0, 169, 209, 0.06) 0%, rgba(0, 169, 209, 0.015) 40%, transparent 70%);
}

.og-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: -1px -1px;
    pointer-events: none;
    z-index: -1;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

:root[data-theme="light"] .og-hero::after {
    background-image:
        linear-gradient(rgba(15,27,38,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,27,38,0.025) 1px, transparent 1px);
}

.og-browser-frame {
    box-shadow: var(--og-shadow-lg);
    transition: transform var(--og-transition);
}

.og-browser-frame:hover { transform: translateY(-4px); }

/* NAVEGACAO ------------------------------------------------------------ */
.wp-block-navigation .wp-block-navigation-item__content {
    transition: color var(--og-transition);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--wp--preset--color--text);
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
    color: var(--wp--preset--color--brand-secondary);
}

.wp-block-navigation__submenu-container {
    background-color: var(--wp--preset--color--surface) !important;
    border: 1px solid var(--wp--preset--color--border) !important;
    border-radius: var(--og-r-md) !important;
    box-shadow: var(--og-shadow-lg) !important;
    padding: 0.5rem !important;
    min-width: 280px !important;
    margin-top: 0.5rem !important;
}

.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    border-radius: var(--og-r-sm);
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem;
}

.wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
    background-color: var(--wp--preset--color--elevated);
    color: var(--wp--preset--color--text);
}

.wp-block-navigation-submenu__toggle .wp-block-navigation__submenu-icon svg {
    fill: currentColor;
    opacity: 0.6;
}

/* ==========================================================================
   PAGE HERO (titulo + breadcrumb + excerpt no topo de paginas individuais)
   ========================================================================== */
.og-page-hero {
    position: relative;
}

.og-page-hero .wp-block-post-title {
    color: var(--wp--preset--color--text);
}

.og-page-hero .wp-block-post-excerpt p,
.og-page-hero .wp-block-post-excerpt {
    color: var(--wp--preset--color--muted) !important;
    font-size: 1.125rem;
    line-height: 1.6;
}

.og-page-hero .wp-block-post-excerpt a {
    display: none; /* "Read more" link nao e necessario */
}

/* ==========================================================================
   BREADCRUMB
   ========================================================================== */
.og-breadcrumb {
    font-family: var(--wp--preset--font-family--mono);
    font-size: 0.8125rem;
    color: var(--wp--preset--color--muted);
}

.og-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.og-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.og-breadcrumb a {
    color: var(--wp--preset--color--brand-secondary);
    text-decoration: none;
    transition: color var(--og-transition);
}

.og-breadcrumb a:hover {
    color: var(--wp--preset--color--brand-accent);
    text-decoration: underline;
}

.og-breadcrumb [aria-current="page"] {
    color: var(--wp--preset--color--text);
    font-weight: 500;
}

.og-breadcrumb-sep {
    color: var(--wp--preset--color--border);
    user-select: none;
}

/* ==========================================================================
   PROSE (conteudo da pagina, tipografia legivel)
   ========================================================================== */
.og-prose {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--wp--preset--color--text);
}

.og-prose > * + * {
    margin-top: 1.5rem;
}

/* Headings dentro do prose */
.og-prose h1,
.og-prose .wp-block-heading.has-h1-typography {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--wp--preset--color--text);
}

.og-prose h2,
.og-prose h2.wp-block-heading {
    font-size: clamp(1.375rem, 2.4vw, 1.75rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--wp--preset--color--text);
}

.og-prose h3,
.og-prose h3.wp-block-heading {
    font-size: clamp(1.125rem, 1.8vw, 1.375rem);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--wp--preset--color--text);
}

.og-prose h4,
.og-prose h4.wp-block-heading {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--wp--preset--color--text);
}

/* Primeiro heading sem margin-top */
.og-prose > :first-child {
    margin-top: 0;
}

.og-prose > h1:first-child,
.og-prose > h2:first-child,
.og-prose > h3:first-child {
    margin-top: 0;
}

/* Paragrafos */
.og-prose p {
    margin: 0;
    color: var(--wp--preset--color--text);
}

/* Links inline */
.og-prose a {
    color: var(--wp--preset--color--brand-secondary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--og-transition);
}

.og-prose a:hover {
    color: var(--wp--preset--color--brand-accent);
}

/* Listas */
.og-prose ul,
.og-prose ol {
    padding-left: 1.5rem;
    margin: 0;
}

.og-prose ul li,
.og-prose ol li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
}

.og-prose ul li::marker {
    color: var(--wp--preset--color--brand-secondary);
}

/* Strong */
.og-prose strong {
    color: var(--wp--preset--color--text);
    font-weight: 600;
}

/* Quote */
.og-prose blockquote {
    border-left: 3px solid var(--wp--preset--color--brand-secondary);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 0;
    font-style: normal;
    color: var(--wp--preset--color--muted);
}

/* Imagens */
.og-prose img {
    border-radius: var(--og-r-md);
}

/* HR / separadores */
.og-prose hr {
    border: 0;
    height: 1px;
    background: var(--wp--preset--color--border);
    margin: 2rem 0;
}

/* Code inline */
.og-prose code {
    font-family: var(--wp--preset--font-family--mono);
    font-size: 0.9em;
    padding: 0.125rem 0.375rem;
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 4px;
}

/* ==========================================================================
   SIDEBAR (paginas Master)
   ========================================================================== */
.og-sidebar {
    position: sticky;
    top: 6rem;
    align-self: flex-start;
}

.og-sidebar-inner {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--og-r-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.og-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.og-sidebar-eyebrow {
    font-family: var(--wp--preset--font-family--mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--muted);
    margin-bottom: 0.25rem;
}

.og-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.og-sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--og-r-sm);
    color: var(--wp--preset--color--text);
    font-size: 0.875rem;
    line-height: 1.4;
    text-decoration: none;
    transition: all var(--og-transition);
    border-left: 2px solid transparent;
}

.og-sidebar-link:hover {
    background: var(--wp--preset--color--elevated);
    color: var(--wp--preset--color--brand-secondary);
    border-left-color: var(--wp--preset--color--border);
}

.og-sidebar-link.is-current {
    background: var(--wp--preset--color--elevated);
    color: var(--wp--preset--color--brand-secondary);
    font-weight: 500;
    border-left-color: var(--wp--preset--color--brand-secondary);
}

.og-sidebar-link-parent {
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.625rem 0.75rem;
}

.og-sidebar-cta {
    border-top: 1px solid var(--wp--preset--color--border);
    padding-top: 1.25rem;
}

.og-sidebar-cta p {
    color: var(--wp--preset--color--muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 0.5rem;
}

.og-sidebar-cta-link {
    color: var(--wp--preset--color--brand-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    font-family: var(--wp--preset--font-family--mono);
}

.og-sidebar-cta-link:hover {
    color: var(--wp--preset--color--brand-accent);
}

/* No mobile, sidebar passa para cima do conteudo */
@media (max-width: 781px) {
    .og-sidebar {
        position: static;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer.wp-block-template-part {
    background-color: var(--wp--preset--color--surface);
    border-top: 1px solid var(--wp--preset--color--border);
    margin-top: 0;
    transition: background-color 200ms ease, border-color 200ms ease;
}

footer p,
footer .wp-block-paragraph {
    color: var(--wp--preset--color--muted);
    font-size: 0.9375rem;
}

footer h4,
footer h5 {
    font-family: var(--wp--preset--font-family--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--muted);
    margin-bottom: 1rem;
}

footer a {
    color: var(--wp--preset--color--text);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color var(--og-transition);
}

footer a:hover {
    color: var(--wp--preset--color--brand-secondary);
}

footer .wp-block-list.is-style-no-bullets,
.wp-block-list.is-style-no-bullets {
    list-style: none;
    padding-left: 0;
}

footer .wp-block-list.is-style-no-bullets li {
    margin-bottom: 0.5rem;
}

/* QUOTE em cards ------------------------------------------------------- */
.og-card .wp-block-quote {
    margin: 0;
    padding: 0 0 0 1rem;
    color: var(--wp--preset--color--text);
}

/* MOTION --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* RESPONSIVE ----------------------------------------------------------- */
@media (max-width: 781px) {
    .og-hero .wp-block-columns {
        gap: 2rem !important;
    }

    .og-card {
        padding: 1.25rem !important;
    }
}
