/*
Theme Name: The Vacancy Project
Theme URI: https://clarity.irish
Author: Petaluma Urban Chat
Description: Custom theme for The Vacancy Project — Petaluma's vacancy map and information site. Styled to match urbanchat.org.
Version: 1.1.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: vacancy-project
*/

:root {
  --vp-green: #90c715;
  --vp-green-dark: #7bab12;
  --vp-ink: #473729;
  --vp-body: #473729;
  --vp-muted: #7a6f64;
  --vp-panel: #dedede;
  --vp-dark: #6b6862;
  --vp-bg-alt: #f5f5f5;
  --vp-border: #e4e4e4;
  --vp-radius: 4px;
  --vp-shadow: 0 2px 16px rgb(0 0 0 / 12%);
  --vp-font-heading: 'Urbanist', -apple-system, sans-serif;
  --vp-font-body: 'Poppins', -apple-system, sans-serif;
  --vp-header-h: 72px;
  --vp-maxw: 1140px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--vp-font-body);
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--vp-body);
  background: #fff;
}

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

h1, h2, h3, h4, h5 {
  font-family: var(--vp-font-heading);
  color: var(--vp-ink);
  line-height: 1.22;
  font-weight: 400;
}

h1 { font-size: clamp(2.1rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.55rem); }
h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h4 { font-size: clamp(1.15rem, 2vw, 1.45rem); }

a { color: inherit; }
p a, li a, dd a { color: var(--vp-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
p a:hover, li a:hover { color: var(--vp-green-dark); }

.vp-container { max-width: var(--vp-maxw); margin: 0 auto; padding: 0 24px; }
.vp-container--narrow { max-width: 780px; }

/* ---------- Header ---------- */
.vp-header {
  position: sticky; top: 0; z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--vp-border);
  height: var(--vp-header-h);
  display: flex; align-items: center;
}
.vp-header__inner {
  width: 100%; max-width: var(--vp-maxw); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.vp-logo {
  font-family: var(--vp-font-heading);
  font-weight: 700; font-size: 1.25rem; color: var(--vp-ink);
  text-decoration: none; line-height: 1.1; display: flex; align-items: center; gap: 10px;
}
.vp-logo__mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--vp-green); flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.05rem;
}
.vp-logo small { display: block; font-family: var(--vp-font-body); font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--vp-muted); }
.vp-nav { display: flex; align-items: center; gap: 26px; }
.vp-nav a {
  font-family: var(--vp-font-body);
  font-weight: 500; font-size: .98rem;
  text-decoration: none; color: var(--vp-body);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.vp-nav a:hover { color: var(--vp-green-dark); }
.vp-nav a.is-active { border-bottom-color: var(--vp-green); color: var(--vp-ink); }
.vp-nav a.vp-nav__cta {
  background: var(--vp-green); color: #fff;
  padding: 10px 22px; border-radius: 4px; border-bottom: 0;
}
.vp-nav a.vp-nav__cta:hover { background: var(--vp-green-dark); color: #fff; }
.vp-nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.vp-nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--vp-ink); margin: 5px 0; border-radius: 2px; }

@media (max-width: 820px) {
  .vp-nav-toggle { display: block; }
  .vp-nav {
    display: none; position: absolute; top: var(--vp-header-h); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--vp-border);
    flex-direction: column; align-items: stretch; padding: 12px 24px 20px;
  }
  .vp-nav.is-open { display: flex; gap: 4px; }
  .vp-nav a { padding: 12px 4px; border-bottom: 1px solid var(--vp-border); }
  .vp-nav a.is-active { border-bottom-color: var(--vp-green); }
  .vp-nav a.vp-nav__cta { margin-top: 10px; text-align: center; }
}

/* ---------- Buttons ---------- */
.vp-btn {
  display: inline-block;
  font-family: var(--vp-font-body); font-weight: 600; font-size: 1rem;
  background: var(--vp-green); color: #fff; text-decoration: none;
  padding: 13px 30px; border-radius: 4px; border: 0; cursor: pointer;
  transition: background .15s ease;
}
.vp-btn:hover { background: var(--vp-green-dark); }
.vp-btn--green { background: var(--vp-green); }
.vp-btn--dark { background: var(--vp-ink); }
.vp-btn--dark:hover { background: #2f2419; }
.vp-btn--ghost { background: transparent; color: var(--vp-ink); box-shadow: inset 0 0 0 2px var(--vp-ink); }
.vp-btn--ghost:hover { background: var(--vp-ink); color: #fff; }

/* ---------- Green-bordered panels (signature urbanchat style) ---------- */
.vp-panel {
  background: var(--vp-panel);
  border: 5px solid var(--vp-green);
  padding: 30px 34px;
  color: var(--vp-ink);
}
.vp-panel > * + * { margin-top: 1em; }
.vp-greenbox {
  border: 2px solid var(--vp-green);
  padding: 28px 32px;
  background: transparent;
}
.vp-greenbox > * + * { margin-top: 1em; }

/* ---------- Hero (photo background + panels) ---------- */
.vp-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 90px 0 110px;
}
@media (max-width: 900px) { .vp-hero { background-attachment: scroll; } }
.vp-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 10fr) minmax(0, 11fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 860px) { .vp-hero__grid { grid-template-columns: 1fr; } }
.vp-hero__side { display: grid; gap: 32px; }

/* ---------- Slideshow ---------- */
.vp-slideshow {
  position: relative;
  border: 5px solid var(--vp-green);
  background: #1c1c1c;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.vp-slideshow figure { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; }
.vp-slideshow figure.is-active { opacity: 1; }
.vp-slideshow img { width: 100%; height: 100%; object-fit: cover; }
.vp-slideshow figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 18px 12px;
  background: linear-gradient(to top, rgb(0 0 0 / 62%), transparent);
  color: #fff; font-size: .92rem; line-height: 1.5;
}

/* ---------- Wavy section divider ---------- */
.vp-wave { display: block; width: 100%; height: 54px; margin-bottom: -1px; }

/* ---------- Sections ---------- */
.vp-section { padding: 80px 0; }
.vp-section--dark { background: var(--vp-dark); color: #fff; }
.vp-section--dark h2, .vp-section--dark h3, .vp-section--dark h4 { color: #fff; }
.vp-section--dark p a, .vp-section--dark li a { color: var(--vp-green); }
.vp-section--dark p a:hover, .vp-section--dark li a:hover { color: #fff; }
.vp-eyebrow {
  font-family: var(--vp-font-body); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; font-size: .8rem;
  color: var(--vp-green-dark); margin-bottom: 10px;
}
.vp-section__lead { max-width: 68ch; margin-top: 16px; font-size: 1.05rem; }
.vp-prose > * + * { margin-top: 1.05em; }
.vp-prose { max-width: 72ch; }
.vp-prose ul, .vp-prose ol { padding-left: 1.3em; }
.vp-prose li + li { margin-top: .45em; }

.vp-twocol {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
@media (max-width: 820px) { .vp-twocol { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- City examples (dark section) ---------- */
.vp-citygrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 22px;
  margin: 36px 0 44px;
}
.vp-citygrid figure { text-align: center; }
.vp-citygrid img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.vp-citygrid figcaption { margin-top: 8px; font-size: .85rem; color: #eee; }

/* ---------- Listings grid ---------- */
.vp-page-title { padding: 72px 0 0; }
.vp-listings { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; padding: 48px 0 96px; }
.vp-card {
  background: #fff; border-radius: var(--vp-radius); overflow: hidden;
  box-shadow: 0 1px 4px rgb(0 0 0 / 8%); border: 1px solid var(--vp-border);
  text-decoration: none; display: block; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
}
.vp-card:hover { transform: translateY(-4px); box-shadow: var(--vp-shadow); }
.vp-card__img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; background: var(--vp-bg-alt); }
.vp-card__body { padding: 18px 20px 22px; }
.vp-card__title { font-family: var(--vp-font-heading); font-weight: 600; font-size: 1.25rem; color: var(--vp-ink); }
.vp-card__meta { margin-top: 6px; font-size: .92rem; color: var(--vp-muted); }
.vp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--vp-font-body); font-weight: 600; font-size: .78rem;
  padding: 4px 12px; border-radius: 999px; margin-top: 12px;
  background: var(--vp-bg-alt); color: var(--vp-ink);
}
.vp-badge__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--vp-muted); }
.vp-badge--occupied { background: #e9f7e9; color: #1d7a2f; }
.vp-badge--occupied .vp-badge__dot { background: #1d7a2f; }

/* ---------- Listings infinite scroll ---------- */
.vp-loadmore { display: flex; justify-content: center; padding: 8px 0 64px; min-height: 40px; }
.vp-loadmore__spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--vp-border); border-top-color: var(--vp-green);
  opacity: 0; animation: vp-spin 0.8s linear infinite;
}
.vp-loadmore.is-loading .vp-loadmore__spinner { opacity: 1; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

/* ---------- Single vacancy ---------- */
.vp-single__hero { max-height: 520px; overflow: hidden; border-radius: var(--vp-radius); margin-top: 40px; box-shadow: var(--vp-shadow); }
.vp-single__hero img { width: 100%; object-fit: cover; max-height: 520px; }
.vp-single__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; padding: 48px 0 96px; align-items: start; }
@media (max-width: 860px) { .vp-single__grid { grid-template-columns: 1fr; } }
.vp-facts {
  background: var(--vp-bg-alt); border-radius: var(--vp-radius);
  padding: 26px 28px; position: sticky; top: calc(var(--vp-header-h) + 24px);
}
.vp-facts h3 { font-size: 1.2rem; margin-bottom: 14px; }
.vp-facts dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: .95rem; }
.vp-facts dt { font-weight: 600; color: var(--vp-ink); font-size: .82rem; }
.vp-facts dd { color: var(--vp-body); }
.vp-facts .vp-btn { width: 100%; text-align: center; margin-top: 20px; }

/* ---------- Type chips (shared with map) ---------- */
.vp-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--vp-font-body); font-weight: 600; font-size: .82rem;
  background: #fff; border: 1px solid var(--vp-border); border-radius: 999px;
  padding: 5px 14px; color: var(--vp-ink);
}
.vp-chip__dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgb(0 0 0 / 35%); }

/* Chip with a hover/focus tooltip explaining the vacancy type */
.vp-chip--tip { position: relative; cursor: help; }
.vp-chip--tip::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 10px); left: 0;
  width: min(320px, 80vw);
  background: var(--vp-ink); color: #fff;
  padding: 10px 14px; border-radius: 10px;
  font-size: .85rem; font-weight: 400; line-height: 1.5;
  opacity: 0; visibility: hidden; transition: opacity .15s ease;
  pointer-events: none; z-index: 60;
}
.vp-chip--tip::before {
  content: ""; position: absolute; bottom: calc(100% + 4px); left: 22px;
  border: 6px solid transparent; border-top-color: var(--vp-ink);
  opacity: 0; visibility: hidden; transition: opacity .15s ease; z-index: 60;
}
.vp-chip--tip:hover::after, .vp-chip--tip:focus::after,
.vp-chip--tip:hover::before, .vp-chip--tip:focus::before { opacity: 1; visibility: visible; }

/* ---------- Footer ---------- */
.vp-footer { background: var(--vp-ink); color: #cdc4bb; padding: 64px 0 40px; margin-top: 0; }
.vp-footer a { color: #e7e0d9; text-decoration: none; }
.vp-footer a:hover { color: var(--vp-green); }
.vp-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 700px) { .vp-footer__grid { grid-template-columns: 1fr; } }
.vp-footer h4 { color: #fff; font-size: 1.15rem; margin-bottom: 14px; }
.vp-footer ul { list-style: none; }
.vp-footer li { margin: 8px 0; }
.vp-footer__legal { border-top: 1px solid rgb(255 255 255 / 14%); margin-top: 48px; padding-top: 24px; font-size: .85rem; color: #a3988c; }
