/**
 * Parrot Bliss — Homepage styles
 * Replaces Divi hero + intro + blog grid sections.
 * Class prefix: ph-  (Parrot Home)
 */

/* ──────── Hero ──────── */
.ph-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.ph-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 5%;
  display: block;
}

/* Logged-in users have a 32px WP admin bar */
.admin-bar .ph-hero img {
  object-position: center 7%;
}

/* ──────── Shared container ──────── */
.ph-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ──────── Intro ──────── */
.ph-intro {
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  background: #fff;
}

.ph-intro-headline {
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #333;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  padding: 0;
}

.ph-intro-links {
  font-size: 1.0625rem;
  font-weight: 700;
  font-style: italic;
  margin: 0 0 1rem;
  line-height: 2;
  padding: 0;
}

.ph-intro-links a {
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.ph-intro-links a:hover {
  opacity: 0.75;
}

/* Match existing Divi link colors exactly */
.ph-intro-links a:nth-child(1) {
  color: var(--pb-accent);
} /* Videos  → Divi blue  */
.ph-intro-links a:nth-child(2) {
  color: var(--pb-accent);
} /* Books   → Amazon red */
.ph-intro-links a:nth-child(3) {
  color: var(--pb-gold);
} /* Products → shop green */

.ph-intro-tagline {
  font-size: 1.175rem;
  font-weight: 700;
  font-style: italic;
  color: #555;
  margin: 0;
  padding: 0;
}

.ph-intro-cta {
  margin: 28px 0 0;
  padding: 0;
}

.ph-parrots-cta {
  display: inline-block !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  text-decoration: none !important;
  background: var(--pb-accent) !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 16px 40px !important;
  box-shadow: 0 6px 24px rgba(187, 5, 7, 0.35) !important;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease !important;
  letter-spacing: 0.01em !important;
}

.ph-parrots-cta:hover {
  background: var(--pb-accent-deep) !important;
  color: #fff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 32px rgba(187, 5, 7, 0.45) !important;
}

/* ──────── Recent Posts ──────── */
.ph-posts {
  padding: 5rem 0;
  background: var(--pb-surface);
}

.ph-posts-heading {
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 700;
  color: #333;
  text-align: center;
  margin: 0 0 1rem;
  padding: 0;
}

.ph-posts-lead {
  text-align: center;
  color: #666;
  font-size: 0.9375rem;
  line-height: 2;
  max-width: 640px;
  margin: 0 auto 3rem;
  padding: 0;
}

.ph-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ──────── Post card ──────── */
.ph-post-card {
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 52px 80px rgba(0, 36, 73, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ph-post-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.ph-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.ph-post-card:hover .ph-post-thumb img {
  transform: scale(1.04);
}

.ph-post-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ph-post-title {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 0.75rem;
  padding: 0;
}

.ph-post-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ph-post-title a:hover {
  color: var(--pb-accent);
}

.ph-post-excerpt {
  font-size: 0.9375rem;
  line-height: 1.9;
  color: #666;
  margin: 0 0 1.25rem;
  padding: 0;
  flex: 1;
}

.ph-post-more {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--pb-accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}

.ph-post-more:hover {
  color: var(--pb-gold);
}

/* ──────── Responsive ──────── */
@media (max-width: 1024px) and (min-width: 769px) {
  .ph-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* 65vw gives enough height to clear the nav overlay while keeping most image width */
  .ph-hero {
    height: 65vw;
  }

  .ph-hero img {
    object-position: center 38%;
  }

  .ph-intro {
    padding: 3rem 1.25rem;
  }

  .ph-posts {
    padding: 3.5rem 0;
  }

  .ph-container {
    padding: 0 1.25rem;
  }

  .ph-posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .ph-intro-headline {
    font-size: 2rem;
  }

  .ph-intro-tagline {
    font-size: 1rem;
  }
}

/* ──────── Reduced motion ──────── */
@media (prefers-reduced-motion: reduce) {
  .ph-post-thumb img,
  .ph-intro-links a,
  .ph-post-title a,
  .ph-post-more {
    transition: none;
  }

  .ph-post-card:hover .ph-post-thumb img {
    transform: none;
  }
}

/* ──────────────────────────────────────────────
   Shared section utilities
────────────────────────────────────────────── */
.ph-eyebrow {
  display: block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pb-accent);
  margin: 0 0 0.75rem;
}

.ph-eyebrow--light {
  color: var(--pb-violet-soft);
}

.ph-section-title {
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--pb-ink-deep);
  margin: 0 0 1rem;
  line-height: 1.25;
}

.ph-section-lead {
  font-size: 1rem;
  line-height: 1.9;
  color: #555;
  max-width: 560px;
  margin: 0 0 2rem;
}

.ph-btn-dark {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--pb-ink-deep);
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 3px;
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 26, 46, 0.14);
  transition:
    background 0.22s ease,
    transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.ph-btn-dark:hover {
  background: var(--pb-violet);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 26, 46, 0.22);
}

.ph-btn-dark:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(26, 26, 46, 0.12);
  transition-duration: 0.07s, 0.07s, 0.07s;
}

.ph-btn-sky {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--pb-accent);
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 3px;
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(46, 163, 242, 0.2);
  transition:
    background 0.22s ease,
    transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.ph-btn-sky:hover {
  background: var(--pb-violet);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46, 163, 242, 0.32);
}

.ph-btn-sky:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(46, 163, 242, 0.15);
  transition-duration: 0.07s, 0.07s, 0.07s;
}

/* Arrow spans — slide right on hover */
.ph-arrow {
  display: inline-block;
  transition: transform 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

.ph-btn-dark:hover .ph-arrow,
.ph-btn-sky:hover .ph-arrow,
.ph-post-more:hover .ph-arrow,
.ph-video-link:hover .ph-arrow {
  transform: translateX(4px);
}

/* Parrot emoji — tilt on hover (discovery reward) */
.ph-parrot {
  display: inline-block;
  cursor: default;
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  transform-origin: center bottom;
}

.ph-parrot:hover {
  transform: rotate(-22deg) scale(1.4);
}

/* ──────── Bond Book ──────── */
.ph-book {
  padding: 4rem 0 4.5rem;
  background: var(--pb-surface);
}

.ph-book .ph-container {
  max-width: 960px;
}

.ph-book-inner {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 4rem;
  align-items: center;
}

.ph-book-img img {
  width: 100%;
  /* Required alongside the width/height attributes added 2026-08-06: without it
     the height attribute acts as a presentational hint and stretches the image
     (320x595 instead of 320x454). height:auto makes the attributes supply the
     aspect ratio only, which is the point — reserving the box without CLS. */
  height: auto;
  border-radius: 4px;
  display: block;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

.ph-book-text {
  max-width: 520px;
}

.ph-book-title {
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  font-style: italic;
  color: var(--pb-ink-deep);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.ph-book-desc {
  font-size: 1rem;
  line-height: 1.9;
  color: #555;
  margin: 0 0 2rem;
}

@media (max-width: 900px) {
  .ph-book-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }

  .ph-book-img {
    max-width: 320px;
    margin: 0 auto;
  }

  .ph-book-text {
    max-width: 100%;
  }

  .ph-section-lead {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ──────── Newsletter ──────── */
.ph-newsletter {
  padding: 4rem 0;
  background: var(--pb-low);
  text-align: center;
}

.ph-newsletter-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ph-newsletter-inner .ph-section-lead {
  text-align: center;
}

.ph-newsletter-embed {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.ph-newsletter-embed iframe {
  width: 100%;
  height: 180px;
  border: none;
  display: block;
}

/* ──────── YouTube ──────── */
.ph-video {
  padding: 5rem 0;
  background: #fff;
  text-align: center;
}

.ph-video-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ph-video-wrap {
  position: relative;
  width: 100%;
  max-width: 740px;
  padding-top: min(56.25%, calc(740px * 9 / 16));
  margin: 0 auto 1.5rem;
}

.ph-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 4px;
}

.ph-video-link {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--pb-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.ph-video-link:hover {
  color: var(--pb-ink-deep);
}

/* ──────── Consultations ──────── */
.ph-consult {
  padding: 5.5rem 0;
  background: var(--pb-ink-deep);
  text-align: center;
}

.ph-consult-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ph-consult-title {
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  font-style: italic;
  color: #fff;
  margin: 0 0 1rem;
  line-height: 1.25;
}

.ph-consult-lead {
  font-size: 1rem;
  line-height: 1.9;
  color: #a8b4c8;
  max-width: 560px;
  margin: 0 0 2.25rem;
  text-align: center;
}

/* ──────── Mobile: new sections ──────── */
@media (max-width: 768px) {
  .ph-book,
  .ph-newsletter,
  .ph-video,
  .ph-consult {
    padding: 3.5rem 0;
  }
}

/* ──────── Book image hover ──────── */
.ph-book-img img {
  transition:
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.ph-book-img:hover img {
  transform: scale(1.02);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.18);
}

/* ──────── Consultations CTA pulse ──────── */
@keyframes ph-glow {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(46, 163, 242, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(46, 163, 242, 0.12),
      0 8px 28px rgba(46, 163, 242, 0.36);
  }
}

.ph-consult .ph-btn-sky {
  animation: ph-glow 2.8s ease-in-out infinite;
}

.ph-consult .ph-btn-sky:hover {
  animation: none;
}

/* ──────── Scroll reveal ──────── */
[data-ph-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.55s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.55s cubic-bezier(0.25, 1, 0.5, 1);
}

[data-ph-reveal].ph-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ──────── Reduced motion: new sections ──────── */
@media (prefers-reduced-motion: reduce) {
  .ph-btn-dark,
  .ph-btn-sky,
  .ph-video-link,
  .ph-book-img img {
    transition: none;
  }

  .ph-consult .ph-btn-sky {
    animation: none;
  }

  [data-ph-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ──────── Find Your Parrot (species directory promo) ──────── */
.ph-finder {
  padding: 3.5rem 0 4rem;
  background: var(--pb-surface);
  border-top: 1px solid var(--pb-soft);
  border-bottom: 1px solid var(--pb-soft);
  text-align: center;
}

.ph-finder-inner {
  max-width: 960px;
}

.ph-finder .ph-eyebrow {
  color: var(--pb-accent-hover);
}

.ph-finder .ph-section-title {
  font-style: italic;
}

.ph-finder .ph-section-lead {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

.ph-finder-thumbs {
  display: grid;
  /* minmax(0,…) not 1fr: a plain `1fr` is `minmax(auto, 1fr)`, whose auto floor is
     the track's min-content. If a thumbnail 404s, the broken <img> falls back to its
     alt text and that text becomes the min-content — widening the tracks until the
     whole page scrolls sideways on mobile. Happened live: three .webp thumbs were
     deleted by the 2026-07-02 WebP sweep and the grid blew out to 613px at a 375px
     viewport. Pinning the floor to 0 keeps a missing image a missing image. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.875rem;
  margin: 0 0 1.75rem;
}

.ph-finder-thumb {
  display: block;
  /* Grid items default to min-width:auto (= min-content), which would overflow the
     track above on its own. Belt and braces with the minmax(0,…) tracks. */
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

.ph-finder-thumb--available {
  position: relative;
}

.ph-finder-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--pb-accent-hover);
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  z-index: 2;
  pointer-events: none;
}

.ph-finder-thumb:hover {
  transform: translateY(-3px);
}

.ph-finder-thumb img {
  width: 100%;
  /* height:auto is what makes aspect-ratio work at all. The <img> tags carry HTML
     width/height attributes (300x169, 300x200, 300x236); those map to presentational
     `height`, and with `width:100%` that makes BOTH dimensions definite, so the
     aspect-ratio below is ignored entirely and each tile renders at its source height
     (169/169/200/236px — visibly ragged, misaligned captions). Worse, the resulting
     box was ~162 x source-height, which cover-cropped a flat 46% off EVERY image's
     width and clipped the Scarlet Macaw's and Conure's beaks. Do not remove the
     width/height attrs to fix this — they prevent layout shift. */
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  box-shadow: 0 6px 20px rgba(26, 26, 46, 0.1);
  transition: box-shadow 0.22s ease;
}

.ph-finder-thumb:hover img {
  box-shadow: 0 12px 28px rgba(26, 26, 46, 0.18);
}

.ph-finder-thumb-name {
  display: block;
  margin-top: 0.625rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--pb-ink-deep);
  letter-spacing: 0.01em;
}

.ph-finder-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.ph-finder-chip {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--pb-ink-soft);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--pb-outline-soft);
  border-radius: 9999px;
  letter-spacing: 0.02em;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.ph-finder-chip:hover {
  background: var(--pb-accent-hover);
  color: #fff;
  border-color: var(--pb-accent-hover);
  transform: translateY(-1px);
}

.ph-finder-cta {
  background: var(--pb-accent-hover);
  box-shadow: 0 2px 8px rgba(143, 0, 3, 0.2);
}

.ph-finder-cta:hover {
  background: var(--pb-accent-deep);
  box-shadow: 0 8px 24px rgba(143, 0, 3, 0.32);
}

@media (max-width: 640px) {
  .ph-finder {
    padding: 2.75rem 0 3rem;
  }
  .ph-finder-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .ph-finder-thumb-name {
    font-size: 0.8125rem;
  }
  .ph-finder-chip {
    font-size: 0.75rem;
    padding: 0.4375rem 0.875rem;
  }
}

/* ──────── Care Guide Library promo ──────── */
.ph-guides {
  position: relative;
  padding: 4rem 0 4.5rem;
  background:
    radial-gradient(
      circle at 20% 0%,
      rgba(143, 0, 3, 0.08) 0%,
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 100%,
      rgba(224, 169, 60, 0.1) 0%,
      transparent 45%
    ),
    linear-gradient(180deg, var(--pb-ink-deep) 0%, var(--pb-ink-deep) 100%);
  color: var(--pb-low);
  text-align: center;
  overflow: hidden;
}

.ph-guides-inner {
  max-width: 760px;
}

.ph-guides-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(143, 0, 3, 0.95);
  color: #fff;
  margin: 0 0 1.25rem;
  box-shadow: 0 12px 32px rgba(143, 0, 3, 0.45);
}

.ph-guides-icon svg {
  width: 32px;
  height: 32px;
}

.ph-guides-eyebrow {
  color: var(--pb-soft);
}

.ph-guides-title {
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  font-weight: 700;
  font-style: italic;
  color: #fff;
  margin: 0 0 0.85rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.ph-guides-lead {
  font-size: 1.04rem;
  line-height: 1.6;
  color: #d8c8b9;
  max-width: 620px;
  margin: 0 auto 1.6rem;
}

.ph-guides-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.ph-guides-topic {
  display: inline-block;
  padding: 0.42rem 0.95rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pb-low);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 214, 168, 0.25);
  border-radius: 9999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ph-guides-cta {
  background: var(--pb-accent-hover);
  color: #fff;
  border-radius: 9999px;
  padding: 14px 30px;
  font-size: 1rem;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 28px rgba(143, 0, 3, 0.55);
}

.ph-guides-cta:hover {
  background: var(--pb-accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(143, 0, 3, 0.65);
}

@media (max-width: 640px) {
  .ph-guides {
    padding: 3rem 0 3.25rem;
  }
  .ph-guides-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }
  .ph-guides-icon svg {
    width: 28px;
    height: 28px;
  }
  .ph-guides-lead {
    font-size: 0.96rem;
  }
  .ph-guides-topic {
    font-size: 0.72rem;
    padding: 0.36rem 0.78rem;
  }
  .ph-guides-cta {
    padding: 12px 24px;
    font-size: 0.94rem;
  }
}
