/* ==========================================================================
   Wilson Souza Advogados — design system
   Palette + type derived from the live site screenshots.
   ========================================================================== */
:root {
    --navy: #16384a;          /* header / footer / headings */
    --navy-deep: #0f2e3d;
    --navy-tile: #1c3f63;     /* service icon tiles */
    --accent: #e08a2c;        /* primary orange — buttons */
    --accent-hover: #c9781f;
    --gold: #c68a3a;          /* dividers, links, small labels */
    --brown: #80501e;         /* brand brown — matches logo-dark, used for brown text */
    --cream: #f8f0e3;         /* section backgrounds */
    --cream-soft: #fbf6ec;
    --surface: #ffffff;       /* cards */
    --ink: #4a4a4a;           /* body text */
    --ink-soft: #6e6e6e;
    --heading: #16384a;
    --line: #ece4d6;

    --font-head: 'Poppins', Helvetica, Arial, sans-serif;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --container: 1140px;
    --radius: 6px;
    --shadow: 0 6px 24px rgba(22, 56, 74, .08);
}

html { font-size: 16px; position: relative; min-height: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.65;
}

h1, h2, h3, h4, h5, .serif { font-family: var(--font-head); color: var(--heading); }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.container-x { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }

/* ---- small gold underline used under section / card headings ---- */
.rule-gold { width: 56px; height: 3px; background: var(--gold); border: 0; margin: .75rem 0 1.25rem; opacity: 1; }
.rule-gold.center { margin-left: auto; margin-right: auto; }

/* ---- buttons ---- */
.btn-orange {
    display: inline-block; background: var(--accent); color: #fff;
    border: 0; border-radius: 4px; padding: .55rem 1.4rem; font-weight: 600;
    font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
    transition: background .15s ease;
}
.btn-orange:hover { background: var(--accent-hover); color: #fff; }

.link-more { color: var(--gold); font-weight: 600; text-transform: uppercase; font-size: .78rem; letter-spacing: .03em; }
.link-more:hover { color: var(--accent-hover); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { background: var(--navy); }
.site-header .container-x { display: flex; align-items: center; justify-content: space-between; min-height: 84px; }

.brand { display: inline-flex; align-items: center; }
.brand .logo-mark { width: 46px; height: 46px; }

.header-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-flags { display: flex; align-items: center; gap: .5rem; margin-left: 2.5rem; }
.nav-flags a { line-height: 0; display: block; }
.nav-flags img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.3); transition: transform .1s ease; }
.nav-flags a:hover img { transform: scale(1.12); }

.main-nav { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.main-nav a {
    color: #eef3f5; font-size: .95rem; padding: .35rem 0; position: relative; font-weight: 500;
}
.main-nav a:hover { color: #fff; }
.main-nav a.active { color: #fff; }
.main-nav a.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--accent);
}

.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .main-nav {
        display: none; position: absolute; top: 84px; left: 0; right: 0; z-index: 50;
        flex-direction: column; gap: 0; background: var(--navy-deep); padding: .5rem 1.25rem 1rem;
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: .65rem 0; width: 100%; border-bottom: 1px solid rgba(255,255,255,.08); }
    .main-nav a.active::after { display: none; }
    .site-header .container-x { position: relative; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 4rem 0; }
.section--cream { background: var(--cream); }
.section--soft { background: var(--cream-soft); }
.section--white { background: #fff; }

.section-title { text-align: center; font-size: 1.7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); margin: 0; }
.section-subtitle { text-align: center; color: var(--navy); font-size: 1.5rem; margin: 0; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    position: relative; min-height: 307px; display: flex; align-items: center;
    background: linear-gradient(rgba(248,240,227,.28), rgba(248,240,227,.28)), url('/images/hero.jpg');
    background-size: cover; background-position: center -360px;   /* framing: slightly lower than -403 */
    background-attachment: fixed;   /* parallax: the page scrolls over the fixed photo */
    overflow: hidden;
}
.hero.has-image { background-blend-mode: multiply; }
.hero-inner { display: flex; align-items: center; gap: 2rem; justify-content: center; width: 100%; transform: translateY(-55px); }
.hero .logo-mark { width: 138px; height: 138px; flex: none; transform-origin: center; animation: logo-pop 1.1s ease-out both; }
.hero-word { font-family: var(--font-head); font-weight: 700; color: var(--brown); font-size: clamp(2.6rem, 7vw, 5rem); line-height: .98; animation: hero-fade 1s ease-out .25s both; }

/* hero mark entrance: 0 → 110% → 100%, like the original */
@keyframes logo-pop {
    0%   { transform: scale(0);   opacity: 0; }
    70%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1);   opacity: 1; }
}
@keyframes hero-fade {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
    .hero { min-height: 213px; background-attachment: scroll; background-position: center bottom; }  /* fixed bg is janky on mobile; anchor to bottom */
    .hero .logo-mark { width: 83px; height: 83px; }
    .hero-inner { transform: translateY(-35px); }
}
@media (prefers-reduced-motion: reduce) {
    .hero .logo-mark, .hero-word { animation: none; }
}

/* ==========================================================================
   Home — services cards
   ========================================================================== */
.cards-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-top: 2.5rem; }

.svc-card {
    flex: 0 0 calc((100% - 4.5rem) / 4);   /* 4 per row; the 5th wraps and centers */
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.75rem 1.5rem; text-align: center; display: flex; flex-direction: column;
}
@media (max-width: 1100px) { .svc-card { flex-basis: calc((100% - 3rem) / 3); } }
@media (max-width: 768px)  { .svc-card { flex-basis: calc((100% - 1.5rem) / 2); } }
@media (max-width: 480px)  { .svc-card { flex-basis: 100%; } }

/* international "Áreas de actuación" — max 3 per line (→ 3 + 2 for 5 items) */
.cards-grid-3 .svc-card { flex: 0 0 calc((100% - 3rem) / 3); }
@media (max-width: 820px) { .cards-grid-3 .svc-card { flex-basis: calc((100% - 1.5rem) / 2); } }
@media (max-width: 520px) { .cards-grid-3 .svc-card { flex-basis: 100%; } }
.svc-card h3 { font-size: 1.15rem; text-transform: uppercase; color: var(--navy); margin: 0 0 .25rem; line-height: 1.25; }
.svc-card .rule-gold { margin: .6rem auto 1rem; }
.svc-card p { color: var(--ink); font-size: .95rem; flex: 1; }
.svc-card .link-more { margin-top: 1rem; }

/* ==========================================================================
   Home — topics (articles)
   ========================================================================== */
.topic-card {
    background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
    display: flex; flex-direction: column;
}
.topic-card .thumb {
    height: 220px; background: linear-gradient(135deg, #c98a4e, #8a5a2e); background-size: cover; background-position: center;
}
.topic-card .body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.topic-card h3 { font-size: 1.05rem; color: var(--navy); margin: 0 0 .25rem; }
.topic-card .meta { color: var(--ink-soft); font-size: .8rem; margin-bottom: .5rem; }
.topic-card p { color: var(--ink); font-size: .9rem; flex: 1; }
.topic-card .btn-orange { align-self: center; margin-top: 1rem; }

.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, 1fr); margin-top: 2.5rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

/* Topics carousel — shows 3, advances 1, autoplay */
.carousel3 { position: relative; margin-top: 2.5rem; }
.carousel3-viewport { overflow: hidden; }
.carousel3-track { display: flex; gap: 1.5rem; transition: transform .5s ease; align-items: stretch; }
.carousel3-slide { flex: 0 0 calc((100% - 3rem) / 3); }
.carousel3-slide > .topic-card { height: 100%; }
.carousel3-btn {
    position: absolute; top: 42%; transform: translateY(-50%); z-index: 3;
    width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--navy); color: #fff;
    font-size: 1.5rem; line-height: 1; cursor: pointer; opacity: .85; transition: opacity .15s;
}
.carousel3-btn:hover { opacity: 1; }
.carousel3-prev { left: -50px; }
.carousel3-next { right: -50px; }
/* when the container nears the viewport width there's no room outside — pull them back in */
@media (max-width: 1240px) {
    .carousel3-prev { left: -14px; }
    .carousel3-next { right: -14px; }
}
.carousel3-dots { display: flex; justify-content: center; gap: .5rem; margin-top: 1.5rem; }
.carousel3-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: #d3c2a4; cursor: pointer; padding: 0; }
.carousel3-dots button.active { background: var(--accent); }
@media (max-width: 900px) { .carousel3-slide { flex-basis: calc((100% - 1.5rem) / 2); } }
@media (max-width: 600px) { .carousel3-slide { flex-basis: 100%; } }

/* ==========================================================================
   Mission / two-column
   ========================================================================== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: stretch; margin-top: 2.5rem; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }
.mission-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.mission-card p { text-align: center; }
.mission-img { border-radius: var(--radius); min-height: 320px; height: 98%; align-self: center; background: linear-gradient(135deg,#e7cba6,#cf9a63); background-size: cover; background-position: center; }

/* ==========================================================================
   Generic content card + article body
   ========================================================================== */
.panel-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.kicker { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: .9rem; }
.content { color: var(--ink); }
.content h2, .content h3, .content h4, .content h5, .content h6 { color: var(--navy); font-family: 'Lora', serif; margin-top: 1.4rem; margin-bottom: .6rem; line-height: 1.25; }
.content h4 { font-size: 1.3rem; }
.content h5 { font-size: 1.12rem; }
.content h6 { font-size: 1rem; letter-spacing: .01em; }
.content p { margin: 0 0 1rem; }
.content a { color: var(--gold); }
.content strong { color: var(--navy); }
.content ul, .content ol { margin: 0 0 1rem; padding-left: 1.35rem; }
.content li { margin: 0 0 .45rem; }
.content hr { border: 0; border-top: 1px solid var(--gold); opacity: .45; margin: 1.6rem 0; }
.content img { max-width: 100%; height: auto; border-radius: 6px; }

.page-wrap { padding: 3.5rem 0; }
.breadcrumbx { font-size: .85rem; color: var(--ink-soft); margin-bottom: 1rem; }
.breadcrumbx a { color: var(--gold); }

/* ==========================================================================
   Services list page
   ========================================================================== */
.svc-row {
    display: flex; gap: 1.5rem; align-items: flex-start; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.75rem; margin-bottom: 1.5rem;
}
.svc-row .icon-tile {
    flex: none; width: 84px; height: 84px; border-radius: 6px; background: var(--navy-tile);
    color: #fff; display: flex; align-items: center; justify-content: center;
}
.svc-row .icon-tile svg { width: 40px; height: 40px; }
.svc-row .icon-tile-img { flex: none; width: 84px; height: 84px; border-radius: 6px; object-fit: cover; }
.svc-row h3 { font-size: 1.15rem; text-transform: uppercase; color: var(--navy); margin: 0; }
.svc-row p { color: var(--ink); font-size: .92rem; margin: .25rem 0 0; }
@media (max-width: 560px) { .svc-row { flex-direction: column; } }

/* ==========================================================================
   About page
   ========================================================================== */
/* left column = 1/3, bio = 2/3; left column vertically centered; navy box ~half the row height */
.about-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 2.5rem; align-items: stretch; margin-top: 2.5rem; }
.about-left { position: relative; display: flex; flex-direction: column; justify-content: center; }
.about-photo {
    display: block; width: 215px; max-width: 80%; margin: -70px 0 0 auto;
    border-radius: 3px; box-shadow: 0 14px 34px rgba(22, 56, 74, .22); position: relative; z-index: 2;
}
@media (min-width: 821px) { .about-photo { transform: translateX(18px); } }

.about-quote {
    background: var(--navy); color: #fff; border-radius: var(--radius); padding: 2rem;
    font-family: var(--font-head); font-size: 1.5rem; line-height: 1.35; position: relative;
    height: 50%; display: flex; flex-direction: column; justify-content: center;
}

@media (max-width: 820px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-left { display: block; }
    .about-quote { height: auto; }
}
.about-quote .accent { color: var(--accent); }
.about-quote .small { display: block; font-size: 1rem; color: #fff; margin-top: 1rem; font-family: var(--font-sans); }

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 360px 1fr; gap: 0; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-photo {
    background: linear-gradient(rgba(22,56,74,.45), rgba(22,56,74,.65)), linear-gradient(135deg,#5a5a5a,#2a2a2a);
    background-size: cover; background-position: center; min-height: 420px; display: flex; align-items: center; justify-content: center;
}
.contact-photo span { color: var(--accent); font-family: var(--font-head); font-size: 2rem; font-weight: 700; }
.contact-card { background: #fff; padding: 2.25rem; }
.info-line { display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem; color: var(--ink); }
.info-line svg { width: 18px; height: 18px; color: var(--accent); flex: none; }

/* ==========================================================================
   Blog page
   ========================================================================== */
.blog-grid { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; }
@media (max-width: 820px) { .blog-grid { grid-template-columns: 1fr; } }
.blog-side { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; align-self: start; }
.blog-side h4 { font-size: 1.1rem; color: var(--navy); }
.blog-side ul { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.blog-side li { margin-bottom: .5rem; }
.blog-side a { color: var(--gold); font-size: .92rem; }

/* ==========================================================================
   Footer — "Vamos conversar?" contact CTA
   ========================================================================== */
.site-footer { background: var(--navy); color: #d9e2e6; padding: 3.25rem 0; }
.site-footer .label { color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: .85rem; }
.site-footer h2 { color: #fff; font-size: 2rem; margin: .5rem 0 1rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-contact { display: flex; flex-direction: column; gap: .85rem; }
.footer-contact .row-i { display: flex; align-items: center; gap: .65rem; color: #e7eef1; }
.footer-contact .row-i svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.footer-contact a { color: #e7eef1; }
.footer-contact a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2.5rem; padding-top: 1.25rem; font-size: .82rem; color: #9fb1b8; }

/* language switcher (international pages) */
.lang-switch { display: flex; gap: .85rem; justify-content: flex-end; align-items: center; margin-bottom: 1.5rem; font-size: .9rem; }
.lang-switch a { color: var(--gold); font-weight: 600; }
.lang-switch a.active { color: var(--navy); text-decoration: underline; }

/* Modelos / documents page */
.doc-search { display: flex; gap: .5rem; max-width: 480px; margin-bottom: 1.25rem; }
.doc-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.doc-chips a { font-size: .82rem; padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.doc-chips a:hover { border-color: var(--gold); color: var(--gold); }
.doc-chips a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.doc-cat { margin-top: 2.25rem; }
.doc-cat h2 { font-size: 1.15rem; color: var(--navy); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.doc-item { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: .75rem; }
.doc-item .doc-info { flex: 1; min-width: 0; }
.doc-item h3 { font-size: 1rem; margin: 0; color: var(--navy); }
.doc-item p { margin: .15rem 0 0; font-size: .9rem; color: var(--ink-soft); }
.doc-item .btn-orange { flex: none; }
@media (max-width: 560px) { .doc-item { flex-wrap: wrap; } .doc-item .btn-orange { width: 100%; text-align: center; } }
.doc-subcat { font-size: .95rem; color: var(--gold); text-transform: uppercase; letter-spacing: .05em; margin: 1.5rem 0 .6rem; }

/* Brazil states map (states are <polygon>/<path>, some grouped in <g>) */
.br-map { max-width: 480px; margin: 1.5rem auto 0; }
.br-map-svg { width: 100%; height: auto; display: block; }
.br-map-svg polygon, .br-map-svg path { fill: #dccbb0; stroke: #fff; stroke-width: .6; transition: fill .15s ease; cursor: pointer; }
.br-map-svg .hover, .br-map-svg .hover polygon, .br-map-svg .hover path { fill: var(--gold); }
.br-map-svg .active, .br-map-svg .active polygon, .br-map-svg .active path { fill: var(--navy); }
.br-uf-label {
    font-family: var(--font-sans); font-size: 7px; font-weight: 700;
    fill: var(--navy); text-anchor: middle; dominant-baseline: middle; pointer-events: none;
}
.br-uf-label.active { fill: #fff; }

/* Floating WhatsApp first-contact button */
.wa-fab {
    position: fixed; right: 22px; bottom: 54px; z-index: 1030;
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; padding: 0; overflow: hidden; white-space: nowrap;
    background: #25d366; color: #fff; text-decoration: none; border-radius: 50px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    transition: width .25s ease, padding .25s ease, background .15s ease, box-shadow .15s ease;
}
.wa-fab svg { width: 30px; height: 30px; flex: none; }
.wa-fab-label { font-family: var(--font-sans); font-weight: 600; font-size: .95rem; max-width: 0; opacity: 0; transition: max-width .25s ease, opacity .2s ease; }
.wa-fab:hover, .wa-fab:focus-visible { width: auto; padding: 0 20px 0 14px; background: #1ebe5d; color: #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .32); }
.wa-fab:hover .wa-fab-label, .wa-fab:focus-visible .wa-fab-label { max-width: 200px; opacity: 1; margin-left: .15rem; }
@media (max-width: 560px) { .wa-fab { right: 16px; bottom: 50px; } }

/* Judicial-news scrolling ticker (fixed to the bottom of the viewport, seamless marquee, pause on hover) */
body.has-ticker { padding-bottom: 40px; }
.news-ticker { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020; display: flex; align-items: center; height: 38px; overflow: hidden; background: var(--navy); color: #e8eef1; font-family: var(--font-sans); font-size: .85rem; border-top: 2px solid var(--gold); box-shadow: 0 -2px 10px rgba(0, 0, 0, .22); }
.news-ticker-tag { flex: none; display: inline-flex; align-items: center; gap: .4rem; height: 100%; padding: 0 .9rem; font-weight: 600; color: var(--gold); white-space: nowrap; background: var(--navy); box-shadow: 6px 0 8px -4px rgba(0, 0, 0, .5); z-index: 2; }
.news-ticker-tag svg { width: 16px; height: 16px; flex: none; }
.news-ticker-viewport { position: relative; flex: 1 1 auto; height: 100%; overflow: hidden; }
.news-ticker-track { display: inline-flex; align-items: center; height: 100%; white-space: nowrap; will-change: transform; animation: news-scroll 70s linear infinite; }
.news-ticker:hover .news-ticker-track { animation-play-state: paused; }
.news-tick { display: inline-flex; align-items: center; gap: .5rem; padding: 0 1rem; color: #e8eef1; text-decoration: none; }
.news-tick:hover .nt-text { text-decoration: underline; }
.news-tick .nt-src { flex: none; font-size: .68rem; font-weight: 700; color: var(--navy); background: var(--gold); border-radius: 3px; padding: .05rem .4rem; }
.nt-sep { color: var(--gold); opacity: .6; }
.news-ticker-close { flex: none; background: none; border: none; color: #9fb1b8; font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 .6rem; }
.news-ticker-close:hover { color: #fff; }
@keyframes news-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .news-ticker-track { animation: none; } .news-ticker-viewport { overflow-x: auto; } }
@media (max-width: 560px) { .news-ticker { font-size: .78rem; } .news-ticker-tag .nt-tag-text { display: none; } }

/* scroll-reveal (fires once when the element enters the viewport) */
.reveal { opacity: 0; transition: opacity .6s ease, transform .6s ease; }
.reveal-left { transform: translateX(-32px); }
.reveal-scale { transform: scale(.8); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}

/* utility */
.text-center { text-align: center; }
.mt-section { margin-top: 2.5rem; }
