
/**
 * W332 | CANONICAL COMPONENTS for the PrevDireitos site.
 *
 * Loaded LAST on both home and every non-home public page. This file owns
 * visual decisions, not data, layout semantics, functionality or SEO.
 * Adjust visual tokens ONLY in design-system-v1.css.
 */
body:is(.pd-home-v1-public, .pd-visual-v1-public) {
    color: var(--pd-color-text);
    background: var(--pd-color-page);
    font-family: var(--pd-font-sans);
    line-height: var(--pd-ui-body-line);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) :where(.portal-container) {
    max-width: var(--pd-width-container);
}

/* One family of heroes with editorial variants (featured versus directory). */
body:is(.pd-home-v1-public, .pd-visual-v1-public) :is(
    .pd-home-hero, .pd-inner-hero, .pd-repository-hero,
    .pd-modelos-hero, .pd-video-hero
) {
    background-color: var(--pd-color-navy-950);
    color: var(--pd-ui-hero-foreground);
    border-color: var(--pd-color-navy-900);
}
body.pd-home-v1-public .pd-home-hero {
    /* Featured editorial image/gradient from home remains intentionally intact. */
    --pd-ui-current-hero-title: var(--pd-ui-hero-feature-title);
}
body.pd-home-v1-public .pd-home-hero h1,
body.pd-visual-v1-public :is(
    .pd-inner-hero, .pd-repository-hero,
    .pd-modelos-hero, .pd-video-hero
) h1 {
    color: var(--pd-ui-hero-foreground);
    font-family: var(--pd-font-sans);
    font-weight: var(--pd-ui-heading-weight);
    line-height: var(--pd-ui-heading-line);
    letter-spacing: var(--pd-ui-heading-tracking);
    overflow-wrap: break-word;
    text-wrap: balance;
}
body.pd-home-v1-public .pd-home-hero h1 {
    font-size: var(--pd-ui-hero-feature-title);
}
body.pd-visual-v1-public :is(
    .pd-inner-hero, .pd-repository-hero,
    .pd-modelos-hero, .pd-video-hero
) h1 {
    font-size: var(--pd-ui-hero-title);
}
body.pd-visual-v1-public :is(.pd-inner-hero, .pd-repository-hero) {
    /* The legacy outer hero already has padding. Replace, don't double it. */
    padding-block: var(--pd-ui-hero-pad-block);
}
body.pd-visual-v1-public :is(
    .pd-inner-hero, .pd-repository-hero,
    .pd-modelos-hero, .pd-video-hero
) :where(p) {
    color: var(--pd-ui-hero-muted);
    line-height: var(--pd-ui-body-line);
}
body.pd-visual-v1-public :is(
    .pd-inner-hero__eyebrow, .pd-repository-hero__eyebrow
) {
    color: var(--pd-ui-hero-muted);
}

/*
 * W361 | Canonical inset hero geometry.
 * Virtual directories currently render full-bleed hero sections even though
 * Calculadoras uses the shared inset-card style. Keep each module's semantic
 * template and forms; only the shared layout geometry belongs here.
 */
body.pd-visual-v1-public main > :is(
    .pd-video-hero, .pd-modelos-hero, .pd-modelo-single-hero,
    .pd-repository-hero, .pd-inner-hero
) {
    box-sizing: border-box;
    width: min(calc(100% - 48px), var(--pd-width-container));
    margin: clamp(24px, 4vw, 60px) auto 0;
    padding: var(--pd-ui-hero-pad-block) var(--pd-ui-hero-pad-inline);
    border: 1px solid var(--pd-color-navy-900);
    border-radius: var(--pd-ui-card-radius);
    background: var(--pd-ui-hero-bg);
    color: var(--pd-ui-hero-foreground);
}
body.pd-visual-v1-public main > :is(
    .pd-video-hero, .pd-modelos-hero, .pd-modelo-single-hero,
    .pd-repository-hero, .pd-inner-hero
) > :is(.pd-video-container, .pd-modelos-container, .portal-container) {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}
body.pd-visual-v1-public .pd-modelo-single-hero h1 {
    font-family: var(--pd-font-sans);
    font-size: var(--pd-ui-hero-title);
    font-weight: var(--pd-ui-heading-weight);
    letter-spacing: var(--pd-ui-heading-tracking);
    line-height: var(--pd-ui-heading-line);
    color: var(--pd-ui-hero-foreground);
    text-wrap: balance;
}
body.pd-visual-v1-public .pd-modelo-single-hero p {
    color: var(--pd-ui-hero-muted);
    line-height: var(--pd-ui-body-line);
}
@media (max-width: 640px) {
    body.pd-visual-v1-public main > :is(
        .pd-video-hero, .pd-modelos-hero, .pd-modelo-single-hero,
        .pd-repository-hero, .pd-inner-hero
    ) {
        width: min(calc(100% - 28px), var(--pd-width-container));
        margin-top: 24px;
    }
}

/* For calculators and legal sheets, the shared hero uses the inset variant. */
body.pd-visual-v1-public .pd-calcs__hero,
body.pd-visual-v1-public .pd-legal-sheet-header {
    background: var(--pd-ui-hero-bg);
    border: 1px solid var(--pd-color-navy-900);
    border-radius: var(--pd-ui-card-radius);
    color: var(--pd-ui-hero-foreground);
    padding: var(--pd-ui-hero-pad-block) var(--pd-ui-hero-pad-inline);
    max-width: none;
}
body.pd-visual-v1-public .pd-calcs__hero h1,
body.pd-visual-v1-public .pd-legal-sheet-header h1 {
    color: var(--pd-ui-hero-foreground);
    font-family: var(--pd-font-sans);
    font-size: var(--pd-ui-hero-title);
    font-weight: var(--pd-ui-heading-weight);
    letter-spacing: var(--pd-ui-heading-tracking);
    line-height: var(--pd-ui-heading-line);
    max-width: 1080px;
    text-wrap: balance;
}
body.pd-visual-v1-public .pd-calcs__hero > p:not(.pd-calcs__eyebrow),
body.pd-visual-v1-public .pd-legal-sheet-header .pd-legal-sheet-origin {
    color: var(--pd-ui-hero-muted);
    line-height: var(--pd-ui-body-line);
}
body.pd-visual-v1-public .pd-calcs__eyebrow {
    color: var(--pd-ui-hero-muted);
    font-size: var(--pd-font-size-sm);
    letter-spacing: var(--pd-letter-label);
}
body.pd-visual-v1-public .pd-legal-sheet-type {
    color: var(--pd-color-brand-action);
    background: var(--pd-color-blue-100);
}

/* Canonical surfaces: same edges, depth and text across modules. */
body:is(.pd-home-v1-public, .pd-visual-v1-public) :is(
    .pd-home-article-card, .pd-home-benefits, .pd-home-module,
    .pd-editorial-card, .pd-modelo-card, .pd-video-card,
    .pd-calc-card, .pd-calcs__tool, .pd-legal-panel,
    .pd-legal-ementa, .pd-legal-actions-card,
    .pd-repository-browse__group, .pd-empty-state
) {
    background: var(--pd-color-surface);
    border-color: var(--pd-ui-card-border);
    border-radius: var(--pd-ui-card-radius);
    box-shadow: var(--pd-ui-card-shadow);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) main :is(
    .pd-home-article-card h3 a, .pd-editorial-card h2 a,
    .pd-modelo-card h2 a, .pd-video-card h2 a,
    .pd-calc-card :is(h2, h3) a
) {
    color: var(--pd-color-text-strong);
    text-decoration: none;
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) main :is(
    .pd-home-article-card h3 a, .pd-editorial-card h2 a,
    .pd-modelo-card h2 a, .pd-video-card h2 a,
    .pd-calc-card :is(h2, h3) a
):hover {
    color: var(--pd-color-brand-action);
    text-decoration: underline;
}

/* Shared button contract; labels must never share the background color. */
body:is(.pd-home-v1-public, .pd-visual-v1-public) :is(
    .pd-shell-search button, .pd-calc-form button,
    .pd-copy-citation, .pd-repository-search button
) {
    color: var(--pd-ui-action-foreground);
    background: var(--pd-ui-action-bg);
    border-color: var(--pd-ui-action-bg);
    border-radius: var(--pd-radius-sm);
    min-height: 44px;
    font-family: var(--pd-font-sans);
    font-weight: 800;
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) :is(
    .pd-shell-search button, .pd-calc-form button,
    .pd-copy-citation, .pd-repository-search button
):hover {
    color: var(--pd-ui-action-foreground);
    background: var(--pd-ui-action-bg-hover);
}
/* W339: legal search cards must keep their primary action label visible.
   A generic internal-page anchor color must not override white on blue. */
body.pd-visual-v1-public main .pd-legal-result__actions a.pd-result-action--primary,
body.pd-visual-v1-public main .pd-legal-result__actions a.pd-result-action--primary:visited {
    color: var(--pd-ui-action-foreground, #ffffff);
    background: var(--pd-ui-action-bg, #075fd8);
    border-color: var(--pd-ui-action-bg, #075fd8);
}
body.pd-visual-v1-public main .pd-legal-result__actions a.pd-result-action--primary:hover,
body.pd-visual-v1-public main .pd-legal-result__actions a.pd-result-action--primary:focus-visible {
    color: var(--pd-ui-action-foreground, #ffffff);
    background: var(--pd-ui-action-bg-hover, #054fb6);
}

body.pd-visual-v1-public main a.pd-legal-primary-action,
body.pd-visual-v1-public main a.pd-legal-mobile-source {
    color: var(--pd-ui-action-foreground);
    background: var(--pd-ui-action-bg);
    border-color: var(--pd-ui-action-bg);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) :is(
    .pd-shell-search input, .pd-calc-form input, .pd-calc-form select
) {
    border-color: var(--pd-ui-field-border);
    background: var(--pd-ui-field-background);
    color: var(--pd-color-text);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) :is(
    button, a, input, select, textarea, summary
):focus-visible {
    outline: 3px solid var(--pd-ui-focus-outline);
    outline-offset: 3px;
}

/* Consistent reading hierarchy, without resizing typography inside tools. */
body:is(.pd-home-v1-public, .pd-visual-v1-public) main :where(
    .pd-home-section__heading h2, .pd-calcs__section-header h2,
    .pd-editorial-section h2, .pd-legal-panel h2
) {
    font-family: var(--pd-font-sans);
    letter-spacing: var(--pd-letter-tight);
}
@media (max-width: 720px) {
    body.pd-visual-v1-public .pd-calcs__hero,
    body.pd-visual-v1-public .pd-legal-sheet-header {
        margin-block: 4px var(--pd-space-6);
    }
}
@media (prefers-reduced-motion: reduce) {
    body:is(.pd-home-v1-public, .pd-visual-v1-public) main * {
        scroll-behavior: auto;
    }
}

/*
 * Public API for FUTURE templates. New components use these classes directly,
 * without copying properties from a page stylesheet.
 */
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ui-hero {
    color: var(--pd-ui-hero-foreground);
    background: var(--pd-ui-hero-bg);
    border-color: var(--pd-color-navy-900);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ui-hero__title {
    color: var(--pd-ui-hero-foreground);
    font-family: var(--pd-font-sans);
    font-size: var(--pd-ui-hero-title);
    font-weight: var(--pd-ui-heading-weight);
    letter-spacing: var(--pd-ui-heading-tracking);
    line-height: var(--pd-ui-heading-line);
    text-wrap: balance;
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ui-hero--featured .pd-ui-hero__title {
    font-size: var(--pd-ui-hero-feature-title);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ui-hero--inset {
    padding: var(--pd-ui-hero-pad-block) var(--pd-ui-hero-pad-inline);
    border: 1px solid var(--pd-color-navy-900);
    border-radius: var(--pd-ui-card-radius);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ui-card {
    background: var(--pd-color-surface);
    border: 1px solid var(--pd-ui-card-border);
    border-radius: var(--pd-ui-card-radius);
    box-shadow: var(--pd-ui-card-shadow);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ui-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-weight: 800;
    font-family: var(--pd-font-sans);
    background: var(--pd-ui-action-bg);
    border: 1px solid var(--pd-ui-action-bg);
    border-radius: var(--pd-radius-sm);
    color: var(--pd-ui-action-foreground);
    text-decoration: none;
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ui-action:hover {
    color: var(--pd-ui-action-foreground);
    background: var(--pd-ui-action-bg-hover);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ui-field {
    min-height: 44px;
    color: var(--pd-color-text);
    background: var(--pd-ui-field-background);
    border: 1px solid var(--pd-ui-field-border);
    border-radius: var(--pd-radius-sm);
}

/*
 * W333 | Independent plugin adapters for the same canonical design matrix.
 * Components below derive ALL presentation colors from the theme variables.
 * Consent state, ads serving and newsletter data are never changed here.
 */
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy__banner,
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy__panel-card,
body:is(.pd-home-v1-public, .pd-visual-v1-public) .prevdireitos-growth-newsletter-shell {
    background: var(--pd-color-surface);
    color: var(--pd-color-text);
    border-color: var(--pd-ui-card-border);
    border-radius: var(--pd-ui-card-radius);
    box-shadow: var(--pd-ui-card-shadow);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy__content h2,
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy__panel-card h2,
body:is(.pd-home-v1-public, .pd-visual-v1-public) .prevdireitos-growth-newsletter-shell__title {
    color: var(--pd-color-text-strong);
    font-family: var(--pd-font-sans);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy .button {
    color: var(--pd-ui-action-bg);
    background: var(--pd-color-surface);
    border-color: var(--pd-ui-action-bg);
    border-radius: var(--pd-radius-sm);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy .button-primary,
body:is(.pd-home-v1-public, .pd-visual-v1-public) .prevdireitos-growth-newsletter-form button[type="submit"] {
    color: var(--pd-ui-action-foreground);
    background: var(--pd-ui-action-bg);
    border-color: var(--pd-ui-action-bg);
    font-family: var(--pd-font-sans);
    font-weight: 800;
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy .button-primary:hover,
body:is(.pd-home-v1-public, .pd-visual-v1-public) .prevdireitos-growth-newsletter-form button[type="submit"]:hover {
    color: var(--pd-ui-action-foreground);
    background: var(--pd-ui-action-bg-hover);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy__reopen {
    color: var(--pd-ui-action-bg);
    background: var(--pd-color-surface);
    border-color: var(--pd-ui-action-bg);
    border-radius: var(--pd-radius-pill);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy__choice {
    border-color: var(--pd-ui-keyline);
    border-radius: var(--pd-radius-md);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy__choice--locked {
    background: var(--pd-color-surface-soft);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-privacy__choice small {
    color: var(--pd-color-text-muted);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .prevdireitos-growth-newsletter-form input[type="email"] {
    color: var(--pd-color-text);
    background: var(--pd-ui-field-background);
    border-color: var(--pd-ui-field-border);
    border-radius: var(--pd-radius-sm);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ad-slot {
    background: var(--pd-color-surface-soft);
    border-color: var(--pd-ui-keyline);
    border-radius: var(--pd-radius-md);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) .pd-ad-slot__label {
    color: var(--pd-color-text-muted);
}
body:is(.pd-home-v1-public, .pd-visual-v1-public) :is(
    .pd-privacy .button, .pd-privacy__reopen,
    .prevdireitos-growth-newsletter-form button,
    .prevdireitos-growth-newsletter-form input
):focus-visible {
    outline: 3px solid var(--pd-ui-focus-outline);
    outline-offset: 3px;
}
