/*
Theme Name: Travel Junk Journal
Theme URI: https://traveljunkjournal.com
Author: Bay
Description: Vintage field guide theme for Travel Junk Journal. Full-bleed hero, recent articles, author section, Substack signup, and an easy-to-read post layout with a table of contents on the left and latest articles on the right.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: travel-junk-journal
*/

:root {
  --cream: #fbf6e9;
  --paper: #fffdf6;
  --beige: #f3ead5;
  --pale: #f6e9c4;
  --yellow: #f8dd95;
  --gold: #f4c64e;
  --blue: #2d4e9e;
  --blue-deep: #2e3f94;
  --ink: #232b42;
  --red: #d2472c;
  --red-deep: #c8372a;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --script: "Yellowtail", cursive;
  --wrap: 1328px;
  --gutter: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .35 0 0 0 0 .25 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--red); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: var(--paper); padding: 8px 14px; clip: auto; width: auto; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Small caps labels */
.label, .site-nav a, .btn, .meta {
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  text-decoration: none;
}
.meta { color: var(--red); font-weight: 500; font-size: 11px; letter-spacing: .08em; }
.label { color: var(--red); letter-spacing: .18em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 28px; border-radius: 4px; border: 0; cursor: pointer;
  background: var(--blue-deep); color: var(--cream); font-size: 13px;
}
.btn:hover { background: var(--blue); color: var(--cream); }
.btn--light { background: var(--cream); color: var(--blue); }
.btn--light:hover { background: var(--paper); color: var(--red); }
.link-arrow { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 4px; }

/* ---------- Header / nav ---------- */
.site-header { position: relative; z-index: 20; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; padding: 32px var(--gutter); }
.site-header .home-link { color: var(--blue); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 38px; }
.site-nav a { color: var(--blue); }
.site-nav a:hover { color: var(--red); }
.nav-toggle { display: none; background: none; border: 0; color: inherit; font: 600 12px var(--sans); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; padding: 8px 0; }
.site-header--overlay { position: absolute; top: 0; left: 0; right: 0; }
.site-header--overlay .home-link,
.site-header--overlay .site-nav a,
.site-header--overlay .nav-toggle { color: var(--cream); }
.site-header--overlay .site-nav a:hover { color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 774px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--cream); background-size: cover; background-position: center; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,23,18,.5) 0%, rgba(26,23,18,.12) 28%, rgba(26,23,18,.15) 70%, rgba(26,23,18,.55) 100%);
}
.hero__inner { position: relative; padding: 140px var(--gutter) 100px; width: 100%; }
.hero__lockup { display: inline-block; text-align: left; }
.hero__script { font-family: var(--script); font-size: clamp(32px, 4.4vw, 64px); line-height: 1.2; transform: rotate(-8deg); transform-origin: left bottom; display: block; margin: 0 0 -6px 4%; }
.hero__actions { text-align: center; }
.hero__title {
  font-family: var(--serif); font-weight: 400; color: var(--gold);
  font-size: clamp(56px, 11.1vw, 160px); line-height: .9; letter-spacing: -.006em; margin: 0 0 70px;
  text-shadow: 6px 6px 0 var(--red-deep);
}

/* ---------- Section headings ---------- */
.section { padding: 120px 0; }
.section-title { font-family: var(--serif); font-weight: 400; color: var(--blue); font-size: clamp(48px, 5.6vw, 80px); line-height: 1; margin: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 50px; }
.filters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; font-size: 15px; }
.filters li + li::before { content: "/"; margin-right: 14px; color: var(--blue); }
.filters a { text-decoration: none; }
.filters .is-current a { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Article cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 16px; }
.card { display: flex; flex-direction: column; gap: 14px; }
.card__media { display: block; position: relative; aspect-ratio: 432 / 440; background: var(--beige); }
.card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__pill { z-index: 1; position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); background: var(--blue-deep); color: var(--cream); padding: 7px 16px; border-radius: 2px; font: 600 10px var(--sans); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; text-decoration: none; }
.card__meta { margin-top: 18px; }
.card__title { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.03; margin: 0; }
.card__title a { color: var(--blue); text-decoration: none; }
.card__title a:hover { color: var(--red); }
.card__excerpt { font-size: 15px; line-height: 1.6; margin: 0; max-width: 400px; }
.card__excerpt p { margin: 0; }
.center-link { text-align: center; margin-top: 60px; }
.empty-note { font-size: 17px; }

/* ---------- About ---------- */
.about { background: var(--beige); overflow: hidden; }
.about .wrap { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 40px; min-height: 625px; }
.about__copy { align-self: center; max-width: 432px; padding: 80px 0; }
.about__copy p { font-size: 16px; line-height: 1.85; margin: 24px 0; }
.about__sign { font-family: var(--script); color: var(--red); font-size: 34px; display: flex; align-items: center; gap: 12px; }
.about__sign::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.about__photo { justify-self: center; align-self: end; }
.about__photo img { max-height: 600px; width: auto; }

/* ---------- Newsletter ---------- */
.newsletter { position: relative; padding: 140px var(--gutter); background-color: var(--blue); background-size: cover; background-position: center; }
.newsletter__card {
  max-width: 780px; margin: 0 auto; background: var(--paper); border: 1.5px solid var(--blue); border-radius: 6px;
  padding: 52px clamp(24px, 6vw, 72px) 56px; text-align: center; box-shadow: 0 12px 40px rgba(13,26,64,.25);
}
.newsletter__star { width: 26px; height: 26px; margin: 0 auto 14px; color: var(--blue); }
.newsletter__title { font-family: var(--serif); font-weight: 400; color: var(--blue); font-size: clamp(40px, 5vw, 60px); line-height: 1; margin: 16px 0 18px; }
.newsletter__text { max-width: 520px; margin: 0 auto 28px; font-size: 18px; line-height: 1.5; }
.newsletter__form { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.newsletter__form input[type="email"] {
  width: 320px; max-width: 100%; height: 54px; padding: 0 20px; border: 1px solid var(--blue); border-radius: 4px;
  background: var(--cream); font: 16px var(--sans); color: var(--ink);
}
.newsletter__form .btn { height: 54px; letter-spacing: .06em; text-transform: none; font-size: 15px; }
.newsletter__note { margin: 18px 0 0; font-size: 13px; opacity: .6; }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue); color: var(--cream); padding: 60px 0 30px; }
.site-footer a { color: var(--cream); text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }
.footer-top { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; align-items: end; padding-bottom: 60px; }
.footer-logo { font-family: var(--sans); font-size: clamp(48px, 5.8vw, 84px); line-height: 1.25; margin: 0; font-weight: 400; }
.footer-col h3 { color: var(--yellow); margin: 0 0 18px; font-size: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 12px; font-size: 16px; }
.footer-bottom { border-top: 1px solid rgba(251,246,233,.6); padding-top: 20px; display: flex; justify-content: space-between; font: 500 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; }

/* ---------- Single post ---------- */
.post-header { text-align: center; padding: 40px var(--gutter) 40px; max-width: 1100px; margin: 0 auto; }
.post-header .label { display: block; margin-bottom: 18px; }
.post-header .label a { color: inherit; text-decoration: none; }
.post-title { font-family: var(--serif); font-weight: 400; color: var(--blue); font-size: clamp(44px, 6.4vw, 92px); line-height: 1; margin: 0 0 24px; }
.post-dek { max-width: 640px; margin: 0 auto 22px; font-size: 18px; line-height: 1.6; }
.post-byline { font-size: 13px; }
.post-hero { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.post-hero img { width: 100%; max-height: 660px; object-fit: cover; }
.post-hero figcaption { font-size: 12px; opacity: .7; margin-top: 10px; }

.post-layout {
  display: grid; grid-template-columns: 240px minmax(0, 640px) 240px; gap: 40px;
  justify-content: center; padding: 60px var(--gutter) 100px; align-items: start;
}
.toc, .latest { position: sticky; top: 30px; }
.toc .label, .latest > .label { display: block; margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0 0 22px; padding: 0; counter-reset: toc; border-left: 1px solid rgba(45,78,158,.25); }
.toc li { counter-increment: toc; }
.toc ol a { display: flex; gap: 14px; padding: 5px 0 5px 16px; margin-left: -1px; border-left: 2px solid transparent; font-family: var(--serif); font-size: 18px; line-height: 1.2; text-decoration: none; color: var(--blue); }
.toc ol a::before { content: counter(toc, decimal-leading-zero); font: 500 11px var(--sans); color: var(--ink); opacity: .55; padding-top: 4px; }
.toc ol a.is-active { border-left-color: var(--red); color: var(--red); font-style: italic; }
.toc details summary { list-style: none; cursor: pointer; }
.toc details summary::-webkit-details-marker { display: none; }
.toc details summary::after { content: " +"; }
.toc details[open] summary::after { content: " \2212"; }

.latest { display: flex; flex-direction: column; gap: 26px; }
.latest__item { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.latest__item img { width: 100%; aspect-ratio: 240 / 150; object-fit: cover; border-radius: 2px; }
.latest__item .meta { font-size: 10px; }
.latest__item .latest__title { font-family: var(--serif); font-size: 24px; line-height: 1.05; color: var(--blue); }
.latest__item:hover .latest__title { color: var(--red); }

/* Post content typography */
.entry-content { font-size: 18px; line-height: 1.78; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content > p:first-child { font-size: 21px; font-weight: 500; line-height: 1.62; }
.entry-content p { margin: 0 0 28px; }
.entry-content h2 { font-family: var(--serif); font-weight: 400; color: var(--blue); font-size: 48px; line-height: 1; margin: 56px 0 26px; scroll-margin-top: 30px; }
.entry-content h2 em { font-style: italic; }
.entry-content h3 { font-family: var(--serif); font-weight: 400; color: var(--blue); font-size: 30px; line-height: 1.1; margin: 40px 0 14px; }
.entry-content h4 { font-size: 18px; margin: 30px 0 10px; }
.entry-content ul, .entry-content ol { padding-left: 1.2em; margin: 0 0 28px; }
.entry-content li { margin-bottom: 8px; }
.entry-content a { color: var(--blue); text-underline-offset: 3px; }
.entry-content strong { font-weight: 600; }
.entry-content blockquote { margin: 36px 0; padding: 0 0 0 24px; border-left: 3px solid var(--red); font-family: var(--serif); font-size: 28px; line-height: 1.25; color: var(--blue); }
.entry-content figure { margin: 36px 0; }
.entry-content img { border-radius: 2px; }
.entry-content figcaption { font-family: var(--script); color: var(--red); font-size: 20px; margin-top: 8px; text-align: left; }
.entry-content .wp-block-gallery { gap: 20px; }
.entry-content hr { border: 0; border-top: 1px solid rgba(45,78,158,.25); margin: 48px 0; }
.entry-content .wp-block-button__link { background: var(--blue-deep); color: var(--cream); border-radius: 4px; font: 600 13px var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: 14px 24px; text-decoration: none; }
.entry-content .wp-block-button__link:hover { background: var(--blue); color: var(--cream); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 0 0 28px; }
.entry-content th, .entry-content td { border-bottom: 1px solid rgba(45,78,158,.2); padding: 10px 8px; text-align: left; }
.entry-content th { font-weight: 600; color: var(--blue); }
/* Optional "Polaroid" image style */
.entry-content .is-style-polaroid img { background: #fff; padding: 14px 14px 46px; box-shadow: 0 10px 28px rgba(35,43,66,.18); }

/* Quick picks box (block pattern) */
.tjj-quick-picks { background: var(--pale); border-radius: 6px; padding: 28px 30px 18px; margin: 36px 0; counter-reset: pick; }
.tjj-quick-picks > h2, .tjj-quick-picks > h3 { font-family: var(--serif); font-weight: 400; color: var(--blue); font-size: 32px; margin: 0 0 4px; line-height: 1.1; }
.tjj-quick-picks > p { font-size: 15px; opacity: .8; margin: 0 0 10px; }
.tjj-pick { counter-increment: pick; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 4px 16px; padding: 14px 0; border-top: 1px solid rgba(45,78,158,.25); }
.tjj-pick:first-of-type { border-top: 0; }
.tjj-pick::before { content: counter(pick, decimal-leading-zero); font-family: var(--serif); color: var(--red); font-size: 26px; grid-row: 1 / span 2; }
.tjj-pick > p { margin: 0; grid-column: 2; font-size: 14px; line-height: 1.45; opacity: .8; }
.tjj-pick > p:first-of-type { font-weight: 600; font-size: 16px; opacity: 1; }
.tjj-pick > .wp-block-buttons { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
.tjj-pick .wp-block-button__link { padding: 10px 16px; font-size: 12px; letter-spacing: .06em; text-transform: none; }

.post-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border-top: 1px solid rgba(45,78,158,.25); padding-top: 24px; margin-top: 40px; }
.tags { display: flex; gap: 10px; flex-wrap: wrap; }
.tags a { border: 1px solid var(--blue); border-radius: 3px; padding: 6px 12px; font-size: 12px; text-decoration: none; }
.share { font-size: 12px; display: flex; gap: 12px; align-items: center; }
.share .label { color: var(--ink); font-size: 11px; }
.share button { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; font: inherit; cursor: pointer; }

.more-articles { background: var(--beige); }

/* ---------- Blog + archive ---------- */
.page-head { padding: 40px 0 60px; }
.breadcrumb { font-size: 13px; margin-bottom: 18px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb span { margin: 0 8px; opacity: .5; }
.page-head .count { display: block; margin-bottom: 14px; }
.page-head .intro { max-width: 640px; font-size: 18px; margin: 18px 0 0; }
.country { padding: 0 0 100px; }
.country .section-head { margin-bottom: 40px; }
.country .section-title { font-size: clamp(40px, 4.5vw, 64px); }
.pagination { display: flex; justify-content: center; gap: 10px; padding: 0 0 100px; }
.pagination .page-numbers { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--blue); border-radius: 3px; text-decoration: none; padding: 0 12px; }
.pagination .current { background: var(--blue); color: var(--cream); }

/* Plain pages */
.page-content { max-width: 760px; margin: 0 auto; padding: 40px var(--gutter) 120px; }
.page-content .post-title { text-align: left; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .post-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .latest { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .latest > .label, .latest > .link-arrow { grid-column: 1 / -1; }
  .latest > .link-arrow { justify-self: start; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 76px; right: var(--gutter); background: var(--paper); border: 1px solid var(--blue); border-radius: 4px; padding: 18px 24px; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 14px; }
  .site-header--overlay .site-nav a { color: var(--blue); }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .about .wrap { grid-template-columns: 1fr; min-height: 0; }
  .about__copy { padding: 80px 0 0; }
  .about__photo img { max-height: 460px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-logo { grid-column: 1 / -1; }
  .post-layout { grid-template-columns: minmax(0, 1fr); padding-top: 30px; }
  .toc > .link-arrow { display: none; }
  .toc { position: static; background: var(--paper); border: 1px solid rgba(45,78,158,.25); border-radius: 4px; padding: 16px 18px 4px; }
  .latest { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 620px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .section { padding: 80px 0; }
  .card-grid, .latest { grid-template-columns: 1fr; }
  .tjj-pick { grid-template-columns: 34px 1fr; }
  .tjj-pick > .wp-block-buttons { grid-column: 2; grid-row: auto; margin-top: 8px; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 10px; }
  .entry-content h2 { font-size: 38px; }
  .newsletter { padding: 90px 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
