/* ==========================================================================
   DAP – Associação de Desporto e Aventura de Portalegre
   Folha de estilos principal
   --------------------------------------------------------------------------
   PALETA (extraída do logotipo):
     --dap-primary:   #5F6B7A  (cinzento-azulado escuro – montanhas/castelo)
     --dap-secondary: #84BDD8  (azul claro – círculo do logo)
     --dap-accent:    #6A9AB5  (azul médio – derivado)
     --dap-dark:      #3D4654  (variante escura)
     --dap-light:     #EFF5F8  (fundo claro)
     --dap-white:     #FFFFFF
     --dap-text:      #2C3E50  (texto corpo)

   FONTES (Google Fonts):
     Títulos: Oswald – condensada, forte, evoca a tipografia stencil do logo
     Corpo:   Lato   – humanista, legível, complementa bem Oswald
   ========================================================================== */

/* ---------- Variáveis CSS :root ---------- */
:root {
  --dap-primary:   #5F6B7A;
  --dap-secondary: #84BDD8;
  --dap-accent:    #6A9AB5;
  --dap-dark:      #3D4654;
  --dap-light:     #EFF5F8;
  --dap-white:     #FFFFFF;
  --dap-text:      #2C3E50;

  /* Sobreposição às variáveis Bootstrap */
  --bs-primary:     #5F6B7A;
  --bs-secondary:   #84BDD8;
  --bs-body-color:  #2C3E50;
  --bs-body-bg:     #FFFFFF;
  --bs-link-color:  #5F6B7A;
}

/* ---------- Reset & Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: 'Lato', sans-serif;
  color: var(--dap-text);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  color: var(--dap-dark);
}

/* ---------- Navbar ---------- */
.navbar-dap {
  transition: background-color .4s ease, box-shadow .4s ease;
  padding-top: .75rem;
  padding-bottom: .75rem;
}

.navbar-dap.transparent {
  background-color: transparent !important;
  box-shadow: none;
}

.navbar-dap.scrolled {
  background-color: var(--dap-primary) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.navbar-dap .navbar-brand img {
  height: 48px;
  width: auto;
  transition: height .3s;
}

.navbar-dap.scrolled .navbar-brand img {
  height: 40px;
}

.navbar-dap .nav-link {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #007bff !important;
  padding: .5rem 1rem;
  transition: color .3s, background-color .3s;
  border-radius: 4px;
}

.navbar-dap .nav-link:hover,
.navbar-dap .nav-link.active {
  background-color: rgba(255,255,255,.15);
  color: #2C3E50 !important;
}

/* ---------- Hero Carousel ---------- */
#heroCarousel {
  height: 100svh;
  min-height: 500px;
}

#heroCarousel .carousel-item {
  height: 100svh;
  min-height: 500px;
}

#heroCarousel .carousel-item img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  filter: brightness(.55);
}

.hero-caption {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 10;
  text-align: center;
  padding: 0 1rem;
}

.hero-caption h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  margin-bottom: .5rem;
}

.hero-caption p {
  font-size: 1.25rem;
  color: rgba(255,255,255,.9);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  margin-bottom: 1.5rem;
}

.hero-caption .btn {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: .75rem 2rem;
  border-radius: 5px;
  font-size: 1rem;
}

.btn-dap-primary {
  background-color: var(--dap-secondary);
  color: var(--dap-dark);
  border: none;
  font-weight: 600;
}

.btn-dap-primary:hover {
  background-color: var(--dap-accent);
  color: #fff;
}

.btn-dap-outline {
  border: 2px solid #fff;
  color: #fff;
  background: transparent;
  font-weight: 600;
}

.btn-dap-outline:hover {
  background-color: #fff;
  color: var(--dap-primary);
}

/* Bootstrap carousel fade */
.carousel-fade .carousel-item {
  opacity: 0;
  transition: opacity .8s ease-in-out;
}
.carousel-fade .carousel-item.active {
  opacity: 1;
}

/* ---------- Secções ---------- */
section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: .5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--dap-secondary);
  margin-top: .75rem;
  border-radius: 2px;
}

.section-subtitle {
  color: var(--dap-primary);
  opacity: .7;
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* ---------- Boas-vindas ---------- */
#welcome {
  background-color: var(--dap-light);
}

/* ---------- Atividades – Cards ---------- */
.activity-card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transition: transform .35s ease, box-shadow .35s ease;
  height: 100%;
}

.activity-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
}

.activity-card .card-img-top {
  height: 220px;
  object-fit: cover;
}

.activity-badge {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .3rem .75rem;
  border-radius: 4px;
  font-weight: 600;
}

.badge-trail { background-color: #D4EDDA; color: #155724; }
.badge-ciclismo { background-color: #CCE5FF; color: #004085; }
.badge-btt { background-color: #FFF3CD; color: #856404; }
.badge-corrida { background-color: #F8D7DA; color: #721C24; }

/* ---------- Calendário ---------- */
.calendar-wrapper {
  background: var(--dap-white);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  overflow: hidden;
}

.calendar-header {
  background-color: var(--dap-primary);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-header h4 {
  margin: 0;
  color: #fff;
  font-size: 1.2rem;
}

.calendar-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: 4px;
  transition: background .2s;
}

.calendar-header button:hover {
  background: rgba(255,255,255,.2);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: #e9ecef;
}

.calendar-grid .day-name {
  background: var(--dap-light);
  text-align: center;
  padding: .5rem .25rem;
  font-family: 'Oswald', sans-serif;
  font-size: .8rem;
  text-transform: uppercase;
  color: var(--dap-primary);
  font-weight: 600;
}

.calendar-grid .day-cell {
  background: #fff;
  min-height: 70px;
  padding: .4rem;
  font-size: .85rem;
  position: relative;
  cursor: default;
  transition: background .2s;
}

.calendar-grid .day-cell.other-month {
  color: #ccc;
  background: #fafafa;
}

.calendar-grid .day-cell.today {
  background-color: rgba(132,189,216,.15);
}

.calendar-grid .day-cell.has-event {
  cursor: pointer;
}

.calendar-grid .day-cell.has-event:hover {
  background-color: rgba(132,189,216,.25);
}

.day-number {
  font-weight: 600;
  font-size: .9rem;
}

.event-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--dap-secondary);
  margin-top: 4px;
}

.event-dot.trail { background-color: #28a745; }
.event-dot.ciclismo { background-color: #007bff; }
.event-dot.btt { background-color: #ffc107; }
.event-dot.corrida { background-color: #dc3545; }

/* Lista de eventos (mobile) */
.events-list {
  display: none;
}

@media (max-width: 767.98px) {
  .calendar-grid {
    display: none;
  }
  .events-list {
    display: block;
  }
  .events-list .event-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
  }
  .events-list .event-date {
    font-family: 'Oswald', sans-serif;
    background: var(--dap-secondary);
    color: var(--dap-dark);
    padding: .5rem .75rem;
    border-radius: 6px;
    text-align: center;
    min-width: 60px;
    font-weight: 600;
  }
  .events-list .event-date .day {
    font-size: 1.5rem;
    line-height: 1;
  }
  .events-list .event-date .month {
    font-size: .75rem;
    text-transform: uppercase;
  }
}

/* ---------- Sobre ---------- */
#sobre {
  background-color: var(--dap-light);
}

.value-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dap-secondary), var(--dap-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 4px 14px rgba(132,189,216,.4);
}

.counter-number {
  font-family: 'Oswald', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dap-primary);
}

/* ---------- Contactos ---------- */
#contactos {
  background-color: var(--dap-white);
}

.contact-info i {
  color: var(--dap-secondary);
  font-size: 1.25rem;
}

.map-container {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.map-container iframe {
  width: 100%;
  height: 350px;
  border: 0;
}

/* ---------- Footer ---------- */
.footer-dap {
  background-color: var(--dap-dark);
  color: rgba(255,255,255,.8);
  padding: 3rem 0 1.5rem;
}

.footer-dap h5 {
  color: #fff;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 1rem;
}

.footer-dap a {
  color: var(--dap-secondary);
  text-decoration: none;
  transition: color .2s;
}

.footer-dap a:hover {
  color: #fff;
}

.footer-dap .social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255,255,255,.1);
  color: #fff;
  font-size: 1.1rem;
  margin-right: .5rem;
  transition: background-color .3s, transform .3s;
}

.footer-dap .social-icons a:hover {
  background-color: var(--dap-secondary);
  transform: scale(1.1);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1rem;
  margin-top: 2rem;
  font-size: .85rem;
}

/* ---------- Botão Voltar ao Topo ---------- */
#btnTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--dap-primary);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  cursor: pointer;
  z-index: 1050;
  transition: background-color .3s, transform .3s;
}

#btnTop.show {
  display: flex;
}

#btnTop:hover {
  background-color: var(--dap-secondary);
  transform: scale(1.1);
}

/* ---------- Animações (IntersectionObserver) ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease-out, transform .7s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respeitar prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .carousel-fade .carousel-item {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Separador SVG Serra ---------- */
.section-divider-serra {
  width: 100%;
  height: 60px;
  overflow: hidden;
  line-height: 0;
}

.section-divider-serra svg {
  width: 100%;
  height: 100%;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
  .hero-caption h1 {
    font-size: 2rem;
  }
  .hero-caption p {
    font-size: 1rem;
  }
  section {
    padding: 3rem 0;
  }
  .section-title {
    font-size: 1.8rem;
  }
}

@media (min-width: 992px) {
  .hero-caption h1 {
    font-size: 4rem;
  }
}

/* ---------- Imagem nota ---------- */
.img-note {
  font-size: .75rem;
  color: var(--dap-primary);
  opacity: .6;
  font-style: italic;
}

/* ---------- Modal evento ---------- */
.modal-event .modal-header {
  background-color: var(--dap-primary);
  color: #fff;
}

.modal-event .modal-header .btn-close {
  filter: brightness(0) invert(1);
}

/* ---------- Formulário ---------- */
.form-control:focus {
  border-color: var(--dap-secondary);
  box-shadow: 0 0 0 .25rem rgba(132,189,216,.25);
}

/* ---------- Parallax placeholder ---------- */
.parallax-bg {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

@media (max-width: 991.98px) {
  .parallax-bg {
    background-attachment: scroll;
  }
}

/* ---------- About image ---------- */
.about-img {
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.15);
  object-fit: cover;
  width: 100%;
  height: 100%;
  min-height: 300px;
}
