/*
Theme Name: Travel Hacker
Theme URI: https://travel-hacker.com/
Author: Travel Hacker
Description: Purpose-built block theme for Travel Hacker, a practical travel planning and travel-hacking publication.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.6.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: travel-hacker
Tags: block-patterns, custom-colors, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, template-editing, wide-blocks, blog, news
*/

html { scroll-behavior: smooth; }
body { text-rendering: optimizeLegibility; overflow-wrap: anywhere; }
a { text-underline-offset: .16em; }
img, video, iframe { max-width: 100%; height: auto; }
.wp-site-blocks { min-height: 100vh; overflow-x: clip; }

.th-eyebrow {
  margin: 0;
  font-size: var(--wp--preset--font-size--meta);
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.th-eyebrow a { color: var(--wp--preset--color--accent); text-decoration: none; }

.th-card {
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--card);
  background: var(--wp--preset--color--surface);
  box-shadow: var(--wp--preset--shadow--soft);
}

.th-card .wp-block-post-featured-image img { object-fit: cover; }

:where(a, button, input, select, textarea, .wp-block-navigation-item__content):focus-visible {
  outline: 3px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
}

:where(.wp-block-button__link, .wp-block-search__button, .wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close) {
  min-height: 44px;
}

/* Site chrome */
.th-site-header { position: relative; z-index: 20; box-shadow: 0 1px 0 rgba(39, 38, 34, .03); }
.th-header-inner { min-height: 68px; }
.th-brand { min-width: max-content; }
.th-brand-mark img, .th-footer-mark img { display: block; border-radius: 50%; }
.th-brand-title { margin: 0; line-height: 1; }
.th-brand-title a, .th-site-footer .wp-block-site-title a { text-decoration: none; }
.th-brand-promise { margin: 0; line-height: 1.25; }
.th-header-actions { margin-left: auto; }
.th-primary-navigation { font-size: var(--wp--preset--font-size--small); font-weight: 650; }
.th-primary-navigation .wp-block-navigation-item__content { text-decoration: none; }
.th-primary-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent); }
.th-header-search { margin: 0; }
.th-header-search .wp-block-search__button {
  min-width: 42px; min-height: 42px; margin: 0; padding: .65rem;
  border: 1px solid var(--wp--preset--color--border); border-radius: 999px;
  background: transparent; color: var(--wp--preset--color--ink);
}
.th-header-search .wp-block-search__button:hover { background: var(--wp--preset--color--canvas); }
.th-site-footer { margin-block-start: var(--wp--preset--spacing--3-xl); }
.th-footer-main { align-items: flex-start; }
.th-footer-brand { flex: 1 1 420px; max-width: 560px; }
.th-footer-discovery { flex: 0 1 260px; }
.th-footer-promise, .th-footer-description, .th-footer-label, .th-footer-meta p { margin: 0; }
.th-footer-description { max-width: 52ch; opacity: .82; }
.th-footer-label { font-weight: 750; letter-spacing: .08em; text-transform: uppercase; opacity: .72; }
.th-footer-navigation .wp-block-navigation-item__content { text-decoration: none; }
.th-footer-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--deal); }
.th-footer-rule { margin-top: var(--wp--preset--spacing--2-xl); opacity: .35; }
.th-footer-meta { opacity: .72; }

/* Editorial primitives */
.th-lead-card {
  overflow: hidden; min-height: 430px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: calc(var(--wp--custom--radius--card) * 1.15);
  background: var(--wp--preset--color--surface);
  box-shadow: var(--wp--preset--shadow--soft);
}
.th-lead-image, .th-lead-image a, .th-lead-image img { width: 100%; height: 100%; }
.th-lead-image img { object-fit: cover; }
.th-lead-copy { align-self: center; }
.th-lead-copy .wp-block-post-title, .th-card-body .wp-block-post-title, .th-compact-copy .wp-block-post-title { margin: 0; }
.th-lead-copy .wp-block-post-title a, .th-card-body .wp-block-post-title a, .th-compact-copy .wp-block-post-title a { color: inherit; text-decoration: none; }
.th-lead-copy .wp-block-post-title a:hover, .th-card-body .wp-block-post-title a:hover, .th-compact-copy .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }
.th-lead-copy .wp-block-post-excerpt, .th-card-body .wp-block-post-excerpt { margin: 0; }
.th-lead-copy .wp-block-post-excerpt__excerpt, .th-card-body .wp-block-post-excerpt__excerpt { margin: 0; }
.th-card-meta { gap: var(--wp--preset--spacing--sm); color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--meta); }
.th-card-grid .wp-block-post-template, .th-deal-grid .wp-block-post-template, .th-destination-grid .wp-block-post-template { gap: var(--wp--preset--spacing--lg); }
.th-article-card, .th-deal-card, .th-destination-card { height: 100%; transition: transform .18s ease, box-shadow .18s ease; }
.th-card-body { display: flex; min-height: 100%; flex-direction: column; }
.th-card-body .wp-block-post-date { margin-top: auto; padding-top: var(--wp--preset--spacing--xs); }
.th-compact-list .wp-block-post-template { display: grid; gap: 0; }
.th-compact-card { gap: var(--wp--preset--spacing--lg); border-bottom: 1px solid var(--wp--preset--color--border); }
.th-compact-card:first-child { border-top: 1px solid var(--wp--preset--color--border); }
.th-compact-image { flex: 0 0 120px; overflow: hidden; border-radius: 12px; }
.th-compact-image img { object-fit: cover; }
.th-compact-copy { min-width: 0; }
.th-deal-card { border-color: color-mix(in srgb, var(--wp--preset--color--deal) 45%, var(--wp--preset--color--border)); }
.th-deal-band { color: var(--wp--preset--color--ink); }
.th-deal-band .wp-block-post-date { color: inherit; }
.th-deal-label { margin: 0; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.th-destination-card .th-destination-image { overflow: hidden; }
.th-destination-card .th-destination-image img { transition: transform .35s ease; }

@media (hover: hover) and (pointer: fine) {
  .th-article-card:hover, .th-deal-card:hover, .th-destination-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(39,38,34,.11);
  }
  .th-destination-card:hover .th-destination-image img { transform: scale(1.025); }
}

/* Core templates */
.th-home-section-accent { border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--card); }
.th-section-heading > * { margin-top: 0; margin-bottom: 0; }
.th-home-grid .wp-block-post-template, .th-archive-grid .wp-block-post-template, .th-404-grid .wp-block-post-template { gap: var(--wp--preset--spacing--lg); }
.th-latest-list .wp-block-post-template, .th-search-results .wp-block-post-template { display: grid; gap: 0; }
.th-search-result { border-bottom: 1px solid var(--wp--preset--color--border); }
.th-search-result:first-child { border-top: 1px solid var(--wp--preset--color--border); }
.th-search-result .wp-block-post-title { margin: 0; }
.th-search-result .wp-block-post-title a { text-decoration: none; }
.th-query-pagination { margin-top: var(--wp--preset--spacing--2-xl); }
.th-query-pagination a { text-decoration: none; }
.th-article-header { max-width: 900px; }
.th-article-header .wp-block-post-title, .th-article-header .wp-block-post-excerpt { margin: 0; }
.th-article-meta { color: var(--wp--preset--color--muted); }
.th-article-meta a { color: inherit; }
.th-article-hero { overflow: hidden; border-radius: var(--wp--custom--radius--card); }
.th-article-body { font-size: clamp(1rem, .35vw + .94rem, 1.12rem); }
.th-article-body :where(h2, h3, h4) { scroll-margin-top: 2rem; }
.th-article-body :where(h2, h3) { margin-top: 2em; }
.th-article-body :where(p, ul, ol) { max-width: 72ch; }
.th-article-body :where(ul, ol) { padding-left: 1.4em; }
.th-article-body :where(table) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; }
.th-article-body :where(pre) { max-width: 100%; overflow-x: auto; }
.th-article-body :where(blockquote) { border-left: 3px solid var(--wp--preset--color--accent); padding-left: var(--wp--preset--spacing--lg); color: var(--wp--preset--color--muted); }
.th-article-body :where(figcaption) { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
.th-post-navigation { gap: var(--wp--preset--spacing--lg); }
.th-post-navigation a { text-decoration: none; font-weight: 700; }
.th-404-shell { max-width: 860px; }
.th-search-form .wp-block-search__inside-wrapper, .th-404-search .wp-block-search__inside-wrapper { min-height: 48px; }

/* Article callouts */
.th-callout { position: relative; margin-block: var(--wp--preset--spacing--xl); border: 1px solid var(--wp--preset--color--border); border-left-width: 5px; border-radius: 14px; background: var(--wp--preset--color--surface); }
.th-callout p { margin-top: 0; margin-bottom: 0; }
.th-callout-label { font-size: var(--wp--preset--font-size--meta); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.th-callout-tip { border-left-color: var(--wp--preset--color--secondary); }
.th-callout-worth-it { border-left-color: var(--wp--preset--color--accent); }
.th-callout-points { border-left-color: var(--wp--preset--color--deal); }
.th-callout-booking { border-left-color: var(--wp--preset--color--secondary); }
.th-callout-watch { border-left-color: var(--wp--preset--color--deal); }

@media (max-width: 960px) {
  .th-brand-promise { display: none; }
  .th-header-inner { min-height: 60px; }
  .th-lead-card { grid-template-columns: 1fr !important; min-height: 0; }
  .th-lead-image { aspect-ratio: 16 / 9; }
}

@media (max-width: 760px) {
  .th-brand-mark img { width: 38px !important; height: auto; }
  .th-brand-title { font-size: 1.15rem !important; }
  .th-header-inner { gap: var(--wp--preset--spacing--sm) !important; }
  .th-header-actions { gap: var(--wp--preset--spacing--sm) !important; }
  .th-primary-navigation .wp-block-navigation__responsive-container-open,
  .th-header-search .wp-block-search__button { min-width: 40px; min-height: 40px; }
  .th-primary-navigation .wp-block-navigation__responsive-container.is-menu-open { padding: var(--wp--preset--spacing--xl); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); }
  .th-primary-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: var(--wp--preset--spacing--lg); font-size: var(--wp--preset--font-size--h4); }
  .th-footer-main { display: block; }
  .th-footer-discovery { margin-top: var(--wp--preset--spacing--xl); }
  .th-footer-meta { align-items: flex-start; }
  .th-card-grid .wp-block-post-template, .th-deal-grid .wp-block-post-template, .th-destination-grid .wp-block-post-template, .th-home-grid .wp-block-post-template, .th-archive-grid .wp-block-post-template, .th-404-grid .wp-block-post-template { grid-template-columns: 1fr !important; }
  .th-compact-card { gap: var(--wp--preset--spacing--md); }
  .th-compact-image { flex-basis: 92px; width: 92px !important; height: 92px !important; }
  .th-home-section-accent { padding-left: var(--wp--preset--spacing--lg) !important; padding-right: var(--wp--preset--spacing--lg) !important; }
  .th-article-body :where(table) { font-size: .9rem; }
}

@media (forced-colors: active) {
  .th-card, .th-lead-card, .th-callout, .th-home-section-accent { border: 1px solid CanvasText; }
  :where(a, button, input, select, textarea):focus-visible { outline: 3px solid Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
