/* Cocopalm — WordPress additions on top of site.css (the approved design). */

/* Neutral placeholder until a photo is chosen in wp-admin */
.cocopalm-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(135deg, var(--sand), #cfc5b3);
}
.hero__media .cocopalm-placeholder,
.page-hero__media .cocopalm-placeholder,
.villa-hero__media .cocopalm-placeholder { background: linear-gradient(135deg, var(--aegean), var(--ink)); }
.location-grid__media .cocopalm-placeholder { position: absolute; inset: 0; }

/* Header logo */
.brand .custom-logo { display: block; }

/* Language switcher (Polylang / WPML) */
.header-actions .language-link + .language-link { margin-left: -.4rem; }

/* "Book direct" inside the menu only on mobile */
.primary-navigation .menu-book { display: none; }
@media (max-width: 1120px) {
  .primary-navigation { justify-self: stretch; width: 100%; }
  .primary-navigation .menu-book { display: block; margin-top: 1.5rem; }
  .primary-navigation .menu-book a {
    display: inline-flex;
    width: 100%;
    padding: .85rem 1.45rem;
    border-bottom: 0;
    font-family: var(--sans);
    font-size: .82rem;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
  }
  .primary-navigation .menu-book a:hover { color: #111b1f; }
}

/* WordPress admin bar offset for the mobile menu panel */
.admin-bar .primary-navigation { top: calc(var(--header-height) + 46px); }
@media (min-width: 783px) {
  .admin-bar .primary-navigation { top: calc(var(--header-height) + 32px); }
}
@media (min-width: 1121px) {
  .admin-bar .primary-navigation { top: auto; }
}

/* Gallery helpers */
.gallery-item[hidden] { display: none; }
.villa-row__media { display: block; }

/* Homepage gallery preview (from the design preview) */
.preview-gallery { background: #f4f1ea; }
.preview-gallery .gallery-grid { grid-template-columns: repeat(4, 1fr); }
.preview-gallery .gallery-item { min-height: 360px; aspect-ratio: auto; }
.preview-gallery .gallery-grid--masonry .gallery-item:nth-child(n) { grid-column: auto; grid-row: auto; }
.preview-gallery .gallery-item img { height: 100%; object-fit: cover; }
@media (max-width: 900px) {
  .preview-gallery .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .preview-gallery .gallery-item { min-height: 240px; }
}
@media (max-width: 640px) {
  .preview-gallery .gallery-grid { grid-template-columns: 1fr 1fr; }
  .preview-gallery .gallery-item { min-height: 180px; }
}

/* Single villa: booking button in the side column */
.article-grid aside .button { margin-top: 1rem; }

/* Footer extras */
.site-footer .eyebrow { color: var(--gold-light); }
.site-footer__title--spaced { margin-top: 2rem; }

/* Contact form select */
.form-field select {
  width: 100%;
  min-height: 52px;
  padding: .8rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}
.form-field select:focus { border-bottom-color: var(--gold); outline: 0; }
.contact-details li > span { min-width: 0; }

/* Page content from the block editor */
.prose img { margin: 2rem 0; }
.prose .wp-block-image figcaption { color: var(--muted); font-size: .85rem; }
.prose .alignwide { margin-inline: calc((min(1240px, 100vw - 48px) - 100%) / -2); }
.section--intro-tight { padding-bottom: 0; }

/* Pagination */
.pagination { margin-top: 3rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.pagination .page-numbers { display: inline-grid; min-width: 44px; height: 44px; place-items: center; padding: 0 .75rem; border: 1px solid var(--border); text-decoration: none; }
.pagination .page-numbers.current { background: var(--ink); color: var(--white); }

/* Villa facts: as many columns as there are facts */
@media (min-width: 1121px) {
  .villa-facts__grid { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; }
}

/* Page & villa heroes: darker on the text side so titles stay readable on bright photos */
.page-hero__veil, .villa-hero__veil {
  background:
    linear-gradient(90deg, rgba(5,18,24,.72) 0%, rgba(5,18,24,.32) 55%, rgba(5,18,24,.12) 100%),
    linear-gradient(0deg, rgba(5,18,24,.6), transparent 70%);
}
@media (max-width: 820px) {
  .page-hero__veil, .villa-hero__veil { background: linear-gradient(0deg, rgba(5,18,24,.82), rgba(5,18,24,.3) 85%); }
}
/* Turnstile widget spacing */
.contact-form .cf-turnstile { min-height: 65px; }
