/*
Theme Name: Clínica Evoluir
Theme URI: https://clinicaevoluir.pt
Author: Rui Fox
Author URI: https://clinicaevoluir.pt
Description: Tema personalizado para Clínica Evoluir
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: clinica-evoluir
Tags: clinica, medicina, saude, responsive, accessibility-ready
*/

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

body {
  font-family:
    'Poppins',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  overflow-x: hidden;
}

:root {
  --color-text: #333;
  --color-text-muted: #555;
  --color-heading: #222;
  --color-primary: #7db83a;
  --color-primary-dark: #6da030;
  --color-primary-deep: #366600;
  --color-primary-light: #9cd65c;
  --color-bg-light: #f2f5ee;
  --color-white: #fff;
  --color-border-light: #e9ecef;
  --color-border-dark: #3a3a3a;
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f5f5f5;
  --color-gray-200: #f0f0f0;
  --color-gray-300: #e0e0e0;
  --color-gray-400: #b0b0b0;
  --color-gray-600: #666;
  --color-gray-900: #2c2c2c;
  --color-gray-950: #1a1a1a;
  --color-input-border: #ddd;
  --color-link: #0073aa;
  --color-link-dark: #005a87;
  --color-success: #46b450;
  --color-success-bg: #f0f9f0;
  --color-error: #dc3232;
  --color-error-bg: #fff0f0;
}

/* Global Button Styles */
button,
.btn,
.button,
input[type='submit'],
input[type='button'],
.wp-block-button__link,
.header-cta-btn,
.fixed-cta-btn,
.hero-button,
a[class*='-button'],
a[class*='-btn'] {
  border-radius: 30px !important;
  padding: 5px 1.5em !important;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Offset anchor targets to account for sticky header */
section[id],
div[id] {
  scroll-margin-top: 100px;
}

/* Top Bar */
.top-bar {
  background: var(--color-primary-deep);
  border-bottom: 1px solid var(--color-border-light);
  padding: 5px 0;
  font-size: 16px;
  color: white;
}

.top-bar-content {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.top-bar-phone,
.top-bar-whatsapp,
.schedule-toggle,
.top-bar-address {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 15px;
}

.top-bar-phone:hover {
  color: var(--color-primary);
}

.top-bar-whatsapp:hover {
  color: #25d366;
}

.top-bar-phone svg,
.top-bar-whatsapp svg,
.schedule-toggle svg,
.top-bar-address svg {
  flex-shrink: 0;
}

/* Phone / Tel sub-label */
.top-bar-phones-wrapper {
  position: relative;
}

.phones-toggle {
  display: none;
}

.top-bar-phones {
  display: flex;
  gap: 16px;
  align-items: center;
}

.top-bar-contact-group {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.top-bar-contact-number {
  font-size: 13px;
}

.top-bar-contact-label {
  font-size: 9px;
  opacity: 0.7;
  white-space: nowrap;
}

.entry-title {
  padding-top: 50px;
}

/* Schedule dropdown */
.top-bar-schedule {
  position: relative;
}

.schedule-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.schedule-toggle:hover {
  color: var(--color-primary);
}

.schedule-chevron {
  transition: transform 0.3s;
  flex-shrink: 0;
}

.top-bar-schedule.is-open .schedule-chevron {
  transform: rotate(180deg);
}

.schedule-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 320px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 200;
  font-weight: 400;
}

.schedule-dropdown.is-open {
  display: block;
  transform: translateX(-9vw);
}

.schedule-dropdown p {
  margin: 4px 0;
  white-space: nowrap;
  color: black;
}

/* Main Header */
.main-header {
  padding: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* Logo */
.site-branding {
  flex-shrink: 0;
}

.site-branding img,
.custom-logo-link img {
  max-height: 115px;
  width: auto;
  display: block;
}

.site-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
}

/* Navigation */
.main-navigation {
  flex-grow: 1;
}

/* Hamburger button — hidden on desktop */
.menu-toggle {
  display: none;
}

/* ─── Mobile Nav Drawer ──────────────────────────────────── */
.mobile-nav-drawer {
  display: none;
}

/* Backdrop */
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.nav-open .mobile-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.main-navigation li {
  margin: 0;
}

.main-navigation a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.3s;
  position: relative;
}

.main-navigation a:hover,
.main-navigation a:focus,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
  color: var(--color-primary);
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after {
  width: 100%;
}

/* Social Icons */
.header-social-icons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: color 0.25s;
  line-height: 1;
}

.header-social-icon:hover {
  color: var(--color-primary);
}

/* CTA Button */
.header-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-cta-btn:hover {
  background: var(--color-primary-deep);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(125, 184, 58, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
  .header-content {
    gap: 20px;
  }

  .main-navigation ul {
    gap: 20px;
  }

  .main-navigation a {
    font-size: 14px;
  }

  .header-cta-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .top-bar-content {
    font-size: 12px;
    gap: 15px;
  }

  .top-bar-address {
    display: none;
  }

  .header-content {
    flex-wrap: nowrap;
    align-items: center;
  }

  /* Hide desktop nav elements on mobile */
  .main-navigation,
  .header-social-icons {
    display: none;
  }

  /* Push CTA + hamburger to the right */
  .site-branding {
    flex: 1;
  }

  /* Hide CTA in header on mobile — only shown inside drawer */
  .header-content .header-cta-btn {
    display: none;
  }

  /* Hamburger button */
  .menu-toggle {
    order: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: 8px;
    flex-shrink: 0;
    border-radius: 30px;
    transition:
      background 0.2s,
      box-shadow 0.2s;
  }

  .menu-toggle:hover {
    background: var(--color-primary-deep);
    box-shadow: 0 4px 12px rgba(125, 184, 58, 0.3);
  }

  .hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition:
      transform 0.3s ease,
      opacity 0.3s ease,
      width 0.3s ease;
    transform-origin: center;
  }

  .menu-toggle.is-active .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.is-active .hamburger-bar:nth-child(2) {
    opacity: 0;
    width: 0;
  }

  .menu-toggle.is-active .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Mobile Nav Drawer */
  .mobile-nav-drawer {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 85vw);
    height: 100dvh;
    background: var(--color-white, #fff);
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav-drawer.is-open {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    display: block;
  }

  .mobile-nav-inner {
    display: flex;
    flex-direction: column;
    padding: 24px 24px 40px;
    min-height: 100%;
  }

  .mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 44px;
    height: 44px;
    background: var(--color-gray-100, #f0f0f0);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text, #333);
    transition: background 0.2s;
    flex-shrink: 0;
    margin-bottom: 32px;
  }

  .mobile-nav-close:hover {
    background: var(--color-gray-200, #e0e0e0);
  }

  /* Mobile nav links */
  .mobile-nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .mobile-nav-menu li {
    border-bottom: 1px solid var(--color-border-light, #f0f0f0);
  }

  .mobile-nav-menu a {
    display: flex;
    align-items: center;
    padding: 16px 4px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text, #333);
    text-decoration: none;
    transition:
      color 0.2s,
      padding-left 0.2s;
    min-height: 52px;
  }

  .mobile-nav-menu a:hover,
  .mobile-nav-menu .current-menu-item > a,
  .mobile-nav-menu .current_page_item > a {
    color: var(--color-primary);
    padding-left: 8px;
  }

  /* Social icons in drawer */
  .mobile-nav-socials {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 32px;
    flex-wrap: wrap;
  }

  .mobile-nav-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-gray-100, #f0f0f0);
    color: var(--color-text, #333);
    transition:
      background 0.2s,
      color 0.2s;
    text-decoration: none;
  }

  .mobile-nav-social-icon:hover {
    background: var(--color-primary);
    color: #fff;
  }

  /* CTA in drawer */
  .mobile-nav-cta {
    display: block;
    text-align: center;
    margin-top: 16px;
  }

  body.nav-open {
    overflow: hidden;
  }

  /* Phones dropdown — mobile */
  .phones-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
  }

  .phones-toggle:hover {
    color: var(--color-primary);
  }

  .phones-chevron {
    transition: transform 0.3s;
    flex-shrink: 0;
  }

  .top-bar-phones-wrapper.is-open .phones-chevron {
    transform: rotate(180deg);
  }

  .top-bar-phones {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border-light, #e5e7eb);
    border-radius: 12px;
    padding: 8px;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 200;
    flex-direction: column;
    gap: 4px;
  }

  .top-bar-phones-wrapper.is-open .top-bar-phones {
    display: flex;
  }

  .top-bar-phones .top-bar-phone,
  .top-bar-phones .top-bar-whatsapp {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--color-gray-50, #f8f9fa);
    color: var(--color-text, #333);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
    min-height: 48px;
  }

  .top-bar-phones .top-bar-phone:hover,
  .top-bar-phones .top-bar-whatsapp:hover {
    background: var(--color-gray-100, #f0f0f0);
    color: var(--color-primary);
  }

  .top-bar-phones .top-bar-whatsapp:hover {
    color: #25d366;
  }

  .top-bar-phones .top-bar-contact-number {
    font-size: 14px;
    font-weight: 600;
  }

  .top-bar-phones .top-bar-contact-label {
    font-size: 11px;
    opacity: 0.65;
  }
}

/* Content */
.site-content {
  min-height: 60vh;
}

.error404 .site-content {
  display: flex;
  align-items: center;
}

.error404 .site-content .container {
  width: 100%;
}

.error-404 {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  padding: 48px 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.error-404 .page-title {
  color: var(--color-primary-deep);
  font-size: 40px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.error-404 .page-content p {
  color: var(--color-text-muted);
  max-width: 56ch;
  margin: 0 auto 24px;
}

.error-404-actions {
  margin-bottom: 28px;
}

.error-404 .search-form {
  max-width: 540px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .error404 .site-content {
    min-height: auto;
    padding: 40px 0;
  }

  .error-404 {
    padding: 32px 20px;
  }

  .error-404 .page-title {
    font-size: 32px;
  }
}

/* Footer */
.footer-main {
  padding: 60px 0 40px;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-column-title {
  color: var(--color-primary-deep);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px 0;
}

/* Footer Brand Column */
.footer-brand .custom-logo-link img {
  width: auto;
  margin-bottom: 15px;
}

.footer-title {
  margin: 0 0 15px 0;
  font-size: 24px;
}

.footer-title a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

.footer-description {
  color: var(--color-gray-900);
  line-height: 1.6;
  font-weight: 500;
  margin: 0;
}

/* Footer Contact Column */
.footer-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 15px;
  color: var(--color-gray-600);
}

.footer-contact-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-primary);
}

.footer-contact-item a {
  color: var(--color-gray-600);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-contact-item a:hover {
  color: var(--color-gray-600);
}

/* Footer Links Column */
.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-menu li {
  margin-bottom: 12px;
}

.footer-menu a {
  color: var(--color-gray-600);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s;
  display: inline-flex;
  align-items: center;
}

.footer-menu a:hover {
  color: var(--color-primary);
}

.footer-menu a::before {
  content: '›';
  margin-right: 8px;
  color: var(--color-primary);
  font-weight: bold;
}

/* Footer Legal Column */
.footer-legal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-legal-list li {
  color: var(--color-gray-600);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* Footer Bottom */
.footer-bottom {
  background: var(--color-gray-950);
  padding: 20px 0;
  border-top: 1px solid var(--color-border-dark);
}

.site-info {
  text-align: center;
  margin: 0;
}

.site-info p {
  margin: 0;
  color: var(--color-gray-400);
  font-size: 14px;
}

.site-info a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s;
}

.site-info a:hover {
  color: var(--color-primary-light);
}

/* Fixed CTA & Go To Top */
.fixed-cta-btn {
  position: fixed;
  right: 20px;
  bottom: 90px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(125, 184, 58, 0.3);
  z-index: 1001;
}

.fixed-cta-btn:hover,
.fixed-cta-btn:focus {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(125, 184, 58, 0.35);
}

.go-top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50% !important;
  padding: 0 !important;
  border: none;
  background: var(--color-gray-950);
  color: var(--color-white);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.3s ease;
  z-index: 1001;
}

.go-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.go-top-btn:hover,
.go-top-btn:focus {
  background: var(--color-gray-900);
}

@media (max-width: 768px) {
  .fixed-cta-btn {
    right: 15px;
    bottom: 80px;
    padding: 10px 20px;
    font-size: 14px;
  }

  .go-top-btn {
    right: 15px;
    bottom: 15px;
    width: 44px;
    height: 44px;
  }
}

/* Footer Responsive */
@media (max-width: 1024px) {
  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .footer-main {
    padding: 40px 0 30px;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-brand {
    grid-column: auto;
    text-align: center;
  }

  .footer-brand .custom-logo-link {
    display: inline-block;
  }

  .footer-contact-list,
  .footer-menu {
    text-align: left;
  }
}

/* Accessibility */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}
