/*
Theme Name: Ifach Grand Panorama
Theme URI: https://ifachgrandpanorama.com
Author: 
Author URI: 
Description: A one-page listing site for Ifach Grand Panorama, a boutique holiday apartment in Calpe, Costa Blanca, Spain.
Version: 1.0
Requires at least: 5.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ifach-grand-panorama
*/

:root{
  --ink:      #16283A;
  --ink-70:   rgba(22,40,58,.72);
  --ink-45:   rgba(22,40,58,.46);
  --paper:    #F6F1E7;
  --paper-2:  #EFE7D8;
  --sea:      #2E7C99;
  --sea-dark: #1E5A72;
  --gold:     #C9A15C;
  --line:     rgba(22,40,58,.14);
  --text-scale: 1;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

/* Invisible until a keyboard user tabs to it, then jumps above
   everything else so it's immediately visible and usable. */
.skip-link{
  position:absolute; top:-100px; left:12px; z-index:200;
  background:var(--ink); color:#fff; padding:12px 18px; border-radius:4px;
  font-size:calc(14px * var(--text-scale)); font-weight:600; text-decoration:none;
  transition:top .15s ease;
}
.skip-link:focus{ top:12px; }

/* :focus-visible shows a clear ring for keyboard navigation without
   adding one on every mouse click — matches the site's gold accent
   so it looks intentional rather than a generic browser default. */
a:focus-visible, button:focus-visible, input:focus-visible{
  outline:2px solid var(--gold); outline-offset:3px; border-radius:2px;
}

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'Work Sans', sans-serif;
  font-size:calc(16px * var(--text-scale));
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{
  font-family:'Fraunces', serif;
  font-weight:600;
  margin:0;
  letter-spacing:-0.01em;
}
a{ color:inherit; }
img{ max-width:100%; display:block; }
.wrap{ max-width:1080px; margin:0 auto; padding:0 28px; }
section{ padding:80px 0; }
.eyebrow{
  font-size:calc(13px * var(--text-scale)); font-weight:600; letter-spacing:.14em; text-transform:uppercase;
  color:var(--sea-dark); display:flex; align-items:center; gap:10px; margin-bottom:14px;
}
.ifach-mark{ display:block; }
.ifach-mark path{ fill:currentColor; }

/* Section band — echoes the property's own brochure headers */
.band{ display:flex; align-items:stretch; margin-bottom:22px; }
.band .accent{ width:6px; background:var(--gold); flex:none; }
.band .label{
  background:var(--ink); color:#fff; font-weight:700; letter-spacing:.12em;
  text-transform:uppercase; font-size:calc(13px * var(--text-scale)); padding:12px 18px;
  font-family:'Work Sans', sans-serif;
}
.subhead{
  font-style:italic; font-size:calc(13px * var(--text-scale)); letter-spacing:.06em; text-transform:uppercase;
  color:var(--sea-dark); border-top:1px solid var(--line); border-bottom:1px solid var(--line);
  padding:10px 0; margin:32px 0 18px;
}

/* ---------- Header ---------- */
header{
  position:sticky; top:0; z-index:50;
  background:rgba(246,241,231,.94); backdrop-filter:blur(6px);
  border-bottom:1px solid var(--line);
}
.nav{ display:flex; align-items:center; justify-content:space-between; padding:16px 28px; max-width:1080px; margin:0 auto; }
.brand{ display:flex; align-items:center; text-decoration:none; line-height:0; }
.brand-logo{ display:block; height:48px; width:48px; object-fit:cover; border-radius:50%; }
.nav-links{ display:flex; align-items:center; gap:26px; }
.nav-links a{ font-size:calc(13.5px * var(--text-scale)); font-weight:500; text-decoration:none; color:var(--ink-70); transition:color .15s; white-space:nowrap; }
.nav-links a:hover{ color:var(--sea-dark); }
.lang-switch{ position:relative; }
.lang-switch-btn{
  display:flex; align-items:center; gap:6px;
  appearance:none; background:none; cursor:pointer;
  border:1px solid var(--line); border-radius:20px; padding:6px 12px;
  font:inherit; font-size:calc(12px * var(--text-scale)); font-weight:600; color:var(--ink-70);
}
.lang-switch-btn:hover{ border-color:var(--sea-dark); color:var(--ink); }
.lang-switch-btn .lang-caret{ color:var(--ink-45); flex:none; }
.lang-switch-menu{
  position:absolute; top:calc(100% + 8px); right:0; z-index:60;
  background:#fff; border:1px solid var(--line); border-radius:10px;
  box-shadow:0 10px 30px rgba(22,40,58,.16);
  padding:6px; min-width:150px;
  display:flex; flex-direction:column; gap:2px;
}
/* Our own display:flex above would otherwise override the browser's
   built-in [hidden]{display:none} rule (author styles always beat
   user-agent styles, even at equal specificity) — this is what was
   stopping the menu from actually closing. Restating it here, with
   higher specificity than the plain class rule, fixes that. */
.lang-switch-menu[hidden]{ display:none; }
.lang-switch-option{
  appearance:none; background:none; border:none; text-align:left; cursor:pointer;
  display:flex; align-items:center; gap:9px;
  font:inherit; font-size:calc(13.5px * var(--text-scale)); color:var(--ink-70);
  padding:9px 12px; border-radius:6px;
}
.lang-switch-option:hover{ background:var(--paper-2); color:var(--ink); }
.lang-switch-option.active{ background:var(--sea-dark); color:#fff; }
.lang-flag{ width:20px; height:14px; flex:none; border-radius:2px; box-shadow:0 0 0 1px rgba(22,40,58,.14); }
.nav-toggle{ display:none; background:none; border:0; cursor:pointer; padding:6px; }
.nav-toggle span{ display:block; width:22px; height:2px; background:var(--ink); margin:5px 0; }

/* ---------- Language switch ----------
   English shows by default with no dependency on JavaScript having
   run — every non-English [data-lang] is hidden the moment this
   stylesheet loads, full stop. The dropdown script (bottom of
   index.php) is what shows a different language instead once
   picked, by setting inline styles directly; the rules below are
   only the safe starting point it works from, plus an early-paint
   fallback (html.lang-XX) so a returning visitor's saved language
   appears immediately rather than after the page's scripts run.
   Adding a new language later needs one more pair of lines here. */
[data-lang="es"], [data-lang="pl"], [data-lang="fr"], [data-lang="de"], [data-lang="nl"], [data-lang="ru"], [data-lang="uk"], [data-lang="it"]{ display:none; }
html.lang-es [data-lang="en"]{ display:none; }
html.lang-es [data-lang="es"]{ display:inline; }
html.lang-pl [data-lang="en"]{ display:none; }
html.lang-pl [data-lang="pl"]{ display:inline; }
html.lang-fr [data-lang="en"]{ display:none; }
html.lang-fr [data-lang="fr"]{ display:inline; }
html.lang-de [data-lang="en"]{ display:none; }
html.lang-de [data-lang="de"]{ display:inline; }
html.lang-nl [data-lang="en"]{ display:none; }
html.lang-nl [data-lang="nl"]{ display:inline; }
html.lang-ru [data-lang="en"]{ display:none; }
html.lang-ru [data-lang="ru"]{ display:inline; }
html.lang-uk [data-lang="en"]{ display:none; }
html.lang-uk [data-lang="uk"]{ display:inline; }
html.lang-it [data-lang="en"]{ display:none; }
html.lang-it [data-lang="it"]{ display:inline; }

/* ---------- Hero ---------- */
.hero{
  position:relative; overflow:hidden;
  min-height:clamp(560px, 88vh, 800px);
  display:flex; align-items:center;
  color:var(--paper);
}
.hero-bg{ position:absolute; inset:0; z-index:0; }
.hero-bg img{ width:100%; height:100%; object-fit:cover; object-position:center 38%; display:block; }
.hero-overlay{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(13,28,42,.88) 0%, rgba(20,38,54,.72) 45%, rgba(24,68,88,.88) 100%);
}
.hero .wrap{ position:relative; z-index:2; padding:80px 28px 72px; }
.hero .eyebrow{ color:var(--gold); }
.hero h1{ font-size:clamp(calc(34px * var(--text-scale)),5vw,calc(54px * var(--text-scale))); line-height:1.12; max-width:20ch; color:#fff; text-shadow:0 2px 16px rgba(0,0,0,.35); }
.hero p.lead{ max-width:52ch; font-size:calc(17px * var(--text-scale)); color:rgba(246,241,231,.92); margin-top:20px; text-shadow:0 1px 10px rgba(0,0,0,.3); }
.hero .cta-row{ display:flex; gap:14px; margin-top:32px; flex-wrap:wrap; }
.skyline{ position:absolute; left:0; right:0; bottom:0; width:100%; height:auto; color:#0A1D2B; opacity:.9; z-index:1; }

/* ---------- Buttons ---------- */
.btn{ display:inline-flex; align-items:center; gap:8px; padding:13px 24px; font-size:calc(14px * var(--text-scale)); font-weight:600; text-decoration:none; border-radius:2px; transition:transform .15s ease; }
.btn-primary{ background:var(--gold); color:var(--ink); }
.btn-primary:hover{ transform:translateY(-1px); }
.btn-ghost{ border:1px solid rgba(246,241,231,.4); color:#fff; }
.btn-ghost:hover{ border-color:#fff; }
.btn-dark{ background:var(--ink); color:var(--paper); }
.btn-dark:hover{ transform:translateY(-1px); }

/* ---------- Text blocks ---------- */
.intro-text{ font-family:'Fraunces', serif; font-size:calc(23px * var(--text-scale)); line-height:1.45; font-weight:500; max-width:62ch; }
.body-text{ margin-top:16px; color:var(--ink-70); font-size:calc(16px * var(--text-scale)); max-width:66ch; }
.body-text + .body-text{ margin-top:10px; }

.stat-row{ display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid var(--line); margin-top:36px; }
.stat-row.cols-5{ grid-template-columns:repeat(5,1fr); }
.stat{ padding:20px 16px 20px 0; border-bottom:1px solid var(--line); }
.stat + .stat{ padding-left:16px; }
.stat .num{ font-family:'Fraunces', serif; font-size:calc(26px * var(--text-scale)); font-weight:600; color:var(--sea-dark); }
.stat .label{ font-size:calc(12.5px * var(--text-scale)); color:var(--ink-45); margin-top:2px; }

/* ---------- Photo grids ---------- */
.photo-grid{
  display:grid; grid-template-columns:repeat(3,1fr);
  grid-auto-flow:dense; align-items:start; gap:10px; margin-top:30px;
}
.photo-grid.cols-2{ grid-template-columns:repeat(2,1fr); }
.photo-grid img{
  width:100%; height:auto; aspect-ratio:3/4;
  object-fit:cover; border-radius:2px; cursor:pointer; transition:opacity .15s;
  display:block;
}
/* Landscape photos get double width AND their own wider aspect
   ratio (instead of a fixed pixel height), so their height is
   always computed from their own actual rendered width — correct
   no matter how wide that turns out to be in any given layout,
   rather than depending on a guessed pixel value that can be wrong
   if the surrounding page width differs from what was assumed. */
.photo-grid img.landscape{ grid-column:span 2; aspect-ratio:3/2; }
.photo-grid img:hover{ opacity:.9; }
.alt-bg{ background:var(--paper-2); }

/* Lightbox */
.lightbox{ position:fixed; inset:0; background:rgba(13,34,51,.95); display:none; align-items:center; justify-content:center; z-index:100; padding:40px; }
.lightbox.open{ display:flex; }
.lightbox img{ max-width:100%; max-height:88vh; border-radius:2px; }
.lightbox-close{ position:absolute; top:24px; right:28px; background:none; border:0; color:#fff; font-size:calc(28px * var(--text-scale)); cursor:pointer; line-height:1; }

/* ---------- Price box ---------- */
.price-box{
  border:1px solid var(--line); background:var(--paper-2);
  padding:26px 30px; text-align:center; margin-top:8px;
}
.price-box .note{ font-size:calc(17px * var(--text-scale)); line-height:1.5; color:var(--ink-70); }

/* ---------- Location ---------- */
.location{ background:var(--ink); color:var(--paper); }
.location .eyebrow{ color:var(--gold); }
.location h2{ color:#fff; font-size:calc(30px * var(--text-scale)); max-width:24ch; }
.location .body-text{ color:rgba(246,241,231,.78); }
.location .stat-row{ border-top-color:rgba(246,241,231,.18); }
.location .stat{ border-bottom-color:rgba(246,241,231,.18); }
.location .stat .num{ color:var(--gold); }
.location .stat .label{ color:rgba(246,241,231,.55); }
.map-frame{ margin-top:32px; border-radius:2px; overflow:hidden; border:1px solid rgba(246,241,231,.18); aspect-ratio:16/6.5; }
.map-frame iframe{ width:100%; height:100%; border:0; filter:saturate(.85) contrast(1.05); }

/* ---------- Contact ---------- */
.contact-grid{ display:grid; grid-template-columns:1fr 1fr; gap:60px; align-items:start; }
#contact h2{ font-size:calc(30px * var(--text-scale)); max-width:16ch; }
.contact-card{ border:1px solid var(--line); padding:30px; border-radius:2px; background:var(--paper-2); }
.contact-name{ font-family:'Fraunces', serif; font-size:calc(19px * var(--text-scale)); font-weight:600; margin-bottom:16px; }
.contact-row{ display:flex; align-items:center; gap:14px; padding:13px 0; border-bottom:1px solid var(--line); }
.contact-row:last-of-type{ border-bottom:0; }
.contact-row .ico{ width:18px; height:18px; color:var(--sea-dark); flex:none; }
.contact-row a{ text-decoration:none; font-weight:500; }
.contact-row .label{ font-size:calc(12px * var(--text-scale)); color:var(--ink-45); display:block; }
.contact-card .btn{ margin-top:18px; width:100%; justify-content:center; }
.address-note{ margin-top:22px; font-size:calc(13.5px * var(--text-scale)); color:var(--ink-45); }
.small-note{ margin-top:16px; font-size:calc(14px * var(--text-scale)); color:var(--ink-45); }

footer.site-footer{ padding:34px 0; text-align:center; font-size:calc(13px * var(--text-scale)); color:var(--ink-45); border-top:1px solid var(--line); }
footer.site-footer .ifach-mark{ width:16px; height:16px; margin:0 auto 10px; color:var(--ink-45); }

@media (max-width:860px){
  .contact-grid{ grid-template-columns:1fr; gap:32px; }
  .stat-row, .stat-row.cols-5{ grid-template-columns:repeat(2,1fr); }
  .photo-grid, .photo-grid.cols-2{ grid-template-columns:repeat(2,1fr); }
  section{ padding:56px 0; }
}
@media (max-width:640px){
  .nav-links{
    position:fixed; top:60px; left:0; right:0; background:var(--paper);
    flex-direction:column; align-items:flex-start; gap:0; border-bottom:1px solid var(--line);
    transform:translateY(-8px); opacity:0; pointer-events:none; transition:all .18s ease;
    max-height:70vh; overflow-y:auto;
  }
  .nav-links.open{ transform:translateY(0); opacity:1; pointer-events:auto; }
  .nav-links a{ width:100%; padding:14px 28px; border-bottom:1px solid var(--line); }
  .nav-toggle{ display:block; }
  .photo-grid, .photo-grid.cols-2{ grid-template-columns:repeat(1,1fr); }
  .photo-grid img.landscape{ grid-column:span 1; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ transition:none !important; }
}

/* ---------- 404 page ---------- */
.notfound-page{
  min-height:100vh; display:flex; flex-direction:column; align-items:center;
  justify-content:center; text-align:center; padding:40px 28px; gap:18px;
}
.notfound-page .brand-logo{ margin-bottom:8px; }
.notfound-page .eyebrow{ color:var(--gold); }
.notfound-page h1{ font-size:calc(32px * var(--text-scale)); max-width:18ch; }
.notfound-page .lead{ font-size:calc(17px * var(--text-scale)); color:var(--ink-70); max-width:44ch; margin:0; }
