/*
Theme Name: Truques de Beleza Redesign
Theme URI: https://truquesdebeleza.com.br/
Description: Redesign editorial 2026 do Truques de Beleza. Em desenvolvimento, previa via Personalizar antes de ativar.
Author: Codex para Truques de Beleza
Version: 3.0.0-beta
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: truques-de-beleza
*/

.tbd-image-frame {
    display: block;
    overflow: hidden;
    background: var(--tdb-surface-2, #f7f1ec);
}

.tbd-image-frame--hero {
    aspect-ratio: 16 / 9;
}

.tbd-image-frame--single {
    aspect-ratio: 3 / 2;
}

.tbd-image-frame--card {
    aspect-ratio: 39 / 28;
}

.tbd-image-frame--portrait {
    aspect-ratio: 32 / 45;
}

.tbd-image-frame--thumb {
    aspect-ratio: 1;
}

.tdb-image,
.tbd-image-frame img,
.tbd-post-card__image img,
.tbd-featured-image img,
.tbd-popular img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--tdb-focus-x, 50%) var(--tdb-focus-y, 50%);
}

.tbd-post-card__image {
    aspect-ratio: 39 / 28;
    min-height: 0 !important;
}

.tbd-featured-image {
    aspect-ratio: 3 / 2;
}

.tbd-hero-card,
.tbd-overlay-card,
.tbd-single-hero {
    background-position: var(--tdb-focus-x, 50%) var(--tdb-focus-y, 50%);
}

.tbd-skip-link {
    left: -999px;
    position: absolute;
    top: auto;
}

.tbd-skip-link:focus {
    background: #fff;
    border: 2px solid currentColor;
    left: 16px;
    padding: 10px 14px;
    top: 16px;
    z-index: 99999;
}

.tbd-nav .sub-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    z-index: 20;
    display: grid;
    gap: 4px;
    min-width: 230px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--tbd-line);
    border-radius: var(--tbd-radius);
    background: var(--tbd-surface);
    box-shadow: var(--tbd-shadow);
    list-style: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.tbd-nav .menu-item {
    position: relative;
}

.tbd-nav .menu-item:hover > .sub-menu,
.tbd-nav .menu-item:focus-within > .sub-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.tbd-nav .menu-item-has-children > a {
    padding-right: 16px;
}

.tbd-nav .sub-menu a {
    width: 100%;
}

.tbd-entry-content img {
    max-width: 100%;
    height: auto;
}

.tbd-featured-grid {
    align-items: stretch;
}

.tbd-hero-card {
    min-height: clamp(560px, 40vw, 680px);
}

.tbd-overlay-card {
    min-height: clamp(270px, calc((40vw - 18px) / 2), 331px);
}

.tbd-hero-card > a,
.tbd-overlay-card > a {
    box-sizing: border-box;
    gap: 12px;
}

.tbd-hero-card > a {
    justify-content: center;
    padding: clamp(30px, 3.2vw, 52px);
}

.tbd-overlay-card > a {
    justify-content: flex-end;
    padding: clamp(22px, 2vw, 30px);
}

.tbd-hero-card h1,
.tbd-overlay-card h2 {
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.tbd-hero-card h1 {
    max-width: 780px;
    margin: 10px 0 4px;
    font-size: clamp(42px, 3.85vw, 68px);
    line-height: 1.02;
}

.tbd-overlay-card h2 {
    max-width: 420px;
    margin: 4px 0 2px;
    font-size: clamp(25px, 1.9vw, 34px);
    line-height: 1.03;
}

.tbd-hero-card p {
    max-width: 620px;
    margin: 0 0 8px;
    font-size: clamp(16px, 1.2vw, 20px);
    line-height: 1.42;
}

.tbd-hero-card .tbd-button,
.tbd-overlay-card .tbd-read-more {
    flex: 0 0 auto;
}

@media (max-width: 1280px) {
    .tbd-home-layout {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
    }

    .tbd-featured-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
    }

    .tbd-hero-card {
        min-height: 580px;
    }

    .tbd-overlay-card {
        min-height: 281px;
    }
}

@media (max-width: 1024px) {
    .tbd-home-layout,
    .tbd-featured-grid {
        grid-template-columns: 1fr;
    }

    .tbd-hero-card,
    .tbd-overlay-card {
        min-height: auto;
        aspect-ratio: 16 / 10;
    }
}

@media (max-width: 640px) {
    .tbd-hero-card,
    .tbd-overlay-card {
        aspect-ratio: auto;
        min-height: 430px;
    }

    .tbd-hero-card h1 {
        font-size: 38px;
    }

    .tbd-overlay-card h2 {
        font-size: 28px;
    }
}

.tbd-badge {
    flex: 0 0 auto;
    width: max-content;
    max-width: min(100%, 220px);
}

.tbd-hero-card .tbd-badge,
.tbd-overlay-card .tbd-badge {
    position: relative;
    z-index: 2;
}

.tbd-footer__nav ul,
.tbd-footer__nav .menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tbd-footer__nav li {
    margin: 0;
    padding: 0;
}

.tbd-footer__nav a {
    display: inline-flex;
    color: var(--tbd-ink);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

.tbd-footer__links {
    text-align: right;
}

.tbd-footer__copy {
    display: block;
    margin-top: 18px;
}

@media (max-width: 760px) {
    .tbd-footer__inner,
    .tbd-footer__links {
        text-align: left;
    }

    .tbd-footer__nav ul,
    .tbd-footer__nav .menu {
        justify-content: flex-start;
    }
}
