/* =====================================================
   Mundo das Bandeiras — Global Navigation
   /assets/css/nav.css
   ===================================================== */

/* --- Page hero banner -------------------------------- */
.photo-frame {
  width: 100%;
  height: clamp(280px, 52vh, 560px);
  overflow: hidden;
  background: var(--bg-tint);
  border-bottom: 1px solid var(--rule);
}
.photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}
@media (max-width: 600px) {
  .photo-frame { height: clamp(200px, 38vh, 300px); }
  .photo-frame img { object-position: center 10%; }
}

/* --- Tokens (mirror each page's :root) -------------- */
:root {
  --sh-h: 60px;
}

/* =====================================================
   SITE HEADER
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.sh-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  height: var(--sh-h);
  display: flex;
  align-items: center;
}

.sh-logo {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.sh-logo img {
  width: 216px;
  height: auto;
  display: block;
}

/* =====================================================
   SITE NAV — desktop
   ===================================================== */
.site-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.sn-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.sn-link,
.sn-toggle {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: color 0.12s;
  line-height: 1;
}

.sn-link:hover,
.sn-link:focus-visible,
.sn-toggle:hover,
.sn-toggle:focus-visible,
.sn-has-drop.is-open > .sn-toggle {
  color: var(--ink);
  outline: none;
}

/* Active section indicator on dropdown toggle buttons (e.g. Guias) */
.sn-toggle.is-current-section {
  color: var(--ink);
}

/* Active section indicator on dropdown links (e.g. Bandeiras municipais for regional subpages) */
.sn-drop a.is-current-section {
  color: var(--ink);
  font-weight: 500;
}

/* Active exact-match link inside dropdowns */
.sn-drop a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

/* Active exact-match direct nav link */
.sn-link[aria-current="page"] {
  color: var(--ink);
}

.sn-arrow {
  font-size: 8px;
  display: inline-block;
  transition: transform 0.18s;
  line-height: 1;
}

.sn-toggle[aria-expanded="true"] .sn-arrow {
  transform: rotate(180deg);
}

/* CTA */
.sn-cta {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--pt-green);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--pt-green);
  margin-left: 8px;
  white-space: nowrap;
  display: inline-block;
  transition: background 0.12s, color 0.12s;
}

.sn-cta:hover,
.sn-cta:focus-visible {
  background: var(--pt-green);
  color: var(--bg);
  outline: none;
}

/* =====================================================
   DROPDOWN
   ===================================================== */
.sn-has-drop {
  position: relative;
}

.sn-drop {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  min-width: 260px;
  background: var(--bg);
  border: 1px solid var(--rule);
  list-style: none;
  margin: 0;
  padding: 8px 0;
  z-index: 201;
}

.sn-has-drop.is-open > .sn-drop {
  display: block;
}

.sn-drop a {
  display: block;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.12s;
  white-space: nowrap;
}

.sn-drop a:hover,
.sn-drop a:focus-visible {
  color: var(--ink);
  outline: none;
}

/* =====================================================
   HAMBURGER
   ===================================================== */
.sh-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.sh-burger span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.sh-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.sh-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.sh-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* =====================================================
   SITE FOOTER
   Reset inline-style conflicts via higher specificity
   ===================================================== */
.site-footer,
.site-footer p,
.site-footer h3 {
  text-align: left;
}

.site-footer a {
  text-decoration: none;
}

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--rule);
  padding-top: 28px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink-soft);
}

.sf-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.sf-top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.sf-logo,
.sf-logo-link {
  display: inline-block;
  line-height: 0;
  margin-bottom: 10px;
}

.site-footer .sf-logo img,
.site-footer .sf-logo-link img {
  display: block;
  width: 260px;
  max-width: 100%;
  height: auto;
}

.sf-tagline {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 8px;
  max-width: 240px;
}

.sf-email {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--ink);
}

.sf-email:hover {
  text-decoration: underline;
}

.sf-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.sf-col h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}

.sf-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sf-col a {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.sf-col a:hover {
  color: var(--ink);
}

.sf-bottom {
  padding: 12px 0 20px;
}

.sf-bottom > .sf-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.sf-legal {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 0;
}

.sf-legal a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-faint);
}

.sf-legal a:hover {
  color: var(--ink-soft);
}

.sf-legal button {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.sf-legal button:hover {
  color: var(--ink-soft);
}

.sf-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  margin: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .sh-inner { padding: 0 24px; }
  .sf-inner { padding: 0 24px; }
  .sf-top { gap: 40px; }
  .sn-link, .sn-toggle { font-size: 10.5px; padding: 8px 9px; }
}

@media (max-width: 760px) {
  :root { --sh-h: 56px; }

  .sh-logo img {
    width: 202px;
  }

  .sh-burger {
    display: flex;
    margin-left: auto;
  }

  /* Mobile nav — full-screen overlay */
  .site-nav {
    display: none;
    position: fixed;
    top: var(--sh-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--rule);
    overflow-y: auto;
    padding: 16px 24px 40px;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    z-index: 199;
  }

  .site-nav.is-open {
    display: flex;
  }

  .sn-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .sn-link,
  .sn-toggle {
    font-size: 13px;
    letter-spacing: 1px;
    padding: 15px 0;
    border-bottom: 1px solid var(--rule);
    justify-content: space-between;
    width: 100%;
  }

  .sn-drop {
    position: static;
    border: none;
    padding: 4px 0 12px 12px;
    border-bottom: 1px solid var(--rule);
    min-width: 0;
  }

  .sn-drop a {
    padding: 9px 0;
    font-size: 14px;
    white-space: normal;
  }

  .sn-cta {
    margin: 20px 0 0;
    display: block;
    text-align: center;
    padding: 14px;
  }

  /* Footer */
  .sf-top {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sf-cols {
    grid-template-columns: 1fr 1fr;
  }

  .sf-bottom > .sf-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .sf-cols { grid-template-columns: 1fr; }
}

/* =====================================================
   FOOTER WORDMARK — CSS text lockup (no raster logo)
   ===================================================== */
.sf-wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 17px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.5;
  margin-bottom: 10px;
}

.sf-wm-p1 {
  display: inline;
  border-bottom: 1.5px solid var(--pt-green);
  padding-bottom: 2px;
}

.sf-wm-p2 {
  display: inline;
  border-bottom: 1.5px solid var(--pt-red);
  padding-bottom: 2px;
}

/* OS Flag secondary brand lockup */
.sf-osflag-lockup {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.sf-osf-main {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.sf-osf-main:hover {
  color: var(--ink);
}

.sf-osf-sub {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 300;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-decoration: none;
}

.sf-osf-sub:hover {
  color: var(--ink-soft);
}
