/**
 * Hearts to Homes — UI Refinement (Phase 1 + Phase 2)
 * Phase 1 pilot: index.html, blog.html
 * Phase 2: index, blog, community hub, contact, FAQ (+ shared tokens)
 * @see docs/DESIGN-SYSTEM.md
 */

:root {
  --h2h-ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Enriched rose — brand #C4788A family, slightly deepened for CTA weight & contrast */
  --h2h-primary: #b5687c;
  --h2h-primary-hover: #9e5a6a;
  --h2h-shadow-soft: 0 4px 20px rgba(68, 38, 48, 0.06);
  --h2h-shadow-lift: 0 12px 40px rgba(68, 38, 48, 0.10);
  --h2h-shadow-hover: 0 20px 56px rgba(68, 38, 48, 0.12);
  --h2h-space-section: clamp(60px, 8vw, 100px);
  --h2h-space-card: clamp(24px, 2.5vw, 34px);
  --h2h-focus-ring: 0 0 0 4px rgba(196, 120, 138, 0.22);
}

/* ── PRIMARY BUTTONS ─────────────────────────────────────────────── */

.btn-primary,
.fyf-promo-cta,
.btn-submit,
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 32px;
  background: var(--h2h-primary);
  color: #fff;
  border: 1.5px solid var(--h2h-primary);
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.22em;
  animation: none;
  transition:
    background 0.35s var(--h2h-ease),
    border-color 0.35s var(--h2h-ease),
    transform 0.35s var(--h2h-ease),
    box-shadow 0.35s ease;
}

.btn-primary:hover,
.fyf-promo-cta:hover,
.btn-submit:hover,
.btn-cta:hover {
  background: var(--h2h-primary-hover);
  border-color: var(--h2h-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--h2h-shadow-lift);
}

.btn-primary:focus-visible,
.fyf-promo-cta:focus-visible,
.btn-submit:focus-visible,
.btn-cta:focus-visible,
.btn-pill:focus-visible {
  outline: 2px solid var(--h2h-primary-hover);
  outline-offset: 4px;
  box-shadow: var(--h2h-focus-ring);
}

.btn-primary:active,
.fyf-promo-cta:active,
.btn-submit:active,
.btn-cta:active {
  transform: translateY(0);
}

/* Hero CTA — subtle resting depth so primary draws the eye first */
.hero-actions .btn-primary {
  box-shadow: 0 2px 12px rgba(158, 90, 106, 0.28);
}

.hero-actions .btn-primary:hover {
  box-shadow: var(--h2h-shadow-lift);
}

.newsletter-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 24px;
  background: var(--h2h-primary);
  border: 1.5px solid var(--h2h-primary);
  letter-spacing: 0.2em;
  transition:
    background 0.35s var(--h2h-ease),
    border-color 0.35s var(--h2h-ease),
    transform 0.35s var(--h2h-ease),
    box-shadow 0.35s ease;
}

.newsletter-form button:hover {
  background: var(--h2h-primary-hover);
  border-color: var(--h2h-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--h2h-shadow-soft);
}

.newsletter-form button:focus-visible {
  outline: 2px solid var(--h2h-primary-hover);
  outline-offset: 3px;
}

.video-btn {
  min-height: 48px;
  transition:
    background 0.35s var(--h2h-ease),
    gap 0.35s var(--h2h-ease),
    transform 0.35s var(--h2h-ease),
    box-shadow 0.35s ease;
}

.video-btn:hover {
  background: var(--h2h-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--h2h-shadow-soft);
}

.video-btn:focus-visible {
  outline: 2px solid var(--h2h-primary-hover);
  outline-offset: 4px;
}

/* ── OUTLINE BUTTONS ───────────────────────────────────────────────── */

.btn-secondary,
.post-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 32px;
  background: transparent;
  color: var(--rose-dark);
  border: 1.5px solid rgba(158, 90, 106, 0.4);
  letter-spacing: 0.22em;
  font-weight: 600;
  transition:
    background 0.35s var(--h2h-ease),
    border-color 0.35s var(--h2h-ease),
    color 0.35s var(--h2h-ease),
    transform 0.35s var(--h2h-ease),
    box-shadow 0.35s ease,
    gap 0.35s var(--h2h-ease);
}

.btn-secondary:hover,
.post-link:hover {
  background: var(--h2h-primary);
  border-color: var(--h2h-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--h2h-shadow-soft);
}

.btn-secondary:focus-visible,
.post-link:focus-visible,
.faq-summary:focus-visible {
  outline: 2px solid var(--h2h-primary);
  outline-offset: 4px;
}

/* ── NAVIGATION CTA ────────────────────────────────────────────────── */

.nav-cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 24px !important;
  letter-spacing: 0.22em !important;
  transition:
    background 0.35s var(--h2h-ease),
    transform 0.35s var(--h2h-ease),
    box-shadow 0.35s ease !important;
}

.nav-cta:hover {
  background: var(--h2h-primary-hover) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(68, 38, 48, 0.12) !important;
}

.nav-cta:focus-visible {
  outline: 2px solid var(--h2h-primary-hover);
  outline-offset: 3px;
}

/* ── BLOG CARDS ────────────────────────────────────────────────────── */

.blog-card {
  border: 1px solid var(--border-rose);
  box-shadow: var(--h2h-shadow-soft);
  transition:
    transform 0.45s var(--h2h-ease),
    box-shadow 0.45s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--h2h-shadow-hover);
}

.blog-card-image {
  transition: transform 1.2s var(--h2h-ease);
}

.blog-card:hover .blog-card-image-link[data-media-frame="photo"] .blog-card-image,
.blog-card:hover .blog-card-image-link:not([data-media-frame]) .blog-card-image {
  transform: scale(1.03);
}

.blog-card:hover .blog-card-image-link[data-media-frame="artwork"] .blog-card-image,
.blog-card:hover .blog-card-image-link[data-media-frame="portrait-photo"] .blog-card-image {
  transform: none;
}

.featured-post:hover .featured-post-image[data-media-frame="photo"] img {
  transform: none;
}

.featured-post:hover .featured-post-image[data-media-frame="artwork"] img,
.featured-post:hover .featured-post-image[data-media-frame="portrait-photo"] img {
  transform: none;
}

.blog-card-image-link::after {
  background: linear-gradient(to top, rgba(68, 38, 48, 0.12) 0%, transparent 48%);
}

.blog-card-content {
  padding: var(--h2h-space-card) var(--h2h-space-card) calc(var(--h2h-space-card) + 4px);
}

.blog-card-excerpt {
  margin-bottom: 24px;
}

.blog-card-title {
  margin-bottom: 16px;
  line-height: 1.32;
}

/* ── FEATURED POST (BLOG) ──────────────────────────────────────────── */

.featured-post {
  border: 1px solid var(--border-rose);
  box-shadow: var(--h2h-shadow-lift);
  transition:
    transform 0.45s var(--h2h-ease),
    box-shadow 0.45s ease;
}

.featured-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--h2h-shadow-hover);
}

.featured-post-image img {
  transition: transform 1.2s var(--h2h-ease);
}

.featured-post:hover .featured-post-image[data-media-frame="photo"] img {
  transform: scale(1.03);
}

.featured-post-image::after {
  background: linear-gradient(135deg, rgba(196, 120, 138, 0) 50%, rgba(68, 38, 48, 0.08) 100%);
}

.featured-post-content {
  padding: clamp(36px, 5vw, 60px) clamp(28px, 4vw, 56px);
}

/* ── SECTION SPACING ───────────────────────────────────────────────── */

.services-section,
.team-section,
.listimonials-section,
.listings-section {
  padding-top: var(--h2h-space-section);
  padding-bottom: var(--h2h-space-section);
}

.about-section {
  padding-top: clamp(68px, 9vw, 110px);
  padding-bottom: clamp(68px, 9vw, 110px);
}

.video-section {
  padding-top: clamp(56px, 7vw, 90px);
  padding-bottom: var(--h2h-space-section);
}

.fyf-promo-section {
  padding-top: clamp(56px, 7vw, 90px);
  padding-bottom: clamp(56px, 7vw, 90px);
}

.featured-section {
  padding-top: var(--h2h-space-section);
  padding-bottom: clamp(48px, 6vw, 80px);
}

.blog-grid-section {
  padding-bottom: var(--h2h-space-section);
}

.vlog-section {
  padding-top: var(--h2h-space-section);
  padding-bottom: var(--h2h-space-section);
}

.newsletter-section {
  padding-top: clamp(56px, 7vw, 80px);
  padding-bottom: clamp(56px, 7vw, 80px);
}

/* ══════════════════════════════════════════════════════════════════════
   PHASE 2 — Visitor-facing components
   Verification: service accent = architectural hairline (low contrast)
   Guide cards = stretched link click affordance (no hover pop-up CTA)
   ══════════════════════════════════════════════════════════════════════ */

/* ── SERVICE CARDS (index) ─────────────────────────────────────────── */

.services-grid .service-card,
.service-card {
  border: 1px solid var(--border-rose);
  box-shadow: var(--h2h-shadow-soft);
  padding: clamp(40px, 4vw, 52px) clamp(32px, 3vw, 40px);
  transition:
    transform 0.45s var(--h2h-ease),
    box-shadow 0.45s ease;
}

.services-grid .service-card::before,
.service-card::before {
  height: 2px !important;
  background: rgba(158, 90, 106, 0.38) !important;
  opacity: 0.22 !important;
  transition: opacity 0.45s var(--h2h-ease) !important;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--h2h-shadow-hover);
}

.service-card:hover::before {
  opacity: 0.42 !important;
  height: 2px !important;
}

.service-card .service-body {
  line-height: 1.82;
}

.service-card .service-link {
  letter-spacing: 0.22em;
  color: var(--rose-dark);
  transition: gap 0.35s var(--h2h-ease), color 0.35s ease;
}

.service-card:hover .service-link {
  color: var(--rose);
}

/* ── TESTIMONIAL CARDS (index) ─────────────────────────────────────── */

.testimonial-card {
  background: #fffcfa;
  border: 1px solid var(--border-rose);
  box-shadow: var(--h2h-shadow-soft);
  padding: var(--h2h-space-card) clamp(28px, 3vw, 38px);
}

.testimonial-mark {
  color: var(--rose-dark) !important;
  opacity: 0.28;
  font-size: 64px !important;
  margin-bottom: 20px !important;
}

.testimonial-stars {
  font-size: 13px;
  letter-spacing: 0.18em;
}

.testimonial-text {
  line-height: 1.88;
}

/* ── COMMUNITY GUIDE CARDS (hub) ───────────────────────────────────── */

.guide-card {
  position: relative;
  box-shadow: var(--h2h-shadow-soft);
  transition:
    transform 0.45s var(--h2h-ease),
    box-shadow 0.45s ease,
    border-color 0.35s ease;
  cursor: pointer;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--h2h-shadow-hover);
  border-color: rgba(196, 120, 138, 0.35);
}

.guide-card .card-overlay,
.guide-card .card-cta-reveal {
  display: none !important;
}

.guide-card .card-visual,
.guide-card .card-body {
  pointer-events: none;
}

.guide-card .card-body {
  padding: var(--h2h-space-card) clamp(22px, 2.5vw, 28px) clamp(20px, 2vw, 24px);
}

.guide-card:hover .card-community-name {
  color: var(--rose-dark);
}

.guide-card .card-read-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose-dark);
  border-bottom: 1.5px solid var(--rose);
  padding-bottom: 5px;
  pointer-events: auto;
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.35s var(--h2h-ease), color 0.35s ease, border-color 0.35s ease;
}

.guide-card:hover .card-read-link {
  color: var(--rose);
  gap: 12px;
}

.guide-card .card-read-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.guide-card .card-read-link:focus-visible {
  outline: 2px solid var(--rose-dark);
  outline-offset: 4px;
  box-shadow: var(--h2h-focus-ring);
}

.guide-card .card-footer {
  border-top: 1px solid var(--border-rose);
  padding-top: 18px;
  margin-top: auto;
}

.guide-card:hover .card-footer {
  border-top-color: rgba(196, 120, 138, 0.35);
}

/* ── FAQ ───────────────────────────────────────────────────────────── */

.faq-item {
  box-shadow: var(--h2h-shadow-soft);
  transition: box-shadow 0.45s var(--h2h-ease), border-color 0.35s ease;
}

.faq-item[open] {
  box-shadow: var(--h2h-shadow-soft);
  border-left: 3px solid var(--rose-dark);
}

.faq-summary {
  transition: color 0.35s ease;
}

.faq-item[open] .faq-toggle {
  background: var(--rose-dark);
}

.faq-answer {
  padding: 0 28px 28px;
  line-height: 1.88;
}

/* ── FORM CONTROLS (contact, index CTA, newsletter inputs) ─────────── */

.contact-form input,
.contact-form select,
.contact-form textarea,
.cta-form input,
.cta-form select,
.cta-form textarea,
.newsletter-form input {
  min-height: 48px;
  background: #fdf8f5;
  border: 1px solid rgba(158, 90, 106, 0.28);
  transition:
    border-color 0.35s var(--h2h-ease),
    box-shadow 0.35s ease,
    background 0.35s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus,
.cta-form input:focus,
.cta-form select:focus,
.cta-form textarea:focus,
.newsletter-form input:focus {
  border-color: var(--rose);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196, 120, 138, 0.18);
}

.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible,
.cta-form input:focus-visible,
.cta-form select:focus-visible,
.cta-form textarea:focus-visible,
.newsletter-form input:focus-visible {
  outline: 2px solid var(--rose-dark);
  outline-offset: 2px;
}

.contact-form select,
.cta-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239e5a6a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
  cursor: pointer;
}

.contact-form textarea,
.cta-form textarea {
  min-height: 120px;
  padding-top: 14px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 18px;
  background: var(--h2h-primary);
  color: #fff;
  border: 1.5px solid var(--h2h-primary);
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition:
    background 0.35s var(--h2h-ease),
    border-color 0.35s var(--h2h-ease),
    box-shadow 0.35s ease;
}

.btn-submit:hover {
  background: var(--h2h-primary-hover);
  border-color: var(--h2h-primary-hover);
  box-shadow: var(--h2h-shadow-soft);
}

/* Hub / FAQ btn-pill — align sizing with Phase 1 buttons (0 radius editorial) */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 28px;
  letter-spacing: 0.22em;
  transition:
    background 0.35s var(--h2h-ease),
    border-color 0.35s var(--h2h-ease),
    color 0.35s var(--h2h-ease),
    transform 0.35s var(--h2h-ease),
    box-shadow 0.35s ease;
}

.btn-pill:hover {
  background: var(--h2h-primary-hover);
  border-color: var(--h2h-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--h2h-shadow-soft);
}

.btn-pill.outline:hover {
  background: var(--h2h-primary);
  border-color: var(--h2h-primary);
  color: #fff;
}

.btn-pill.gold,
.btn-pill.gold:hover {
  background: var(--h2h-primary);
  border-color: var(--h2h-primary);
  color: #fff;
}

/* ── FORM SUCCESS / ERROR MESSAGES ─────────────────────────────────── */

.h2h-form-message {
  padding: 28px 24px;
  background: #fffcfa;
  border: 1px solid var(--border-rose);
  box-shadow: var(--h2h-shadow-soft);
  text-align: center;
}

.h2h-form-message--success {
  border-left: 3px solid var(--gold);
}

.h2h-form-message--error {
  border-left: 3px solid var(--rose-dark);
}

.h2h-form-message__title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 500;
  color: #2A2522;
  margin-bottom: 10px;
}

.h2h-form-message--error .h2h-form-message__title {
  color: var(--rose-dark);
}

.h2h-form-message__body {
  font-size: 14px;
  color: #4a3038;
  line-height: 1.75;
}

.h2h-form-message__body a {
  color: var(--rose-dark);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(158, 90, 106, 0.35);
}

.h2h-form-message__ref {
  font-size: 10px;
  color: #7a6060;
  margin-top: 12px;
  opacity: 0.75;
}

/* ── SECTION RHYTHM (index headers, hub cat-section) ───────────────── */

.divider {
  animation: none !important;
  background-size: 100% auto !important;
}

.services-header,
.testimonials-header {
  margin-bottom: 56px;
}

.cat-section {
  padding-top: var(--h2h-space-section);
  padding-bottom: var(--h2h-space-section);
}

.cat-header {
  margin-bottom: 56px;
}

.faq-section {
  padding-top: clamp(56px, 7vw, 70px);
  padding-bottom: clamp(56px, 7vw, 70px);
}

.cta-section {
  padding-top: clamp(68px, 9vw, 110px);
  padding-bottom: clamp(68px, 9vw, 110px);
}

.contact-form-wrap {
  box-shadow: var(--h2h-shadow-soft);
}

/* ── REDUCED MOTION ────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .btn-secondary,
  .post-link,
  .fyf-promo-cta,
  .nav-cta,
  .btn-submit,
  .btn-cta,
  .btn-pill,
  .newsletter-form button,
  .video-btn,
  .blog-card,
  .featured-post,
  .blog-card-image,
  .featured-post-image img,
  .service-card,
  .guide-card {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }

  .btn-primary:hover,
  .btn-secondary:hover,
  .post-link:hover,
  .fyf-promo-cta:hover,
  .nav-cta:hover,
  .btn-submit:hover,
  .btn-cta:hover,
  .btn-pill:hover,
  .newsletter-form button:hover,
  .video-btn:hover,
  .blog-card:hover,
  .featured-post:hover,
  .service-card:hover,
  .guide-card:hover {
    transform: none;
  }

  .blog-card:hover .blog-card-image-link[data-media-frame="photo"] .blog-card-image,
  .blog-card:hover .blog-card-image-link:not([data-media-frame]) .blog-card-image,
  .featured-post:hover .featured-post-image[data-media-frame="photo"] img {
    transform: none;
  }

  .divider {
    animation: none !important;
  }
}
