/*
Theme Name: YesMonetize Apps
Theme URI: https://ruthes.dev/themes/yesmonetize-apps
Author: RuthesDev
Author URI: https://ruthes.dev
Description: Tema WordPress otimizado para blogs monetizados. Focado em performance, Core Web Vitals, responsividade e otimização de receita com AdSense. Desenvolvido com Full Site Editing (FSE) para máxima personalização sem código.
Requires at least: 6.7
Tested up to: 6.7
Requires PHP: 8.0
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yesmonetize-apps
Tags: blog, one-column, two-columns, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, news, entertainment, portfolio

YesMonetize Apps é um tema premium gratuito desenvolvido por RuthesDev (https://ruthes.dev).
Projetado especificamente para publishers e criadores de conteúdo que monetizam via Google AdSense.

Recursos Principais:
- Full Site Editing (FSE) - Edite todo o site visualmente
- Otimização de Core Web Vitals (LCP, FID, CLS)
- Sistema de gerenciamento de anúncios integrado
- Compatível com Ad Inserter e outros plugins
- Lazy loading inteligente de anúncios
- Posições de anúncios estratégicas
- Schema.org / Rich Snippets
- Design responsivo mobile-first
- Cores customizáveis via Site Editor
*/

/* 
 * Reset e Base Styles
 * Estilos mínimos - a maior parte é controlada via theme.json
 */

/* Smooth scrolling para melhor UX */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Prevent horizontal scroll globally */
    width: 100%;
}

body {
    overflow-x: hidden;
    /* Prevent horizontal scroll globally */
    width: 100%;
    position: relative;
}

/* Links com transição suave */
a {
    text-decoration-thickness: 1px !important;
    text-underline-offset: 0.15em;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Focus styles para acessibilidade */
/* Focus styles para acessibilidade (Apenas Teclado) */
:where(.wp-site-blocks *:focus) {
    outline: none;
}

:where(.wp-site-blocks *:focus-visible) {
    outline-width: 2px;
    outline-style: solid;
    outline-offset: 2px;
    outline-color: var(--wp--preset--color--primary, currentColor);
}

/* Typography otimizada */
h1,
h2,
h3,
h4,
h5,
h6,
blockquote,
caption,
figcaption,
p {
    text-wrap: pretty;
}

/* Preformatted text */
:where(pre) {
    overflow-x: auto;
}

/* ========================================
   SITE HEADER - Premium Design
   ======================================== */

/* Header container */
.ym-site-header {
    background: var(--wp--preset--color--base, #ffffff);
    z-index: 1000;
}

/* Top bar - mini header */
.ym-header-top {
    font-size: 0.8rem;
}

.ym-header-top p {
    margin: 0;
    opacity: 0.9;
}

/* Main header area */
.ym-header-main {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Brand area with logo */
.ym-header-brand {
    gap: 0.75rem !important;
}

/* Header Ad Wrapper - Remove all spacing */
.ym-ad-header-wrapper {
    margin: 0 !important;
    padding: 30px 0 20px 0 !important;
}

.ym-ad-header-wrapper p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure navigation and submenus are above ads */
.wp-block-navigation,
.wp-block-navigation__responsive-container {
    position: relative !important;
    z-index: 9999 !important;
}

.wp-block-navigation .wp-block-navigation__submenu-container {
    position: absolute !important;
    z-index: 9999 !important;
}

.ym-ad-slot,
.ym-ad-header-wrapper {
    position: relative !important;
    z-index: 1 !important;
}

.ym-site-logo img {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.ym-site-logo:hover img {
    transform: scale(1.05);
}

/* Main navigation */
.ym-main-nav {
    gap: 0.25rem !important;
}

.ym-main-nav .wp-block-navigation__container {
    gap: 0.5rem;
}

.ym-main-nav .wp-block-navigation-item__content {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ym-main-nav .wp-block-navigation-item__content:hover {
    background: var(--wp--preset--color--light, #f5f5f5);
    color: var(--wp--preset--color--primary, #0066CC);
}

.ym-main-nav .current-menu-item .wp-block-navigation-item__content {
    background: var(--wp--preset--color--primary, #0066CC);
    color: var(--wp--preset--color--base, #ffffff);
}

/* Search in header */
.ym-header-search {
    transition: all 0.3s ease;
}

.ym-header-search:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.ym-header-search .wp-block-search__inside-wrapper {
    border-radius: 50px !important;
    overflow: hidden;
}

.ym-header-search .wp-block-search__input {
    border: none !important;
    background: var(--wp--preset--color--light, #f5f5f5);
}

.ym-header-search .wp-block-search__button {
    background: var(--wp--preset--color--primary, #0066CC) !important;
    border: none !important;
    padding: 0.5rem 1rem;
}

.ym-header-search .wp-block-search__button svg {
    fill: #fff;
}

/* CTA Button in header */
.ym-cta-button .wp-block-button__link {
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.ym-cta-button .wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

/* CTA Button - Direct Link (Home Page) */
a.ym-cta-button {
    display: inline-block;
    background: var(--wp--preset--color--primary, #2196F3);
    color: #fff !important;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--wp--preset--color--primary, #2196F3), transparent 60%);
}

a.ym-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--wp--preset--color--primary, #2196F3), transparent 50%);
    filter: brightness(110%);
}

a.ym-cta-button:active {
    transform: translateY(-1px);
}

/* Header actions container */
.ym-header-actions {
    gap: 1rem !important;
}

/* Sticky header shadow on scroll */
.ym-site-header.is-scrolled .ym-header-main {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* Responsive Header */
@media (max-width: 991px) {
    .ym-header-brand .wp-block-site-tagline {
        display: none;
    }

    .ym-header-search {
        max-width: 160px;
    }

    .ym-cta-button {
        display: none;
    }
}

/* ========================================
   RECENT POSTS FEED
   Fix image overflow
   ======================================== */

.ym-recent-posts-feed .wp-block-post-featured-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    display: block !important;
}

.ym-recent-posts-feed .wp-block-post-featured-image {
    margin: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.ym-recent-posts-feed .wp-block-group {
    max-width: 100% !important;
    overflow: hidden !important;
}

@media (max-width: 767px) {
    .ym-header-top {
        display: none;
    }

    .ym-header-main .wp-block-group {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .ym-header-brand {
        flex: 1;
    }

    .ym-header-search {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .ym-header-actions {
        order: 1;
    }
}

/* ========================================
   AD SLOTS - Espaços reservados para anúncios
   Evita CLS (Cumulative Layout Shift)
   ======================================== */

/* Container padrão de anúncio */
.ym-ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ym-ad-min-height, 90px);
    overflow: hidden;
    margin: 0.5rem 0;
}

/* Anúncio no header - 728x90 ou responsivo */
.ym-ad-slot--header {
    --ym-ad-min-height: 90px;
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
}

/* Anúncio in-content - 336x280 ou responsivo */
.ym-ad-slot--in-content {
    --ym-ad-min-height: 280px;
    max-width: 336px;
    float: none;
}

/* Anúncio sidebar - 300x250 ou 300x600 */
.ym-ad-slot--sidebar {
    --ym-ad-min-height: 250px;
    max-width: 300px;
}

/* Anúncio footer - 728x90 ou responsivo */
.ym-ad-slot--footer {
    --ym-ad-min-height: 90px;
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
}

/* Anúncio sticky bottom mobile */
.ym-ad-slot--sticky-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    --ym-ad-min-height: 50px;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Responsivo - Mobile */
@media (max-width: 767px) {

    .ym-ad-slot--header,
    .ym-ad-slot--footer {
        --ym-ad-min-height: 50px;
        max-width: 320px;
    }

    .ym-ad-slot--in-content {
        --ym-ad-min-height: 250px;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Lazy load placeholder */
.ym-ad-slot[data-lazy="true"]:not(.ym-ad-loaded) {
    background: linear-gradient(90deg,
            var(--wp--preset--color--accent-6, #f5f5f5) 0%,
            var(--wp--preset--color--base, #ffffff) 50%,
            var(--wp--preset--color--accent-6, #f5f5f5) 100%);
    background-size: 200% 100%;
    animation: ym-shimmer 1.5s infinite;
}

@keyframes ym-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Label "Publicidade" para transparência */


.ym-ad-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Label gerada pelo PHP */


/* Container do anúncio */
.ym-ad-content {
    display: block;
    text-align: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   READING PROGRESS BAR
   Aumenta engajamento e tempo no site
   ======================================== */

.ym-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg,
            var(--wp--preset--color--primary, #0073aa),
            var(--wp--preset--color--secondary, #005177));
    z-index: 99999;
    transition: width 0.1s ease-out;
}

/* ========================================
   RELATED POSTS - Aumenta pageviews/sessão
   ======================================== */

.ym-related-posts {
    margin-top: var(--wp--preset--spacing--60, 3rem);
    padding-top: var(--wp--preset--spacing--50, 2rem);
    border-top: 1px solid var(--wp--preset--color--accent-6, #eee);
}

.ym-related-posts__title {
    font-size: var(--wp--preset--font-size--large, 1.25rem);
    font-weight: 600;
    margin-bottom: var(--wp--preset--spacing--40, 1.5rem);
}

.ym-related-posts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--wp--preset--spacing--40, 1.5rem);
}

.ym-related-post {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ym-related-post:hover {
    transform: translateY(-4px);
}

.ym-related-post__image {
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.ym-related-post__title {
    font-size: var(--wp--preset--font-size--medium, 1rem);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   TABLE OF CONTENTS - Aumenta tempo no site
   ======================================== */

.ym-toc {
    background: var(--wp--preset--color--accent-5, #f9f9f9);
    border-radius: 8px;
    padding: var(--wp--preset--spacing--40, 1.5rem);
    margin-bottom: var(--wp--preset--spacing--50, 2rem);
}

.ym-toc__title {
    font-size: var(--wp--preset--font-size--medium, 1rem);
    font-weight: 600;
    margin-bottom: var(--wp--preset--spacing--30, 1rem);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.ym-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ym-toc__item {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--wp--preset--color--accent-6, #eee);
}

.ym-toc__item:last-child {
    border-bottom: none;
}

.ym-toc__link {
    text-decoration: none;
    color: var(--wp--preset--color--contrast, #333);
    font-size: var(--wp--preset--font-size--small, 0.875rem);
    transition: color 0.2s ease;
}

.ym-toc__link:hover {
    color: var(--wp--preset--color--primary, #0073aa);
}

/* ========================================
   UTILITIES
   ======================================== */

/* Hide on specific breakpoints */
@media (max-width: 767px) {
    .ym-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .ym-hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .ym-hide-desktop {
        display: none !important;
    }
}

/* Screen reader only */
.ym-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   HOME SEARCH - Smart Design (System Style)
   ======================================== */
.ym-home-search .wp-block-search__inside-wrapper {
    border: 1px solid #E2E8F0;
    border-radius: 99px !important;
    padding: 3px;
    background: #fff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ym-home-search .wp-block-search__inside-wrapper:focus-within {
    border-color: var(--wp--preset--color--primary, #2196F3);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary, #2196F3), transparent 85%);
    transform: translateY(-1px);
}

.ym-home-search .wp-block-search__input {
    border: none !important;
    background: transparent !important;
    padding-left: 20px !important;
    font-size: 16px !important;
    color: #334155;
    outline: none !important;
    box-shadow: none !important;
}

.ym-home-search .wp-block-search__button {
    border-radius: 50px !important;
    background: var(--wp--preset--color--primary, #2196F3) !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 24px !important;
    margin: 3px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.ym-home-search .wp-block-search__button:hover {
    filter: brightness(110%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(0) !important;
    /* Reset scale transform if it exists */
}

.ym-home-search .wp-block-search__button svg {
    fill: #fff;
    width: 18px;
    height: 18px;
}

/* ========================================
   SINGLE POST - Tags Dynamic Visibility
   ======================================== */
.single-post-tags-wrapper:not(:has(.wp-block-post-terms a)) {
    display: none !important;
}

/* Single Post Categories - Tighter spacing */
.single-post-monetized .wp-block-post-terms.ym-badge-list {
    gap: 4px;
}

.single-post-monetized .wp-block-post-terms.ym-badge-list a {
    margin: 0;
}