/*
Theme Name: X-Hemp Research Archive — Journal
Theme URI: https://x-hemp.net
Description: Field Research Journal — a serious, ruled, editorial classic theme for the X-Hemp Research Archive. Text-forward, hairline-driven, no carousel.
Author: X-Hemp
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: xhemp-journal
*/

/* ============================================================
   Tokens
   ============================================================ */
:root{
  --bg:#f6f4ec;
  --ink:#1c211b;
  --leaf:#1f4a34;   /* deep green — logo mark */
  --spark:#b7852f;  /* amber accent — logo spark */
  --muted:#7c806f;
  --hair:#e3ddcd;
  --paper:#fffdf6;

  --f-disp:"Spectral", Georgia, "Times New Roman", serif;
  --f-body:"Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap:1180px;
  --gut:clamp(20px,4vw,44px);

  --step--1:.82rem;
  --step-0:1.02rem;
  --step-1:1.24rem;
  --step-2:1.62rem;
  --step-3:2.1rem;
  --step-4:clamp(2.3rem,1.4rem + 3.4vw,3.5rem);
  --step-5:clamp(2.8rem,1.4rem + 5.4vw,4.6rem);
}

/* ============================================================
   Reset / base
   ============================================================ */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--f-body);
  font-size:var(--step-0);
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img{max-width:100%;height:auto;display:block}
a{color:inherit;text-decoration:none}
h1,h2,h3,h4,h5{margin:0;font-family:var(--f-disp);font-weight:600;line-height:1.12;letter-spacing:-.01em}
p{margin:0 0 1em}
.wrap{max-width:var(--wrap);margin-inline:auto;padding-inline:var(--gut);width:100%}

.skip{position:absolute;left:-9999px;top:0;background:var(--leaf);color:#fff;padding:.5rem .9rem;z-index:100}
.skip:focus{left:12px;top:12px}

::selection{background:var(--spark);color:#fff}

/* shared kicker / meta */
.kicker{
  display:inline-block;
  font-family:var(--f-body);
  font-weight:700;
  font-size:.7rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--spark);
}
.kicker:hover{color:var(--leaf)}
.meta{
  font-family:var(--f-body);
  font-size:.78rem;
  letter-spacing:.02em;
  color:var(--muted);
}
.dot{color:var(--hair);padding:0 .35em}

/* ============================================================
   Masthead
   ============================================================ */
.masthead{
  background:var(--bg);
  border-bottom:2px solid var(--ink);
}
.masthead__top{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:1.4rem;
  padding-block:1.05rem;
  position:relative;
}
.brand{display:inline-flex;align-items:center;gap:.7rem}
.brand__mark{width:34px;height:auto;flex:0 0 auto}
.brand__wm b{
  display:block;
  font-family:var(--f-disp);
  font-weight:600;
  font-size:1.32rem;
  letter-spacing:-.01em;
  line-height:1;
  color:var(--ink);
}
.brand__sub{
  display:block;
  font-family:var(--f-body);
  font-size:.62rem;
  letter-spacing:.24em;
  text-transform:uppercase;
  color:var(--muted);
  margin-top:.28rem;
}
.masthead__slug{
  justify-self:center;
  font-family:var(--f-body);
  font-size:.68rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--muted);
  white-space:nowrap;
}
.masthead__slug .dot{color:var(--hair)}

/* nav (categories) */
.nav{
  justify-self:end;
  display:flex;
  flex-wrap:wrap;
  gap:1.35rem;
}
.nav a{
  font-family:var(--f-body);
  font-weight:600;
  font-size:.74rem;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--ink);
  position:relative;
  padding-bottom:3px;
}
.nav a::after{
  content:"";position:absolute;left:0;bottom:0;width:0;height:2px;background:var(--spark);
  transition:width .22s ease;
}
.nav a:hover{color:var(--leaf)}
.nav a:hover::after{width:100%}

/* hamburger (hidden until small) */
.mtoggle{display:none}
.mbtn{display:none;flex-direction:column;justify-content:center;gap:5px;width:34px;height:30px;cursor:pointer}
.mbtn span{display:block;height:2px;background:var(--ink);width:24px;transition:transform .25s ease,opacity .2s ease}

/* ============================================================
   Front page — Issue (hero)
   ============================================================ */
.front{padding-bottom:clamp(3rem,6vw,5rem)}

.issue{padding-top:clamp(2rem,4vw,3.2rem)}
.issue__grid{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) 1px minmax(0,1fr);
  gap:clamp(1.6rem,3.4vw,3rem);
  align-items:start;
}
.issue__rule{
  align-self:stretch;
  background:var(--hair);
  width:1px;
}

/* lead article (left) */
.lead__img{
  display:block;
  aspect-ratio:16/10;
  overflow:hidden;
  border:1px solid var(--hair);
  background:var(--paper);
}
.lead__img img{width:100%;height:100%;object-fit:cover;transition:transform .5s ease,filter .5s ease;filter:saturate(.96)}
.lead__img:hover img{transform:scale(1.03);filter:saturate(1.05)}
.lead__img--ph{display:grid;place-items:center;color:var(--hair);aspect-ratio:16/10}
.lead__leaf{width:120px;height:auto;opacity:.4}
.kicker--lead{margin-top:1.2rem}
.lead__title{
  font-size:var(--step-5);
  font-weight:600;
  margin:.5rem 0 .55rem;
  color:var(--ink);
}
.lead__title a{background-image:linear-gradient(var(--spark),var(--spark));background-size:0 2px;background-repeat:no-repeat;background-position:0 100%;transition:background-size .3s ease}
.lead__title a:hover{background-size:100% 2px}
.lead__dek{
  font-family:var(--f-disp);
  font-style:italic;
  font-weight:500;
  font-size:var(--step-1);
  line-height:1.45;
  color:#3a413a;
  max-width:42ch;
  margin:0 0 1rem;
}
.meta--lead{
  padding-top:.85rem;
  border-top:1px solid var(--hair);
  display:inline-block;
}

/* contents rail (right) */
.rail-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-bottom:.7rem;
  border-bottom:2px solid var(--ink);
  margin-bottom:.2rem;
}
.rail-head__label{
  font-family:var(--f-body);
  font-weight:700;
  font-size:.72rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--ink);
}
.rail-head__leaf{width:20px;height:auto;color:var(--leaf)}
.rail-list{display:flex;flex-direction:column}
.issue-row{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:.95rem;
  padding:1.1rem 0;
  border-bottom:1px solid var(--hair);
  align-items:start;
}
.issue-row:last-child{border-bottom:0}
.issue-row__no{
  font-family:var(--f-disp);
  font-weight:600;
  font-size:1.35rem;
  color:var(--spark);
  line-height:1;
  padding-top:.15rem;
  font-variant-numeric:tabular-nums;
}
.issue-row__body{display:flex;flex-direction:column;gap:.28rem}
.issue-row__title{
  font-family:var(--f-disp);
  font-weight:600;
  font-size:1.16rem;
  line-height:1.2;
  color:var(--ink);
  transition:color .18s ease;
}
.issue-row:hover .issue-row__title{color:var(--leaf)}
.issue-row .kicker{font-size:.62rem}

/* ============================================================
   Ruled section label
   ============================================================ */
.ruled-label{
  display:flex;
  align-items:baseline;
  gap:1.1rem;
  margin:clamp(2.6rem,5vw,4rem) 0 1.4rem;
}
.ruled-label__t{
  font-family:var(--f-body);
  font-weight:700;
  font-size:.82rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--ink);
  white-space:nowrap;
}
.ruled-label__rule{flex:1;height:1px;background:var(--ink);opacity:.85;transform:translateY(-3px)}
.ruled-label__more{
  font-family:var(--f-body);
  font-weight:600;
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--spark);
  white-space:nowrap;
}
.ruled-label__more:hover{color:var(--leaf)}

/* ============================================================
   Field-note list rows (image-left, text-right)
   ============================================================ */
.notes__grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  column-gap:clamp(2rem,4vw,3.4rem);
}
.notes__grid--full{grid-template-columns:1fr 1fr}
.note{
  display:grid;
  grid-template-columns:140px 1fr;
  gap:1.15rem;
  align-items:center;
  padding:1.3rem 0;
  border-top:1px solid var(--hair);
}
/* top rule for the very first row of each column */
.notes__grid .note:nth-child(1),
.notes__grid .note:nth-child(2){border-top:1px solid var(--ink)}
.note__img{
  width:140px;height:140px;
  overflow:hidden;
  border:1px solid var(--hair);
  background:var(--paper);
  flex:0 0 auto;
}
.note__img img{width:100%;height:100%;object-fit:cover;transition:transform .45s ease;filter:saturate(.96)}
.note:hover .note__img img{transform:scale(1.05)}
.note__ph{display:grid;place-items:center;width:100%;height:100%;color:var(--hair)}
.note__leaf{width:64px;height:auto}
.note__body{min-width:0}
.note__title{
  font-family:var(--f-disp);
  font-weight:600;
  font-size:1.28rem;
  line-height:1.18;
  margin:.35rem 0 .5rem;
  color:var(--ink);
}
.note__title a{transition:color .18s ease}
.note:hover .note__title a{color:var(--leaf)}

/* ============================================================
   Categories rail
   ============================================================ */
.catrail__list{display:flex;flex-direction:column}
.catrail__item{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:1rem;
  padding:.9rem 0;
  border-bottom:1px solid var(--hair);
  transition:padding-left .2s ease;
}
.catrail__item:first-child{border-top:1px solid var(--ink)}
.catrail__lead{width:34px;height:2px;background:var(--spark);transition:width .22s ease}
.catrail__item:hover{padding-left:.5rem}
.catrail__item:hover .catrail__lead{width:52px}
.catrail__name{
  font-family:var(--f-disp);
  font-weight:600;
  font-size:1.3rem;
  color:var(--ink);
}
.catrail__item:hover .catrail__name{color:var(--leaf)}
.catrail__count{
  font-family:var(--f-body);
  font-size:.72rem;
  letter-spacing:.14em;
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}

/* ============================================================
   Single article
   ============================================================ */
main{display:block}
.single{padding-top:clamp(1.8rem,4vw,2.8rem)}
.art-head{max-width:760px}
.breadcrumb{
  font-family:var(--f-body);
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  display:flex;gap:.55rem;align-items:center;
  margin-bottom:1.1rem;
}
.breadcrumb a:hover{color:var(--leaf)}
.breadcrumb__sep{color:var(--hair)}
.art-head__title{
  font-size:var(--step-4);
  font-weight:600;
  margin:.7rem 0 .6rem;
  max-width:20ch;
}
.art-head__dek{
  font-family:var(--f-disp);
  font-style:italic;
  font-weight:500;
  font-size:var(--step-1);
  line-height:1.45;
  color:#3a413a;
  margin:0 0 1.1rem;
}
.byline{
  font-family:var(--f-body);
  font-size:.8rem;
  letter-spacing:.02em;
  color:var(--muted);
  padding-top:.85rem;
  border-top:1px solid var(--hair);
}
.byline__field{
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--spark);
  margin-right:.5rem;
  font-size:.72rem;
}

.art-feat{
  margin:clamp(1.8rem,4vw,2.8rem) auto;
  max-width:960px;
}
.art-feat img{width:100%;border:1px solid var(--hair)}

/* prose */
.prose{max-width:680px;font-size:1.08rem;line-height:1.78}
.prose > p:first-of-type::first-letter{
  font-family:var(--f-disp);
  font-weight:600;
  float:left;
  font-size:3.9rem;
  line-height:.8;
  padding:.06em .12em 0 0;
  color:var(--leaf);
}
.prose h2{
  font-family:var(--f-disp);
  font-weight:600;
  font-size:1.7rem;
  margin:2.2rem 0 .8rem;
  padding-top:1.2rem;
  border-top:1px solid var(--hair);
  color:var(--ink);
}
.prose h3{
  font-family:var(--f-disp);
  font-weight:600;
  font-size:1.32rem;
  margin:1.8rem 0 .6rem;
  color:var(--ink);
}
.prose p{margin:0 0 1.15em}
.prose a{
  color:var(--leaf);
  background-image:linear-gradient(var(--spark),var(--spark));
  background-size:100% 1px;background-repeat:no-repeat;background-position:0 1.05em;
  transition:background-position .2s ease;
}
.prose a:hover{background-position:0 1.15em}
.prose figure{margin:1.8rem 0}
.prose figure img{border:1px solid var(--hair);width:100%}
.prose figcaption{
  font-family:var(--f-body);
  font-size:.78rem;
  color:var(--muted);
  padding-top:.5rem;
  border-bottom:1px solid var(--hair);
  padding-bottom:.7rem;
}
.prose blockquote{
  margin:1.8rem 0;
  padding:.2rem 0 .2rem 1.4rem;
  border-left:3px solid var(--spark);
  font-family:var(--f-disp);
  font-style:italic;
  font-weight:500;
  font-size:1.32rem;
  line-height:1.5;
  color:#2b322a;
}
.prose ul,.prose ol{margin:0 0 1.2em;padding-left:1.3em}
.prose li{margin:.4em 0}
.prose li::marker{color:var(--spark)}
.prose img{border:1px solid var(--hair)}
.prose code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  background:var(--paper);
  border:1px solid var(--hair);
  padding:.08em .35em;font-size:.9em;border-radius:2px;
}
.prose hr{border:0;border-top:1px solid var(--hair);margin:2rem 0}

/* related reuses .notes__grid */
.related{margin-top:clamp(2.4rem,5vw,4rem)}

/* ============================================================
   Listing / archive
   ============================================================ */
.listing{padding-top:clamp(1.8rem,4vw,2.8rem);padding-bottom:clamp(3rem,6vw,5rem)}
.page-head{margin-bottom:1rem}
.page-head__eyebrow{
  font-family:var(--f-body);
  font-weight:700;
  font-size:.72rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--spark);
}
.page-head__title{
  font-size:var(--step-4);
  font-weight:600;
  margin:.5rem 0 .7rem;
}
.page-head__desc{color:var(--muted);max-width:60ch;margin-bottom:.9rem}
.page-head__rule{display:block;height:2px;background:var(--ink)}
.empty{color:var(--muted);font-family:var(--f-disp);font-style:italic;padding:2rem 0}

/* pagination */
.pager{margin-top:2.5rem;display:flex;gap:.5rem;flex-wrap:wrap}
.pager .page-numbers{
  font-family:var(--f-body);
  font-size:.82rem;
  font-weight:600;
  letter-spacing:.04em;
  padding:.5rem .85rem;
  border:1px solid var(--hair);
  color:var(--ink);
  transition:all .18s ease;
}
.pager .page-numbers:hover{border-color:var(--leaf);color:var(--leaf)}
.pager .page-numbers.current{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.pager .dots{border:0}

/* ============================================================
   Footer
   ============================================================ */
.site-footer{margin-top:clamp(3rem,6vw,5rem);border-top:2px solid var(--ink);background:var(--bg)}
.site-footer__top{
  display:grid;
  grid-template-columns:1.6fr 1fr 1fr;
  gap:clamp(1.6rem,4vw,3rem);
  padding-block:clamp(2.4rem,4vw,3.2rem);
}
.fcol{display:flex;flex-direction:column;gap:.55rem}
.fcol--brand .brand{margin-bottom:.4rem}
.fcol__blurb{color:var(--muted);font-size:.9rem;max-width:40ch;margin:0}
.fcol__h{
  font-family:var(--f-body);
  font-weight:700;
  font-size:.72rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--ink);
  margin-bottom:.4rem;
  padding-bottom:.5rem;
  border-bottom:1px solid var(--hair);
}
.fcol a{
  font-family:var(--f-body);
  font-size:.9rem;
  color:var(--muted);
  transition:color .18s ease;
  padding:.12rem 0;
}
.fcol a:hover{color:var(--leaf)}
.site-footer__legal{border-top:1px solid var(--hair)}
.site-footer__legal .wrap{padding-block:1.4rem;display:flex;flex-direction:column;gap:.5rem}
.disclaimer{
  font-family:var(--f-body);
  font-size:.76rem;
  line-height:1.6;
  color:var(--muted);
  max-width:80ch;
  margin:0;
}
.copy{
  font-family:var(--f-body);
  font-size:.74rem;
  letter-spacing:.06em;
  color:var(--muted);
  margin:0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media(max-width:960px){
  .issue__grid{grid-template-columns:1fr;gap:2rem}
  .issue__rule{display:none}
  .issue__rail{border-top:1px solid var(--hair);padding-top:1.4rem}
  .site-footer__top{grid-template-columns:1fr 1fr}
  .fcol--brand{grid-column:1/-1}
}
@media(max-width:820px){
  .notes__grid,.notes__grid--full{grid-template-columns:1fr}
  .notes__grid .note:nth-child(2){border-top:1px solid var(--hair)}
  .notes__grid .note:nth-child(1){border-top:1px solid var(--ink)}
}
@media(max-width:620px){
  .masthead__top{grid-template-columns:auto auto;gap:.8rem}
  .masthead__slug{display:none}
  .mbtn{display:flex;justify-self:end}
  .nav{
    grid-column:1/-1;
    justify-self:stretch;
    flex-direction:column;
    gap:0;
    max-height:0;
    overflow:hidden;
    transition:max-height .32s ease;
    border-top:0;
  }
  .nav a{
    padding:.85rem .2rem;
    border-bottom:1px solid var(--hair);
    font-size:.82rem;
  }
  .nav a::after{display:none}
  .mtoggle:checked ~ .nav{max-height:60vh;border-top:1px solid var(--hair);margin-top:.4rem}
  .mtoggle:checked ~ .mbtn span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  .mtoggle:checked ~ .mbtn span:nth-child(2){opacity:0}
  .mtoggle:checked ~ .mbtn span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
  .note{grid-template-columns:104px 1fr;gap:.9rem}
  .note__img{width:104px;height:104px}
  .site-footer__top{grid-template-columns:1fr}
}
@media(max-width:420px){
  .note{grid-template-columns:84px 1fr}
  .note__img{width:84px;height:84px}
}

/* ===== centered footer ===== */
.site-footer__top{text-align:center}
.site-footer__top .fcol{display:flex;flex-direction:column;align-items:center;text-align:center}
.fcol--brand .brand{justify-content:center}
.fcol__blurb{margin-left:auto;margin-right:auto}
.site-footer__legal .wrap{justify-content:center;text-align:center}
/* ===== centered legal row (fix) ===== */
.site-footer__legal .wrap{align-items:center;text-align:center}
.site-footer__legal .disclaimer{max-width:80ch;margin-left:auto;margin-right:auto}
.site-footer__legal .copy{margin-left:auto;margin-right:auto;text-align:center}
