:root {
  --bg: #FFFFFF;
  --ink: #000000;
  --text: #1A1A1A;
  --muted: #5E5E5E;
  --line: #D9D9D9;
  --soft: #F3F3F3;
  --red: #C41212;
  --band: #000000;
  --band-text: #FFFFFF;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --ink: #FFFFFF;
    --text: #E6E6E6;
    --muted: #A3A3A3;
    --line: #333333;
    --soft: #141414;
    --red: #E03A3A;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
a:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }
.serif { font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; }

/* Topo */
header.top { position: relative; z-index: 2; background: #fff; border-bottom: 1px solid #E2E2E2; }
header.top .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 5.5rem; gap: 1.5rem; }
.logo { display: block; line-height: 0; }
.logo img { width: clamp(11rem, 30vw, 15rem); height: auto; }
nav { display: flex; gap: 1.75rem; font-size: 0.95rem; }
nav a { text-decoration: none; color: #000; font-weight: 500; }
nav a:hover { color: #C41212; }

/* Entrada */
.hero { background: #000; color: #fff; position: relative; overflow: hidden; }
.hero > .wrap { padding-top: 4.5rem; padding-bottom: 9rem; position: relative; z-index: 1; }
.hero h1 {
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(2.3rem, 6.5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  max-width: 15ch;
}
.hero .rule { width: 4.5rem; height: 4px; background: var(--red); margin: 0 0 1.5rem; border: 0; }
.hero .role { font-size: 1.2rem; margin: 0 0 0.35rem; font-weight: 500; }
.hero .intro { opacity: 0.75; max-width: 34rem; margin: 0 0 2.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-block;
  padding: 0.8rem 1.35rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid currentColor;
}
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: transparent; color: inherit; border-color: currentColor; }
.btn.secondary:hover { background: #fff; color: #000; }
.bridge { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; color: #fff; opacity: 0.18; pointer-events: none; }

/* Secções */
section { padding: 4.5rem 0; }
section + section { border-top: 1px solid var(--line); }
h2 {
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
}
.lead { color: var(--muted); max-width: 38rem; margin: 0 0 2.5rem; }

/* Áreas de atuação */
.areas { border-top: 2px solid var(--ink); }
.areas details { border-bottom: 1px solid var(--line); }
.areas summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1.5rem;
  align-items: center;
  padding: 1.3rem 0;
}
.areas summary::-webkit-details-marker { display: none; }
.areas summary h3 { margin: 0; font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.areas summary p { margin: 0; color: var(--muted); font-size: 0.975rem; grid-column: 1; }
.areas summary .toggle {
  grid-column: 2; grid-row: 1 / span 2;
  width: 2.25rem; height: 2.25rem; position: relative;
  border: 1.5px solid var(--ink); border-radius: 50%;
}
.areas summary .toggle::before, .areas summary .toggle::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 0.85rem; height: 2px; background: var(--ink);
  transform: translate(-50%, -50%);
}
.areas summary .toggle::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform 0.2s ease; }
.areas summary:hover h3 { color: var(--red); }
.areas details[open] summary .toggle { background: var(--red); border-color: var(--red); }
.areas details[open] summary .toggle::before, .areas details[open] summary .toggle::after { background: #fff; }
.areas details[open] summary .toggle::after { transform: translate(-50%, -50%) rotate(0deg); }
@media (prefers-reduced-motion: reduce) { .areas summary .toggle::after { transition: none; } }
.area-body {
  display: grid; grid-template-columns: 1fr; gap: 1rem 3rem;
  padding: 0 0 2rem;
}
@media (min-width: 52rem) { .area-body { grid-template-columns: 1.1fr 1fr; } }
.area-body p { margin: 0 0 0.9rem; max-width: 36rem; }
.area-body h4 { margin: 0 0 0.6rem; font-size: 0.95rem; font-weight: 600; color: var(--red); }
.area-body ul { margin: 0; padding: 0; list-style: none; }
.area-body li { padding: 0.45rem 0 0.45rem 1.1rem; border-top: 1px solid var(--line); position: relative; font-size: 0.975rem; }
.area-body li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 0.4rem; height: 2px; background: var(--red); }

/* Equipa */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 2.5rem 2rem; }
.member figure { margin: 0; }
.photo {
  aspect-ratio: 4 / 5; background: var(--soft); position: relative; overflow: hidden;
  display: grid; place-items: center;
  border-bottom: 4px solid var(--red);
}
.photo .initials { font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-weight: 700; font-size: 3rem; color: var(--muted); }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.member h3 { margin: 1rem 0 0.15rem; font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.member .role { margin: 0; color: var(--red); font-weight: 500; font-size: 0.95rem; }
.member .note { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.925rem; }

/* Sobre */
.about p { margin: 0 0 1rem; max-width: 40rem; }

/* Contactos */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 1.75rem; margin-top: 2rem; }
@media (min-width: 40rem) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-grid h3 { font-size: 0.95rem; font-weight: 600; color: var(--muted); margin: 0 0 0.4rem; }
.contact-grid p { margin: 0; }
.contact-grid a.big { font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-size: 1.35rem; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.contact-grid a.big:hover { color: var(--red); }
.contact-grid address { font-style: normal; }
.maplink { display: inline-block; margin-top: 0.6rem; color: var(--red); font-weight: 500; }

footer { background: #000; color: #fff; border-top: 1px solid var(--line); font-size: 0.875rem; padding: 2rem 0; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; opacity: 0.8; }
footer p { margin: 0; }

@media (max-width: 34rem) {
  nav { display: none; }
  .hero > .wrap { padding-top: 2.75rem; padding-bottom: 6.5rem; }
  .btn { flex: 1 1 100%; text-align: center; }
}

/* Blog: lista de artigos */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0 2.5rem; border-top: 2px solid var(--ink); }
.post-card { border-bottom: 1px solid var(--line); padding: 1.5rem 0; }
.post-card a { text-decoration: none; display: block; }
.post-card .meta { margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--muted); }
.post-card h3 { margin: 0 0 0.5rem; font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-weight: 700; font-size: 1.2rem; line-height: 1.3; color: var(--ink); }
.post-card p { margin: 0; color: var(--muted); font-size: 0.975rem; }
.post-card a:hover h3 { color: var(--red); }
.more { display: inline-block; margin-top: 2rem; color: var(--red); font-weight: 600; }

/* Blog: página de artigo */
.page-head { background: #000; color: #fff; }
.page-head .wrap { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.page-head .back { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.95rem; }
.page-head .back:hover { color: #fff; }
.page-head h1 { font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-weight: 700; font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -0.015em; margin: 1.25rem 0 1rem; max-width: 22ch; }
.page-head .meta { margin: 0; opacity: 0.7; font-size: 0.95rem; }
.page-head .rule { width: 4.5rem; height: 4px; background: var(--red); margin: 1.5rem 0 0; border: 0; }
article.post { padding: 3.5rem 0 4.5rem; }
article.post .body { max-width: 42rem; }
article.post .body p { margin: 0 0 1.2rem; line-height: 1.75; }
article.post .body h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin: 2.5rem 0 1rem; }
article.post .body a { color: var(--red); }
.cta-box { margin-top: 3rem; padding: 1.75rem; border-left: 4px solid var(--red); background: var(--soft); max-width: 42rem; }
.cta-box p { margin: 0 0 1rem; }
.cta-box .btn.primary { color: #fff; }
article.post .body h3 { font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--ink); margin: 2rem 0 0.75rem; }

/* Redes sociais */
.social { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.social a { display: inline-block; padding: 0.55rem 1.1rem; border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.social a:hover { background: var(--red); border-color: var(--red); color: #fff; }
footer .social-links { display: flex; gap: 1.25rem; }
footer .social-links a { color: #fff; text-decoration: none; font-weight: 600; }
footer .social-links a:hover { color: #E03A3A; }

.social a { display: inline-flex; align-items: center; gap: 0.6rem; }
.social img { width: 1.5rem; height: 1.5rem; border-radius: 4px; }
footer .social-links { align-items: center; }
footer .social-links img { width: 1.9rem; height: 1.9rem; border-radius: 5px; display: block; }
footer .social-links a:hover img { opacity: 0.8; }

/* Título principal: ADVOGADO + localização */
.hero h1 { max-width: none; }
.hero h1 .h1-main { display: block; text-transform: uppercase; letter-spacing: 0.02em; font-size: clamp(2.8rem, 9vw, 6rem); line-height: 1; }
.hero h1 .h1-sub { display: block; font-weight: 600; font-size: clamp(1.25rem, 3vw, 1.9rem); letter-spacing: 0; margin-top: 0.6rem; color: rgba(255,255,255,0.85); }
