/*
Theme Name: Sendero 4x4
Author: Adventure 4x4 editorial
Description: Lightweight editorial WordPress theme for responsible off-road routes, workshop notes and overland travel.
Version: 1.1.1
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: sendero4x4
*/

:root {
  --s4-bg: #101512;
  --s4-panel: #18211b;
  --s4-panel-soft: #243027;
  --s4-paper: #f4efe3;
  --s4-paper-2: #e8dfcc;
  --s4-ink: #1a211c;
  --s4-muted: #667069;
  --s4-cream: #fffaf0;
  --s4-orange: #df642d;
  --s4-orange-dark: #b8451b;
  --s4-olive: #72805c;
  --s4-line: rgba(255, 250, 240, 0.16);
  --s4-radius: 4px;
  --s4-shadow: 0 20px 52px rgba(6, 10, 7, 0.24);
  --s4-wide: 1180px;
  --s4-reading: 760px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--s4-ink);
  background: var(--s4-paper);
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  background-image:
    linear-gradient(rgba(68, 76, 60, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 76, 60, .035) 1px, transparent 1px);
  background-size: 34px 34px;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

.screen-reader-text,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  clip: auto;
  padding: 12px 16px;
  background: var(--s4-cream);
  color: var(--s4-ink);
  border-radius: 10px;
}

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  color: var(--s4-cream);
}

.site-header.is-solid {
  position: relative;
  color: var(--s4-cream);
  background: var(--s4-bg);
  border-bottom: 3px solid var(--s4-orange);
}

.header-inner {
  max-width: var(--s4-wide);
  margin: 0 auto;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  width: 270px;
  max-width: 34vw;
  color: var(--s4-cream);
  text-decoration: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .22));
}

.brand-logo { display: block; width: 100%; height: auto; border-left: 4px solid var(--s4-orange); }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  padding: 10px 12px;
  color: rgba(255, 250, 240, 0.84);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.08); border-bottom-color: var(--s4-orange); outline: none; }
.site-nav .nav-accent { margin-left: 8px; color: #fff; background: var(--s4-orange); }
.site-nav .nav-accent:hover, .site-nav .nav-accent:focus-visible { background: var(--s4-orange-dark); }

.hero {
  min-height: 740px;
  display: grid;
  align-items: end;
  color: var(--s4-cream);
  background-color: var(--s4-bg);
  background-position: center;
  background-size: cover;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 14, 10, 0.96) 0%, rgba(9, 14, 10, 0.72) 36%, rgba(9, 14, 10, 0.18) 70%, rgba(9, 14, 10, 0.1) 100%),
    linear-gradient(0deg, rgba(9, 14, 10, 0.72) 0%, rgba(9, 14, 10, 0) 46%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background:
    repeating-radial-gradient(ellipse at 82% 24%, transparent 0 34px, rgba(255,255,255,.22) 35px 36px, transparent 37px 58px),
    repeating-linear-gradient(112deg, transparent 0 86px, rgba(223,100,45,.26) 87px 89px, transparent 90px 172px);
  mix-blend-mode: screen;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--s4-wide);
  margin: 0 auto;
  padding: 190px 28px 86px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: #f4b58f;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 42px; height: 2px; background: var(--s4-orange); }

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(50px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.hero p {
  max-width: 600px;
  margin: 26px 0 0;
  color: rgba(255, 250, 240, 0.82);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  font-weight: 850;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}
.button:hover, .button:focus-visible { transform: translateY(-2px); outline: none; }
.button-primary { color: #fff; background: var(--s4-orange); }
.button-primary:hover, .button-primary:focus-visible { background: var(--s4-orange-dark); }
.button-secondary { color: #fff; border: 1px solid rgba(255,255,255,.3); background: rgba(12,18,13,.48); }

.trail-strip { position: relative; color: var(--s4-cream); background: var(--s4-bg); border-top: 4px solid var(--s4-orange); overflow: hidden; }
.trail-strip::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 28%; opacity: .13; background: repeating-linear-gradient(132deg, transparent 0 20px, #fff 21px 28px, transparent 29px 42px); transform: skewX(-12deg); }
.trail-strip-inner { max-width: var(--s4-wide); margin: 0 auto; padding: 30px 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.trail-point { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.trail-number { color: var(--s4-orange); font-size: 13px; font-weight: 900; }
.trail-point strong { display: block; font-size: 15px; }
.trail-point span { display: block; margin-top: 3px; color: rgba(255,250,240,.62); font-size: 13px; line-height: 1.5; }

.section { padding: 88px 28px; }
.section-dark { color: var(--s4-cream); background: var(--s4-panel); }
.section-inner { max-width: var(--s4-wide); margin: 0 auto; }
.section-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 36px; }
.section-kicker { margin: 0 0 8px; color: var(--s4-orange); font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.section-title { margin: 0; font-size: clamp(34px, 4.5vw, 56px); line-height: 1.05; letter-spacing: -.045em; }
.section-intro { max-width: 520px; margin: 0; color: var(--s4-muted); }
.section-dark .section-intro { color: rgba(255,250,240,.66); }

.topic-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.topic-card {
  min-height: 245px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--s4-cream);
  background: linear-gradient(145deg, var(--s4-panel-soft), #111914);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 0;
  border-left: 5px solid var(--s4-orange);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
  text-decoration: none;
  box-shadow: var(--s4-shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.topic-card:hover, .topic-card:focus-visible { transform: translateY(-5px); border-color: rgba(223,100,45,.72); outline: none; }
.topic-card small { color: #f4b58f; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
.topic-copy { display: grid; gap: 10px; }
.topic-copy strong { font-size: 23px; letter-spacing: -.035em; }
.topic-copy > span { color: rgba(255,250,240,.65); font-size: 14px; }
.topic-arrow { margin-top: 22px; color: var(--s4-orange); font-size: 24px; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { overflow: hidden; background: var(--s4-cream); border: 1px solid rgba(26,33,28,.16); border-top: 5px solid var(--s4-olive); border-radius: 0; box-shadow: 0 14px 36px rgba(22,29,24,.10); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%); }
.post-card-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--s4-paper-2); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card-image img { transform: scale(1.035); }
.post-card-body { padding: 24px; }
.post-meta { display: flex; gap: 10px; align-items: center; color: var(--s4-muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.post-meta .category { color: var(--s4-orange-dark); }
.post-card h2, .post-card h3 { margin: 11px 0 10px; font-size: 24px; line-height: 1.2; letter-spacing: -.035em; }
.post-card h2 a, .post-card h3 a { text-decoration: none; }
.post-card h2 a:hover, .post-card h2 a:focus-visible, .post-card h3 a:hover, .post-card h3 a:focus-visible { color: var(--s4-orange-dark); outline: none; }
.post-card p { margin: 0; color: var(--s4-muted); font-size: 15px; }
.read-more { display: inline-flex; margin-top: 18px; color: var(--s4-orange-dark); font-weight: 850; text-decoration: none; }
.read-more:hover, .read-more:focus-visible { text-decoration: underline; text-underline-offset: 4px; outline: none; }

.editorial-banner { padding: 64px 28px; color: var(--s4-cream); background: var(--s4-orange-dark); }
.editorial-banner-inner { max-width: var(--s4-wide); margin: 0 auto; display: grid; grid-template-columns: 1.25fr .75fr; gap: 44px; align-items: center; }
.editorial-banner h2 { margin: 0; font-size: clamp(34px, 5vw, 64px); line-height: 1.04; letter-spacing: -.05em; }
.editorial-banner p { margin: 0; color: rgba(255,250,240,.82); }

.page-hero { padding: 170px 28px 78px; color: var(--s4-cream); background: radial-gradient(circle at 75% 15%, #384935 0, var(--s4-bg) 48%); }
.page-hero-inner { max-width: var(--s4-wide); margin: 0 auto; }
.page-hero h1 { max-width: 880px; margin: 12px 0 0; font-size: clamp(42px, 6vw, 76px); line-height: 1.02; letter-spacing: -.055em; }
.page-hero .post-meta { color: rgba(255,250,240,.64); }

.article-shell { max-width: var(--s4-wide); margin: 0 auto; padding: 58px 28px 96px; }
.article-featured { margin: -28px auto 52px; overflow: hidden; border: 7px solid #fffaf0; border-radius: 0; border-bottom: 9px solid var(--s4-orange); box-shadow: var(--s4-shadow); clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%); }
.article-featured img { display: block; width: 100%; max-height: 680px; object-fit: cover; }
.article-content { max-width: var(--s4-reading); margin: 0 auto; font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.82; }
.article-content > * { max-width: 100%; }
.article-content h2, .article-content h3 { font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif; color: var(--s4-ink); line-height: 1.2; letter-spacing: -.035em; }
.article-content h2 { margin: 2.2em 0 .7em; font-size: clamp(29px, 4vw, 40px); }
.article-content h3 { margin: 1.8em 0 .6em; font-size: 25px; }
.article-content p { margin: 0 0 1.35em; }
.article-content ul, .article-content ol { padding-left: 1.25em; }
.article-content li { margin-bottom: .7em; }
.article-content a { color: #9d3513; font-weight: 650; text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.article-content a:hover { color: #315d42; text-decoration-thickness: 3px; }
.article-content a:focus-visible { color: #111; outline: 3px solid rgba(223,100,45,.42); outline-offset: 4px; border-radius: 3px; }
.article-content blockquote { margin: 2em 0; padding: 24px 28px; border-left: 5px solid var(--s4-orange); background: #ece3cf; font-size: 1.04em; }
.article-content table { width: 100%; border-collapse: collapse; font-family: Inter, Arial, sans-serif; font-size: 15px; }
.article-content th, .article-content td { padding: 12px; border: 1px solid #c9bea7; text-align: left; }
.article-content th { background: #e1d6bf; }
.article-content figure { margin: 2.2em 0; }
.article-content figcaption { margin-top: 8px; color: var(--s4-muted); font-family: Inter, Arial, sans-serif; font-size: 13px; }

.archive-shell { max-width: var(--s4-wide); margin: 0 auto; padding: 70px 28px 96px; }
.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination a, .pagination span { min-width: 42px; padding: 8px 12px; text-align: center; border-radius: 8px; background: #e5dcc9; text-decoration: none; }
.pagination .current { color: #fff; background: var(--s4-orange-dark); }

.site-footer { color: var(--s4-cream); background: #0c110e; border-top: 1px solid var(--s4-line); }
.footer-inner { max-width: var(--s4-wide); margin: 0 auto; padding: 58px 28px 30px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 42px; }
.footer-title { margin: 0 0 12px; font-size: 24px; }
.footer-copy { max-width: 460px; color: rgba(255,250,240,.62); }
.footer-nav { display: grid; gap: 9px; }
.footer-nav a { color: rgba(255,250,240,.72); text-decoration: none; }
.footer-nav a:hover, .footer-nav a:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 4px; outline: none; }
.footer-bottom { margin-top: 42px; padding-top: 22px; display: flex; justify-content: space-between; gap: 24px; color: rgba(255,250,240,.45); font-size: 12px; border-top: 1px solid var(--s4-line); }

.empty-state { padding: 60px; text-align: center; background: var(--s4-cream); border-radius: 0; border-left: 6px solid var(--s4-orange); }

@media (max-width: 960px) {
  .header-inner { align-items: flex-start; }
  .site-nav { justify-content: flex-end; flex-wrap: wrap; }
  .site-nav a { padding: 8px 9px; }
  .hero { min-height: 690px; background-position: 62% center; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .header-inner { padding: 18px 18px; gap: 14px; display: grid; }
  .site-brand { width: 205px; max-width: 72vw; }
  .site-nav { width: calc(100vw - 36px); justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; -ms-overflow-style: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 0 0 auto; padding: 7px 9px; font-size: 12px; }
  .site-nav .nav-accent { margin-left: 0; }
  .hero { min-height: 700px; background-position: 68% center; }
  .hero::before { background: linear-gradient(0deg, rgba(9,14,10,.97) 0%, rgba(9,14,10,.62) 70%, rgba(9,14,10,.25) 100%); }
  .hero-inner { padding: 205px 18px 52px; }
  .hero h1 { font-size: clamp(46px, 15vw, 66px); }
  .hero p { font-size: 17px; }
  .trail-strip-inner { padding: 24px 18px; grid-template-columns: 1fr; gap: 18px; }
  .section { padding: 66px 18px; }
  .section-head { align-items: start; flex-direction: column; }
  .topic-grid, .post-grid, .editorial-banner-inner, .footer-grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 210px; }
  .editorial-banner { padding: 54px 18px; }
  .page-hero { padding: 135px 18px 54px; }
  .page-hero h1 { font-size: 44px; }
  .article-shell { padding: 38px 18px 72px; }
  .article-featured { margin-top: -18px; border-width: 4px; border-bottom-width: 7px; }
  .article-content { font-size: 18px; }
  .article-content table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .archive-shell { padding: 52px 18px 72px; }
  .footer-inner { padding: 48px 18px 24px; }
  .footer-bottom { flex-direction: column; }
}
