/* ============================================================
   JUNTA DE FREGUESIA DA FUSETA — Estilos Globais
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy:        #1b3f7a;
  --navy-dark:   #0c2461;
  --gold:        #c9a428;
  --gold-light:  #e8c84a;
  --text:        #333;
  --text-light:  #666;
  --border:      #e0e0e0;
  --bg-links:    #eef3f9;
  --bg-notice:   #fef9e8;
  --border-notice: #f0c040;
  --white:       #ffffff;
  --max-width:   1200px;
  --radius:      10px;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --transition:  0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 1rem;
  background: var(--navy);
  color: var(--white);
  padding: .5rem 1.1rem;
  border-radius: 0 0 6px 6px;
  font-size: .875rem;
  font-weight: 600;
  z-index: 10001;
  transition: top 180ms var(--ease-out);
}
.skip-link:focus { top: 0; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
  font-optical-sizing: auto;
  font-kerning: normal;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img { display: block; max-width: 100%; }
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }

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


/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.logo img {
  height: 52px;
  width: auto;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-small {
  font-size: .6rem;
  letter-spacing: .12em;
  color: var(--navy);
  font-weight: 600;
}
.logo-big {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .05em;
}

/* Nav */
.main-nav { margin-left: auto; }

.main-nav > ul {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav > ul > li > a,
.main-nav > ul > li > .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .5rem .85rem;
  font-size: .88rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--navy);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.main-nav > ul > li > a:hover,
.main-nav > ul > li > a.active,
.main-nav > ul > li > .dropdown-toggle.active,
.main-nav > ul > li > .dropdown-toggle:hover {
  color: var(--navy-dark);
  background: var(--bg-links);
}

.main-nav > ul > li > a.active,
.main-nav > ul > li > .dropdown-toggle.active {
  border-bottom: 2px solid var(--navy);
  border-radius: 4px 4px 0 0;
}

.arrow {
  font-size: .75rem;
  transition: transform var(--transition);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform-origin: top left;
  transform: scale(0.95) translateY(-4px);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 180ms;
  z-index: 200;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.has-dropdown:hover .arrow {
  transform: rotate(180deg);
}

.dropdown li a {
  display: block;
  padding: .65rem 1.2rem;
  font-size: .875rem;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  border-radius: 4px;
}

.dropdown li a:hover {
  background: var(--bg-links);
  color: var(--navy);
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: .5rem; }

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy);
  padding: .45rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--bg-links); }
.search-btn:active { transform: scale(0.88); }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Barra de pesquisa */
.search-bar {
  display: none;
  background: var(--bg-links);
  border-top: 1px solid var(--border);
}
.search-bar.open { display: block; }

.search-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: .75rem 2rem;
  display: flex;
  gap: .75rem;
}

.search-bar-inner input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .5rem 1rem;
  font-size: .9rem;
  outline: none;
  font-family: inherit;
}
.search-bar-inner input:focus { border-color: var(--navy); }

#search-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-light);
  padding: .4rem .75rem;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition), transform 120ms var(--ease-out);
}
#search-close:hover { background: var(--border); color: var(--text); }
#search-close:active { transform: scale(0.88); }

.search-results {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem .75rem;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text);
}
.search-result-item:hover { background: var(--bg-links); }

.search-result-item strong {
  font-size: .9rem;
  color: var(--navy);
}
.search-result-item span {
  font-size: .8rem;
  color: var(--text-light);
}

.search-no-results {
  padding: .75rem 1rem;
  font-size: .875rem;
  color: var(--text-light);
}


/* ============================================================
   HERO SLIDER
   ============================================================ */
.hero-slider {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 480px;
  overflow: hidden;
}

.slides-wrapper { width: 100%; height: 100%; }

.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}

.slide.active { opacity: 1; z-index: 1; }

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.15) 0%, rgba(0,0,0,.45) 100%);
}

.slide-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  z-index: 2;
  padding: 2rem;
}

.slide-title {
  font-family: 'Pinyon Script', cursive;
  font-size: clamp(3.5rem, 6vw, 6rem);
  font-weight: 400;
  text-shadow: 0 2px 20px rgba(0,0,0,.4);
  margin-bottom: .1em;
}

.slide-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  letter-spacing: .12em;
  font-family: 'Cinzel', serif;
  font-weight: 400;
  color: #e7b88c;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
  margin-top: 0;
  line-height: 1;
}

.slide-subtitle span {
  display: inline;
}

/* Botões prev/next */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.6);
  color: var(--white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), transform 120ms var(--ease-out);
  backdrop-filter: blur(4px);
}
.slider-btn:hover {
  background: rgba(255,255,255,.35);
  border-color: white;
}
.slider-btn:active {
  transform: translateY(-50%) scale(0.92);
}
.slider-btn.prev { left: 1.5rem; }
.slider-btn.next { right: 1.5rem; }

/* Dots */
.slider-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: .6rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.8);
  transition: background var(--transition), transform var(--transition);
}
.dot.active {
  background: var(--white);
  transform: scale(1.2);
}


/* ============================================================
   CARDS DE ACESSO RÁPIDO
   ============================================================ */
.cards-section {
  padding: 3rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  transition: box-shadow var(--transition), transform var(--transition), border-top-color var(--transition);
  opacity: 0;
  animation: fadeInUp 350ms var(--ease-out) both;
}

.card:nth-child(1) { animation-delay: 50ms; }
.card:nth-child(2) { animation-delay: 110ms; }
.card:nth-child(3) { animation-delay: 170ms; }

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    box-shadow: 0 6px 24px rgba(27,63,122,.1);
    transform: translateY(-4px);
    border-top-color: var(--gold);
  }
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  text-wrap: balance;
}

.card p {
  font-size: .9rem;
  color: var(--text-light);
  flex: 1;
}

.card-link {
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition), transform 120ms var(--ease-out);
  margin-top: .5rem;
  display: inline-block;
}
.card-link:hover { color: var(--navy-dark); }
.card-link:active { transform: scale(0.95); }


/* ============================================================
   AVISOS IMPORTANTES
   ============================================================ */
.avisos-section {
  padding: 0 0 3rem;
}

.avisos-box {
  background: var(--bg-notice);
  border: 1.5px solid var(--border-notice);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
}

.avisos-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.avisos-icon {
  font-size: 1.4rem;
  color: #e6a817;
}

.avisos-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.avisos-list li {
  padding: .85rem 0;
  border-bottom: 1px solid rgba(240,192,64,.4);
  font-size: .95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.avisos-list li:last-child { border-bottom: none; }

.avisos-list li::before {
  content: "•";
  color: #e6a817;
  font-size: 1.2rem;
  flex-shrink: 0;
}


/* ============================================================
   LINKS ÚTEIS
   ============================================================ */
.links-section {
  background: var(--bg-links);
  padding: 3.5rem 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 400;
  font-family: 'Cinzel', serif;
  color: var(--navy);
  text-align: center;
  letter-spacing: .06em;
  margin-bottom: 2.5rem;
  text-wrap: balance;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.link-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(27,63,122,.08);
  transition: transform var(--transition), box-shadow var(--transition);
  background: var(--white);
  display: flex;
  flex-direction: column;
}
@media (hover: hover) and (pointer: fine) {
  .link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(27,63,122,.14);
  }
}

.link-card-img {
  height: 200px;
  overflow: hidden;
}
.link-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .link-card:hover .link-card-img img { transform: scale(1.05); }
}

.link-card-label {
  display: block;
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: .85rem 1rem;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--navy-dark); }

/* Onda */
.footer-wave {
  position: relative;
  height: 90px;
  background: var(--navy-dark);
  overflow: visible;
}

.footer-wave svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.footer-brasao {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 90px;
  background: white;
  border-radius: 50%;
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.footer-brasao img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

/* Corpo do footer */
.footer-body {
  padding: 3rem 0 2.5rem;
  color: rgba(255,255,255,.85);
}

.footer-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--gold);
  margin-bottom: 2.5rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-col h4 {
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(201,164,40,.3);
}

.footer-info {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: .75rem;
}

.footer-icon {
  flex-shrink: 0;
  margin-top: .2rem;
  color: rgba(255,255,255,.55);
  display: flex;
  align-items: flex-start;
}

.footer-col p {
  font-size: .875rem;
  line-height: 1.7;
  color: rgba(255,255,255,.8);
}

.footer-link {
  font-size: .85rem;
  color: var(--gold-light);
  transition: color var(--transition);
  display: inline-block;
  margin-top: .25rem;
}
.footer-link:hover { color: white; }

/* Link social minimalista */
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.65);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color var(--transition), transform 120ms var(--ease-out);
  margin-top: .25rem;
}
.footer-social-link:hover { color: var(--gold); }
.footer-social-link:active { transform: scale(0.95); }
.footer-social-link svg { flex-shrink: 0; }

/* Footer base */
.footer-bottom {
  background: rgba(0,0,0,.25);
  padding: 1rem 0;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.footer-bottom p {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}


/* ============================================================
   PÁGINAS INTERIORES — Banner, Layout, Sidebar, Tipografia
   ============================================================ */

/* Banner de topo */
.page-banner {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: white;
  padding: 3rem 2rem 2.5rem;
  text-align: center;
}
.page-banner h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  font-family: 'Cinzel', serif;
  margin-bottom: .6rem;
  letter-spacing: .04em;
  text-wrap: balance;
}
.page-banner .breadcrumb {
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.page-banner .breadcrumb a {
  color: rgba(255,255,255,.6);
  transition: color var(--transition);
}
.page-banner .breadcrumb a:hover { color: var(--gold); }
.page-banner .breadcrumb .sep { color: rgba(255,255,255,.3); }

/* Layout de página interior */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 2.5rem;
  align-items: start;
}

.page-main { min-width: 0; }

.page-sidebar {
  position: sticky;
  top: 88px;
}

/* Sidebar nav */
.sidebar-nav {
  background: var(--bg-links);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.sidebar-nav-title {
  font-size: .7rem;
  letter-spacing: .16em;
  color: var(--navy);
  font-weight: 700;
  padding: .9rem 1.2rem .7rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
.sidebar-nav ul { list-style: none; }
.sidebar-nav ul li a {
  display: block;
  padding: .65rem 1.2rem;
  font-size: .875rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav ul li:last-child a { border-bottom: none; }
.sidebar-nav ul li a:hover { background: white; color: var(--navy); }
.sidebar-nav ul li a.active {
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
}

/* Tipografia de conteúdo */
.page-main h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2.5rem 0 .85rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: .5rem;
  text-wrap: balance;
}
.page-main h2:first-child { margin-top: 0; }
.page-main h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1.75rem 0 .5rem;
}
.page-main p {
  font-size: .95rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1rem;
  text-align: justify;
  hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}
.page-main ul, .page-main ol {
  font-size: .95rem;
  line-height: 1.8;
  color: var(--text);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.page-main ul { list-style: disc; }
.page-main ol { list-style: decimal; }
.page-main li { margin-bottom: .3rem; }

/* Heráldica */
.heraldic-section { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid #dce4f0; }
.heraldic-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.heraldic-lead { display: flex; gap: 2rem; align-items: flex-start; margin-bottom: 1.75rem; }
.heraldic-img { flex: 0 0 160px; text-align: center; }
.heraldic-img img { max-width: 160px; width: 100%; }
.heraldic-img figcaption { font-size: .78rem; color: var(--text-light); margin-top: .5rem; font-style: italic; }
.heraldic-desc { background: #f4f7fc; border: 1px solid rgba(27,63,122,.15); border-top: 3px solid var(--navy); border-radius: 8px; padding: 1rem 1.25rem; font-size: .93rem; color: #333; line-height: 1.75; margin-bottom: 1rem; }
.page-main h3.heraldic-sub { font-family: 'Cinzel', serif; font-size: 1rem; color: var(--navy); margin: 1.75rem 0 .5rem; }
.page-main h4.heraldic-elem { font-size: .95rem; color: #1a2a4a; margin: 1.25rem 0 .35rem; font-weight: 600; }

/* Mensagem da Presidente */
.mp-layout { display: flex; gap: 2.25rem; align-items: center; }
.mp-col-img { flex: 0 0 34%; }
.mp-figura { margin: 0 0 0; }
.mp-figura img { width: 100%; border-radius: 16px; display: block; object-fit: cover; margin-top: -60px; }
.mp-info { margin-top: 14px; text-align: center; padding: 0 10px; }
.mp-nome { margin: 0 0 5px; color: var(--navy); font-size: 1.05rem; font-weight: 700; line-height: 1.45; }
.mp-cargo { margin: 0 0 8px; color: #5c6f82; font-size: .9rem; line-height: 1.5; }
.mp-email { margin: 0; font-size: .92rem; }
.mp-email a { color: var(--navy); text-decoration: none; border-bottom: 1px solid rgba(27,63,122,.28); padding-bottom: 2px; transition: color var(--transition), border-color var(--transition); }
.mp-email a:hover { color: #163b6c; border-bottom-color: #163b6c; }
.mp-col-txt { flex: 1; }
.mp-box { position: relative; background: linear-gradient(135deg,#fbfdff,#f4f8fc); border: 1px solid #dce8f5; border-top: 4px solid var(--gold); border-radius: 18px; padding: 30px; box-shadow: 0 10px 28px rgba(27,63,122,.07); overflow: hidden; }
.mp-box::before { content: "\201C"; position: absolute; top: 10px; right: 18px; font-size: 5rem; line-height: 1; color: rgba(27,63,122,.08); font-family: Georgia,serif; pointer-events: none; }
.mp-texto { margin: 0; color: var(--text); font-size: 1rem; line-height: 1.95; }

/* História */
.historia-lead { font-size: 1.05rem; color: var(--navy-dark); line-height: 1.85; font-style: italic; padding: 1rem 1.5rem; background: var(--bg-links); border-radius: var(--radius); border-top: 3px solid var(--navy); margin-bottom: 1.75rem; }
.historia-closing { font-size: 1rem; font-style: italic; color: var(--navy); background: var(--bg-links); border-radius: 10px; padding: 1.1rem 1.4rem; margin-top: 1.75rem; line-height: 1.85; }

/* Lista de documentos */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1rem;
}
.doc-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-links);
  transition: border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}
.doc-item:hover {
  border-color: var(--navy);
  box-shadow: 0 2px 10px rgba(27,63,122,.08);
}
.doc-icon {
  width: 34px;
  height: 34px;
  background: var(--navy);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.doc-info { flex: 1; min-width: 0; }
.doc-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--navy);
  display: block;
}
.doc-meta {
  font-size: .78rem;
  color: var(--text-light);
  display: block;
  margin-top: .1rem;
}
.doc-arrow {
  color: var(--text-light);
  font-size: .9rem;
  flex-shrink: 0;
}

/* Cards de membros — grelha vertical */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.members-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}
.member-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}
@media (hover: hover) and (pointer: fine) {
  .member-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.09);
    transform: translateY(-2px);
  }
}
.member-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  display: block;
}.member-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #dce7f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--navy);
}
.member-info {
  padding: .9rem 1rem 1rem;
}
.member-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .2rem;
}
.member-role {
  font-size: .78rem;
  color: var(--text-light);
  margin-bottom: .5rem;
}
.member-party {
  margin: 0;
}

/* Badges de partido */
.party-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .18rem .6rem;
  border-radius: 999px;
}
.party-badge--ps    { background: #fde8e8; color: #c0392b; }
.party-badge--psd   { background: #fef0e0; color: #c0550a; }
.party-badge--chega { background: #e8e8e8; color: #333; }

/* Caixa de aviso/nota */
.notice-box {
  background: var(--bg-notice);
  border: 1.5px solid var(--border-notice);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  font-size: .9rem;
  color: var(--text);
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.notice-box strong { color: var(--navy); }

/* Tabela de informações */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: .9rem;
}
.info-table th {
  background: var(--navy);
  color: white;
  padding: .65rem 1rem;
  text-align: left;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.info-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.info-table tr:last-child td { border-bottom: none; }
.info-table tr:hover td { background: var(--bg-links); }

/* Cards de contacto */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.contact-card-title {
  font-size: .7rem;
  letter-spacing: .15em;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.contact-row {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin-bottom: .75rem;
  font-size: .9rem;
  color: var(--text);
}
.contact-row:last-child { margin-bottom: 0; }
.contact-row-icon { color: var(--navy); flex-shrink: 0; margin-top: .15rem; }
.contact-row a { color: var(--navy); }
.contact-row a:hover { text-decoration: underline; }

/* Horário */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: .9rem;
}
.schedule-table th {
  background: var(--navy);
  color: white;
  padding: .55rem 1rem;
  text-align: left;
  font-size: .8rem;
}
.schedule-table td {
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--border);
}
.schedule-table tr:last-child td { border-bottom: none; }
.schedule-table td,
.info-table td,
.info-table th { font-variant-numeric: tabular-nums; }

/* Galeria de imagens */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .gallery-item:hover img { transform: scale(1.05); }
}

/* Sub-nav por tabs */
.sub-nav {
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}
.sub-nav > ul {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}
.sub-nav ul li a,
.sub-nav-link {
  display: block;
  padding: .6rem 1.1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-light);
  border-radius: 4px 4px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition);
}
.sub-nav ul li a:hover,
.sub-nav-link:hover { color: var(--navy); }
.sub-nav ul li a.active,
.sub-nav-link.active {
  color: var(--navy);
  font-weight: 700;
  border-bottom-color: var(--navy);
  background: var(--bg-links);
}

/* ============================================================
   RESPONSIVO
   ============================================================ */

/* Elimina atraso de 300ms em touch em todos os elementos clicáveis */
a, button, .dot, .slider-btn, .card-link, .doc-item,
.link-card, .member-card, .search-result-item, .sub-nav-link,
.sidebar-nav ul li a {
  touch-action: manipulation;
}

@media (max-width: 1024px) {
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .page-layout { grid-template-columns: 1fr 240px; }
}

@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .page-sidebar { position: static; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .mp-layout { flex-direction: column; }
  .mp-col-img { flex: 0 0 100%; max-width: 280px; margin: 0 auto; }
  .mp-figura img { margin-top: 0; }
  .heraldic-lead { flex-direction: column; }
  .heraldic-img { flex: 0 0 auto; }
  .page-content { padding: 2rem 1.25rem 3rem; }
  .page-banner  { padding: 2rem 1.25rem 1.75rem; }
}

@media (max-width: 768px) {
  /* Header menor em mobile */
  .header-inner {
    padding: 0 1.25rem;
    height: 60px;
  }

  /* Menu mobile */
  .main-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 1rem 1.25rem;
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .main-nav.open { display: block; }

  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }

  .main-nav > ul > li > a,
  .main-nav > ul > li > .dropdown-toggle {
    padding: .85rem .5rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: .95rem;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    display: none;
  }
  .has-dropdown.open .dropdown { display: block; }

  /* Hambúrguer animado */
  .menu-toggle { display: flex; }
  .menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Sidebar sticky — compensar altura do header mobile */
  .page-sidebar { top: 76px; }

  .cards-grid { grid-template-columns: 1fr; gap: 1rem; }
  .links-grid  { grid-template-columns: 1fr; gap: 1rem; }

  /* Imagens dos link-cards mais compactas em coluna única */
  .link-card-img { height: 160px; }

  .hero-slider { height: 58vh; min-height: 360px; }

  /* Botões slider mais próximos das margens */
  .slider-btn.prev { left: .75rem; }
  .slider-btn.next { right: .75rem; }

  .footer-cols { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }

  .cards-section { padding: 2rem 1.25rem; }
  .avisos-section .container { padding: 0 1.25rem; }
  .links-section  { padding: 2.5rem 1.25rem; }

  /* Avisos — padding mais compacto */
  .avisos-box { padding: 1.25rem 1.25rem; }

  /* Texto justificado fica horrível em mobile */
  .page-main p { text-align: left; hyphens: none; }

  /* Sub-nav: scroll horizontal em vez de wrap */
  .sub-nav > ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 0;
  }
  .sub-nav > ul::-webkit-scrollbar { display: none; }
  .sub-nav ul li a,
  .sub-nav-link { white-space: nowrap; }

  /* Tabelas: scroll horizontal em vez de overflow */
  .info-table,
  .schedule-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .slide-title { font-size: 2.6rem; }
  .hero-cta { padding: .65rem 1.5rem; font-size: .75rem; letter-spacing: .08em; }

  .footer-cols { grid-template-columns: 1fr; }
  .footer-brasao { width: 70px; height: 70px; top: -30px; }
  .footer-brasao img { width: 52px; height: 52px; }

  /* Doc items: esconder meta em ecrãs muito pequenos */
  .doc-meta { display: none; }
}


/* ============================================================
   ANIMAÇÕES & ACESSIBILIDADE
   ============================================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   ONDAS ANIMADAS — Hero
   ============================================================ */
.hero-waves {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 3;
  pointer-events: none;
}

.hero-waves svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hw-back {
  fill: rgba(255,255,255,.18);
  animation: hwBack 9s ease-in-out infinite;
}

.hw-mid {
  fill: rgba(255,255,255,.45);
  animation: hwMid 7s ease-in-out infinite;
  animation-delay: -2s;
}

.hw-front {
  fill: rgba(255,255,255,.95);
  animation: hwFront 5s ease-in-out infinite;
  animation-delay: -1s;
}

@keyframes hwBack {
  0%, 100% { d: path("M0,40 C360,10 720,70 1080,35 C1260,20 1380,50 1440,45 L1440,80 L0,80 Z"); }
  50%       { d: path("M0,45 C360,70 720,10 1080,55 C1260,65 1380,30 1440,40 L1440,80 L0,80 Z"); }
}

@keyframes hwMid {
  0%, 100% { d: path("M0,55 C240,30 480,70 720,50 C960,30 1200,65 1440,52 L1440,80 L0,80 Z"); }
  50%       { d: path("M0,50 C240,68 480,32 720,55 C960,68 1200,40 1440,58 L1440,80 L0,80 Z"); }
}

@keyframes hwFront {
  0%, 100% { d: path("M0,65 C180,52 360,72 540,62 C720,52 900,68 1080,58 C1260,48 1380,65 1440,60 L1440,80 L0,80 Z"); }
  50%       { d: path("M0,60 C180,70 360,52 540,68 C720,60 900,50 1080,64 C1260,58 1380,52 1440,66 L1440,80 L0,80 Z"); }
}


/* ============================================================
   ANIMAÇÃO DO TEXTO DO HERO
   ============================================================ */
.slide.active .slide-title {
  animation: heroTitleIn 1.1s .1s var(--ease-out) both;
}

.slide.active .slide-subtitle {
  animation: heroSubIn 1s .6s var(--ease-out) both;
}

@keyframes heroTitleIn {
  from { opacity: 0; transform: translateY(28px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0);   }
}

@keyframes heroSubIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}


/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   ONDA ANIMADA — Footer
   ============================================================ */
.footer-wave path {
  animation: footerWaveFloat 5s ease-in-out infinite;
}

@keyframes footerWaveFloat {
  0%, 100% { d: path("M0,0 C240,90 480,90 720,45 C960,0 1200,90 1440,45 L1440,0 Z"); }
  50%       { d: path("M0,0 C240,70 480,95 720,55 C960,10 1200,85 1440,35 L1440,0 Z"); }
}


/* ============================================================
   HERO — CTA button
   ============================================================ */
.hero-actions {
  margin-top: 2.25rem;
}

.slide.active .hero-actions {
  animation: heroSubIn 1s .9s var(--ease-out) both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: .75rem 2.25rem;
  border: 1.5px solid rgba(255,255,255,.7);
  color: var(--white);
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  letter-spacing: .14em;
  border-radius: 2px;
  transition: background var(--transition), border-color var(--transition), transform 140ms var(--ease-out);
  white-space: nowrap;
}

.hero-cta:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.95);
}

.hero-cta:active { transform: scale(0.97); }


/* ============================================================
   CARDS — eyebrow label + numbered watermark + hover gold
   ============================================================ */
.cards-eyebrow {
  font-size: .68rem;
  letter-spacing: .24em;
  font-weight: 700;
  color: var(--navy);
  opacity: .42;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2rem;
}

.cards-grid { counter-reset: card; }

.cards-grid .card {
  counter-increment: card;
  position: relative;
  overflow: hidden;
}

.cards-grid .card::before {
  content: "0" counter(card);
  position: absolute;
  bottom: -.75rem;
  right: .5rem;
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
  color: rgba(27, 63, 122, .055);
  pointer-events: none;
  user-select: none;
}


/* ============================================================
   SECTION TITLE — gold underline accent
   ============================================================ */
.section-title::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--gold);
  margin: .8rem auto 0;
}


@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
