/* =========================================================
   Costa Brava Rent — main stylesheet
   ========================================================= */
:root {
  --green: #0e7c66;
  --green-dark: #0a5f4e;
  --green-light: #0e9c7f;
  --whatsapp: #25d366;
  --whatsapp-dark: #1da851;
  --ink: #16211f;
  --muted: #5c6b68;
  --line: #e4e9e7;
  --bg: #ffffff;
  --bg-soft: #f4f8f6;
  --sand: #fdf7ee;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(14, 124, 102, 0.10);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.06);
  --maxw: 1160px;
  --font-head: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--ink); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.container-wide { max-width: 1240px; }
.site-main { min-height: 60vh; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; box-shadow: 0 6px 18px rgba(37, 211, 102, .35); }
.btn-whatsapp:hover { background: var(--whatsapp-dark); color: #fff; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-outline { background: transparent; border-color: #fff; color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.14); color:#fff; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); border-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-accent { color: var(--green); }
.brand-name { white-space: nowrap; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.main-nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink); font-weight: 500; font-size: 15px; }
.main-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.main-nav a.active { color: var(--green); background: var(--bg-soft); }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* Language switcher */
.lang-switcher { position: relative; }
.lang-current {
  display: inline-flex; align-items: center; gap: 4px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
  font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--ink); cursor: pointer;
}
.lang-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s ease;
}
.lang-switcher.open .lang-list { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-list a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-size: 14px; }
.lang-list a:hover { background: var(--bg-soft); text-decoration: none; }
.lang-list a.active { color: var(--green); font-weight: 600; }

/* Mobile toggle */
.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { border-top: 1px solid var(--line); background: #fff; padding: 16px 20px 24px; }
.mobile-menu ul { list-style: none; margin: 0 0 14px; padding: 0; }
.mobile-menu a { display: block; padding: 12px 4px; font-family: var(--font-head); font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,95,78,.92), rgba(14,156,127,.82)),
    url("/images/hero-costa-brava.webp") center/cover no-repeat;
}
.hero-inner { position: relative; padding: 96px 20px 88px; text-align: center; max-width: 860px; }
.hero-badge { display: inline-block; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600; margin-bottom: 22px; }
.hero-title { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 18px; color: #fff; letter-spacing: -.5px; }
.hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: rgba(255,255,255,.92); margin: 0 auto 32px; max-width: 640px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }
.hero-trust { display: flex; gap: 40px; justify-content: center; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.hero-trust li { display: flex; flex-direction: column; }
.hero-trust strong { font-family: var(--font-head); font-size: 1.9rem; color: #fff; }
.hero-trust span { font-size: 14px; color: rgba(255,255,255,.85); }

/* ---------- Sections ---------- */
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); text-align: center; margin: 0 0 12px; }
.features { padding: 84px 0; background: var(--bg); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 40px; }
.feature { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 26px; text-align: center; transition: transform .2s ease, box-shadow .2s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-num { width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.feature h3 { font-size: 1.15rem; margin: 0 0 10px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }

/* Latest posts */
.latest-posts { padding: 84px 0; background: var(--sand); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head .section-title { text-align: left; margin: 0; }
.link-arrow { font-family: var(--font-head); font-weight: 600; white-space: nowrap; }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

/* Post cards */
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.post-card-link { display: block; color: inherit; }
.post-card-link:hover { text-decoration: none; }
.post-card-media { position: relative; aspect-ratio: 3 / 2; background: var(--bg-soft); overflow: hidden; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card-media img { transform: scale(1.05); }
.post-card-media-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--green-light), var(--green)); }
.post-card-cat { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.95); color: var(--green-dark); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; text-transform: capitalize; }
.post-card-body { padding: 22px 22px 24px; }
.post-card-title { font-size: 1.2rem; margin: 0 0 10px; }
.post-card-excerpt { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.post-card-meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--green-dark), var(--green-light)); color: #fff; padding: 72px 0; }
.cta-inner { text-align: center; }
.cta-inner h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); max-width: 700px; margin: 0 auto 28px; }

/* ---------- Page hero ---------- */
.page-hero { background: var(--bg-soft); padding: 64px 0 48px; text-align: center; border-bottom: 1px solid var(--line); }
.page-title { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 12px; }
.page-sub { color: var(--muted); font-size: 1.1rem; max-width: 620px; margin: 0 auto; }
.list-section { padding: 56px 0 84px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Sidebar layout ---------- */
.list-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; align-items: start; }
.list-main .posts-grid { grid-template-columns: repeat(2, 1fr); }
.sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 26px; }
.sidebar-block { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.sidebar-title { font-size: 1.05rem; margin: 0 0 16px; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li + li { margin-top: 4px; }
.cat-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: 14px; }
.cat-list a:hover { background: #fff; color: var(--green); text-decoration: none; }
.cat-list .cat-name { text-transform: capitalize; }
.cat-list .count { flex-shrink: 0; background: #fff; color: var(--muted); font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-cloud-item { display: inline-block; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; line-height: 1.2; text-transform: capitalize; }
.tag-cloud-item:hover { color: #fff; background: var(--green); border-color: var(--green); text-decoration: none; }

@media (max-width: 980px) {
  .list-layout { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar-block { flex: 1 1 260px; }
}


/* ---------- Blog post ---------- */
.post { padding-bottom: 80px; }
.back-link { display: inline-block; margin: 32px 0 8px; font-weight: 500; font-size: 14px; }
.post-header { padding: 8px 0 28px; }
.post-cat { display: inline-block; background: var(--bg-soft); color: var(--green-dark); font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 999px; text-transform: capitalize; margin-bottom: 16px; }
.post-title { font-size: clamp(1.8rem, 4vw, 3rem); margin: 0 0 16px; letter-spacing: -.5px; }
.post-meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px; }
.post-hero-img { margin: 0 0 44px; }
.post-hero-img img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); max-height: 520px; object-fit: cover; }

/* Prose */
.prose { font-size: 1.08rem; }
.prose > * + * { margin-top: 1.35em; }
.prose h2 { font-size: 1.7rem; margin-top: 2em; }
.prose h3 { font-size: 1.35rem; margin-top: 1.6em; }
.prose img { border-radius: var(--radius); box-shadow: var(--shadow-sm); margin: 1.8em 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .5em; }
.prose blockquote { border-left: 4px solid var(--green); background: var(--bg-soft); padding: 16px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink); font-style: italic; margin: 1.8em 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }

.post-tags { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-tags > span { color: var(--muted); font-size: 14px; margin-right: 4px; }
.tag { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }
.tag:hover { text-decoration: none; color: var(--green); border-color: var(--green); }

.post-cta { margin-top: 52px; text-align: center; background: var(--sand); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 28px; }
.post-cta p { font-size: 1.15rem; margin: 0 0 22px; font-family: var(--font-head); font-weight: 500; }

.related { margin-top: 80px; }
.related .section-title { text-align: left; margin-bottom: 32px; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 56px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 600; }
.page-link:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.page-link.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d7e0dd; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding: 64px 20px 48px; }
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand .brand-accent { color: var(--green-light); }
.footer-brand p { color: #a9b8b4; max-width: 340px; margin: 0 0 22px; font-size: 15px; }
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: #a9b8b4; font-size: 15px; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-lang { margin-top: 18px; display: flex; gap: 10px; align-items: center; font-size: 14px; color: #7f8f8b; flex-wrap: wrap; }
.footer-lang a { border: 1px solid #33413d; padding: 3px 9px; border-radius: 6px; font-size: 12px; }
.footer-bottom { border-top: 1px solid #26332f; }
.footer-bottom .container { display: flex; align-items: center; justify-content: space-between; padding: 20px; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { margin: 0; font-size: 14px; color: #7f8f8b; }
.footer-bottom nav { display: flex; gap: 18px; }
.footer-bottom a { font-size: 14px; }

/* ---------- Floating WhatsApp ---------- */
.whatsapp-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--whatsapp); color: #fff; padding: 14px 20px 14px 16px;
  border-radius: 999px; box-shadow: 0 10px 26px rgba(37,211,102,.45);
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  transition: transform .2s ease, background .2s ease;
}
.whatsapp-float:hover { transform: scale(1.05); background: var(--whatsapp-dark); color: #fff; text-decoration: none; }
.whatsapp-float .icon { flex-shrink: 0; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(0,0,0,.16); padding: 20px 22px;
  opacity: 0; transform: translateY(20px); transition: opacity .3s ease, transform .3s ease;
  max-width: 760px; margin: 0 auto;
}
.cookie-banner.visible { opacity: 1; transform: translateY(0); }
.cookie-inner { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.cookie-text { margin: 0; font-size: 14px; color: var(--muted); flex: 1 1 340px; }
.cookie-text a { font-weight: 600; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .features-grid, .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  .main-nav { display: none; }
  .btn-whatsapp span { display: none; }
  .header-actions .btn-whatsapp { padding: 12px; }
  .nav-toggle { display: flex; }
  /* Adaptive logo on tablets/phones */
  .header-inner { gap: 12px; }
  .site-header .brand { gap: 8px; font-size: 18px; }
  .site-header .logo-mark { width: 30px; height: 30px; }
  /* Full-width blog cards on mobile (one per row) */
  .list-main .posts-grid { grid-template-columns: 1fr; }
  /* Big full-width WhatsApp button on mobile */
  .whatsapp-float {
    left: 16px; right: 16px; bottom: 16px;
    justify-content: center;
    padding: 17px 20px;
    font-size: 17px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(37,211,102,.5);
  }
  .whatsapp-float .icon { width: 24px; height: 24px; }
  .whatsapp-float-label { display: inline; }
  .whatsapp-float:hover { transform: none; }
  /* Keep the cookie banner clear of the button */
  .cookie-banner { bottom: 88px; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .features-grid, .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 72px 20px 64px; }
  .hero-trust { gap: 26px; }
  .site-header .brand { font-size: 16px; gap: 7px; }
  .site-header .logo-mark { width: 28px; height: 28px; }
  /* Compact cookie banner on mobile */
  .cookie-banner { left: 10px; right: 10px; bottom: 82px; padding: 12px 14px; border-radius: 12px; }
  .cookie-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .cookie-text {
    flex: none;
    font-size: 12.5px; line-height: 1.4; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
  }
  .cookie-actions { gap: 8px; }
  .cookie-actions .btn { flex: 1; justify-content: center; padding: 9px 14px; font-size: 14px; }
}
@media (max-width: 400px) {
  /* Very small phones: keep only the logo mark in the header */
  .site-header .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
