/* =========================================================
   CLINICARE — Página da Clínica: melhorias
   FICHEIRO NOVO: não substitui o clinica-melhorias.css.
   Carregar no clinica.html DEPOIS do clinica-melhorias.css:
   <link rel="stylesheet" href="../assets/css/clinica-extras.css">
   ========================================================= */

/* ---------- 0. Menu fixo no topo (o body com overflow hidden quebrava o position:sticky) ---------- */
html { overflow-x: hidden; scroll-padding-top: 90px; }
body { overflow-x: clip; }

/* =========================================================
   1. BANNER — telemóvel
      ALTURA: um pouco acima da do site (style.css: 440/400/360px) para a
      fotografia da clínica se ver: 530px (≤768), 490px (≤575), 450px (≤399). Fotografia a toda a largura, a dissolver-se no
      azul escuro, com o texto ancorado em baixo.
   ========================================================= */
@media (max-width: 768px) {
  body .clinic-banner {
    height: 530px !important; min-height: 530px !important; max-height: 530px !important;
    position: relative; display: flex !important; flex-direction: column; justify-content: flex-end;
    margin-bottom: 28px; background: #0a2f52 !important; box-shadow: none; overflow: hidden;
  }
  /* fotografia só na parte de cima (como nas outras páginas), a dissolver-se no azul sólido onde fica o texto */
  body .clinic-banner::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 62%; z-index: 0;
    background: url("../../images/banner-clinica.webp") 74% 32% / cover no-repeat;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
  }
  /* película azul da marca no topo: tira o cinzento do céu e dá profundidade */
  body .clinic-banner::after {
    content: ""; display: block !important; position: absolute; inset: 0; height: auto; z-index: 1; pointer-events: none;
    background: linear-gradient(to bottom, rgba(10,47,82,.42) 0%, rgba(10,47,82,.16) 26%, rgba(10,47,82,0) 48%);
  }
  body .clinic-banner .clinic-banner-overlay { display: none !important; }

  body .clinic-banner .clinic-banner-content {
    position: relative; z-index: 2; display: block !important; width: 100% !important; max-width: none !important;
    height: auto !important; margin: 0 !important; padding: 0 1.25rem 1.4rem !important; box-sizing: border-box;
  }
  body .clinic-banner .clinic-banner-text { width: 100% !important; max-width: none !important; padding: 0 !important; }

  /* etiqueta em pílula, com escudo */
  body .clinic-banner .clinic-banner-badge {
    display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .7rem; padding: .4rem .95rem;
    border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(255,255,255,.08);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: #fff; font-size: .64rem; font-weight: 800; letter-spacing: .2em; white-space: nowrap;
  }
  body .clinic-banner .clinic-banner-badge i { display: inline-block; color: #8fd8ff; font-size: .75rem; }

  /* título em duas linhas: "Sobre a Nossa" branco + "Clínica" azul-claro */
  body .clinic-banner .clinic-title {
    max-width: none; margin: 0 0 .85rem; color: #fff !important; font-size: clamp(1.5rem, 7vw, 2.05rem);
    font-weight: 800; line-height: 1.03; letter-spacing: -.025em; text-shadow: none;
  }
  body .clinic-banner .clinic-title span { display: block; white-space: normal; }
  body .clinic-banner .clinic-title .highlight { color: #8fd8ff !important; }
  body .clinic-banner .clinic-title::after {
    width: 72px; height: 3px; margin-top: .75rem; background: linear-gradient(90deg, #58c2ff, #fff); box-shadow: 0 2px 12px rgba(88,194,255,.35);
  }

  body .clinic-banner .clinic-banner-text p {
    max-width: 34rem; margin: 0; color: #e3eefa !important; font-size: clamp(.84rem, 3.7vw, .98rem); line-height: 1.5; text-shadow: none;
  }

  /* botão "Agendar Consulta": pílula branca premium */
  body .clinic-banner .clinic-banner-text .clinic-banner-cta {
    position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    width: auto; min-height: 40px; margin-top: .95rem; padding: 0 1.1rem 0 .7rem;
    border: 1px solid rgba(255,255,255,.9); border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #eef5fb 100%); color: #0a3d63 !important;
    font-size: .85rem; font-weight: 800; letter-spacing: .005em; white-space: nowrap; text-decoration: none;
    box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 10px 22px -8px rgba(0,0,0,.5), 0 0 0 4px rgba(255,255,255,.08);
    transition: transform .25s ease, box-shadow .25s ease;
    -webkit-tap-highlight-color: transparent;
  }
  body .clinic-banner .clinic-banner-cta i {
    display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
    background: #dcecf9; color: #0a62b0; font-size: .7rem;
  }
  /* brilho que passa devagar, de vez em quando */
  body .clinic-banner .clinic-banner-cta::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.95), transparent); transform: skewX(-18deg);
    animation: clCtaSheen 5.5s ease-in-out 1.5s infinite; z-index: 0; opacity: .7;
  }
  body .clinic-banner .clinic-banner-cta > * { position: relative; z-index: 1; }
  body .clinic-banner .clinic-banner-cta:active { transform: scale(.98); }
  body .clinic-banner .clinic-banner-cta:focus-visible { outline: 3px solid #8fd8ff; outline-offset: 3px; }
}
@keyframes clCtaSheen { 0%, 62% { left: -40%; } 100% { left: 130%; } }
@media (hover: hover) and (max-width: 768px) {
  body .clinic-banner .clinic-banner-cta:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 20px 38px -8px rgba(0,0,0,.55), 0 0 0 5px rgba(255,255,255,.12); }
}
/* ecrãs muito pequenos (banner de 360px): um pouco mais compacto, para a fotografia continuar a aparecer */
@media (max-width: 399px) {
  body .clinic-banner .clinic-banner-content { padding-bottom: 1.1rem !important; }
  body .clinic-banner .clinic-banner-badge { margin-bottom: .55rem; padding: .32rem .8rem; font-size: .58rem; }
  body .clinic-banner .clinic-title { margin-bottom: .65rem; font-size: clamp(1.4rem, 6.8vw, 1.7rem); }
  body .clinic-banner .clinic-title::after { margin-top: .6rem; }
  body .clinic-banner .clinic-banner-text .clinic-banner-cta { min-height: 38px; margin-top: .8rem; font-size: .82rem; }
}
@media (max-width: 575px) {
  body .clinic-banner { height: 490px !important; min-height: 490px !important; max-height: 490px !important; }
  body .clinic-banner .clinic-banner-text p { display: none; }   /* liberta espaço: a fotografia continua a aparecer em cima */
  body .clinic-banner .clinic-title::after { margin-bottom: .1rem; }
}
@media (max-width: 399px) {
  body .clinic-banner { height: 450px !important; min-height: 450px !important; max-height: 450px !important; }
}
@media (prefers-reduced-motion: reduce) {
  body .clinic-banner .clinic-banner-cta::after { animation: none; display: none; }
}

/* =========================================================
   2. VÍDEO — proporção fixa no telemóvel, play maior e com pulso
   ========================================================= */
.clinica-video-overlay {
  background: linear-gradient(to top, rgba(6,20,38,.62), rgba(6,20,38,0) 58%), rgba(9,67,125,.2);
}
.clinica-video-play { animation: clPlayPulse 2.4s ease-out infinite; }
.clinica-video-play:hover, .clinica-video-play:focus-visible { animation-play-state: paused; }
.clinica-video-play:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
@keyframes clPlayPulse {
  0%   { box-shadow: 0 10px 30px rgba(0,0,0,.28), 0 0 0 0 rgba(255,255,255,.55); }
  70%  { box-shadow: 0 10px 30px rgba(0,0,0,.28), 0 0 0 24px rgba(255,255,255,0); }
  100% { box-shadow: 0 10px 30px rgba(0,0,0,.28), 0 0 0 0 rgba(255,255,255,0); }
}
@media (max-width: 768px) {
  body .clinica-video { height: auto !important; aspect-ratio: 16 / 11; min-height: 230px; border-radius: 20px; }
  body .clinica-video-play { width: 76px; height: 76px; font-size: 1.6rem; }
  body .clinica-video-title {
    left: 1.1rem; right: 1.1rem; bottom: 1.1rem; font-size: 1rem; line-height: 1.3;
  }
}

/* =========================================================
   3. SOBRE NÓS (telemóvel) — Missão e Visão sempre visíveis
      Ordem: texto → "Mais Detalhes" → Missão → Visão.
      O botão só abre/fecha o 2.º parágrafo; os cartões nunca somem.
      (a faixa de números e as unidades ficam como estão: não se mexe)
   ========================================================= */
@media (max-width: 768px) {
  body .clinica-text { display: flex; flex-direction: column; }
  body .clinica-text > .clinica-eyebrow { order: 1; }
  body .clinica-text > .clinica-heading { order: 2; }
  body .clinica-text > p:first-of-type  { order: 3; }

  /* o contentor deixa de contar como caixa: o parágrafo e os cartões passam a ser filhos diretos */
  body .clinica-text .detalhes { display: contents !important; }
  body .clinica-text .detalhes > p { order: 4; display: none; margin: 0; }
  body .clinica-text .detalhes.active > p { display: block; margin: 1.1rem 0 0; animation: fade .3s ease; }

  body .clinica-text .toggle-btn { order: 5; width: 100%; min-height: 52px; margin: 1.4rem 0 0; }
  body .clinica-text .toggle-btn:focus-visible { outline: 3px solid #25a7e0; outline-offset: 3px; }

  body .clinica-text .clinica-cards {
    order: 6; display: grid !important; grid-template-columns: 1fr; gap: 1rem; margin: 1.8rem 0 0;
  }

  /* 1.º parágrafo: curto quando fechado, completo quando aberto */
  body .clinica-text.is-expanded > p:first-of-type {
    display: block; -webkit-line-clamp: unset; overflow: visible;
  }

  /* MESMO tamanho, fonte e entrelinha em todos os textos desta secção */
  body .clinica-text > p,
  body .clinica-text .detalhes > p,
  body .clinica-text .clinica-card p {
    font-family: inherit; font-size: clamp(.92rem, 3.9vw, 1.02rem); font-weight: 400; line-height: 1.7;
    letter-spacing: 0; text-align: left; hyphens: manual; text-wrap: pretty;
  }
  body .clinica-text .clinica-card h3 { font-family: inherit; }
}

/* =========================================================
   3b. FAIXA DE NÚMEROS — banda azul com ícones em círculo
       (43 · 300K+ · 2 · 24h). Estes estilos não existiam no clinica.css.
   ========================================================= */
.cl-stats {
  width: 100%; padding: 4.5rem 2rem; color: #fff;
  background: radial-gradient(900px 380px at 12% 0%, rgba(37,167,224,.22), transparent 60%),
              linear-gradient(135deg, #0a3d63 0%, #0b5a92 100%);
}
.cl-stats .cl-stats-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 0; max-width: 1400px; margin: 0 auto;
}
.cl-stats .cl-stat {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: .6rem 1rem; text-align: center;
}
/* traço vertical entre colunas */
.cl-stats .cl-stat::before {
  content: ""; display: none; position: absolute; left: 0; top: 50%; width: 1px; height: 78%;
  transform: translateY(-50%); background: linear-gradient(to bottom, transparent, rgba(255,255,255,.3) 20%, rgba(255,255,255,.3) 80%, transparent);
}
.cl-stats .cl-stat:not(:first-child)::before { display: block; }
.cl-stats .cl-stat > i {
  display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: .5rem; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #8fd8ff; font-size: 1.45rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.cl-stats .cl-stat-number {
  display: inline-block; color: #fff; font-size: clamp(2.4rem, 3.6vw, 3.4rem); font-weight: 800; line-height: 1;
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.cl-stats .cl-stat-label {
  color: #bfe6ff; font-size: .86rem; font-weight: 700; letter-spacing: .06em; line-height: 1.35; text-transform: uppercase; text-wrap: balance;
}
/* entrada: só se o JS correr (clinica.js põe .cl-js e depois .is-in) */
.cl-stats.cl-js .cl-stat { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; transition-delay: var(--d, 0ms); }
.cl-stats.cl-js.is-in .cl-stat { opacity: 1; transform: none; }

@media (max-width: 768px) {
  .cl-stats { padding: 3rem 1rem; }
  .cl-stats .cl-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem 0; }
  .cl-stats .cl-stat:not(:first-child)::before { display: none; }
  .cl-stats .cl-stat:nth-child(even)::before { display: block; }
  .cl-stats .cl-stat > i { width: 58px; height: 58px; font-size: 1.25rem; }
  .cl-stats .cl-stat-number { font-size: clamp(2.2rem, 10vw, 2.9rem); }
  .cl-stats .cl-stat-label { font-size: .74rem; letter-spacing: .05em; }
}

/* =========================================================
   3c. UNIDADES — botões Ligar / Como chegar / Ver todos os contactos
   ========================================================= */
.unit-card p, .unit-value { text-align: left; }   /* o justificado abria buracos entre palavras */
/* cartão em coluna: os botões ficam sempre alinhados em baixo nas duas unidades */
.unit-card { display: flex; flex-direction: column; }
.unit-card .unit-body { display: flex; flex: 1; flex-direction: column; }
.unit-card .unit-details { margin-bottom: 1.8rem; }

/* botões: iguais no computador e no telemóvel — Ligar | Como chegar, e o link centrado por baixo */
.unit-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin-top: auto; }
.unit-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-width: 0; min-height: 56px; padding: 0 1.2rem;
  border: 2px solid #0a62b0; border-radius: 18px; background: #fff; color: #0a5aa0; text-decoration: none;
  font-size: 1rem; font-weight: 750; line-height: 1; transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.unit-btn i { font-size: .95rem; }
.unit-btn:hover { background: #f0f7fd; transform: translateY(-2px); }
.unit-btn-primary {
  border-color: transparent; background: linear-gradient(135deg, #005eb8, #087fc0); color: #fff;
  box-shadow: 0 12px 26px rgba(0,89,179,.24);
}
.unit-btn-primary:hover { background: linear-gradient(135deg, #0055a8, #006fac); box-shadow: 0 16px 32px rgba(0,89,179,.32); }
.unit-link {
  grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; margin-top: .55rem;
  color: #0a5aa0; text-decoration: none; font-size: 1rem; font-weight: 750;
}
.unit-link i { font-size: .8rem; transition: transform .25s ease; }
.unit-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.unit-link:hover i { transform: translateX(4px); }
.unit-btn:focus-visible, .unit-link:focus-visible { outline: 3px solid #25a7e0; outline-offset: 3px; }

@media (max-width: 768px) {
  .unit-actions { gap: .75rem; }
  .unit-btn { min-height: 52px; padding: 0 1rem; font-size: .95rem; }
}

/* =========================================================
   4. TOQUE PREMIUM — detalhes discretos (todos os tamanhos)
   ========================================================= */
.clinica-heading, .units-header h2 { text-wrap: balance; }
.toggle-btn, .clinica-card, .unit-card, .clinica-video-play { -webkit-tap-highlight-color: transparent; }
.toggle-btn:focus-visible, .unit-card a:focus-visible, .unit-card button:focus-visible {
  outline: 3px solid #25a7e0; outline-offset: 3px;
}

/* entrada suave dos blocos ao rolar (só se o JS correr; respeita "reduzir movimento") */
.cl-reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--rv, 0ms); }
.cl-reveal.cl-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .clinica-video-play { animation: none; }
  .cl-reveal { opacity: 1; transform: none; transition: none; }
  body .clinica-text .detalhes.active > p { animation: none; }
}
