/* ═══════════════════════════════════════════════════════════════════
   THAISA GARCIA — DESIGN SYSTEM
   Base para o tema WordPress (Timber/Twig + ACF Pro)

   Índice:
   1.  Imports
   2.  Tokens — Cores
   3.  Tokens — Tipografia
   4.  Tokens — Espaçamento
   5.  Tokens — Layout
   6.  Reset
   7.  Tipografia base
   8.  Botões
   9.  Badges / Status
   10. Formulários
   11. Tabelas
   12. Layout — Sidebar (Admin)
   13. Layout — Split Panel (Landing / Login)
   14. Utilitários
═══════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────
   1. IMPORTS
───────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');


/* ─────────────────────────────────────────────────────────────────
   2. TOKENS — CORES
───────────────────────────────────────────────────────────────── */

:root {

  /* Fundo */
  --bg:          #fafaf8;   /* background principal */
  --bg-warm:     #f8f5f0;   /* background aquecido (landing) */
  --panel:       #ede6da;   /* painel lateral claro (landing) */
  --dark-bg:     #1c1a17;   /* fundo escuro (login painel esquerdo) */
  --white:       #ffffff;

  /* Texto */
  --text:        #1c1c1a;   /* texto principal */
  --text-dim:    #3a3a38;   /* texto levemente suavizado */
  --muted:       #888580;   /* texto secundário, labels */
  --muted-lt:    #b0ada8;   /* texto mais suave, metadata */

  /* Bordas */
  --line:        #e8e4de;   /* borda padrão */
  --line-lt:     #f0ece6;   /* borda muito suave */

  /* Accent (dourado) */
  --accent:      #b89a6a;   /* cor principal da marca */
  --accent-lt:   #d4b98a;   /* accent claro (hover, ícones) */
  --accent-bg:   #fdf8f0;   /* fundo accent suave */
  --accent-bdr:  #ecdec3;   /* borda accent */
  --accent-text: #8a6c35;   /* texto sobre fundo accent */

  /* Status */
  --green:       #4a7c59;
  --green-bg:    #eef5f1;
  --red:         #8b3a3a;
  --red-bg:      #f5eeee;
  --yellow:      #8a6c35;
  --yellow-bg:   #f8f4eb;
  --gray-bg:     #f0efed;
}


/* ─────────────────────────────────────────────────────────────────
   3. TOKENS — TIPOGRAFIA
───────────────────────────────────────────────────────────────── */

:root {

  /* Famílias */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  /* Escala (base 14px → razão ~1.2) */
  --fs-xs:   10px;   /* labels, caps, badges */
  --fs-sm:   12px;   /* meta, legendas */
  --fs-base: 14px;   /* corpo */
  --fs-md:   16px;   /* destaque suave */
  --fs-lg:   20px;   /* subtítulos, nomes em cards */
  --fs-xl:   28px;   /* headings de seção */
  --fs-2xl:  36px;   /* título de página */
  --fs-3xl:  48px;   /* hero (serif) */
  --fs-4xl:  60px;   /* hero grande (serif) */

  /* Line-heights */
  --lh-tight:  1.2;  /* headings */
  --lh-normal: 1.5;  /* corpo */
  --lh-loose:  1.75; /* texto corrido */

  /* Letter-spacing recorrente */
  --ls-caps:  0.1em;   /* labels em maiúsculas */
  --ls-tight: 0.02em;  /* texto normal com leve rastreamento */
}


/* ─────────────────────────────────────────────────────────────────
   4. TOKENS — ESPAÇAMENTO (grid de 8px)
───────────────────────────────────────────────────────────────── */

:root {
  --sp-2:  8px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  40px;
  --sp-8:  48px;
  --sp-9:  64px;
  --sp-10: 80px;
  --sp-11: 96px;
}


/* ─────────────────────────────────────────────────────────────────
   5. TOKENS — LAYOUT
───────────────────────────────────────────────────────────────── */

:root {
  --r:             2px;    /* border-radius padrão (minimalista) */
  --r-lg:          4px;    /* border-radius cartões/seções */
  --sidebar:       220px;  /* largura do sidebar admin */
  --content-max:   720px;  /* largura máxima de formulários */
  --wrap:          1200px; /* largura máxima da página */

  /* Ícones */
  --icon-xs: 12px;
  --icon-sm: 14px;
  --icon-md: 16px;
  --icon-lg: 20px;
  --icon-xl: 24px;
}

/* Breakpoints (usar com @media)
   --bp-sm:  512px
   --bp-md:  768px
   --bp-lg:  1024px
   --bp-xl:  1280px
   --bp-xxl: 1440px
*/


/* ─────────────────────────────────────────────────────────────────
   6. RESET
───────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img { height: auto; }

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

button, input, select, textarea {
  font: inherit;
}

ul, ol { list-style: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ─────────────────────────────────────────────────────────────────
   7. TIPOGRAFIA BASE
───────────────────────────────────────────────────────────────── */

/* Heading serif — usado em títulos de marca e heroes */
.heading-serif {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: var(--lh-tight);
  color: var(--text);
}

/* Label caps — usado em labels de seção, navegação */
.label-caps {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--muted);
}

/* Texto muted — metadata, datas, legenda */
.text-muted {
  color: var(--muted);
  font-size: var(--fs-md);
  font-weight: 300;
}

@media (max-width: 1024px) {
  .text-muted { font-size: var(--fs-base); }
}

/* Nome da marca (usado no header/sidebar) */
.brand-name {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text);
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}


/* ─────────────────────────────────────────────────────────────────
   8. BOTÕES
───────────────────────────────────────────────────────────────── */

/* Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 40px;
  padding: 0 var(--sp-5);
  border-radius: var(--r);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Primário — fundo escuro */
.btn--primary {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}
.btn--primary:hover:not(:disabled) { opacity: 0.82; }

/* Accent — dourado */
.btn--accent {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn--accent:hover:not(:disabled) { opacity: 0.85; }

/* Outline — borda escura */
.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--outline:hover:not(:disabled) {
  border-color: var(--text);
  background: var(--text);
  color: var(--white);
}

/* Ghost — sem borda */
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding: 0 var(--sp-4);
}
.btn--ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--line);
}
.btn--ghost.is-active {
  color: var(--text);
  background: var(--line);
}

/* Destrutivo */
.btn--danger {
  background: transparent;
  color: var(--red);
  border-color: var(--line);
}
.btn--danger:hover:not(:disabled) {
  background: var(--red-bg);
  border-color: var(--red);
}

/* Tamanhos */
.btn--sm {
  height: 32px;
  padding: 0 var(--sp-4);
  font-size: 12px;
}

.btn--lg {
  height: 48px;
  padding: 0 var(--sp-6);
  font-size: var(--fs-base);
}


/* ─────────────────────────────────────────────────────────────────
   9. BADGES / STATUS
───────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border-radius: 40px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  white-space: nowrap;
}

/* Ponto decorativo */
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  opacity: 0.7;
}

/* Variantes */
.badge--green {
  background: var(--green-bg);
  color: var(--green);
}

.badge--red {
  background: var(--red-bg);
  color: var(--red);
}

.badge--yellow {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge--gray {
  background: var(--gray-bg);
  color: var(--muted);
}

.badge--accent {
  background: var(--accent-bg);
  color: var(--accent-text);
  border: 1px solid var(--accent-bdr);
}

/* Sem ponto (puramente textual) */
.badge--plain::before { display: none; }


/* ─────────────────────────────────────────────────────────────────
   10. FORMULÁRIOS
───────────────────────────────────────────────────────────────── */

/* Grupo de campo */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* Grid de dois campos lado a lado */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

@media (max-width: 512px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Label */
.field label,
label.field__label {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  color: var(--text);
}

.field__label--required::after {
  content: ' *';
  color: var(--accent);
}

/* Inputs, selects, textareas */
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="tel"],
.field input[type="number"],
.field select,
input.input,
select.input {
  width: 100%;
  height: 40px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.field textarea,
textarea.input {
  width: 100%;
  min-height: 96px;
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Focus */
.field input:focus,
.field select:focus,
.field textarea:focus,
input.input:focus,
select.input:focus,
textarea.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 154, 106, 0.12);
}

/* Placeholder */
.field input::placeholder,
.field textarea::placeholder,
input.input::placeholder {
  color: var(--muted-lt);
}

/* Select — seta customizada */
.field select,
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888580'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Input de busca */
.search-wrap {
  position: relative;
  width: 100%;
}

.search-wrap .search-icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 var(--sp-4) 0 38px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--muted); }

/* Seção de formulário (card com header) */
.form-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
  overflow: hidden;
}

.form-section__header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--muted);
}

.form-section__body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Ações do formulário (salvar/cancelar) */
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}


/* ─────────────────────────────────────────────────────────────────
   11. TABELAS
───────────────────────────────────────────────────────────────── */

.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap thead tr {
  border-bottom: 1px solid var(--line);
}

.table-wrap th {
  padding: var(--sp-4) var(--sp-4);
  text-align: left;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.table-wrap tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.table-wrap tbody tr:last-child {
  border-bottom: none;
}

.table-wrap tbody tr:hover {
  background: #fdfcfa;
}

.table-wrap td {
  padding: var(--sp-4) var(--sp-4);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text);
}

/* Coluna de ações à direita */
.table-wrap td.td-actions {
  text-align: right;
  white-space: nowrap;
}

/* Célula de texto muted */
.table-wrap td.td-muted {
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* Responsivo — scroll horizontal em mobile */
@media (max-width: 768px) {
  .table-wrap { overflow-x: auto; }
}


/* ─────────────────────────────────────────────────────────────────
   12. LAYOUT — SIDEBAR (Admin)
───────────────────────────────────────────────────────────────── */

/* Wrapper geral */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  padding: var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.sidebar__nav {
  flex: 1;
  padding: var(--sp-4) 0;
}

.sidebar__label {
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--muted-lt);
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar__item:hover {
  color: var(--text);
  background: var(--bg);
}

.sidebar__item--active {
  color: var(--text);
  background: var(--bg);
  font-weight: 500;
}

.sidebar__item--active .sidebar__item-icon {
  color: var(--accent);
}

.sidebar__footer {
  padding: var(--sp-4);
  border-top: 1px solid var(--line);
}

/* Conteúdo principal */
.admin-main {
  flex: 1;
  min-width: 0;
  padding: var(--sp-6) var(--sp-6);
  overflow-y: auto;
}

.admin-main__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
  gap: var(--sp-4);
}

.admin-main__title {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 400;
  color: var(--text);
}

/* Responsivo — sidebar vira barra horizontal em tablet/mobile */
@media (max-width: 1024px) {
  .admin-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .admin-main { padding: var(--sp-4); }
}


/* ─────────────────────────────────────────────────────────────────
   13. LAYOUT — SPLIT PANEL (Landing / Login)
───────────────────────────────────────────────────────────────── */

/* Dois painéis lado a lado em fullscreen */
.split-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Painel esquerdo (conteúdo / marca) */
.split-layout__left {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-8) var(--sp-9);
}

/* Painel direito (imagem / formulário) */
.split-layout__right {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Painel escuro (login) */
.split-layout__left--dark {
  background: var(--dark-bg);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

/* Painel com imagem de fundo */
.split-layout__panel--image {
  background-size: cover;
  background-position: center;
}

.split-layout__panel--image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* Responsivo — empilha em mobile 50/50 */
@media (max-width: 1024px) {
  .split-layout { flex-direction: column; overflow: hidden; }
  .split-layout__left  { flex: 0 0 50%; padding: var(--sp-8) var(--sp-5); overflow-y: auto; border-bottom: 1px solid var(--line); }
  .split-layout__right { flex: 1; }
}


/* ─────────────────────────────────────────────────────────────────
   14. UTILITÁRIOS
───────────────────────────────────────────────────────────────── */

/* Visibilidade */
.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;
}

/* Separador */
.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--sp-5) 0;
}

/* Wrapper de página */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* Breadcrumb / link de voltar */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: var(--sp-4);
  transition: color 0.15s;
}
.page-back:hover { color: var(--text); }

/* Truncar texto com ellipsis */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flex helpers */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }

/* ─────────────────────────────────────────────────────────────────
   15. ÍCONES — Lucide Icons (data-lucide="nome")
───────────────────────────────────────────────────────────────── */

.icon {
  display: inline-block;
  width: var(--icon-md);
  height: var(--icon-md);
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon--xs { width: var(--icon-xs); height: var(--icon-xs); }
.icon--sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon--lg { width: var(--icon-lg); height: var(--icon-lg); }
.icon--xl { width: var(--icon-xl); height: var(--icon-xl); }
