/*
Theme Name: Lacostanera(Dicas)
Theme URI: https://lacostanera.com.br/
Author: LaCostanera
Author URI: https://lacostanera.com.br/
Description: Portal PWA de Alto Volume, Hub de Ferramentas de Inteligência Artificial (Gerador de Frases, Cartões de Agradecimento e Calculadora de Quantidades) e SEO Programático em Escala (SSR + Schema.org + Service Worker Stale-While-Revalidate) para o Ateliê da Lola.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.3
Text Domain: lacostanera-dicas
*/

:root {
  /* Paleta App Shell Moderna & Acolhedora */
  --app-bg: #F6F4F0;
  --app-surface: #FFFFFF;
  --app-surface-elevated: #FDFBF7;
  --app-muted: #EDE8DF;
  --app-dark: #191614;

  --app-text: #1B1816;
  --app-text-secondary: #595048;
  --app-text-muted: #877B70;

  --app-primary: #8C6239;        /* Bronze Editorial / Ateliê */
  --app-primary-hover: #6E4B28;
  --app-primary-soft: #F4ECE1;
  --app-ai-accent: #6B46C1;      /* Roxo Sutil para badges de IA */
  --app-ai-soft: #F3EFFC;
  --app-wa: #1B7F47;

  --app-border: #E4DDD3;
  --app-radius-sm: 8px;
  --app-radius-md: 14px;
  --app-radius-lg: 20px;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --topbar-height: 74px;
  --bottomnav-height: 68px;
  --shadow-card: 0 4px 20px -4px rgba(25, 22, 20, 0.06);
  --shadow-float: 0 12px 32px -8px rgba(25, 22, 20, 0.14);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--app-bg);
  color: var(--app-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}

body {
  background-color: var(--app-bg);
  color: var(--app-text);
  min-height: 100vh;
  padding-top: var(--topbar-height);
  padding-bottom: calc(var(--bottomnav-height) + 1.5rem);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3.5vw, 2rem);
}

.app-reading-box {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3.5vw, 1.5rem);
}

/* Barra de Progresso de Leitura no Topo */
.app-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--app-primary), #D4AF37);
  width: 0%;
  z-index: 250;
  transition: width 0.1s linear;
}

/* Top Bar Contextual do App Shell */
.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--app-border);
  z-index: 200;
  display: flex;
  align-items: center;
}

.app-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.app-brand-logo {
  height: 52px;
  width: auto;
  max-width: 215px;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.2s ease;
}

.app-brand:hover .app-brand-logo {
  transform: scale(1.02);
}

@media (max-width: 640px) {
  .app-brand-logo {
    height: 42px;
    max-width: 165px;
  }
}

.app-topbar-search {
  flex: 1;
  max-width: 420px;
  display: none;
}

@media (min-width: 768px) {
  .app-topbar-search {
    display: flex;
  }
}

.app-search-box {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  padding: 0.32rem 0.45rem 0.32rem 0.9rem;
}

.app-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.86rem;
  color: var(--app-text);
  outline: none;
  font-family: var(--font-sans);
}

.app-search-box button {
  background: var(--app-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-btn-chip:hover {
  border-color: var(--app-primary);
  color: var(--app-primary);
}

.app-btn-chip.ai-chip {
  background: var(--app-ai-soft);
  border-color: rgba(107, 70, 193, 0.25);
  color: var(--app-ai-accent);
}

.app-btn-chip.wa-chip {
  background: var(--app-wa);
  border-color: var(--app-wa);
  color: #FFFFFF;
}

/* Bottom Navigation Bar Fixa (4 Abas Nativas PWA) */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottomnav-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--app-border);
  z-index: 210;
  display: flex;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-bottom-nav-inner {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 100%;
}

.app-nav-tab {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  color: var(--app-text-muted);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.app-nav-tab svg {
  width: 21px;
  height: 21px;
  transition: transform 0.2s ease;
}

.app-nav-tab.active {
  color: var(--app-primary);
}

.app-nav-tab.active svg {
  transform: translateY(-2px);
}

.app-nav-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 36px;
  height: 3px;
  background: var(--app-primary);
  border-radius: 0 0 4px 4px;
}

.app-saved-counter {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  background: var(--app-primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Gerenciamento de Views das 4 Abas */
.app-view-panel {
  display: none;
  animation: appFadeIn 0.22s ease;
}

.app-view-panel.active {
  display: block;
}

@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Compacto / Hub Header */
.app-hub-banner {
  background: linear-gradient(135deg, #1E1916 0%, #332922 100%);
  color: #FAF7F2;
  border-radius: var(--app-radius-lg);
  padding: clamp(1.35rem, 3.5vw, 2.25rem);
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: center;
  box-shadow: var(--shadow-card);
}

@media (min-width: 860px) {
  .app-hub-banner {
    grid-template-columns: 1.35fr 0.65fr;
  }
}

.app-hub-title {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.app-hub-sub {
  font-size: 0.92rem;
  color: #D5CBBF;
  max-width: 60ch;
}

/* Barra Horizontal de Filtros Rápidos (Scroll-Snap Mobile) */
.app-filter-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  scrollbar-width: none;
}

.app-filter-strip::-webkit-scrollbar {
  display: none;
}

.app-filter-pill {
  flex-shrink: 0;
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-text-secondary);
  transition: all 0.2s ease;
}

.app-filter-pill:hover,
.app-filter-pill.active {
  background: var(--app-text);
  border-color: var(--app-text);
  color: #FFFFFF;
}

/* Feed de Alto Volume (Cards de Leitura Rápida + Botão Salvar Offline) */
.app-feed-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

@media (min-width: 680px) {
  .app-feed-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.35rem;
  }
}

@media (min-width: 1024px) {
  .app-feed-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.app-feed-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.app-feed-card:hover {
  transform: translateY(-3px);
  border-color: var(--app-primary);
}

.app-feed-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--app-muted);
  overflow: hidden;
}

.app-feed-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-bookmark-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border: 1px solid var(--app-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--app-text);
  transition: all 0.2s ease;
}

.app-bookmark-btn.saved {
  background: var(--app-primary);
  border-color: var(--app-primary);
  color: #FFFFFF;
}

.app-feed-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.app-feed-meta {
  font-size: 0.74rem;
  color: var(--app-text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-feed-title {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.24;
  margin-bottom: 0.5rem;
}

.app-feed-title a:hover {
  color: var(--app-primary);
}

.app-feed-excerpt {
  font-size: 0.87rem;
  color: var(--app-text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-feed-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--app-primary);
}

/* Módulo Interativo de IA (Aba 3: Ferramentas IA) */
.ai-studio-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-card);
  margin-block: 1.25rem;
}

.ai-tool-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .ai-tool-selector {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ai-tool-tab {
  padding: 0.85rem 1rem;
  border-radius: var(--app-radius-md);
  border: 1.5px solid var(--app-border);
  background: var(--app-bg);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.ai-tool-tab.active {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
}

.ai-tool-tab strong {
  display: block;
  font-size: 0.88rem;
  color: var(--app-text);
  margin-bottom: 0.15rem;
}

.ai-tool-tab span {
  font-size: 0.74rem;
  color: var(--app-text-secondary);
}

.ai-style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.ai-style-chip {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--app-text-secondary);
}

.ai-style-chip.active {
  background: var(--app-primary);
  border-color: var(--app-primary);
  color: #FFFFFF;
}

.ai-form-group {
  margin-bottom: 1.15rem;
}

.ai-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--app-text);
}

.ai-input, .ai-select {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: var(--app-radius-sm);
  border: 1px solid var(--app-border);
  background: var(--app-bg);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--app-text);
}

.ai-submit-btn {
  width: 100%;
  padding: 0.9rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--app-primary) 0%, #6A4522 100%);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 8px 20px rgba(140, 98, 57, 0.25);
}

.ai-submit-btn:hover {
  opacity: 0.95;
}

/* Skeleton Screen de Carregamento IA */
.ai-skeleton {
  display: none;
  padding: 1.5rem;
  border-radius: var(--app-radius-md);
  background: var(--app-bg);
  margin-top: 1.25rem;
}

.ai-skeleton.active {
  display: block;
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #E6DFD5 25%, #F3EFEA 50%, #E6DFD5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 0.65rem;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Cards de Resultado Gerados pela IA */
.ai-results-area {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-result-card {
  background: var(--app-surface-elevated);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--app-primary);
  border-radius: var(--app-radius-md);
  padding: 1.25rem;
}

.ai-result-quote {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  line-height: 1.45;
  color: var(--app-text);
  margin-bottom: 0.75rem;
  white-space: pre-line;
}

.ai-result-tip {
  font-size: 0.8rem;
  color: var(--app-text-secondary);
  background: var(--app-primary-soft);
  padding: 0.55rem 0.8rem;
  border-radius: var(--app-radius-sm);
  margin-bottom: 0.9rem;
}

.ai-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Single Post no App Shell */
.app-single-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  padding: clamp(1.35rem, 4vw, 2.75rem);
  margin-top: 1.25rem;
  box-shadow: var(--shadow-card);
}

.app-single-card figure {
  margin: 0 0 1.75rem 0;
  width: 100%;
}

.app-single-card img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--app-radius-md);
}

.app-prose {
  font-size: clamp(1.02rem, 0.3vw + 0.95rem, 1.12rem);
  line-height: 1.78;
  color: var(--app-text);
}

.app-prose p { margin-bottom: 1.35rem; }
.app-prose h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  scroll-margin-top: 80px;
}
.app-prose h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}
.app-prose ul, .app-prose ol {
  margin-bottom: 1.35rem;
  padding-left: 1.35rem;
}
.app-prose li { margin-bottom: 0.45rem; }
.app-prose a {
  color: var(--app-primary);
  text-decoration: underline;
}

/* Toast Notification */
.app-toast {
  position: fixed;
  bottom: calc(var(--bottomnav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--app-dark);
  color: #fff;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 300;
  box-shadow: var(--shadow-float);
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
