/*
Theme Name: Jim Link
Theme URI: https://jimlink.me
Author: Built for Jim Link
Description: A custom biographical theme for a retired U.S. Army Inspector General and DoD AI modernization leader. Senatorial palette, serif typography, full-width tan hero band, and a ringed-binder bookshelf motif. Four-section structure: Home, About, Blog, Contact.
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jimlink
*/

/* ============================================================
   Design tokens
   ============================================================ */
:root{
  --navy:#15294E;
  --burgundy:#7E2A30;
  --burgundy-dark:#5E1E23;
  --tan:#CBB68B;
  --hero-band:#E6D7B5;
  --parchment:#F5EEDC;
  --offwhite:#FBF8F1;
  --ink:#23211C;
  --muted:#5A5446;
  --rule:rgba(21,41,78,0.16);

  --font-head:"Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-body:"Source Serif 4", Georgia, "Times New Roman", serif;

  --maxw:1120px;
  --readw:720px;
  --radius:6px;
}

/* ============================================================
   Base
   ============================================================ */
*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background-color:var(--parchment);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  color:var(--ink);
  font-family:var(--font-body);
  font-size:18px;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto;display:block;}
a{color:var(--burgundy);text-underline-offset:2px;}
a:hover{color:var(--burgundy-dark);}

h1,h2,h3,h4{font-family:var(--font-head);color:var(--navy);line-height:1.2;font-weight:700;}
h1{font-size:2.6rem;margin:0 0 .5em;}
h2{font-size:1.9rem;margin:0 0 .6em;}
h3{font-size:1.3rem;margin:0 0 .5em;}
p{margin:0 0 1.1em;}

.wrap{max-width:var(--maxw);margin:0 auto;padding:0 1.5rem;}
.readable{max-width:var(--readw);}
.center{text-align:center;}

/* Skip link + focus */
.skip-link{position:absolute;left:-999px;}
.skip-link:focus{left:1rem;top:1rem;background:var(--offwhite);padding:.6rem 1rem;border-radius:var(--radius);z-index:1000;}
a:focus-visible,button:focus-visible,.button:focus-visible{outline:3px solid var(--burgundy);outline-offset:2px;}

/* ============================================================
   Buttons
   ============================================================ */
.button{
  display:inline-block;
  background:var(--burgundy);
  color:var(--offwhite);
  font-family:var(--font-head);
  font-size:.95rem;
  letter-spacing:.02em;
  text-decoration:none;
  padding:.75rem 1.5rem;
  border-radius:var(--radius);
  border:1px solid var(--burgundy-dark);
  transition:background .15s ease;
}
.button:hover{background:var(--burgundy-dark);color:var(--offwhite);}
.button--ghost{background:transparent;color:var(--offwhite);border-color:rgba(251,248,241,.5);}
.button--ghost:hover{background:rgba(251,248,241,.12);color:var(--offwhite);}

/* ============================================================
   Header
   ============================================================ */
.site-header{background:var(--navy);color:var(--offwhite);border-bottom:3px solid var(--burgundy);}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:72px;flex-wrap:wrap;}
.site-brand{font-family:var(--font-head);font-size:1.25rem;color:var(--offwhite);text-decoration:none;letter-spacing:.01em;}
.site-brand:hover{color:#fff;}
.main-nav ul{list-style:none;display:flex;gap:1.4rem;margin:0;padding:0;}
.main-nav a{color:var(--offwhite);text-decoration:none;font-family:var(--font-head);font-size:.95rem;padding:.4rem 0;border-bottom:2px solid transparent;}
.main-nav a:hover,.main-nav .current-menu-item>a{border-bottom-color:var(--tan);color:#fff;}

/* ============================================================
   Hero (front page)
   ============================================================ */
.hero{position:relative;overflow:visible;z-index:2;background:var(--hero-band);border-bottom:1px solid rgba(21,41,78,.18);}
.hero__inner{position:relative;z-index:2;min-height:580px;display:flex;align-items:center;padding:3.75rem 0;}
.hero__name{font-size:clamp(2.4rem,3.8vw,3.4rem);line-height:1.05;margin:0 0 .4rem;color:var(--navy);white-space:nowrap;}
.hero__subtitle{font-family:var(--font-head);font-size:1.15rem;color:var(--burgundy-dark);margin:0 0 1.6rem;font-weight:400;}
.hero__text{max-width:34rem;position:relative;z-index:2;}
.hero__intro{font-size:1.08rem;color:var(--ink);margin:0 0 1.8rem;max-width:34rem;}
.hero__portrait{position:absolute;right:0;bottom:-64px;z-index:1;pointer-events:none;}
.hero__portrait img{height:clamp(504px,55vw,672px);width:auto;display:block;}

/* ============================================================
   Sections
   ============================================================ */
.section{padding:3.75rem 0;}
.section--alt{background:var(--offwhite);border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);}
.section__eyebrow{font-family:var(--font-head);font-size:.8rem;letter-spacing:.14em;text-transform:uppercase;color:var(--burgundy);margin:0 0 .6rem;}
.section__head{margin-bottom:2rem;}

/* CTA band */
.cta-band{background:var(--navy);color:var(--offwhite);padding:3rem 0;text-align:center;}
.cta-band h2{color:#fff;}
.cta-band p{color:rgba(251,248,241,.85);max-width:38rem;margin:0 auto 1.6rem;}

/* ============================================================
   Post lists / cards
   ============================================================ */
.post-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1.5rem;}
.post-card{background:var(--offwhite);border:1px solid var(--rule);border-radius:var(--radius);padding:1.5rem;display:flex;flex-direction:column;}
.section--alt .post-card{background:var(--parchment);}
.post-card__date{font-family:var(--font-head);font-size:.8rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:0 0 .4rem;}
.post-card__title{font-size:1.3rem;margin:0 0 .5rem;}
.post-card__title a{color:var(--navy);text-decoration:none;}
.post-card__title a:hover{color:var(--burgundy);}
.post-card__excerpt{color:var(--ink);margin:0 0 1rem;}
.post-card__more{margin-top:auto;font-family:var(--font-head);font-size:.9rem;}

/* Single + page content */
.entry{padding:3.25rem 0;}
.entry__header{margin-bottom:1.8rem;}
.entry__meta{font-family:var(--font-head);font-size:.85rem;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);}
.entry__content{font-size:1.08rem;}
.entry__content h2{margin-top:1.8em;}
.entry__content h3{margin-top:1.5em;}
.entry__content img{border-radius:var(--radius);margin:1.5em 0;}
.entry__content blockquote{border-left:4px solid var(--burgundy);margin:1.5em 0;padding:.4em 0 .4em 1.4em;color:var(--muted);font-style:italic;}
.entry__content a{text-decoration:underline;}

/* About portrait (black and white treatment) */
.about-portrait{float:right;margin:0 0 1.5rem 1.8rem;width:240px;}
.about-portrait img{filter:grayscale(100%);border-radius:var(--radius);border:4px solid var(--offwhite);box-shadow:0 6px 18px rgba(21,41,78,.18);}

/* ============================================================
   Bookshelf / ringed-binder motif
   ============================================================ */
.bookshelf{position:relative;padding-left:3.25rem;}
.bookshelf::before{content:"";position:absolute;left:0;top:0;bottom:0;width:2.4rem;background:var(--navy);border-radius:var(--radius) 0 0 var(--radius);}
.bookshelf::after{content:"";position:absolute;left:.62rem;top:1.2rem;bottom:1.2rem;width:1.15rem;
  background-image:radial-gradient(circle, var(--parchment) 0 .34rem, rgba(0,0,0,.25) .35rem .42rem, transparent .44rem);
  background-size:1.15rem 3.4rem;background-repeat:repeat-y;}
.book{display:grid;grid-template-columns:96px 1fr;gap:1.3rem;background:var(--offwhite);border:1px solid var(--rule);border-radius:var(--radius);padding:1.3rem;margin:0 0 1.3rem;}
.book__cover{width:96px;height:140px;object-fit:cover;border-radius:4px;border:1px solid var(--rule);background:var(--tan);}
.book__title{font-size:1.2rem;margin:0 0 .15rem;color:var(--navy);}
.book__author{font-family:var(--font-head);font-size:.9rem;color:var(--muted);margin:0 0 .5rem;}
.book__rating{color:var(--burgundy);letter-spacing:.1em;margin:0 0 .5rem;}
.book__review{margin:0 0 .6rem;}
@media(max-width:520px){.book{grid-template-columns:1fr;}.book__cover{width:96px;}}

/* ============================================================
   Footer
   ============================================================ */
.site-footer{background:var(--navy);color:rgba(251,248,241,.85);padding:2.5rem 0;border-top:3px solid var(--burgundy);margin-top:0;}
.site-footer a{color:var(--tan);}
.site-footer .wrap{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;align-items:center;}
.footer-nav ul{list-style:none;display:flex;gap:1.2rem;margin:0;padding:0;}
.footer-nav a{text-decoration:none;font-family:var(--font-head);font-size:.9rem;}
.footer-credit{font-size:.85rem;}

/* ============================================================
   Pagination + misc
   ============================================================ */
.pagination{margin:2.5rem 0 0;display:flex;gap:.5rem;flex-wrap:wrap;}
.pagination .page-numbers{display:inline-block;padding:.4rem .8rem;border:1px solid var(--rule);border-radius:var(--radius);text-decoration:none;color:var(--navy);background:var(--offwhite);}
.pagination .current{background:var(--navy);color:var(--offwhite);border-color:var(--navy);}

/* ============================================================
   Responsive
   ============================================================ */
@media(max-width:1024px){
  .hero__inner{min-height:auto;flex-direction:column;text-align:center;padding:2.5rem 0 0;}
  .hero__name{font-size:2.3rem;white-space:normal;}
  .hero__intro{margin-left:auto;margin-right:auto;}
  .hero__text{padding-bottom:2rem;max-width:100%;}
  .hero__portrait{position:static;text-align:center;}
  .hero__portrait img{height:auto;max-height:340px;margin:0 auto;}
  .about-portrait{float:none;margin:0 auto 1.5rem;}
}
@media(max-width:640px){
  body{font-size:17px;}
  h1{font-size:2.1rem;}
  .site-header .wrap{min-height:auto;padding-top:.8rem;padding-bottom:.8rem;}
  .main-nav ul{gap:1rem;flex-wrap:wrap;}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  *{transition:none !important;}
}

/* anchor offset so menu jumps clear the header */
#log,#library{scroll-margin-top:90px;}

/* Featured book + featured log entry */
.featured-book{display:flex;gap:1.75rem;align-items:flex-start;}
.featured-book__cover{flex:0 0 auto;line-height:0;}
.featured-book__cover img{width:150px;height:auto;border-radius:4px;box-shadow:0 8px 22px rgba(21,41,78,.20);display:block;}
.featured-book__title{font-size:1.5rem;margin:0 0 .45rem;}
.featured-book__note{margin:0 0 1rem;color:var(--ink);}
.book-links{display:flex;flex-wrap:wrap;gap:.7rem;align-items:center;}
.book-links--single{margin:1.75rem 0;}
.button--sm{padding:.4rem .95rem;font-size:.92rem;}
.feature-entry{display:flex;gap:1.75rem;align-items:flex-start;}
.feature-entry__thumb{flex:0 0 38%;max-width:38%;line-height:0;}
.feature-entry__thumb img{width:100%;height:auto;border-radius:6px;display:block;}
.feature-entry__title{font-size:1.6rem;margin:.15rem 0 .55rem;}
@media(max-width:680px){
  .featured-book,.feature-entry{flex-direction:column;}
  .feature-entry__thumb{max-width:100%;flex-basis:auto;}
  .featured-book__cover img{width:130px;}
}

/* Library page list */
.book-list{display:flex;flex-direction:column;gap:2rem;margin-top:1.5rem;}
.book-list__item{display:flex;gap:1.5rem;align-items:flex-start;padding-bottom:2rem;border-bottom:1px solid rgba(21,41,78,.12);}
.book-list__item:last-child{border-bottom:0;padding-bottom:0;}
.book-list__cover{flex:0 0 auto;line-height:0;}
.book-list__cover img{width:120px;height:auto;border-radius:4px;box-shadow:0 6px 18px rgba(21,41,78,.18);display:block;}
.book-list__title{font-size:1.4rem;margin:.15rem 0 .5rem;}
.book-list__note{margin:0 0 .9rem;color:var(--ink);}
.pagination{margin-top:2.25rem;}
.pagination ul{list-style:none;display:flex;gap:.5rem;flex-wrap:wrap;padding:0;margin:0;}
.pagination a,.pagination span{display:inline-block;padding:.4rem .8rem;border:1px solid rgba(21,41,78,.2);border-radius:4px;text-decoration:none;}
.pagination .current{background:var(--navy);color:#fff;border-color:var(--navy);}
@media(max-width:680px){
  .book-list__item{flex-direction:column;}
  .book-list__cover img{width:110px;}
}

/* Contact page */
.contact-methods{margin-top:2rem;display:flex;flex-direction:column;gap:1.1rem;}
.contact-methods a{font-size:1.1rem;}
