/*
Theme Name: Tua Encomenda
Theme URI: https://tuaencomenda.com.br
Author: MMoura Soluções
Author URI: https://marcosmoura.dev
Description: Tema personalizado para Tua Encomenda — gestão de encomendas para condomínios.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: Proprietary
Text Domain: tua-encomenda
*/

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* escala do tamanho dos textos — ajustada por seção no painel */
  --fs-t: 1;   /* títulos */
  --fs-x: 1;   /* textos */
  --primary:      #2DC9A0;
  --primary-dark: #1FA882;
  --primary-light:#55D9B4;
  --accent:       #FF6B00;
  --text:         #1A1A2E;
  --text-muted:   #5A6072;
  --bg:           #FFFFFF;
  --bg-alt:       #F4F7FC;
  --border:       #DDE3EE;
  --radius:       12px;
  --shadow:       0 4px 24px rgba(45,201,160,.10);
  --shadow-lg:    0 8px 40px rgba(45,201,160,.16);
  --transition:   .25s ease;
  --max-w:        1200px;
  --header-h:     72px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Sora', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  background: #fff;
  box-shadow: 0 2px 16px rgba(45,201,160,.10);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.site-nav__link {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.site-nav__link:hover,
.site-nav__link[aria-current="section"] {
  background: var(--bg-alt);
  color: var(--primary);
  text-decoration: none;
}

.btn-access {
  background: var(--primary);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-access:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: calc(var(--header-h) + 80px);
  padding-bottom: 100px;
  background: linear-gradient(145deg, #E6FAF5 0%, #FFFFFF 60%);
  text-align: center;
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,201,160,.08) 0%, transparent 70%);
  top: -100px; right: -200px;
  pointer-events: none;
}

.hero__badge {
  display: inline-block;
  background: rgba(45,201,160,.12);
  color: var(--primary);
  font-size: calc(.8rem * var(--fs-x));
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 6px 16px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: calc(clamp(2rem, 5vw, 3.5rem) * var(--fs-t));
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  max-width: 820px;
  margin-inline: auto;
  margin-bottom: 20px;
}
.hero h1 span { color: var(--primary); }

.hero__desc {
  font-size: calc(1.15rem * var(--fs-x));
  color: var(--text-muted);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 40px;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 60px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: inline-block;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
  display: inline-block;
}
.btn-secondary:hover {
  background: var(--bg-alt);
  transform: translateY(-2px);
  text-decoration: none;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px;
}
.hero__stat-number {
  font-size: calc(2rem * var(--fs-t));
  font-weight: 800;
  color: var(--primary);
  display: block;
}
.hero__stat-label {
  font-size: calc(.85rem * var(--fs-x));
  color: var(--text-muted);
}

/* ============================================================
   SECTIONS COMMONS
   ============================================================ */
.section-title {
  font-size: calc(clamp(1.5rem, 3vw, 2.25rem) * var(--fs-t));
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: calc(1.05rem * var(--fs-x));
  max-width: 580px;
  margin-inline: auto;
}

section { padding-block: 80px; }

.text-center { text-align: center; }
.mb-12 { margin-bottom: 12px; }
.mb-48 { margin-bottom: 48px; }

/* ============================================================
   SOBRE / QUEM SOMOS
   ============================================================ */
.sobre { background: var(--bg-alt); }

.sobre__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.sobre__img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--border);
}

.sobre h2 { margin-bottom: 16px; }
.sobre p  { color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; font-size: calc(1rem * var(--fs-x)); }

/* ============================================================
   SOLUÇÕES
   ============================================================ */
.solucoes { background: var(--bg); }

.solucoes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.card-solucao {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card-solucao:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

.card-solucao__icon {
  width: 52px; height: 52px;
  background: rgba(45,201,160,.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.card-solucao h3 {
  font-size: calc(1.1rem * var(--fs-t));
  font-weight: 700;
  margin-bottom: 8px;
}
.card-solucao p  { color: var(--text-muted); font-size: calc(.9rem * var(--fs-x)); line-height: 1.6; }

/* ============================================================
   FAQ
   ============================================================ */
.faq { background: var(--bg-alt); }

.faq__list {
  max-width: 780px;
  margin-inline: auto;
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq__item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq__question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 20px 24px;
  font-family: inherit;
  font-size: calc(1rem * var(--fs-t));
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text);
}
.faq__question::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.faq__item.open .faq__question::after { transform: rotate(45deg); }

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.faq__answer-inner {
  font-size: calc(1rem * var(--fs-x));
  padding: 0 24px 20px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   CONTATO
   ============================================================ */
.contato { background: var(--bg); }

.contato__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
  margin-top: 48px;
}

.contato__info h3 {
  font-size: calc(1.1rem * var(--fs-t));
  font-weight: 700;
  margin-bottom: 16px;
}
.contato__info p { color: var(--text-muted); margin-bottom: 8px; font-size: calc(1rem * var(--fs-x)); }
.contato__info a { color: var(--primary); font-weight: 600; }

.contato__form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: calc(.875rem * var(--fs-x)); font-weight: 600; color: var(--text); }
.form-group input,
.form-group textarea,
.form-group select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: calc(.95rem * var(--fs-x));
  color: var(--text);
  background: var(--bg-alt);
  transition: border-color var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.form-group textarea { resize: vertical; min-height: 120px; }

.form-notice {
  font-size: calc(.85rem * var(--fs-x));
  color: var(--text-muted);
  padding: 10px;
  background: #e0f7f1;
  border-radius: 6px;
  text-align: center;
}
.form-notice.success { background: #d4edda; color: #155724; }
.form-notice.error   { background: #f8d7da; color: #721c24; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.7);
  padding-block: 40px;
  text-align: center;
  font-size: calc(.875rem * var(--fs-x));
}
.site-footer a { color: rgba(255,255,255,.9); }
.site-footer strong { color: #fff; }

/* ============================================================
   WHATSAPP FLOAT
   ============================================================ */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  background: #25D366;
  color: #fff;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  font-size: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,.5);
  text-decoration: none;
  color: #fff;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sobre__grid,
  .contato__grid { grid-template-columns: 1fr; gap: 40px; }
  .sobre__img { order: -1; }
}

@media (max-width: 680px) {
  .site-nav { display: none; flex-direction: column; position: absolute;
    top: var(--header-h); left: 0; right: 0;
    background: #fff; padding: 16px 24px 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1); }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding-top: calc(var(--header-h) + 48px); padding-bottom: 60px; }
  .hero__ctas { flex-direction: column; align-items: center; }
  section { padding-block: 56px; }
}

/* ── Soluções: grid responsivo melhorado ──────────────────── */
.solucoes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

/* ── Hero CTAs: quando só 1 botão está ativo ──────────────── */
.hero__ctas:has(.btn-primary:only-child),
.hero__ctas:has(.btn-secondary:only-child) {
  justify-content: center;
}

/* ════════════════════════════════════════════
   BLOG / POSTS
════════════════════════════════════════════ */
.blog-posts { background: var(--bg); }

.blog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 48px;
  text-align: left;
}

.card-post {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.card-post:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

.card-post__thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--border);
}
.card-post__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card-post:hover .card-post__thumb img { transform: scale(1.04); }

.card-post__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-post__date {
  font-size: calc(.78rem * var(--fs-x));
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .04em;
}

.card-post__title {
  font-size: calc(1rem * var(--fs-t));
  font-weight: 700;
  line-height: 1.4;
}
.card-post__title a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}
.card-post__title a:hover { color: var(--primary); text-decoration: none; }

.card-post__excerpt {
  font-size: calc(.875rem * var(--fs-x));
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.card-post__link {
  font-size: calc(.875rem * var(--fs-x));
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-top: 4px;
  display: inline-block;
  transition: gap var(--transition);
}
.card-post__link:hover { text-decoration: underline; }

/* ════════════════════════════════════════════
   MODAIS — BASE UNIFICADA (.tua-modal__)
════════════════════════════════════════════ */

body.modal-open { overflow: hidden; }

/* Wrapper overlay */
[id$="-modal"] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
[id$="-modal"].is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Backdrop */
.tua-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, .65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Panel */
.tua-modal__panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  transform: translateY(24px);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  scroll-behavior: smooth;
  word-break: break-word;
  overflow-wrap: break-word;
}
[id$="-modal"].is-open .tua-modal__panel { transform: translateY(0); }

/* Close button */
.tua-modal__close {
  position: sticky;
  top: 0;
  float: right;
  margin: 16px 16px 0 0;
  z-index: 2;
  width: 36px; height: 36px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.tua-modal__close:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Scrollbar */
.tua-modal__panel::-webkit-scrollbar { width: 6px; }
.tua-modal__panel::-webkit-scrollbar-track { background: transparent; }
.tua-modal__panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.tua-modal__panel::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ════════════════════════════════════════════
   MODAL DE CONTEÚDO DO POST
════════════════════════════════════════════ */

.post-modal__content { display: block; }

/* Featured image */
.post-modal__featured-img,
.single-post__thumb img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
  display: block;
}

/* Header */
.post-modal__header,
.single-post__header {
  padding: 28px 36px 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-modal__meta,
.single-post__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.post-modal__cat {
  background: rgba(45,201,160,.12);
  color: var(--primary-dark);
  font-size: calc(.75rem * var(--fs-x));
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 3px 10px;
}

.post-modal__meta time,
.single-post__meta time {
  font-size: calc(.8rem * var(--fs-x));
  color: var(--text-muted);
}

.post-modal__title,
.single-post__title {
  font-size: calc(clamp(1.4rem, 3vw, 2rem) * var(--fs-t));
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0;
}

/* Content body */
.post-modal__entry,
.single-post__content {
  padding: 24px 36px 48px;
  font-size: calc(1rem * var(--fs-x));
  line-height: 1.8;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.post-modal__entry p, .single-post__content p { margin-bottom: 1.25em; }
.post-modal__entry h2, .single-post__content h2 { font-size: calc(1.35rem * var(--fs-t)); font-weight: 700; margin: 1.6em 0 .6em; }
.post-modal__entry h3, .single-post__content h3 { font-size: calc(1.1rem * var(--fs-t));  font-weight: 700; margin: 1.6em 0 .6em; }
.post-modal__entry img, .single-post__content img { max-width: 100%; border-radius: 8px; margin-block: 1em; }
.post-modal__entry a, .single-post__content a { color: var(--primary); }
.post-modal__entry ul, .post-modal__entry ol,
.single-post__content ul, .single-post__content ol { padding-left: 1.5em; margin-bottom: 1.25em; }
.post-modal__entry li, .single-post__content li { margin-bottom: .4em; }
.post-modal__entry blockquote, .single-post__content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--bg-alt);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════
   MODAL DE LISTAGEM DE POSTS (#list-modal)
════════════════════════════════════════════ */

.list-modal__header {
  padding: 32px 36px 20px;
  border-bottom: 1px solid var(--border);
}

.list-modal__title {
  font-size: calc(1.4rem * var(--fs-t));
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.list-modal__count {
  font-size: calc(.875rem * var(--fs-x));
  color: var(--text-muted);
}

.list-modal__grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Each post row */
.list-modal__card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 36px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background var(--transition);
}
.list-modal__card:last-child { border-bottom: none; }
.list-modal__card:hover { background: var(--bg-alt); }

.list-modal__thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--border);
}
.list-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.list-modal__thumb--empty {
  background: linear-gradient(135deg, var(--bg-alt), var(--border));
}

.list-modal__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-modal__post-title {
  font-size: calc(.975rem * var(--fs-t));
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}
.list-modal__card:hover .list-modal__post-title { color: var(--primary); }

.list-modal__excerpt {
  font-size: calc(.825rem * var(--fs-x));
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Single post page (fallback) ────────────────────────── */
.single-post-page { padding-block: calc(var(--header-h) + 48px) 80px; }

.single-post {
  max-width: 780px;
  margin-inline: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.single-post__footer { padding: 0 36px 36px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  [id$="-modal"] { padding: 0; align-items: flex-end; }
  .tua-modal__panel {
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
  }
  .post-modal__header,
  .post-modal__entry,
  .single-post__header,
  .single-post__content,
  .single-post__footer,
  .list-modal__header,
  .list-modal__card { padding-inline: 20px; }
  .post-modal__featured-img,
  .single-post__thumb img { border-radius: 20px 20px 0 0; }
  .list-modal__thumb { width: 60px; height: 48px; }
}
