/*
Theme Name: Casa de Fora
Theme URI: https://casadefora.pt
Author: Agilstore
Author URI: https://agilstore.pt
Description: Tema para o alojamento rural Casa de Fora — turismo rural nos montes do Minho, perto de Fafe.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Proprietary
Text Domain: casa-de-fora
*/

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --stone: #F4EFE4;
  --clay: #A9764E;
  --ink: #2B2620;
  --moss: #5C6B4C;
  --line: rgba(43, 38, 32, .12);
  --bg: #FBF8F2;
  --panel: var(--stone);
  --fg: var(--ink);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Work Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================
   HEADER & NAV
   ============================================================ */
header.site {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(251, 248, 242, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  max-width: 1120px;
  margin: 0 auto;
}

.logo {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  text-decoration: none;
}

.logo em {
  font-style: italic;
  color: var(--clay);
}

nav .links {
  display: none;
  gap: 28px;
  font-size: .92rem;
}

@media (min-width: 720px) {
  nav .links {
    display: flex;
  }
}

nav .links a {
  text-decoration: none;
  opacity: .8;
}

nav .links a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  background: var(--ink);
  color: #FBF8F2;
  padding: 12px 22px;
  border-radius: 2px;
  text-decoration: none;
  font-size: .92rem;
  border: 1px solid var(--ink);
  transition: background .2s ease, color .2s ease;
}

.btn:hover {
  background: transparent;
  color: var(--ink);
}

.btn-line {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 2px;
  text-decoration: none;
  font-size: .92rem;
  border: 1px solid var(--ink);
  transition: background .2s ease, color .2s ease;
}

.btn-line:hover {
  background: var(--ink);
  color: #FBF8F2;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 86vh;
  min-height: 560px;
  max-height: 820px;
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(20, 16, 10, .62) 0%,
    rgba(20, 16, 10, .15) 42%,
    rgba(20, 16, 10, .05) 60%,
    transparent 75%
  );
}

.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 28px 56px;
  max-width: 1120px;
  margin: 0 auto;
  color: #FBF8F2;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.08;
  max-width: 13ch;
}

.hero p.lede {
  margin-top: 18px;
  max-width: 42ch;
  font-size: 1.04rem;
  opacity: .92;
}

.hero .cta-row {
  margin-top: 28px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.hero .cta-row .sub {
  font-size: .86rem;
  opacity: .8;
}

.hero .btn {
  background: #FBF8F2;
  color: var(--ink);
  border-color: #FBF8F2;
}

.hero .btn:hover {
  background: transparent;
  color: #FBF8F2;
}

/* ============================================================
   SECTIONS — base
   ============================================================ */
section {
  padding: 88px 0;
}

.section-head {
  display: grid;
  gap: 10px;
  margin-bottom: 44px;
}

@media (min-width: 760px) {
  .section-head {
    grid-template-columns: 1.1fr .9fr;
    align-items: end;
    gap: 40px;
  }
}

.section-head p {
  opacity: .72;
  max-width: 46ch;
}

/* ============================================================
   INTRO
   ============================================================ */
.intro .wrap {
  display: grid;
  gap: 36px;
}

@media (min-width: 800px) {
  .intro .wrap {
    grid-template-columns: .85fr 1.15fr;
    align-items: center;
  }
}

.intro .stat {
  font-family: 'Fraunces', serif;
  font-size: 3.6rem;
  line-height: 1;
  color: var(--clay);
}

.intro .stat-label {
  margin-top: 10px;
  font-size: .94rem;
  opacity: .68;
  max-width: 24ch;
}

.intro .copy p {
  margin-bottom: 16px;
  max-width: 54ch;
  opacity: .9;
}

/* ============================================================
   FULL-BLEED IMAGE BAND
   ============================================================ */
.imgband {
  position: relative;
  height: 52vh;
  min-height: 340px;
  max-height: 520px;
}

/* ============================================================
   SPACES — linhas alternadas
   ============================================================ */
.space-row {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.space-row:last-child {
  border-bottom: 1px solid var(--line);
}

@media (min-width: 840px) {
  .space-row {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .space-row.rev {
    direction: rtl;
  }

  .space-row.rev > * {
    direction: ltr;
  }
}

.space-media {
  aspect-ratio: 6 / 5;
  overflow: hidden;
}

@media (min-width: 840px) {
  .space-media {
    aspect-ratio: auto;
    min-height: 420px;
  }
}

.space-copy {
  padding: 44px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 840px) {
  .space-copy {
    padding: 44px 60px;
  }
}

.space-copy .num {
  font-family: 'Fraunces', serif;
  font-style: italic;
  opacity: .4;
  font-size: 1rem;
  margin-bottom: 10px;
}

.space-copy h3 {
  font-size: 1.7rem;
  margin-bottom: 14px;
}

.space-copy p {
  opacity: .78;
  max-width: 42ch;
}

/* ============================================================
   AROUND — envolvente
   ============================================================ */
.around {
  background: var(--panel);
}

.around .wrap {
  display: grid;
  gap: 40px;
}

@media (min-width: 840px) {
  .around .wrap {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.around-media {
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border-radius: 2px;
}

.around ul {
  margin-top: 26px;
  display: grid;
  gap: 18px;
}

.around li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.around li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.around li .dist {
  font-family: 'Fraunces', serif;
  font-style: italic;
  opacity: .6;
  white-space: nowrap;
}

.around li h4 {
  font-size: 1.02rem;
  font-weight: 600;
  font-family: 'Work Sans', sans-serif;
}

.around li p {
  opacity: .72;
  font-size: .94rem;
  margin-top: 4px;
}

/* ============================================================
   REVIEWS
   ============================================================ */
.reviews-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .reviews-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
  }
}

blockquote {
  font-family: 'Fraunces', serif;
  font-size: 1.14rem;
  line-height: 1.5;
}

.review-meta {
  margin-top: 18px;
  font-size: .86rem;
  opacity: .62;
}

/* ============================================================
   GALLERY SLIDER (Swiper)
   ============================================================ */
.gallery-slider {
  width: 100%;
  overflow: hidden;
  background: var(--stone);
}

.cdf-gallery-swiper {
  padding-bottom: 52px;
  padding-left: 12px;
  padding-right: 12px;
}

.swiper-slide {
  height: auto;
}

.gallery-slide-inner {
  position: relative;
  width: 100%;
  /* Altura explícita via padding-bottom trick para garantir render correto */
  padding-bottom: 125%; /* ratio 4:5 = 80% → inverso = 125% */
  overflow: hidden;
}

.gallery-slide-inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.cdf-gallery-swiper .swiper-slide:not(.swiper-slide-active) .gallery-slide-inner img {
  transform: scale(.97);
}

.cdf-gallery-swiper .swiper-slide-active .gallery-slide-inner img {
  transform: scale(1);
}

.cdf-gallery-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  transform: scale(1.3);
}



/* Paginação — bullets com cor do tema */
.cdf-gallery-swiper .swiper-pagination-bullet {
  background: var(--clay);
  opacity: .35;
  width: 7px;
  height: 7px;
  transition: opacity .2s, transform .2s;
}

/* Setas — estilizadas com as cores do tema */
.cdf-gallery-prev,
.cdf-gallery-next {
  color: var(--clay);
  background: rgba(251, 248, 242, .85);
  border-radius: 50%;
  width: 42px !important;
  height: 42px !important;
  margin-top: calc(-42px / 2);
  transition: background .2s, color .2s;
}

.cdf-gallery-prev::after,
.cdf-gallery-next::after {
  font-size: .9rem !important;
  font-weight: 700;
}

.cdf-gallery-prev:hover,
.cdf-gallery-next:hover {
  background: var(--ink);
  color: #FBF8F2;
}

@media (max-width: 679px) {
  .cdf-gallery-prev,
  .cdf-gallery-next {
    display: none !important;
  }
}

/* ============================================================
   CTA BAND
   ============================================================ */
.cta-band {
  background: var(--ink);
  color: #FBF8F2;
}

.cta-band .wrap {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}

@media (min-width: 760px) {
  .cta-band .wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cta-band h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  max-width: 16ch;
  color: #FBF8F2;
}

.cta-band .btn {
  background: #FBF8F2;
  color: var(--ink);
  border-color: #FBF8F2;
  white-space: nowrap;
}

.cta-band .btn:hover {
  background: transparent;
  color: #FBF8F2;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--line);
}

footer .wrap {
  display: grid;
  gap: 34px;
}

@media (min-width: 760px) {
  footer .wrap {
    grid-template-columns: 1.3fr 1fr 1fr;
  }
}

footer h4 {
  font-size: .82rem;
  letter-spacing: .02em;
  opacity: .55;
  margin-bottom: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

footer p,
footer a {
  font-size: .92rem;
  opacity: .82;
  text-decoration: none;
}

footer .links {
  display: grid;
  gap: 10px;
}

.foot-bottom {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: .8rem;
  opacity: .55;
}
