/*
Theme Name: AB VRSA
Theme URI: https://www.abvrsa.pt
Author: Daniel Silva
Author URI: https://d316.pt
Description: Custom WordPress theme for Igreja Acção Bíblica - Vila Real de Santo António, ported from the existing Next.js site.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: ab-vrsa-wp
*/

/* Base reset (minimal – Tailwind handles most utilities) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* html scroll-behavior removed - Lenis handles smooth scrolling */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Urbanist", sans-serif;
  background-color: #ffffff;
  color: #111827;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.abv-skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100000;
  background: #111827;
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: top 0.2s ease;
}

.abv-skip-link:focus {
  top: 1rem;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Remove list bullets from navigation */
nav ul,
nav ol,
.abv-main-nav ul,
.abv-main-nav ol,
.abv-mobile-menu-overlay ul,
.abv-mobile-menu-overlay ol {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

nav ul li,
nav ol li,
.abv-main-nav ul li,
.abv-main-nav ol li,
.abv-mobile-menu-overlay ul li,
.abv-mobile-menu-overlay ol li {
  list-style: none !important;
}

/* Remove any pseudo-elements that might create bullets */
.abv-mobile-menu-overlay ul li::before,
.abv-mobile-menu-overlay ul li::after,
.abv-mobile-menu-overlay li::before,
.abv-mobile-menu-overlay li::after {
  display: none !important;
  content: none !important;
}

/* Force remove list style from all lists in mobile menu */
#abv-mobile-menu ul,
#abv-mobile-menu ol {
  list-style: none !important;
  list-style-type: none !important;
  -webkit-padding-start: 0;
  padding-inline-start: 0;
}

#abv-mobile-menu ul li,
#abv-mobile-menu ol li {
  list-style: none !important;
  list-style-type: none !important;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #365A88;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Container utility matching Next.js layout */
.abv-container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header logo */
.abv-logo {
  width: 90px;
  height: auto;
}

/* Header transparency over hero video */
#site-header {
  transition: background-color 200ms ease, box-shadow 200ms ease, backdrop-filter 200ms ease;
}

#site-header.header-transparent {
  background-color: transparent;
  box-shadow: none;
}

#site-header.header-solid {
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
}

/* Header text / logo colors depending on state */
#site-header.header-transparent .abv-main-nav {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

#site-header.header-solid .abv-main-nav {
  color: #111827;
}

#site-header.header-transparent .header-logo {
  filter: brightness(0) invert(1);
  transition: filter 200ms ease;
}

#site-header.header-solid .header-logo {
  filter: none;
}

/* Mobile menu toggle button - no background or border */
#abv-menu-toggle,
#abv-menu-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

#site-header.header-transparent #abv-menu-toggle,
#site-header.header-transparent #abv-menu-close {
  color: #ffffff;
}

#site-header.header-solid #abv-menu-toggle,
#site-header.header-solid #abv-menu-close {
  color: #111827;
}

/* Ensure content does not ficar escondido atrás do header fixo em páginas sem hero vídeo */
body:not(.home) .site-main {
  padding-top: 6rem;
}

/* Simple mobile menu overlay (when JS adds .abv-menu-open on body) */
body.abv-menu-open {
  overflow: hidden;
}

.abv-mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  min-height: 100dvh;
  height: 100dvh;
  background-color: #ffffff;
  z-index: 99999;
  display: none;
  overflow-y: auto;
  color: #111827; /* Black text inside mobile menu */
  /* Ensure it's completely independent from header positioning */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

body.abv-menu-open .abv-mobile-menu-overlay {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure all text inside mobile menu is black */
.abv-mobile-menu-overlay a,
.abv-mobile-menu-overlay button,
.abv-mobile-menu-overlay i,
.abv-mobile-menu-overlay li {
  color: #111827;
}

.abv-mobile-menu-overlay a:hover {
   color: #365A88;
}

.abv-mobile-menu-overlay > div {
  width: 100%;
  min-height: 100dvh;
}

/* Close button in mobile menu should always be black */
#abv-mobile-menu #abv-menu-close,
#abv-mobile-menu #abv-menu-close i {
  color: #111827 !important;
}

/* Prevent header from interfering with mobile menu */
body.abv-menu-open #site-header {
  z-index: 50; /* Keep header z-index lower than menu */
}

/* Hide scrollbar for rolamento components */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Font family utilities */
.font-\[Urbanist\] {
  font-family: 'Urbanist', sans-serif;
}

.font-\[Fraunces\] {
  font-family: 'Fraunces', serif;
}

.font-\[Urbanist-SemiBold\] {
  font-family: 'Urbanist', sans-serif;
  font-weight: 600;
}

/* Line height utilities to match original */
.leading-snug {
  line-height: 1.375;
}

.leading-relaxed {
  line-height: 1.625;
}

.leading-tight {
  line-height: 1.25;
}

/* Ensure hero image displays properly */
img[src*="incio.jpg"] {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Hide mobile hero image on desktop */
.hero-mobile-image {
  display: block;
}

@media (min-width: 1024px) {
  .hero-mobile-image {
    display: none !important;
  }
}

.title-card {
  margin: 0;
}

/* Full-screen hero video section */
.hero-video-section {
  min-height: 100vh;
}

.hero-video-section video {
  pointer-events: none;
}

.abv-home-hero-content {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.hero-background-video {
  display: block;
}

.abv-home-hero-content {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.abv-home-hero-intro {
  width: 100%;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.abv-home-hero-title {
  max-width: 100%;
  font-size: clamp(2.15rem, 10vw, 3.5rem);
  line-height: 0.95;
  word-break: normal;
  overflow-wrap: anywhere;
}

.abv-home-hero-copy {
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.abv-home-hero-cta {
  width: 100%;
  max-width: 18rem;
  margin-left: auto;
  margin-right: auto;
}

.abv-home-hero-schedule {
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .abv-home-hero-intro,
  .abv-home-hero-copy,
  .abv-home-hero-schedule {
    max-width: 42rem;
  }

  .abv-home-hero-cta {
    width: auto;
    max-width: none;
  }

  .abv-home-hero-title {
    font-size: clamp(3.5rem, 7vw, 5rem);
    line-height: 1;
    overflow-wrap: normal;
  }
}

/* Floating WhatsApp button */
.abv-whatsapp-button {
  position: fixed;
  right: 1.5rem;
  bottom: 2rem;
  z-index: 40;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: #22c55e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
  border: 3px solid #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.abv-whatsapp-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  background-color: #16a34a;
}

.abv-whatsapp-icon {
  font-size: 1.5rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .abv-whatsapp-button {
    width: 2.75rem;
    height: 2.75rem;
    right: 1.25rem;
    bottom: 1.5rem;
  }
}

.form-button {
  background: transparent !important;
  border:0 !important
}

/* Confissão de Fé - h2 headers with half border bottom */
.abv-confissao-h2 {
  position: relative;
}

.abv-confissao-h2::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 15%;
  height: 2px;
  background-color: #1f2937; /* border-gray-800 */
}

/* Dropdown menu styles */
.menu-item-has-dropdown {
  position: relative;
}

.abv-dropdown-menu {
  position: absolute;
  top: 120%;
  left: 0;
  min-width: 200px;
  background-color: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 50;
  list-style: none;
  overflow: hidden;
}

.menu-item-has-dropdown:hover .abv-dropdown-menu,
.menu-item-has-dropdown.active .abv-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.abv-dropdown-menu li {
  margin: 0;
}

.abv-dropdown-menu li:first-child > a {
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}

.abv-dropdown-menu li:last-child > a {
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

.current-menu-item > a,
.current_page_item > a,
.current-menu-ancestor > a,
.current-page-ancestor > a {
  border-color: currentColor;
}

.abv-main-nav a[aria-expanded="true"] {
  border-color: currentColor;
}

.abv-footer-nav {
  text-align: right;
}

.abv-footer-nav a {
  display: inline-block;
}

.abv-footer-ministries {
  margin-top: 8rem !important;
}

.prose {
  color: #1f2937;
}

.prose p,
.prose li {
  font-family: "Urbanist", sans-serif;
  line-height: 1.75;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose a {
  color: #365A88;
  text-decoration: underline;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-form label {
  flex: 1 1 16rem;
}

.search-form .search-field {
  width: 100%;
  min-height: 3rem;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding: 0.75rem 1rem;
  font-family: "Urbanist", sans-serif;
  color: #111827;
  background-color: #ffffff;
}

.search-form .search-submit {
  min-height: 3rem;
  border: 0;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-family: "Urbanist", sans-serif;
  font-weight: 700;
  color: #ffffff;
  background-color: #365a88;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.search-form .search-submit:hover,
.search-form .search-submit:focus-visible {
  background-color: #294366;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .abv-dropdown-menu {
    position: static;
    box-shadow: none;
    padding: 0;
    margin-top: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

  .menu-item-has-dropdown.active .abv-dropdown-menu {
    display: block;
  }

  .abv-home-hero-content {
    padding-bottom: 5rem;
  }
}

@media (min-width: 1024px) {
  .abv-footer-ministries {
    margin-top: 17.5rem !important;
  }

  .abv-footer-nav {
    text-align: right;
  }
}

@supports (-webkit-touch-callout: none) {
  .abv-mobile-menu-overlay {
    min-height: -webkit-fill-available;
  }

  .abv-mobile-menu-overlay > div {
    min-height: -webkit-fill-available;
  }
}

/* Dropdown icon + wiggle animation */
.abv-dropdown-icon svg {
  transition: transform 0.2s ease;
}

.menu-item-has-dropdown.active .abv-dropdown-icon svg {
  transform: rotate(180deg);
}

@keyframes abv-wiggle {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-1px);
  }
  50% {
    transform: translateY(1px);
  }
  75% {
    transform: translateY(-1px);
  }
}

.abv-dropdown-toggle:hover .abv-dropdown-icon svg {
  animation: abv-wiggle 0.4s ease-in-out;
}

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