/* ══════════════════════════════════════════════════════
   editorial.css
   · Fora do .page  → visual temtudinho (dark, DM Mono, accent azul)
   · Dentro do .page → design original do modelo (dark sidebar, red accents)
══════════════════════════════════════════════════════════ */

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

:root {
  /* Site temtudinho */
  --tt-ink: #0d0f14;
  --tt-accent: #2a6dd9;
  --tt-border: rgba(240, 243, 248, 0.1);
  --tt-card-bg: rgba(240, 243, 248, 0.04);

  /* Modelo editorial (usadas dentro de .page) */
  --red: #c0392b;
  --red-dark: #922b21;
  --red-light: #e74c3c;
  --cream: #faf8f4;
  --dark: #1a1a1a;
  --mid: #4a4a4a;
  --light: #8a8a8a;
  --rule: #e0d8d0;
  --col-left: 220px;
  --col-right: 1fr;
}

/* ─── BODY — fundo do site ──────────────────────────── */
body {
  font-family: "DM Sans", sans-serif;
  background: var(--tt-ink);
  background-image:
    linear-gradient(rgba(240, 243, 248, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 243, 248, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px 80px;
}

/* ─── BACK NAVBAR ───────────────────────────────────── */
.back-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(13, 15, 20, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tt-border);
}

.back-nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.back-nav-logo {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: rgba(240, 243, 248, 0.88);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.back-nav-logo span {
  color: var(--tt-accent);
}

.back-nav-sep {
  color: var(--tt-border);
  font-size: 1rem;
}

.back-nav-label {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 243, 248, 0.35);
}

.back-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(240, 243, 248, 0.55);
  background: none;
  border: 1px solid var(--tt-border);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 3px;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.back-nav-btn:hover {
  color: rgba(240, 243, 248, 0.9);
  border-color: rgba(240, 243, 248, 0.25);
}

/* ─── TOAST ──────────────────────────────────────────── */
.saved-toast {
  position: fixed;
  top: 68px;
  right: 1.5rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #6ee7a0;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 999;
  pointer-events: none;
}
.saved-toast.show {
  opacity: 1;
}

/* ─── TOOLBAR ────────────────────────────────────────── */
.toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(13, 15, 20, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--tt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 2rem;
  z-index: 100;
}

.toolbar-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 243, 248, 0.25);
}
.toolbar-hint svg {
  stroke: rgba(240, 243, 248, 0.25);
  flex-shrink: 0;
}

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

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.toolbar-btn-save {
  background: var(--tt-card-bg);
  color: rgba(240, 243, 248, 0.7);
  border: 1px solid var(--tt-border);
}
.toolbar-btn-save:hover {
  background: rgba(240, 243, 248, 0.08);
  color: rgba(240, 243, 248, 0.95);
}
.toolbar-btn-print {
  background: var(--tt-accent);
  color: #fff;
}
.toolbar-btn-print:hover {
  background: #3a7de9;
}
.toolbar-btn-print:active {
  transform: scale(0.97);
}
.toolbar-btn-reset {
  background: transparent;
  color: rgba(240, 243, 248, 0.25);
  border: 1px solid rgba(240, 243, 248, 0.08);
  font-size: 0.58rem;
}
.toolbar-btn-reset:hover {
  color: rgba(240, 243, 248, 0.55);
  border-color: rgba(240, 243, 248, 0.18);
}

/* ══════════════════════════════════════════════════════
   A PARTIR DAQUI: tudo dentro do .page
   Design original do modelo editorial — não alterar
══════════════════════════════════════════════════════════ */

/* ── EDIT HINTS ── */
.page [contenteditable="true"]:hover {
  outline: 1.5px dashed rgba(192, 57, 43, 0.45);
  border-radius: 2px;
  cursor: text;
}
.page [contenteditable="true"]:focus {
  outline: 2px solid var(--red);
  border-radius: 2px;
  background: rgba(192, 57, 43, 0.05);
}

/* ── PÁGINA A4 ── */
.page {
  width: 210mm;
  min-height: 297mm;
  background: var(--cream);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3);
  font-family: "DM Sans", sans-serif;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ── HEADER ── */
.header {
  background: var(--dark);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0;
  padding: 0;
  position: relative;
}

.header-photo-col {
  background: var(--red);
  padding: 18px 20px 18px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
  cursor: pointer;
  transition: background 0.2s;
}
.header-photo-col:hover {
  background: var(--red-dark);
}
.header-photo-col::after {
  content: "";
  position: absolute;
  top: 0;
  right: -22px;
  width: 0;
  height: 0;
  border-left: 22px solid var(--red);
  border-top: 0 solid transparent;
  border-bottom: 130px solid transparent;
  pointer-events: none;
}
.header-photo-col:hover::after {
  border-left-color: var(--red-dark);
}

.photo-frame {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.photo-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 8.5px;
  text-align: center;
  pointer-events: none;
}
.photo-ph svg {
  width: 22px;
  height: 22px;
}
#photo-input {
  display: none;
}

.header-info {
  padding: 18px 24px 18px 40px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
}
.header-top {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.name {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 22px;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.3px;
}
.role-tag {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
  white-space: nowrap;
  position: relative;
  top: -1px;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 20px;
}
.contact-item {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.contact-item .dot {
  display: inline-block;
  width: 3.5px;
  height: 3.5px;
  background: var(--red-light);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── BODY LAYOUT ── */
.body {
  display: grid;
  grid-template-columns: var(--col-left) var(--col-right);
  min-height: calc(297mm - 130px);
}

/* ── SIDEBAR ── */
.sidebar {
  background: #222222;
  padding: 24px 18px;
  color: #fff;
}
.sidebar-section {
  margin-bottom: 24px;
  position: relative;
}
.sidebar-title {
  font-family: "Playfair Display", serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--red-light);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.skill-item {
  margin-bottom: 10px;
  position: relative;
}
.skill-name {
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 4px;
  display: block;
}
.skill-bar-bg {
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s;
}
.skill-bar-bg:hover {
  background: rgba(255, 255, 255, 0.18);
}
.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-light));
  border-radius: 2px;
}
.soft-skill {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 7px;
  position: relative;
}
.soft-skill::before {
  content: "▸";
  color: var(--red-light);
  font-size: 10px;
  margin-top: 1px;
  flex-shrink: 0;
}
.soft-skill span {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}
.edu-item {
  margin-bottom: 12px;
  position: relative;
}
.edu-degree {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.3;
  margin-bottom: 2px;
}
.edu-inst {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.3;
}

/* ── MAIN ── */
.main {
  padding: 24px 26px;
}
.section {
  margin-bottom: 22px;
  position: relative;
}
.section-title {
  font-family: "Playfair Display", serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--red) 0%, var(--rule) 100%);
}
.objetivo-text {
  font-size: 11px;
  color: var(--mid);
  line-height: 1.7;
  border-left: 3px solid var(--red);
  padding-left: 12px;
  font-style: italic;
}
.job {
  margin-bottom: 16px;
  position: relative;
  padding-left: 14px;
}
.job::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 5px;
  height: 5px;
  background: var(--red);
  border-radius: 50%;
}
.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2px;
  gap: 8px;
}
.job-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
}
.job-period {
  font-size: 9.5px;
  color: var(--red);
  font-weight: 500;
  white-space: nowrap;
  background: rgba(192, 57, 43, 0.07);
  padding: 2px 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.job-company {
  font-size: 10px;
  color: var(--light);
  margin-bottom: 6px;
}
.job-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.job-bullets li {
  font-size: 10px;
  color: var(--mid);
  line-height: 1.55;
  padding-left: 12px;
  padding-right: 18px;
  position: relative;
}
.job-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--red);
  font-size: 9px;
  top: 1px;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.tool-card {
  background: white;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--red);
  padding: 7px 10px;
  border-radius: 0 4px 4px 0;
  position: relative;
}
.tool-card-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}
.tool-card-desc {
  font-size: 9.5px;
  color: var(--light);
  line-height: 1.4;
}
.courses-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.course-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 10px;
  color: var(--mid);
  position: relative;
}
.course-item::before {
  content: "◆";
  color: var(--red);
  font-size: 6px;
  flex-shrink: 0;
  position: relative;
  top: -1px;
}
.footer-strip {
  background: var(--dark);
  padding: 7px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-strip > span {
  font-size: 8.5px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.08em;
}
.footer-dots {
  display: flex;
  gap: 4px;
}
.footer-dots span {
  width: 5px;
  height: 5px;
  background: var(--red);
  border-radius: 50%;
  opacity: 0.6;
}

/* ── CONTROLES DINÂMICOS ── */
.section-wrap {
  position: relative;
}
.section-wrap:hover .dyn-add-row,
.sidebar-section:hover .dyn-add-row {
  opacity: 1;
  pointer-events: all;
}
.dyn-block {
  position: relative;
}
.dyn-block:hover > .dyn-remove {
  opacity: 1;
  pointer-events: all;
}
.dyn-remove {
  position: absolute;
  top: 1px;
  right: 0;
  width: 15px;
  height: 15px;
  background: #d94040;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    background 0.15s;
  z-index: 10;
}
.dyn-remove:hover {
  background: #b02020;
}
.dyn-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.dyn-add-btn {
  font-family: "Source Sans 3", sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-light);
  background: transparent;
  border: 1px dashed var(--red-light);
  border-radius: 2px;
  padding: 2px 7px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.dyn-add-btn:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.job:hover .job-inline-controls {
  opacity: 1;
  pointer-events: all;
}
.job-inline-controls {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  margin-top: 5px;
  display: flex;
  gap: 5px;
}
.li-remove {
  position: absolute;
  right: 0;
  top: 3px;
  width: 13px;
  height: 13px;
  background: #d94040;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.job-bullets li:hover .li-remove {
  display: flex;
}

/* ── PRINT ── */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  html,
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    background: none;
  }
  body {
    display: block;
    padding: 0;
  }
  .page {
    width: 210mm !important;
    height: 297mm !important;
    min-height: unset !important;
    box-shadow: none !important;
    overflow: hidden !important;
    margin: 0;
  }
  .toolbar,
  .back-nav,
  .saved-toast {
    display: none !important;
  }
  .dyn-add-row,
  .dyn-remove,
  .li-remove,
  .job-inline-controls {
    display: none !important;
  }
  .photo-ph {
    display: none !important;
  }
  .page [contenteditable="true"]:hover,
  .page [contenteditable="true"]:focus {
    outline: none !important;
    background: transparent !important;
  }
  .header,
  .sidebar,
  .skill-bar-fill,
  .role-tag,
  .job-period,
  .tool-card,
  .footer-strip {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ─── Botão formulário guiado ─── */
.back-nav-form-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--tt-accent);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 3px;
  transition: background 0.2s;
}
.back-nav-form-btn:hover {
  background: #3a7de9;
}
