/*
Theme Name: Trailpress
Author: Wynn Halloran
Description: Dense magazine layout for outdoor and sport titles — hero grid, category rail, section blocks and a trending sidebar.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: trailpress
*/

/* Palette is taken from the site's own logo (#9A3412 rust). */
:root{
  --accent:#9A3412;
  --accent-deep:#7C2D12;
  --accent-wash:#FDF3EE;
  --ink:#1C1917;
  --ink-soft:#44403C;
  --muted:#78716C;
  --line:#E7E5E4;
  --line-soft:#F2F0EF;
  --surface:#FAFAF9;
  --bg:#FFFFFF;
  --dark:#1C1917;
  --radius:4px;
  --shell:1220px;
  --gap:22px;
  --fh:'Barlow Condensed',Impact,sans-serif;
  --fb:'Source Sans 3',-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:var(--fb);font-size:16px;line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto;display:block}
a{color:inherit;text-decoration:none}
a:hover{text-decoration:none}
h1,h2,h3,h4{font-family:var(--fh);font-weight:700;line-height:1.08;margin:0;letter-spacing:.01em}

.tp-shell{max-width:var(--shell);margin:0 auto;padding:0 20px}

.tp-skip{
  position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden;
}
.tp-skip:focus{
  position:fixed;left:12px;top:12px;width:auto;height:auto;z-index:999;
  background:var(--accent);color:#fff;padding:10px 16px;border-radius:var(--radius);
}

/* ---------- topbar ---------- */
.tp-topbar{background:var(--dark);color:#D6D3D1;font-size:12.5px}
.tp-topbar-inner{display:flex;align-items:center;gap:14px;height:34px;overflow:hidden}
.tp-today{white-space:nowrap;letter-spacing:.02em;opacity:.75}
.tp-ticker-label{
  background:var(--accent);color:#fff;font-family:var(--fh);font-size:12px;
  letter-spacing:.12em;text-transform:uppercase;padding:3px 9px;white-space:nowrap;
}
.tp-ticker{display:flex;gap:20px;margin:0;padding:0;list-style:none;overflow:hidden;white-space:nowrap}
.tp-ticker a{color:#E7E5E4}
.tp-ticker a:hover{color:#fff}

/* ---------- masthead ---------- */
.tp-masthead{background:var(--bg);border-bottom:1px solid var(--line)}
.tp-masthead-inner{
  display:flex;align-items:center;justify-content:space-between;gap:24px;
  padding:20px 20px;
}
.tp-logo-img{max-height:58px;width:auto}
.tp-wordmark{font-family:var(--fh);font-size:40px;color:var(--ink);display:block;line-height:1}
.tp-tagline{display:block;font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-top:3px}

.tp-search{display:flex;align-items:center;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.tp-search input{
  border:0;background:transparent;padding:9px 12px;font:inherit;font-size:14px;
  width:210px;color:var(--ink);outline:none;
}
.tp-search button{
  border:0;background:var(--accent);color:#fff;padding:9px 14px;cursor:pointer;
  font-size:15px;line-height:1;
}
.tp-search button:hover{background:var(--accent-deep)}

/* ---------- category rail ---------- */
.tp-rail{background:var(--dark);position:sticky;top:0;z-index:40}
.tp-rail-inner{display:flex;align-items:center}
.tp-menu{display:flex;gap:0;margin:0;padding:0;list-style:none;flex-wrap:wrap}
.tp-menu li{position:relative}
.tp-menu a{
  display:block;padding:13px 15px;color:#E7E5E4;
  font-family:var(--fh);font-size:16px;letter-spacing:.06em;text-transform:uppercase;
  border-bottom:3px solid transparent;
}
.tp-menu a:hover{color:#fff;background:rgba(255,255,255,.06);border-bottom-color:var(--accent)}
.tp-menu .current-menu-item>a,.tp-menu .current-cat>a{color:#fff;border-bottom-color:var(--accent)}
/* second level */
.tp-menu .sub-menu{
  display:none;position:absolute;left:0;top:100%;min-width:190px;
  background:var(--dark);padding:6px 0;list-style:none;margin:0;z-index:50;
  box-shadow:0 12px 28px rgba(0,0,0,.24);
}
.tp-menu li:hover>.sub-menu{display:block}
.tp-menu .sub-menu a{padding:9px 16px;border-bottom:0;font-size:15px;text-transform:none;letter-spacing:.02em}

.tp-nav-toggle{
  display:none;align-items:center;gap:8px;background:none;border:0;cursor:pointer;
  color:#E7E5E4;font-family:var(--fh);font-size:16px;letter-spacing:.08em;
  text-transform:uppercase;padding:12px 0;
}
.tp-nav-toggle span{display:block;width:18px;height:2px;background:#E7E5E4}
.tp-nav-toggle span+span{margin-top:-6px}

/* ---------- hero ---------- */
.tp-hero-wrap{background:var(--surface);border-bottom:1px solid var(--line);padding:22px 0}
.tp-hero{display:grid;grid-template-columns:2fr 1fr;grid-template-rows:1fr 1fr;gap:14px;min-height:430px}
.tp-feature{position:relative;overflow:hidden;border-radius:var(--radius);background:var(--dark)}
.tp-feature-lead{grid-row:1 / span 2}
.tp-feature-link{display:block;position:absolute;inset:0}
.tp-feature-link img{width:100%;height:100%;object-fit:cover;transition:transform .5s ease}
.tp-feature:hover .tp-feature-link img{transform:scale(1.04)}
.tp-feature-scrim{
  position:absolute;inset:0;
  background:linear-gradient(to top,rgba(0,0,0,.82) 0%,rgba(0,0,0,.35) 42%,rgba(0,0,0,0) 72%);
}
.tp-feature-body{position:relative;z-index:2;padding:18px;display:flex;flex-direction:column;justify-content:flex-end;height:100%}
/* Titles are author-supplied and some run long; clamp them or they overflow
   the tile and collide with the kicker above. */
.tp-feature-title{
  color:#fff;margin:6px 0 4px;
  display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;
}
.tp-feature-lead .tp-feature-title{font-size:38px;-webkit-line-clamp:3;line-clamp:3}
.tp-feature-side .tp-feature-title{font-size:21px;-webkit-line-clamp:2;line-clamp:2}
.tp-feature-body{overflow:hidden}
.tp-feature-title a{color:#fff}
.tp-feature-title a:hover{color:#FED7C3}

/* ---------- layout ---------- */
.tp-layout{display:grid;grid-template-columns:1fr 322px;gap:34px;padding-top:28px;padding-bottom:40px;align-items:start}
.tp-main{min-width:0}

.tp-page-head{border-bottom:2px solid var(--ink);padding-bottom:10px;margin-bottom:20px}
.tp-page-head h1{font-size:34px}
.tp-page-sub{color:var(--muted);font-size:14px;margin-top:5px}

.tp-section{margin-top:34px}
.tp-section-head{
  display:flex;align-items:baseline;justify-content:space-between;gap:12px;
  border-bottom:2px solid var(--ink);padding-bottom:8px;margin-bottom:18px;
}
.tp-section-head h2{font-size:25px;text-transform:uppercase;letter-spacing:.03em;position:relative}
.tp-section-head h2::after{content:"";position:absolute;left:0;bottom:-10px;width:100%;height:2px;background:var(--accent)}
.tp-section-more{font-size:13px;color:var(--accent);font-weight:600;white-space:nowrap}
.tp-section-more:hover{color:var(--accent-deep)}

/* ---------- cards ---------- */
.tp-grid{display:grid;gap:var(--gap)}
.tp-grid-2{grid-template-columns:repeat(2,1fr)}
.tp-grid-4{grid-template-columns:repeat(4,1fr)}

.tp-card{display:flex;flex-direction:column;background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;transition:box-shadow .2s,transform .2s}
.tp-card:hover{box-shadow:0 10px 26px rgba(28,25,23,.09);transform:translateY(-2px)}
.tp-card-media{display:block;aspect-ratio:16/10;overflow:hidden;background:var(--line-soft)}
.tp-card-media img{width:100%;height:100%;object-fit:cover;transition:transform .4s}
.tp-card:hover .tp-card-media img{transform:scale(1.05)}
.tp-card-body{padding:13px 15px 15px;display:flex;flex-direction:column;gap:6px;flex:1}
/* Text-only card when a post has no featured image: it should read as a
   deliberate lede, not a broken tile. */
.tp-card-flat{border-left:3px solid var(--accent)}
.tp-card-flat .tp-card-body{padding-top:15px}

.tp-kicker{
  align-self:flex-start;font-family:var(--fh);font-size:12px;letter-spacing:.11em;
  text-transform:uppercase;color:var(--accent);font-weight:700;
}
.tp-kicker:hover{color:var(--accent-deep)}
.tp-title{
  font-size:20px;line-height:1.22;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;
}
.tp-card-compact .tp-title{font-size:17px}
.tp-title a:hover{color:var(--accent)}
.tp-excerpt{
  margin:0;color:var(--ink-soft);font-size:14.5px;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;
}
.tp-meta{font-size:12.5px;color:var(--muted);margin-top:auto;padding-top:4px}
.tp-meta-light{color:rgba(255,255,255,.8)}

.tp-empty{color:var(--muted);padding:26px 0}

/* ---------- single ---------- */
.tp-single-head{border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:18px}
.tp-single-title{font-size:42px;margin:8px 0 8px;line-height:1.06}
.tp-single-media{margin:0 0 20px;border-radius:var(--radius);overflow:hidden}
.tp-prose{font-size:17px;line-height:1.72;color:var(--ink-soft);max-width:72ch}
.tp-prose p{margin:0 0 1.05em}
.tp-prose h2,.tp-prose h3{color:var(--ink);margin:1.5em 0 .5em}
.tp-prose h2{font-size:27px}
.tp-prose h3{font-size:22px}
.tp-prose a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}
.tp-prose img{border-radius:var(--radius);margin:1em 0}
.tp-prose ul,.tp-prose ol{padding-left:1.25em;margin:0 0 1.05em}
.tp-prose li{margin-bottom:.4em}
.tp-prose blockquote{
  margin:1.4em 0;padding:4px 0 4px 18px;border-left:3px solid var(--accent);
  color:var(--ink);font-size:19px;
}
.tp-tags{margin-top:22px;display:flex;flex-wrap:wrap;gap:8px}
.tp-tags a{
  font-size:12.5px;background:var(--accent-wash);color:var(--accent-deep);
  padding:5px 10px;border-radius:999px;
}

/* ---------- sidebar ---------- */
.tp-rail-col{position:sticky;top:64px}
.tp-widget{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:15px 16px 17px;margin-bottom:18px;
}
.tp-widget-head{
  font-size:17px;text-transform:uppercase;letter-spacing:.07em;
  padding-bottom:8px;margin-bottom:12px;border-bottom:2px solid var(--accent);
}
.tp-rank{list-style:none;margin:0;padding:0;counter-reset:tp}
.tp-rank li{display:flex;gap:10px;align-items:flex-start;padding:9px 0;border-bottom:1px solid var(--line)}
.tp-rank li:last-child{border-bottom:0;padding-bottom:0}
.tp-rank-num{font-family:var(--fh);font-size:20px;color:var(--accent);width:18px;flex:0 0 auto;line-height:1.2}
.tp-rank-media{flex:0 0 auto;width:62px;height:46px;overflow:hidden;border-radius:3px}
.tp-rank-media img{width:100%;height:100%;object-fit:cover}
.tp-rank-body a{font-size:14.5px;font-weight:600;line-height:1.3;display:block;color:var(--ink)}
.tp-rank-body a:hover{color:var(--accent)}
.tp-rank-date{display:block;font-size:12px;color:var(--muted);margin-top:3px}

.tp-catlist{list-style:none;margin:0;padding:0}
.tp-catlist li{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
.tp-catlist li:last-child{border-bottom:0}
.tp-catlist a{font-size:14.5px;font-weight:600}
.tp-catlist a:hover{color:var(--accent)}
.tp-count{font-size:12px;color:var(--muted);background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:1px 8px}

/* ---------- pagination ---------- */
.pagination,.tp-pagelinks{margin-top:26px;display:flex;gap:6px;flex-wrap:wrap}
.pagination .page-numbers,.tp-pagelinks a,.tp-pagelinks>span{
  display:inline-block;padding:8px 13px;border:1px solid var(--line);
  border-radius:var(--radius);font-size:14px;font-weight:600;background:var(--bg);
}
.pagination .current{background:var(--accent);border-color:var(--accent);color:#fff}
.pagination a:hover{border-color:var(--accent);color:var(--accent)}
.screen-reader-text{position:absolute;left:-9999px}

/* ---------- footer ---------- */
.tp-footer{background:var(--dark);color:#D6D3D1;margin-top:20px}
.tp-footer-top{display:grid;grid-template-columns:2fr 1fr 1fr;gap:34px;padding-top:34px;padding-bottom:28px}
.tp-footer-logo{max-height:52px;width:auto;filter:brightness(0) invert(1);opacity:.92}
.tp-footer-name{font-family:var(--fh);font-size:30px;color:#fff}
.tp-footer-tag{font-size:13.5px;color:#A8A29E;margin:10px 0 0;max-width:42ch}
.tp-footer-col h4{font-size:16px;color:#fff;text-transform:uppercase;letter-spacing:.09em;margin-bottom:11px}
.tp-footer-col ul,.tp-footer-menu{list-style:none;margin:0;padding:0}
.tp-footer-col li{margin-bottom:7px}
.tp-footer-col a{font-size:14px;color:#D6D3D1}
.tp-footer-col a:hover{color:#fff}
.tp-footer-bottom{border-top:1px solid rgba(255,255,255,.12);padding:14px 0;font-size:13px;color:#A8A29E}

/* ---------- responsive ---------- */
@media(max-width:1040px){
  .tp-layout{grid-template-columns:1fr}
  .tp-rail-col{position:static}
  .tp-grid-4{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:820px){
  .tp-hero{grid-template-columns:1fr;grid-template-rows:auto;min-height:0}
  .tp-feature{min-height:250px}
  .tp-feature-lead{grid-row:auto;min-height:320px}
  .tp-feature-lead .tp-feature-title{font-size:28px}
  .tp-masthead-inner{flex-direction:column;align-items:flex-start;gap:14px}
  .tp-search{width:100%}
  .tp-search input{width:100%}
  .tp-nav-toggle{display:flex}
  .tp-menu-wrap{display:none;width:100%}
  .tp-menu-wrap.is-open{display:block}
  .tp-rail-inner{flex-direction:column;align-items:stretch}
  .tp-menu{flex-direction:column}
  .tp-menu a{border-bottom:1px solid rgba(255,255,255,.08)}
  .tp-menu .sub-menu{position:static;display:block;box-shadow:none;padding-left:14px}
  .tp-rail{position:static}
  .tp-single-title{font-size:30px}
  .tp-ticker{display:none}
}
@media(max-width:560px){
  .tp-grid-2,.tp-grid-4{grid-template-columns:1fr}
  .tp-footer-top{grid-template-columns:1fr;gap:22px}
  .tp-page-head h1{font-size:27px}
}
