/* Grupo Ferreira e Santos — site novo
   Paleta: dourado #C99F4E + preto/branco */

:root {
  --gold: #C99F4E;
  --gold-dark: #A9803A;
  --black: #171512;
  --ink: #2B2925;
  --gray: #6B6863;
  --line: #E7E2D8;
  --bg: #FFFFFF;
  --bg-soft: #FAF8F4;

  --font: "Georgia", "Iowan Old Style", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: 1180px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 600; margin: 0 0 var(--space-2); color: var(--black); }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 var(--space-2); color: var(--gray); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--gold);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--gold); color: var(--black); }
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-outline { background: transparent; color: var(--black); }
.btn-outline:hover { background: var(--black); border-color: var(--black); color: #fff; }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,9,7,0.5) 0%, rgba(10,9,7,0) 100%);
  z-index: -1;
  opacity: 1;
  transition: opacity 220ms ease;
  pointer-events: none;
}
.site-header.is-solid {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(23, 21, 18, 0.03);
}
.site-header.is-solid::before { opacity: 0; }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: 0.7rem;
  max-width: none;
  padding-left: 1.25rem;
  padding-right: var(--space-3);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.brand img {
  width: auto;
  height: 34px;
  aspect-ratio: 207 / 213;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
  transition: color 220ms ease;
}
.site-header.is-solid .brand-name { color: var(--black); }
@media (max-width: 480px) {
  .brand-name { font-size: 0.82rem; }
}
@media (max-width: 360px) {
  .brand-name { display: none; }
}
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.4rem;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: background-color 220ms ease;
}
.site-header.is-solid .nav-toggle span { background: var(--black); }
.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.main-nav a {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color 220ms ease, border-color 220ms ease;
}
.ext-icon {
  display: inline-block;
  font-size: 1em;
  margin-left: 0.2em;
  transform: translateY(-0.05em);
}
.main-nav a:hover,
.main-nav a.is-active { border-color: var(--gold); color: var(--gold); }
.site-header.is-solid .main-nav a { color: var(--ink); }
.site-header.is-solid .main-nav a:hover,
.site-header.is-solid .main-nav a.is-active { color: var(--gold-dark); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .main-nav.is-open { max-height: 480px; }
  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--space-2) var(--space-3) var(--space-3);
  }
  .main-nav li { width: 100%; }
  .main-nav a { display: block; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
  /* dropdown panel is always solid white, regardless of header scroll state */
  .site-header .main-nav.is-open a { color: var(--ink); }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background-color: #14110D;
  background-image:
    linear-gradient(180deg, rgba(12,10,8,0.55) 0%, rgba(12,10,8,0.6) 45%, rgba(12,10,8,0.94) 100%),
    linear-gradient(90deg, rgba(12,10,8,0.65) 0%, rgba(12,10,8,0.1) 28%, rgba(12,10,8,0.1) 72%, rgba(12,10,8,0.65) 100%),
    url("../assets/img/hero-skyline.jpg");
  background-repeat: no-repeat;
  background-position: center, center, center 60%;
  background-size: cover, cover, cover;
  background-attachment: fixed, fixed, fixed;
  color: #fff;
  padding-block: var(--space-5);
}
@media (max-width: 760px) {
  /* background-attachment:fixed repaints per scroll frame on iOS Safari — swap to scroll to avoid jank */
  .hero { background-attachment: scroll, scroll, scroll; }
}
@media (prefers-reduced-motion: reduce) {
  .hero { background-attachment: scroll, scroll, scroll; }
}
.hero .container {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  max-width: 760px;
  text-align: center;
}
.hero-logo {
  width: clamp(84px, 11vw, 140px);
  height: auto;
  aspect-ratio: 207 / 213;
  object-fit: contain;
  margin-bottom: var(--space-1);
}
.hero h1 { color: #fff; }
.hero p { color: #D8D5CD; font-size: 1.05rem; max-width: 56ch; }
.hero-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; margin-top: var(--space-1); }

.page-hero {
  position: relative;
  overflow: hidden;
  background-color: #14110D;
  background-image:
    linear-gradient(180deg, rgba(12,10,8,0.6) 0%, rgba(12,10,8,0.62) 45%, rgba(12,10,8,0.94) 100%),
    linear-gradient(90deg, rgba(12,10,8,0.65) 0%, rgba(12,10,8,0.12) 28%, rgba(12,10,8,0.12) 72%, rgba(12,10,8,0.65) 100%),
    var(--hero-photo);
  background-repeat: no-repeat;
  background-position: center, center, center;
  background-size: cover, cover, cover;
  background-attachment: fixed, fixed, fixed;
  color: #fff;
  padding-block: var(--space-4);
}
@media (max-width: 760px) {
  .page-hero { background-attachment: scroll, scroll, scroll; }
}
@media (prefers-reduced-motion: reduce) {
  .page-hero { background-attachment: scroll, scroll, scroll; }
}
.page-hero .container { position: relative; }
.page-hero h1 { color: #fff; margin-bottom: 0.3rem; }
.page-hero p { color: #D8D5CD; margin: 0; }

/* Sections */
section { padding-block: var(--space-5); }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 640px; margin-bottom: var(--space-4); }

/* Cards - empresas */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.company-card {
  border: 1px solid var(--line);
  padding: var(--space-3);
  background: #fff;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}
.company-card:hover,
.company-card:focus-within {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -18px rgba(23, 21, 18, 0.35);
}
.company-card .card-index {
  display: block;
  font-family: var(--font);
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--gold);
  margin-bottom: var(--space-2);
  transition: transform 220ms ease, color 220ms ease;
}
.company-card .card-index::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin-top: 0.6rem;
  background: var(--line);
  transition: width 220ms ease, background 220ms ease;
}
.company-card:hover .card-index,
.company-card:focus-within .card-index {
  color: var(--gold-dark);
  transform: translateX(2px);
}
.company-card:hover .card-index::after,
.company-card:focus-within .card-index::after {
  width: 52px;
  background: var(--gold);
}
.company-card .eyebrow { margin-bottom: var(--space-2); }
.company-card a.card-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-dark);
  outline-offset: 3px;
}
.company-card a.card-link:focus-visible { outline: 2px solid var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .company-card,
  .company-card .card-index,
  .company-card .card-index::after { transition: none; }
  .company-card:hover,
  .company-card:focus-within { transform: none; }
}

/* Anchor sections inside inner pages */
.anchor-section:target { scroll-margin-top: 90px; }
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.stat-row div { border-left: 3px solid var(--gold); padding-left: var(--space-2); }
.stat-row strong { display: block; font-size: 1.7rem; font-family: var(--font); color: var(--black); }
.stat-row span { font-size: 0.8rem; color: var(--gray); }

.pill-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill-list li {
  border: 1px solid var(--line);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: var(--ink);
}

.partners-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}
.partner-placeholder {
  width: 140px;
  height: 60px;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--gray);
  text-align: center;
}

.notice {
  border-left: 3px solid var(--gold);
  background: var(--bg-soft);
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: var(--space-3);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--space-4);
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-details li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.contact-details li strong { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold-dark); margin-bottom: 0.2rem; }

.form-grid { display: grid; gap: var(--space-2); }
.form-grid label { font-size: 0.8rem; font-weight: 600; color: var(--ink); display: block; margin-bottom: 0.3rem; }
.form-grid input, .form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0.65rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
}
.form-grid input:focus, .form-grid textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.form-grid button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }
.contact-form-msg { font-size: 0.85rem; margin: 0; min-height: 1em; }
.contact-form-msg.is-success { color: #2f6b3a; }
.contact-form-msg.is-error { color: #b23333; }

/* Processos societários (Contabilidade) */
.const-form-intro { max-width: 640px; margin-bottom: var(--space-4); }

.proc-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-4);
}
.proc-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 0.2rem;
  margin-right: var(--space-4);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gray);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
}
.proc-tab:hover { color: var(--ink); }
.proc-tab.is-active { color: var(--gold-dark); border-color: var(--gold); }

.proc-panel { padding-top: var(--space-1); }

.const-fieldset {
  border: 1px solid var(--line);
  padding: var(--space-3);
  margin: 0 0 var(--space-3);
}
.const-fieldset legend {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--black);
  padding: 0 0.5rem;
}

.const-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
@media (max-width: 640px) { .const-grid { grid-template-columns: 1fr; } }
.const-field.span-2 { grid-column: 1 / -1; }

.const-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.const-field .req { color: var(--gold-dark); }
.const-field .opt { color: var(--gray); font-weight: 400; text-transform: none; }

.const-field input,
.const-field select,
.const-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0.65rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
}
.const-field textarea { resize: vertical; }
.const-field input:focus,
.const-field select:focus,
.const-field textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.const-field-error {
  font-size: 0.78rem;
  color: #b23333;
  margin: 0.3rem 0 0;
  min-height: 1em;
}
.const-field-hint { font-size: 0.78rem; color: var(--gray); margin: 0.3rem 0 0; }

.const-add-btn {
  display: inline-block;
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--space-2);
  transition: background 150ms ease, color 150ms ease;
}
.const-add-btn:hover { background: var(--gold); color: var(--black); }

.socio-card {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.socio-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.socio-card-head strong { font-family: var(--font); font-size: 0.95rem; color: var(--black); }
.socio-remove {
  background: none;
  border: 1px solid var(--line);
  color: var(--gray);
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}
.socio-remove:hover { border-color: #b23333; color: #b23333; }

.const-submit-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}
.const-submit-row button[type="submit"] {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.4rem;
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--black);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.const-submit-row button[type="submit"]:hover:not(:disabled) { background: var(--gold-dark); border-color: var(--gold-dark); }
.const-submit-row button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
.const-submit-note { font-size: 0.78rem; color: var(--gray); }

.const-form-status { font-size: 0.85rem; color: #b23333; margin-top: var(--space-2); }

.const-success {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: var(--space-4);
  text-align: center;
  max-width: 480px;
  margin-inline: auto;
}
.const-success h3 { margin-bottom: 0.4rem; }
.const-success p { margin: 0; }

/* Footer */
.site-footer { background: var(--black); color: #C9C6BF; padding-block: var(--space-4) var(--space-3); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid #35322C;
}
.footer-grid h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-2); }
.footer-grid p, .footer-grid li { font-size: 0.88rem; color: #B4B0A7; }
.footer-grid a:hover { color: var(--gold); }
.footer-grid li { margin-bottom: 0.45rem; }
.social-row { display: flex; gap: 0.7rem; margin-top: var(--space-2); }
.social-row a {
  width: 34px; height: 34px;
  border: 1px solid #45423B;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  border-radius: 50%;
}
.social-row a:hover { border-color: var(--gold); color: var(--gold); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: var(--space-2);
  font-size: 0.78rem;
  color: #7D7A72;
}

/* Scroll reveal */
.reveal,
.reveal-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 560ms cubic-bezier(0.16, 1, 0.3, 1), transform 560ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--stagger-index, 0) * 90ms);
  will-change: opacity, transform;
}
.reveal.is-visible,
.reveal-group.is-visible .reveal-item {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-item {
    transition: none;
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}

.section-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-bottom: var(--space-3);
}

/* Blog cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}
.blog-card:hover,
.blog-card:focus-within {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -18px rgba(23, 21, 18, 0.35);
}
.blog-card-img {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(180deg, rgba(23,21,18,0.15), rgba(23,21,18,0.55)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='2' fill='%23C99F4E' opacity='0.5'/%3E%3C/svg%3E"),
    #1A1A1A;
  background-repeat: no-repeat, repeat, no-repeat;
  background-size: cover, 40px 40px, cover;
  flex-shrink: 0;
}
.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: var(--space-3);
  flex: 1;
}
.blog-card-body h3 { font-size: 1.05rem; margin-bottom: 0; }
.blog-card-body p { flex: 1; }
.blog-card-date {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.blog-card-body a.card-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-dark);
}
.blog-card.no-image .blog-card-img { display: none; }
