/*
Theme Name: HappiTravel Blog
Template: twentytwentyfive
Description: HappiTravel branded child theme for the HappiTravel blog (happitravel.com/blog). Overrides typography, color palette, header, and footer with HappiTravel branding. Brand reference: docs/HAPPITRAVEL_BRAND.md in the happitravel repo.
Version: 2.2
Author: HappiTravel
Text Domain: happitravel-blog
*/

/* ─── Typography ─────────────────────────────────────────────────────────── */
/* Fonts loaded via wp_enqueue_style in functions.php (happitravel-blog-fonts):
   Open Sans 400/600/700 + Playfair Display 700/800/700italic.
   font-weight 400 + letter-spacing normal are set EXPLICITLY because the
   Twenty Twenty-Five parent declares 300 / -0.1px globally and our body rule
   didn't previously override them — so prose was rendering as Light. */
body,
p,
li,
td,
.wp-block-post-content,
.wp-block-navigation,
.wp-block-post-excerpt,
.wp-block-post-date {
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: #1d2939;
  font-weight: 400;
  letter-spacing: normal;
}

/* Article body prose — match happitravel.com /faq/ /happiscience/ body p:
   1.1rem (17.6px) / weight 400 / line-height 1.7 / softer #555 text */
.wp-block-post-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #555;
}

/* Display headings match happitravel.com: Open Sans 700, tight letter-spacing.
   Verified via Playwright 2026-05-18: main site h2 (hero) = Open Sans 38.4px
   weight 700, h3 = Open Sans 20.8px weight 700. No Playfair on main site. */
h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-site-title,
.wp-block-heading {
  font-family: 'Open Sans', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1, .wp-block-post-title { color: #1d2939; font-weight: 700; }
h2 { color: #1d2939; }

/* Post title — fluid responsive size */
h1.entry-title,
.wp-block-post-title,
.wp-block-post-title a {
  font-size: clamp(2rem, 5vw, 3rem);
}

/* ─── Links ──────────────────────────────────────────────────────────────── */
a,
.wp-block-post-content a {
  color: #F39228;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover,
.wp-block-post-content a:hover {
  color: #d97d1a;
}

/* Category / term label links
   font-weight uses !important because Twenty Twenty-Five renders post-terms
   as <div style="font-weight:300"> — an inline style that beats every
   external selector except !important. Verified via Playwright 2026-05-17. */
.wp-block-post-terms,
.wp-block-post-terms a,
.wp-block-categories,
.wp-block-categories a {
  color: #F39228;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-family: 'Open Sans', system-ui, sans-serif;
  font-weight: 700 !important;
}

/* ─── Content width ──────────────────────────────────────────────────────── */
.wp-block-post-content,
.wp-block-post-content > .alignwide {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

/* Centering: belt-and-suspenders for FSE constrained-layout children so the article column never drifts left on narrower viewports */
.wp-site-blocks .entry-content,
.wp-block-post-content,
.wp-block-group.is-layout-constrained > *,
.is-layout-constrained > * {
  margin-left: auto;
  margin-right: auto;
}

/* Left-align body copy — override any upstream text-align: justify from parent theme or Gutenberg block styles */
p, li, blockquote {
  text-align: left;
}

/* Featured image matches content column width */
.wp-block-post-featured-image,
.wp-block-post-featured-image img {
  max-width: 860px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: block !important;
}

.wp-block-post-content {
  max-width: 860px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.wp-block-template-part + * {
  margin-top: 0 !important;
}

/* Kill excess whitespace after the article */
.wp-block-group.alignfull {
  padding-top: 40px !important;
  padding-bottom: 20px !important;
}

.wp-site-blocks > main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Remove the MORE POSTS gap */
.wp-block-query,
.wp-block-pattern-more-posts {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ─── Site header — pixel-clone of happitravel.com Layout.tsx sticky variant ─
   Source: app/src/components/Layout.tsx (non-home / scrolled state)
   isSticky=true → navBg=#fff, linkColor=#444, shadow=0 1px 4px rgba(0,0,0,0.15)
   Logo: /images/logo.members.png (dark), 40px tall; container 60px / 1140px / pad 0 15px
   Font: Open Sans 0.85rem weight 700; padding 0 12px; line-height 60px; no underline
   Login = link with .fas.fa-user; Signup = link with .fas.fa-check (plain link, no orange bg)
   Hamburger: white-on-dark pill (color #fff, bg rgba(0,0,0,0.38), 6px 8px, border-radius 5)
   Breakpoint 768px matches main-site index.css .nav-desktop / .nav-hamburger media rule.
*/

/* Offset FSE content so it doesn't sit under the fixed nav (mirrors Layout.tsx pt-[60px]) */
body.wp-theme-twentytwentyfive { padding-top: 60px; }

.ht-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.ht-header__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ht-header__logo {
  flex-shrink: 0;
  line-height: 0;
  display: inline-block;
  text-decoration: none;
}
.ht-header__logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Desktop nav — hidden under 768px */
.ht-nav-desktop {
  display: none;
  align-items: center;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
}
.ht-nav-desktop > a {
  color: #444;
  padding: 0 12px;
  line-height: 60px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  white-space: nowrap;
}
.ht-nav-desktop > a:hover,
.ht-nav-desktop > a:focus-visible { color: #F39228; }
/* sup/sub reset — mirrors Tailwind preflight, which applies globally on the
   React app at happitravel.com. UA default (vertical-align: super) expands the
   line box and pushes the HappiScience® <a> off the shared baseline; this
   reset keeps line-height contribution at 0 and shifts the glyph up via
   position:relative;top:-0.5em, which is what the main site computes to. */
sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }

.ht-nav-desktop > a > i.fas { margin-right: 5px; }

/* Hamburger — visible only below 768px (mirrors main-site styling: white icon on dark pill) */
.ht-nav-hamburger {
  display: flex;
  align-items: center;
  color: #ffffff;
  background: rgba(0,0,0,0.38);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 0;
}
.ht-nav-hamburger .ht-icon-close { display: none; }
.ht-nav-hamburger[aria-expanded="true"] .ht-icon-menu { display: none; }
.ht-nav-hamburger[aria-expanded="true"] .ht-icon-close { display: block; }

/* Mobile drawer */
.ht-mobile-drawer {
  display: none;
  background-color: #ffffff;
  border-top: 1px solid #eee;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
}
.ht-mobile-drawer.is-open { display: block; }
.ht-mobile-drawer__item {
  padding: 14px 24px;
  border-bottom: 1px solid #f0f0f0;
}
.ht-mobile-drawer__item a {
  color: #444;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}
.ht-mobile-drawer__item a:hover,
.ht-mobile-drawer__item a:focus-visible { color: #F39228; }
.ht-mobile-drawer__item a > i.fas { margin-right: 8px; }
.ht-mobile-drawer__item a.ht-mobile-drawer__signup {
  color: #ffffff;
  background-color: #F39228;
  padding: 10px 20px;
  border-radius: 4px;
}
.ht-mobile-drawer__item a.ht-mobile-drawer__signup:hover { color: #ffffff; }

@media (min-width: 768px) {
  .ht-nav-desktop   { display: flex; }
  .ht-nav-hamburger { display: none; }
  .ht-mobile-drawer { display: none !important; }
}

/* Hide parent theme's site-title block if it leaks through — we use the logo instead */
.wp-block-site-title { display: none; }

/* ─── Footer — pixel-clone of happitravel.com Layout.tsx footer ──────────────
   Source: app/src/components/Layout.tsx lines 216-322 + app/src/index.css
   lines 161-240. Two rows: content row on #0E0E0E (Be Happy / News / thumb),
   copyright bar on #060606 (logo / contact links / copyright text). Open Sans
   everywhere. Mirrors the React inline styles + .footer-bar* utility classes. */
.ht-footer {
  background-color: #0E0E0E;
  color: #bbb;
  font-family: 'Open Sans', sans-serif;
  /* Reset to main site's 16px / 1.5 base. Blog body is 17px / 1.75, which makes
     any em-scaled child (heading 1.4em, copyright bar 0.72em) render larger
     than main. Verified via Playwright 2026-05-18: main footer root = 16/24. */
  font-size: 16px;
  line-height: 1.5;
}
.ht-footer__body-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 15px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}
.ht-footer__col-be-happy { flex: 1 1 340px; }
.ht-footer__col-news     { flex: 1 1 200px; }

.ht-footer__heading {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.4em;
  color: #ddd;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 12px;
  letter-spacing: normal;
}
.ht-footer__heading sup { font-size: 0.6em; }

.ht-footer__lede {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: #999;
  margin: 0;
}
.ht-footer__license {
  font-size: 12px;
  line-height: 15px;
  color: #777;
  margin-top: 12px;
}
.ht-footer__news-scroll {
  height: 110px;
  overflow-y: auto;
}
.ht-footer__news-item {
  font-size: 14px;
  line-height: 18px;
  margin: 0 0 10px;
  color: #bbb;
}
.ht-footer__news-item a {
  color: #777;
  text-decoration: none;
}
.ht-footer__news-item a:hover { color: #F39228; }

/* Thumb image — mirrors main site Layout.tsx .footer-thumb */
.footer-thumb {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer-thumb img {
  display: block;
  max-width: 144px;
  height: auto;
}

/* Copyright bar (lower row, darker bg) */
.ht-footer__bar-wrap { background-color: #060606; }
.footer-bar {
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.footer-bar__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.footer-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 10px;
  text-decoration: none;
  color: inherit;
}
.footer-bar__link i { color: #777; font-size: 24px; line-height: 1; }
.footer-bar__link .ht-footer__bar-label {
  color: #777;
  font-size: 9px;
  line-height: 9px;
  text-transform: none;
  letter-spacing: normal;
}
.footer-bar__link strong { color: #fff; font-size: 14px; line-height: 21px; font-weight: 700; }
.footer-bar__link img { border: 0; height: 38px; }
.footer-bar__logo-wrap {
  display: flex;
  justify-content: flex-start;
}
.footer-bar__logo-wrap img {
  height: 38px;
  width: auto;
  object-fit: contain;
}
.footer-bar__copyright {
  text-align: center;
  font-size: 0.72em;
  line-height: 1.5;
  color: #555;
}
/* All three children are explicitly centered to override the earlier global
   `p, li, blockquote { text-align: left }` rule (specificity 0,0,1) which
   was winning over `.footer-bar__copyright { text-align: center }` for <p>
   descendants. text-align is inheritable, but our higher-specificity p rule
   blocked it. Verified via Playwright 2026-05-18. */
.footer-bar__copyright > div,
.footer-bar__copyright p {
  margin: 2px 0 0;
  font-weight: 400;
  font-size: inherit;
  line-height: inherit;
  color: #555;
  text-align: center;
  letter-spacing: normal;
}
.footer-bar__copyright > div:first-child { margin-top: 0; }
.footer-bar__copyright a { color: #555; text-decoration: none; }
.footer-bar__copyright a:hover { color: #F39228; }

@media (max-width: 767px) {
  .footer-bar {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 24px 15px;
  }
  .footer-bar__logo-wrap { justify-content: center; }
  .footer-bar__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 0;
    width: 100%;
    justify-items: center;
  }
  .footer-bar__link { margin: 0; }
  .footer-thumb { width: 100%; }
}

/* ─── Blog index / archive layout (home.html + archive.html) ────────────────
   Design language: editorial, magazine-feel, dark navy hero on warm-white
   page, brand orange used sparingly (eyebrow + pill hover + cat label). */

body.home,
body.archive,
body.blog,
body.category,
body.search {
  background: #faf8f4;
}

/* Hero band */
.ht-blog-hero {
  background: #1d2939;
  color: #faf8f4;
  padding: 96px 24px 88px;
  margin-bottom: 0;
  border-bottom: 4px solid #F39228;
}
.ht-blog-hero.is-compact {
  padding: 56px 24px 44px;
}
.ht-blog-hero__inner {
  max-width: 1140px;
  margin: 0 auto;
}
.ht-blog-hero__eyebrow {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #F39228;
  margin: 0 0 14px;
}
.ht-blog-hero__title {
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #faf8f4;
  margin: 0 0 18px;
  max-width: 22ch;
}
.ht-blog-hero.is-compact .ht-blog-hero__title {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  margin-bottom: 0;
}
.ht-blog-hero__lede {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(250, 248, 244, 0.85);
  margin: 0;
  max-width: 60ch;
}
.ht-blog-hero__title sup,
.ht-blog-hero__eyebrow sup { font-size: 0.5em; }

/* Category pills row */
.ht-blog-pills {
  background: #faf8f4;
  border-bottom: 1px solid #e5e8ed;
}
.ht-blog-pills__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ht-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #ffffff;
  color: #1d2939;
  border: 1px solid #e5e8ed;
  border-radius: 4px;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ht-pill:hover,
.ht-pill:focus-visible {
  background: #F39228;
  color: #ffffff;
  border-color: #F39228;
}
.ht-pill.is-active {
  background: #1d2939;
  color: #ffffff;
  border-color: #1d2939;
}
.ht-pill sup { font-size: 0.6em; }

/* Featured article (newest) */
.ht-featured-wrap {
  padding: 56px 24px 48px;
}
.ht-featured {
  display: grid;
  gap: 0;
  background: #ffffff;
  border: 1px solid #e5e8ed;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(22, 55, 80, 0.05);
}
/* max-width: none cancels the legacy single-post `.wp-block-post-featured-image
   { max-width: 860px !important }` rule which was leaking into the home-page
   featured card and grid cards, leaving a ~5px gap on the right of the image
   inside the 866px featured card. Verified via Playwright 2026-05-18. */
.ht-featured__image,
.ht-featured__image a,
.ht-featured__image img {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto;
  margin: 0 !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.ht-featured__body {
  padding: 36px clamp(20px, 4vw, 56px) 40px !important;
  margin: 0 !important;
  max-width: none !important;
}
.ht-featured__title,
.ht-featured__title a {
  font-family: 'Open Sans', system-ui, sans-serif !important;
  font-size: clamp(1.5rem, 2.6vw, 2rem) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em !important;
  color: #1d2939 !important;
  margin: 12px 0 14px !important;
  text-decoration: none !important;
}
.ht-featured__title a:hover { color: #F39228 !important; }
.ht-featured__excerpt,
.ht-featured__excerpt p {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #555;
  margin: 0 0 12px;
  font-weight: 400;
}

/* 2-column grid (and 3-column compact on single's "More Articles") */
.ht-grid-wrap,
.ht-more-wrap {
  padding: 16px 24px 80px;
}
.ht-more-wrap { padding-top: 64px; padding-bottom: 96px; border-top: 1px solid #e5e8ed; margin-top: 64px; }
.ht-more-heading {
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1d2939;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}
.ht-grid-wrap .wp-block-post-template.is-layout-grid,
.ht-more-wrap .wp-block-post-template.is-layout-grid {
  gap: 32px !important;
}

/* Article cards (used in grid + more-articles) */
.ht-card {
  background: #ffffff;
  border: 1px solid #e5e8ed;
  border-radius: 6px;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ht-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 55, 80, 0.08);
  border-color: #d8dde3;
}
.ht-card__image,
.ht-card__image a,
.ht-card__image img {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto;
  margin: 0 !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.ht-card__body {
  padding: 22px 24px 26px !important;
  margin: 0 !important;
  max-width: none !important;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ht-card__cat,
.ht-card__cat a {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
  color: #F39228 !important;
  text-decoration: none;
  margin: 0 !important;
  line-height: 1.4 !important;
}
.ht-card__title,
.ht-card__title a {
  font-family: 'Open Sans', system-ui, sans-serif !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: #1d2939 !important;
  margin: 10px 0 12px !important;
  text-decoration: none !important;
  letter-spacing: -0.01em !important;
}
.ht-card__title a:hover { color: #F39228 !important; }
.ht-card__excerpt,
.ht-card__excerpt p {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
  margin: 0 0 14px;
  font-weight: 400;
  flex: 1;
}
.ht-card__meta {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ht-card__readtime { color: #888; }

/* Compact variant for "More Articles" (3-up, no excerpt) */
.ht-card--compact .ht-card__body { padding: 18px 20px 22px !important; }
.ht-card--compact .ht-card__title { font-size: 1.15rem !important; margin: 8px 0 10px !important; }

/* Empty state inside any query */
.ht-grid-empty {
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 32px 0;
}

/* Single article: back-link + cat label above title */
.ht-back-link-wrap {
  max-width: 860px;
  margin: 28px auto 0;
  padding: 0 24px;
}
.ht-back-link {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1d2939;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}
.ht-back-link:hover { color: #F39228; }
/* Single post meta bar — category · read time, sits between title and featured image */
.ht-meta-bar {
  max-width: 860px;
  margin: 0 auto 28px !important;
  padding: 0 24px;
  display: flex !important;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 10px;
  font-family: 'Open Sans', sans-serif;
}
.ht-meta-bar .ht-meta-bar__cat,
.ht-meta-bar .ht-meta-bar__cat a {
  font-family: 'Open Sans', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  color: #F39228 !important;
  text-decoration: none !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}
.ht-meta-bar .ht-meta-bar__cat a:hover { color: #d97d1a !important; }
.ht-meta-bar__dot {
  color: #888;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.4;
}
.ht-meta-bar__readtime {
  color: #888;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* Responsive: collapse 2-col grid to 1-col under 720px */
@media (max-width: 720px) {
  .ht-blog-hero { padding: 72px 20px 64px; }
  .ht-blog-hero.is-compact { padding: 44px 20px 36px; }
  .ht-featured-wrap, .ht-grid-wrap, .ht-more-wrap { padding-left: 16px; padding-right: 16px; }
  .ht-featured__body { padding: 24px 20px 28px !important; }
  .ht-grid-wrap .wp-block-post-template.is-layout-grid,
  .ht-more-wrap .wp-block-post-template.is-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}
