/*
Theme Name:   HHH Stays V2
Theme URI:    https://hokkaidohobbyhomes.com
Description:  HHH Stays V2 — long-term stays directory + enquiry modal. Reads from VikBooking DB, never modifies plugin files, safe against plugin/core updates.
Author:       AugustJD
Author URI:   https://github.com/AugustJD
Version:      2.0.0
License:      GNU General Public License v2 or later
Text Domain:  hhh-stays
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (max-width: 999px) { html { scroll-padding-top: 80px; } }

:root {
  --bg:          #0A0A0A;
  --bg-2:        #121212;
  --bg-3:        #1A1A1A;
  --fg:          #FAFAF7;
  --fg-dim:      #A8A8A3;
  --fg-faint:    #55554F;
  --amber:       #F0A500;
  --amber-soft:  rgba(240, 165, 0, 0.15);
  --line:        rgba(250, 250, 247, 0.12);
  --line-strong: rgba(250, 250, 247, 0.22);
  --glass:       rgba(16, 16, 16, 0.55);
  --glass-hi:    rgba(255, 255, 255, 0.04);

  --serif: 'Instrument Serif', 'Noto Serif JP', Georgia, serif;
  --sans:  'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  --jp:    'Noto Serif JP', serif;
  --mono:  ui-monospace, 'SF Mono', Menlo, monospace;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Nav ─────────────────────────────────────────── */

.hhh-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

.hhh-nav.scrolled {
  background: rgba(16, 16, 16, 0.55);
  backdrop-filter: blur(22px) saturate(1.2);
  border-color: var(--line);
}

.hhh-nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 78px;
  padding: 0 40px;
}

.hhh-nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hhh-nav__logo img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.hhh-nav__logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hhh-nav__logo-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--fg);
}

.hhh-nav__logo-sub {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  line-height: 1;
}

.hhh-nav__pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
  backdrop-filter: blur(10px);
}

.hhh-nav__pill a {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--fg);
  padding: 9px 18px;
  border-radius: 999px;
  transition: background 150ms ease;
  white-space: nowrap;
}

.hhh-nav__pill a:hover,
.hhh-nav__pill a.active {
  background: rgba(255, 255, 255, 0.06);
}

.hhh-nav__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.hhh-nav__cta {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--amber);
  color: #111;
  padding: 9px 22px;
  border: 1px solid var(--amber);
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.hhh-nav__cta:hover { opacity: 0.88; }

.hhh-nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--glass-hi);
  backdrop-filter: blur(10px);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hhh-nav__burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hhh-nav__burger.open span:first-child { transform: translateY(3.25px) rotate(45deg); }
.hhh-nav__burger.open span:last-child  { transform: translateY(-3.25px) rotate(-45deg); }

/* Mobile menu */
.hhh-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(24px);
  padding: 100px 24px 40px;
  flex-direction: column;
}

.hhh-mobile-menu.open { display: flex; }

.hhh-mobile-menu a {
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1.1;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}

.hhh-mobile-menu__cta {
  margin-top: 32px;
  align-self: flex-start;
  font-family: var(--sans) !important;
  font-size: 15px !important;
  font-weight: 500;
  background: var(--amber);
  color: #111 !important;
  padding: 12px 28px;
  border: 1px solid var(--amber);
  border-radius: 999px;
  border-bottom: none !important;
  cursor: pointer;
}

@media (max-width: 999px) {
  .hhh-nav__inner {
    display: flex;
    grid-template-columns: none;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    height: 68px;
    padding: 0 20px;
  }
  .hhh-nav__pill    { display: none; }
  .hhh-nav__cta     { display: none; }
  .hhh-nav__actions { flex: 0 0 auto; }
  .hhh-nav__burger  { display: flex; }

  .hhh-nav__logo      { min-width: 0; flex: 1 1 auto; }
  .hhh-nav__logo-text { min-width: 0; overflow: hidden; }
  .hhh-nav__logo-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 640px) {
  .hhh-nav__inner    { height: 60px; }
  .hhh-nav__logo img { width: 32px; height: 32px; }
  .hhh-nav__logo-name { font-size: 15px; line-height: 1.15; }
  .hhh-nav__logo-sub  { display: none; }
}

@media (max-width: 380px) {
  .hhh-nav__logo-text { display: none; }
}

/* ── Footer ──────────────────────────────────────── */

.hhh-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 72px 32px 0;
}

.hhh-footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
}

.hhh-footer__brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hhh-footer__brand-logo img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.hhh-footer__brand-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.1;
}

.hhh-footer__brand-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.hhh-footer__desc {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.65;
  max-width: 320px;
  margin-bottom: 20px;
}

.hhh-footer__address {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  line-height: 1.7;
}

.hhh-footer__address strong {
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hhh-footer__col-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 20px;
}

.hhh-footer__col a {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-dim);
  padding: 6px 0;
  transition: color 150ms ease;
}

.hhh-footer__col a:hover { color: var(--fg); }
.hhh-footer__col a.js-enquire { cursor: pointer; }

.hhh-footer__bar {
  border-top: 1px solid var(--line);
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hhh-footer__copy,
.hhh-footer__built {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.05em;
}

@media (max-width: 900px) {
  .hhh-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 600px) {
  .hhh-footer { padding: 48px 20px 0; }
  .hhh-footer__inner { grid-template-columns: 1fr; }
  .hhh-footer__bar { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── Enquiry modal ───────────────────────────────── */

.hhh-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.hhh-modal.is-open { display: flex; }

.hhh-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(18px);
  animation: hhh-fade 260ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

.hhh-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  max-height: calc(100svh - 64px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(250, 250, 247, 0.13);
  backdrop-filter: blur(28px);
  border-radius: 20px;
  padding: 44px 44px 36px;
  animation: hhh-rise 320ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

@keyframes hhh-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes hhh-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hhh-modal__bracket {
  position: absolute;
  width: 14px; height: 14px;
  pointer-events: none;
}
.hhh-modal__bracket--tl {
  top: 14px; left: 14px;
  border-top: 1px solid var(--fg);
  border-left: 1px solid var(--fg);
}
.hhh-modal__bracket--br {
  bottom: 14px; right: 14px;
  border-bottom: 1px solid var(--fg);
  border-right: 1px solid var(--fg);
}

.hhh-modal__close {
  position: absolute;
  top: 18px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.hhh-modal__close:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--line-strong); }

.hhh-modal__head { margin-bottom: 28px; }
.hhh-modal__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.hhh-modal__eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
}
.hhh-modal__hdivider {
  width: 60px;
  height: 1px;
  background: var(--line);
  margin-bottom: 20px;
}
.hhh-modal__title {
  font-family: var(--serif);
  font-size: clamp(30px, 3.5vw, 42px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0;
}
.hhh-modal__context {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-top: 12px;
}

.hhh-modal__form { display: flex; flex-direction: column; gap: 18px; }
.hhh-modal__form[hidden] { display: none; }
.hhh-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hhh-modal__row--3 { grid-template-columns: 1fr 1fr 100px; }

.hhh-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hhh-modal__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.hhh-modal__label em {
  font-style: normal;
  color: var(--fg-faint);
  opacity: 0.7;
  text-transform: none;
  letter-spacing: 0.05em;
  margin-left: 4px;
}
.hhh-modal__form input[type="text"],
.hhh-modal__form input[type="email"],
.hhh-modal__form input[type="date"],
.hhh-modal__form input[type="number"],
.hhh-modal__form textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 44px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg);
  outline: none;
  transition: border-color 200ms ease;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
}
.hhh-modal__form input:focus,
.hhh-modal__form textarea:focus { border-color: var(--line-strong); }
.hhh-modal__form textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.55;
  font-family: var(--sans);
}
.hhh-modal__form input::placeholder,
.hhh-modal__form textarea::placeholder { color: var(--fg-faint); }

.hhh-modal__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.hhh-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  flex-wrap: wrap;
}
.hhh-modal__note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.hhh-modal__submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  background: var(--amber);
  color: #111;
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  transition: opacity 200ms cubic-bezier(0.2, 0.6, 0.2, 1), transform 200ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.hhh-modal__submit:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.hhh-modal__submit:disabled { opacity: 0.5; cursor: default; }

.hhh-modal__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 8px 8px;
  gap: 14px;
}
.hhh-modal__success[hidden] { display: none; }
.hhh-modal__success-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hhh-modal__success-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0;
}
.hhh-modal__success-body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-dim);
  margin: 0 0 8px;
}
.hhh-modal__success-close {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  transition: background 200ms ease;
}
.hhh-modal__success-close:hover { background: rgba(255, 255, 255, 0.05); }

@media (max-width: 640px) {
  .hhh-modal { padding: 16px; }
  .hhh-modal__panel { padding: 40px 24px 28px; border-radius: 16px; }
  .hhh-modal__row,
  .hhh-modal__row--3 { grid-template-columns: 1fr; gap: 14px; }
  .hhh-modal__foot { justify-content: center; }
}

@media (max-width: 420px) {
  .hhh-modal__label { font-size: 9px; letter-spacing: 0.14em; }
  .hhh-modal__label em { display: block; margin-left: 0; margin-top: 2px; }
}

@media (max-height: 640px) {
  .hhh-modal__panel { padding: 24px 24px 20px; max-height: calc(100svh - 24px); }
  .hhh-modal__head { margin-bottom: 16px; }
  .hhh-modal__title { font-size: 24px; }
  .hhh-modal__form { gap: 12px; }
  .hhh-modal__form textarea { min-height: 72px; }
}
