/*
Theme Name: Minha Telinha
Author: Minha Telinha
Description: Tema para novelinhas em vídeo vertical (9:16). Episódios agrupados por série, página de episódio com player vertical e chamada para receber avisos no WhatsApp.
Version: 1.5.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minha-telinha
*/

:root {
	--bg: #FFF7E8;
	--ink: #1E1B4B;
	--muted: #4C4870;
	--line: #EADFC4;
	--accent: #DB2777;
	--novela: #3730A3;
	--cozinha: #FDE68A;
	--soft: #E0E7FF;
	--radius: 20px;
	--title: 'Fredoka', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: #BE185D; }
a:hover { color: #9D174D; }
h1, h2, h3 { font-family: var(--title); font-weight: 700; line-height: 1.05; margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 700px) { .wrap { padding: 0 40px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: #fff; padding: 8px 12px; z-index: 100; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }

/* Cabeçalho */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--title); font-weight: 700; font-size: 24px; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
.logo svg { width: 32px; height: 32px; }
.logo .tv-screen { fill: var(--accent); }
.custom-logo { max-height: 56px; width: auto; }
.menu-toggle { width: 44px; height: 44px; border-radius: 14px; border: 2px solid var(--ink); background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.menu-toggle svg { width: 20px; height: 20px; }
.main-nav { display: none; width: 100%; flex-direction: column; gap: 12px; padding: 4px 0; }
.main-nav.is-open { display: flex; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.menu a { display: block; padding: 10px 0; font-family: var(--title); font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; }
.menu a:hover { color: var(--accent); }
@media (min-width: 900px) {
	.site-header { padding-top: 24px; padding-bottom: 24px; }
	.logo { font-size: 28px; }
	.logo svg { width: 38px; height: 38px; }
	.menu-toggle { display: none; }
	.main-nav { display: flex; width: auto; flex-direction: row; align-items: center; gap: 28px; padding: 0; }
	.menu { flex-direction: row; gap: 28px; }
	.menu a { padding: 0; }
}

/* Botões e selos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px; border-radius: 16px; background: var(--accent); border: 2px solid var(--accent); color: #fff; font-family: var(--title); font-weight: 600; font-size: 17px; text-decoration: none; cursor: pointer; }
.btn:hover { color: #fff; filter: brightness(0.92); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { color: var(--ink); background: var(--soft); filter: none; }
.btn--small { min-height: 44px; padding: 0 20px; font-size: 16px; border-radius: 14px; align-self: flex-start; }
.badge { display: inline-block; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--cozinha); padding: 6px 12px; border-radius: 999px; text-decoration: none; }
a.badge:hover { color: var(--ink); filter: brightness(0.95); }

/* Destaque do topo */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 48px; padding-top: 12px; padding-bottom: 32px; }
.hero__text { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-size: clamp(36px, 5.5vw, 68px); }
.lead { margin: 0; font-size: clamp(16px, 1.6vw, 18px); color: var(--muted); max-width: 540px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 150px; }
@media (min-width: 700px) {
	.hero { padding-top: 40px; padding-bottom: 72px; }
	.actions .btn { flex: 0 0 auto; }
}
.featured { flex: 1 1 260px; display: flex; justify-content: center; }
.phone { position: relative; width: min(280px, 100%); aspect-ratio: 9 / 16; border-radius: 30px; border: 8px solid var(--ink); background: var(--novela); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; color: #fff; text-decoration: none; }
.phone:hover { color: #fff; }
.phone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(30, 27, 75, 0.88), rgba(30, 27, 75, 0) 55%); }
.phone > span { position: relative; z-index: 1; }
.phone__play { align-self: center; width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.phone__play svg { width: 28px; height: 28px; }
.phone__title { display: block; font-family: var(--title); font-weight: 700; font-size: 24px; line-height: 1.1; }
.phone__meta { display: block; margin-top: 4px; font-size: 14px; color: var(--soft); }

/* Filtro (só no celular) */
.filters { display: flex; gap: 8px; padding-bottom: 20px; overflow-x: auto; }
.filters button { min-height: 44px; padding: 0 16px; border-radius: 999px; font-family: var(--title); font-size: 16px; font-weight: 600; cursor: pointer; background: #fff; color: var(--ink); border: 2px solid var(--line); white-space: nowrap; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (min-width: 900px) { .filters { display: none; } }

/* Seções e cards */
.block { padding-bottom: 48px; }
@media (min-width: 700px) { .block { padding-bottom: 64px; } }
.block__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.block__head h2, .page-title { display: flex; align-items: center; gap: 8px; font-size: clamp(26px, 3vw, 34px); }
.block__head h2 svg, .page-title svg { width: 28px; height: 28px; flex-shrink: 0; }
.block__head a { font-size: 15px; font-weight: 600; white-space: nowrap; }
.icon-novela { color: var(--novela); }
.icon-cozinha { color: #B45309; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; } }
.card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.card:hover { color: var(--ink); }
.card:hover .cover { transform: translateY(-3px); }
.cover { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.cover--novela { background: var(--novela); }
.cover--cozinha { background: var(--cozinha); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__play { width: 48px; height: 48px; border-radius: 50%; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.cover__play svg { width: 16px; height: 16px; }
.pill { position: absolute; left: 10px; bottom: 10px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, 0.5); padding: 4px 10px; border-radius: 999px; }
.card__title { font-family: var(--title); font-weight: 600; font-size: 17px; line-height: 1.2; }
.card__meta { display: flex; align-items: center; gap: 5px; font-size: 14px; color: var(--muted); }
.card__meta svg { width: 14px; height: 14px; }
.empty { color: var(--muted); margin: 0; }

/* Páginas de lista */
.page-head { padding: 16px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.page-head p { margin: 0; color: var(--muted); max-width: 640px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chips a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; background: #fff; border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.chips a:hover { border-color: var(--ink); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.pagination .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 12px; background: #fff; border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Página do vídeo */
.watch { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 32px 48px; padding-top: 8px; padding-bottom: 48px; }
.player { flex: 0 1 400px; width: 100%; max-width: 400px; margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 24px; overflow: hidden; background: var(--ink); display: flex; align-items: center; justify-content: center; position: relative; }
.player iframe, .player video { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.player--embed { aspect-ratio: auto; min-height: 400px; overflow: auto; background: transparent; }
.player img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player > div, .player > section { width: 100% !important; height: 100% !important; max-width: none !important; padding: 0 !important; position: relative !important; }
.player__start { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background: var(--novela); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.player__start .phone__play { position: relative; z-index: 1; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); }
.player__start:hover .phone__play { transform: scale(1.06); }
.player__start:focus-visible { outline-offset: -6px; }
.watch__info { flex: 999 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.watch__info h1 { font-size: clamp(30px, 4vw, 48px); }
.meta-line { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.meta-line svg { width: 16px; height: 16px; }
.entry { font-size: 17px; line-height: 1.65; }
.entry h2, .entry h3 { margin: 1.2em 0 0.4em; font-size: 24px; }
.entry ul, .entry ol { padding-left: 1.2em; }
.ep-nav { display: flex; flex-wrap: wrap; gap: 10px; }

/* Episódio: primeiro o texto, depois o vídeo */
.read { max-width: 800px; padding-top: 8px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 20px; }
.read__head { display: flex; flex-direction: column; gap: 12px; }
.read__head h1 { font-size: clamp(30px, 4.5vw, 48px); }
.read__head .meta-line { margin: 0; }
.read .entry > :first-child { margin-top: 0; }
.read__video { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 8px; }
.read__label { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--title); font-weight: 600; font-size: 20px; color: var(--ink); }
.read__label svg { width: 14px; height: 14px; color: var(--accent); }
.read__video .player { flex: none; margin: 0; }
.read .ep-nav { justify-content: center; }
.more { padding-bottom: 40px; }
.mini-title { font-size: clamp(22px, 2.4vw, 28px); }
.mini-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.mini { flex: 0 0 104px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.mini:hover { color: var(--ink); }
.mini:hover .cover { transform: translateY(-2px); }
.mini .cover { border-radius: 14px; }
.mini .cover__play { width: 34px; height: 34px; }
.mini .cover__play svg { width: 12px; height: 12px; }
.mini .pill { left: 6px; bottom: 6px; font-size: 11px; padding: 2px 8px; }
.mini__title { font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 700px) { .mini { flex-basis: 128px; } .mini-row { gap: 16px; } }

/* Aviso no WhatsApp e rodapé */
.cta { margin-bottom: 40px; padding: 24px 20px; border-radius: 24px; background: var(--ink); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.cta__text { flex: 999 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cta h2 { font-size: clamp(24px, 3vw, 34px); }
.cta p { margin: 0; color: var(--soft); font-size: clamp(15px, 1.5vw, 17px); }
.cta .btn { flex: 1 1 auto; }
.cta .btn svg { width: 18px; height: 18px; }
@media (min-width: 700px) {
	.cta { padding: 44px 48px; border-radius: 30px; }
	.cta .btn { flex: 0 0 auto; }
}
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; padding-bottom: 40px; border-top: 2px solid var(--line); font-size: 15px; color: var(--muted); }
.social { display: flex; flex-wrap: wrap; gap: 20px; }

/* Anúncios: ocupam a largura toda, no celular e no computador */
.ad-slot { display: block; width: 100%; margin-top: 8px; margin-bottom: 32px; text-align: center; overflow: hidden; }
.ad-item { width: 100%; min-width: 0; margin: 0 auto 16px; }
.ad-item:last-child { margin-bottom: 0; }
.ad-slot ins.adsbygoogle, .entry ins.adsbygoogle { display: block; max-width: 100%; margin: 0 auto; }
.ad-slot iframe, .entry iframe { max-width: 100%; }
.watch__info, .entry { min-width: 0; max-width: 100%; }
.entry .wp-block-html, .entry .widget_custom_html { width: 100%; overflow: hidden; }

/* Páginas comuns */
.page-content { max-width: 760px; padding-top: 16px; padding-bottom: 48px; }
.page-content h1 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 20px; }
.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.post-list h2 { font-size: 24px; }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption-text { font-size: 14px; color: var(--muted); }
