/* =========================================================
   Apartment Dante — Piran, Slovenia
   Hand-written stylesheet (no framework, no template)
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Coastal palette */
  --c-deep: #0B3A53;
  --c-sea: #1B6B7E;
  --c-sea-hover: #14525f;
  --c-aqua: #4FB3C4;
  --c-sand: #F4EDE2;
  --c-shell: #FBF8F3;
  --c-ink: #243B45;
  --c-muted: #5E7480;
  --c-line: #E3DACD;
  --c-coral: #E2725B;
  --c-white: #ffffff;

  --header-bg: rgba(251, 248, 243, 0.82);
  --header-bg-solid: rgba(251, 248, 243, 0.95);

  /* Type */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --fs-hero: clamp(2.6rem, 6vw + 1rem, 4.75rem);
  --fs-h2: clamp(1.9rem, 3vw + 1rem, 2.9rem);
  --fs-h3: clamp(1.15rem, 1vw + 1rem, 1.4rem);
  --fs-lead: clamp(1.05rem, 1vw + 0.9rem, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
  --fs-eyebrow: 0.8rem;

  /* Spacing (4px base) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-24: 6rem;

  /* Layout */
  --container: 1180px;
  --container-narrow: 760px;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --header-h: 72px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(11, 58, 83, 0.08);
  --shadow-md: 0 14px 40px rgba(11, 58, 83, 0.14);
  --shadow-lg: 0 24px 60px rgba(11, 58, 83, 0.22);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.2s;
  --t-med: 0.45s;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-shell);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--c-sea); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--c-sea-hover); }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--c-deep);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 var(--sp-4);
  letter-spacing: 0.01em;
}

p { margin: 0 0 var(--sp-4); }

ul { margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid var(--c-aqua);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden,
.skip-link:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 10001;
  background: var(--c-deep);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.icon {
  width: 1.4em;
  height: 1.4em;
  flex: none;
}

/* ---------- Layout helpers ---------- */
.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}
.container.narrow { max-width: var(--container-narrow); }

.section {
  padding-block: clamp(3.5rem, 8vw, var(--sp-24));
  scroll-margin-top: calc(var(--header-h) + 12px);
}
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  color: var(--c-aqua);
  margin: 0 0 var(--sp-3);
}
.eyebrow-dark { color: var(--c-sea); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--c-sea);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.btn-primary {
  background: var(--c-sea);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--c-sea-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: #fff;
}
.btn-lg { padding: 0.9rem 1.9rem; font-size: 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.site-header.is-scrolled {
  background: var(--header-bg-solid);
  border-bottom-color: var(--c-line);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--c-deep);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand:hover { color: var(--c-deep); }
.brand-sub {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.nav { display: flex; align-items: center; gap: var(--sp-8); }
.nav-list {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  list-style: none;
}
.nav-list a {
  color: var(--c-deep);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--c-aqua);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast) var(--ease);
}
.nav-list a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--c-deep);
  cursor: pointer;
  padding: var(--sp-2);
  line-height: 0;
}
.nav-toggle .icon { width: 1.8rem; height: 1.8rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(560px, 88vh, 820px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(11, 58, 83, 0.30) 0%, rgba(11, 58, 83, 0.20) 40%, rgba(11, 58, 83, 0.62) 100%),
    linear-gradient(90deg, rgba(11, 58, 83, 0.55) 0%, rgba(11, 58, 83, 0.15) 60%, rgba(11, 58, 83, 0) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 720px;
  padding-block: var(--sp-16);
}
.hero-content .eyebrow { color: #cfeef4; }
.hero h1 {
  color: #fff;
  font-size: var(--fs-hero);
  margin-bottom: var(--sp-4);
  text-shadow: 0 2px 24px rgba(11, 58, 83, 0.35);
}
.hero .lead {
  font-size: var(--fs-lead);
  color: rgba(255, 255, 255, 0.92);
  max-width: 38ch;
  margin-bottom: var(--sp-8);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: var(--sp-6);
  transform: translateX(-50%);
  z-index: 2;
  color: #fff;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: bob 2.2s var(--ease) infinite;
}
.scroll-cue:hover { color: #fff; background: rgba(255, 255, 255, 0.15); }
.scroll-cue .icon { width: 1.3rem; height: 1.3rem; }
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(7px); }
}

/* ---------- Feature rows ---------- */
.feature-alt { background: var(--c-sand); }
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.feature-text { max-width: 52ch; }
.feature-media {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.feature-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--t-med) var(--ease);
}
.feature-media:hover img { transform: scale(1.04); }

/* ---------- Amenities ---------- */
.amenities {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.amenities li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.feature-alt .amenities li { background: #fff; }
.amenities .icon { color: var(--c-sea); }

/* ---------- Booking ---------- */
.booking-head { text-align: center; }
.booking-frame {
  margin-top: var(--sp-8);
}
.booking-frame iframe {
  display: block;
  width: 100%;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* ---------- Gallery ---------- */
.gallery-section { background: var(--c-sand); }
.gallery-head { text-align: center; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-8);
}
.gallery-item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  background: #ddd;
  box-shadow: var(--shadow-sm);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--t-med) var(--ease);
}
.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.07); }
.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.6rem 0.85rem 0.7rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  background: linear-gradient(0deg, rgba(11, 58, 83, 0.78), rgba(11, 58, 83, 0));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.gallery-item:hover .gallery-caption,
.gallery-item:focus-visible .gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-inner { margin-inline: auto; }
.contact-lead { color: var(--c-muted); margin-bottom: var(--sp-8); }
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-8) var(--sp-4);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  color: var(--c-ink);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: var(--c-ink);
}
.contact-card .icon {
  width: 2rem; height: 2rem;
  color: var(--c-sea);
  margin-bottom: var(--sp-2);
}
.contact-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--c-muted);
}
.contact-value { font-weight: 600; color: var(--c-deep); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-deep);
  color: rgba(255, 255, 255, 0.85);
  padding-block: var(--sp-12);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  text-align: center;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
}
.footer-icons {
  display: flex;
  gap: var(--sp-3);
  list-style: none;
}
.footer-icons a {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.footer-icons a:hover {
  background: var(--c-sea);
  border-color: var(--c-sea);
  color: #fff;
}
.footer-copy {
  margin: 0;
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Floating CTA ---------- */
.floating-cta {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 900;
  background: var(--c-sea);
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.floating-cta:hover {
  background: var(--c-sea-hover);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease), visibility var(--t-med);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 26, 36, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lightbox-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(92vw, 1200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  transform: scale(0.96);
  transition: transform var(--t-med) var(--ease);
}
.lightbox.is-open .lightbox-figure { transform: scale(1); }
.lightbox-img {
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  background: #1a2c35;
}
.lightbox-caption {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
}
.lightbox-counter { color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }

.lightbox-btn {
  position: absolute;
  z-index: 2;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.26); }
.lightbox-btn .icon { width: 1.6rem; height: 1.6rem; }
.lightbox-close { top: 1.1rem; right: 1.1rem; }
.lightbox-prev { left: 1.1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.1rem; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

body.no-scroll { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--header-bg-solid);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--c-line);
    box-shadow: var(--shadow-md);
    padding: var(--sp-3) var(--sp-4) var(--sp-6);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
  }
  .nav.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    visibility: visible;
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-list a {
    display: block;
    padding: var(--sp-3) var(--sp-2);
    border-bottom: 1px solid var(--c-line);
  }
  .nav-list a::after { display: none; }
  .nav-cta {
    margin-top: var(--sp-4);
    width: 100%;
  }
  .nav-toggle { display: inline-flex; }
  .floating-cta { display: block; }
}

@media (max-width: 760px) {
  .feature-grid,
  .feature-grid.reversed {
    grid-template-columns: 1fr;
  }
  /* Always show image first on mobile for visual rhythm */
  .feature-grid .feature-media { order: -1; }
  .hero .lead { max-width: 100%; }
  .amenities { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .amenities { grid-template-columns: 1fr; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scroll-cue { animation: none; }
}
