/* =========================================================
   GLEASON TENNIS — COACHING JOURNAL ARTICLE TEMPLATE
   Reusable components for every Journal post. Load after
   styles.css / nav.css / widgets.css on article pages.

   Components:
     .article-hero + .article-meta   hero & byline row
     .article-shell                  70/30 body + sticky TOC
     .article-toc                    numbered rail, active dot
     .article-body                   editorial typography
     .coach-note                     "Coach Jimmy's Take"
     .article-figure / .article-video / .article-diagram
     .pull-quote
     .cue-grid                       coaching cues
     .train-module                   local relevance
     .keep-training                  related coaching
     .article-faq                    disclosure FAQ
     .author-block                   E-E-A-T author card
   ========================================================= */

/* ---------- Hero ---------- */
.article-hero .article-meta{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem 1.35rem;
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(16,24,32,.12);
  max-width: 680px;
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--c-charcoal-soft);
}
.article-meta-item{ display: inline-flex; align-items: center; gap: .45rem; }
.article-meta-item b{ font-weight: 700; color: var(--c-charcoal-deep); }
.article-meta a{ color: var(--c-blue-deep); font-weight: 700; text-decoration: none; }
.article-meta a:hover{ color: var(--c-charcoal-deep); }
.article-meta-item::before{
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-neon-primary);
  flex: none;
}

/* ---------- Shell: article + sticky TOC ---------- */
.article-shell{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
.article-body{ max-width: 740px; }     /* keeps the measure readable */

/* ---------- Table of contents ---------- */
.article-toc{
  position: sticky;
  top: calc(var(--nav-h, 112px) + 1.5rem);
  max-height: calc(100vh - var(--nav-h, 112px) - 3rem);
  overflow-y: auto;
  padding-left: 1.25rem;
}
.article-toc-label{
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-blue-deep);
}
.article-toc-rail{ position: relative; }
.article-toc-rail::before{         /* thin court line */
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 1px;
  background: rgba(16,24,32,.16);
}
.toc-dot{
  position: absolute;
  left: -3px;
  top: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-neon-primary);
  box-shadow: 0 0 8px rgba(184,255,24,.85);
  opacity: 0;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
  pointer-events: none;
}
.toc-dot.is-ready{ opacity: 1; }
.article-toc ol{ list-style: none; margin: 0; padding: 0; }
.article-toc li{ margin: 0; }
.article-toc a{
  display: grid;
  grid-template-columns: 2.1rem minmax(0,1fr);
  gap: .5rem;
  padding: .5rem 0 .5rem 1.1rem;
  font-family: var(--font-body);
  font-size: .84rem;
  line-height: 1.4;
  color: var(--c-charcoal-soft);
  text-decoration: none;
  transition: color .2s ease;
}
.article-toc a .toc-num{
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .06em;
  color: rgba(16,24,32,.38);
  transition: color .2s ease;
}
.article-toc a:hover{ color: var(--c-charcoal-deep); }
.article-toc a:hover .toc-num{ color: var(--c-blue-deep); }
.article-toc li.is-current a{ color: var(--c-charcoal-deep); font-weight: 700; }
.article-toc li.is-current .toc-num{ color: var(--c-blue-deep); }

/* ---------- Body typography ---------- */
.article-body h2{
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.08;
  color: var(--c-charcoal-deep);
  margin: 3.25rem 0 1rem;
  scroll-margin-top: calc(var(--nav-h, 112px) + 1.25rem);
}
.article-body h2:first-child{ margin-top: 0; }
.article-body p{
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--c-charcoal-soft);
  margin-bottom: 1.15rem;
}
.article-body p strong{ color: var(--c-charcoal-deep); }
.article-body a:not(.btn){
  color: var(--c-blue-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.article-body a:not(.btn):hover{ color: var(--c-charcoal-deep); }
.article-lede{
  font-size: clamp(1.15rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--c-charcoal-deep);
  font-weight: 500;
}

/* ---------- Coach note ---------- */
.coach-note{
  margin: 2.25rem 0 2.75rem;
  padding: 1.5rem 1.6rem;
  border-radius: 6px;
  background: var(--c-charcoal-deep);
  border-left: 3px solid var(--c-neon-primary);
  color: rgba(255,255,255,.86);
}
.coach-note-label{
  margin: 0 0 .6rem;
  font-family: var(--font-body);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-neon-primary);
}
.coach-note p{
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: rgba(255,255,255,.88);
}

/* ---------- Media ---------- */
.article-figure{ margin: 2.5rem 0; }
.article-figure img,
.article-image{
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 6px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* Opt-in modifier for portrait/square source photos, which a 16:9 crop
   would decapitate. Additive — does not affect existing figures. */
.article-figure--portrait{ max-width: 420px; margin-left: auto; margin-right: auto; }
.article-figure--portrait img{ aspect-ratio: 4 / 5; object-position: center 12%; }

.article-caption{
  margin-top: .7rem;
  padding-left: .85rem;
  border-left: 2px solid var(--c-neon-primary);
  font-family: var(--font-body);
  font-size: .82rem;
  line-height: 1.5;
  color: var(--c-charcoal-soft);
}
.article-caption b{
  display: block;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-blue-deep);
  margin-bottom: .2rem;
}
/* Responsive embed shell — use for YouTube when a verified URL exists:
   <div class="article-video"><iframe src="…" title="…" loading="lazy"
        allowfullscreen></iframe></div> */
.article-video{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 2.5rem 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--c-charcoal-deep);
}
.article-video iframe{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.article-diagram{
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 1px solid rgba(16,24,32,.12);
  border-radius: 6px;
  background: var(--c-blue-ice);
}
.article-diagram svg,
.article-diagram img{ display: block; width: 100%; height: auto; }

.pull-quote{
  margin: 2.5rem 0;
  padding: .25rem 0 .25rem 1.4rem;
  border-left: 3px solid var(--c-neon-primary);
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--c-charcoal-deep);
}

/* ---------- Coaching cues ---------- */
.cue-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 2rem 0 2.5rem;
  padding: 0;
  list-style: none;
  background: rgba(16,24,32,.12);
  border: 1px solid rgba(16,24,32,.12);
  border-radius: 6px;
  overflow: hidden;
}
.cue-item{
  margin: 0;
  padding: 1.35rem 1.4rem;
  background: var(--c-white);
}
.cue-num{
  display: block;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--c-neon-dark);
  margin-bottom: .45rem;
}
.cue-item b{
  display: block;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--c-charcoal-deep);
  margin-bottom: .3rem;
}
.cue-item span{
  display: block;
  font-size: .93rem;
  line-height: 1.55;
  color: var(--c-charcoal-soft);
}

/* ---------- Local relevance ---------- */
.train-module{
  margin: 3rem 0;
  padding: 1.75rem 1.75rem 1.6rem;
  border: 1px solid rgba(86,169,226,.3);
  border-radius: 6px;
  background: linear-gradient(150deg, var(--c-blue-ice), var(--c-white));
}
.train-module h2{
  margin: .4rem 0 .7rem !important;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem) !important;
}
.train-module p{ margin-bottom: 1.1rem; }
.train-links{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.train-links a{
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .84rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-charcoal-deep);
  text-decoration: none !important;
}
.train-links a:hover{ color: var(--c-blue-deep); }

/* ---------- Keep training ---------- */
.keep-training{ margin: 3rem 0; }
.keep-training-list{ margin: 0; padding: 0; list-style: none; }
.keep-training-list li{ border-top: 1px solid rgba(16,24,32,.12); }
.keep-training-list li:last-child{ border-bottom: 1px solid rgba(16,24,32,.12); }
.keep-training-list a{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem .25rem;
  text-decoration: none !important;
  color: var(--c-charcoal-deep);
  transition: padding-left .2s ease;
}
.keep-training-list a:hover{ padding-left: .75rem; }
.keep-training-list b{
  display: block;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
}
.keep-training-list small{
  display: block;
  margin-top: .15rem;
  font-size: .86rem;
  color: var(--c-charcoal-soft);
}
.keep-training-list .kt-arrow{ color: var(--c-neon-dark); font-weight: 800; }

/* ---------- FAQ ---------- */
.article-faq{ margin: 3rem 0; }
.faq-item{
  border-top: 1px solid rgba(16,24,32,.12);
}
.faq-item:last-of-type{ border-bottom: 1px solid rgba(16,24,32,.12); }
.faq-item summary{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem .25rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--c-charcoal-deep);
}
.faq-item summary::-webkit-details-marker{ display: none; }
.faq-item summary::after{
  content: '+';
  flex: none;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--c-blue-deep);
}
.faq-item[open] summary::after{ content: '\2212'; }
.faq-item p{
  margin: 0 0 1.15rem;
  padding-right: 2rem;
  font-size: .98rem;
  line-height: 1.7;
  color: var(--c-charcoal-soft);
}

/* ---------- Author ---------- */
.author-block{
  display: grid;
  grid-template-columns: 104px minmax(0,1fr);
  gap: 1.5rem;
  align-items: start;
  margin: 3rem 0 0;
  padding: 1.75rem;
  border: 1px solid rgba(16,24,32,.12);
  border-radius: 6px;
  background: var(--c-white);
}
/* Avatar wrapper so a full-body source photo can be zoomed to head-and-
   shoulders. Tune --av-x / --av-y per photo to centre the subject. */
.author-avatar{
  position: relative;
  display: block;
  width: 104px; height: 104px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--c-neon-primary);
  background: var(--c-blue-ice);
}
.author-avatar img{
  position: absolute;
  width: var(--av-zoom, 200%);
  height: auto;
  left: var(--av-x, -38%);
  top: var(--av-y, -22%);
  max-width: none;
}
.author-label{
  margin: 0 0 .35rem;
  font-family: var(--font-body);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-blue-deep);
}
.author-block h2{
  margin: 0 0 .1rem !important;
  font-size: 1.4rem !important;
  scroll-margin-top: 0;
}
.author-role{
  margin: 0 0 .75rem;
  font-family: var(--font-body);
  font-size: .84rem;
  font-weight: 600;
  color: var(--c-charcoal-soft);
}
.author-block p.author-bio{
  font-size: .96rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}
.author-link{
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-charcoal-deep);
  text-decoration: none !important;
}
.author-link:hover{ color: var(--c-blue-deep); }

/* Module-level headings sit a tier below the article's section H2s. */
.article-body .module-h{
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  margin: 0 0 1.1rem;
}

/* ---------- Section headings shared by modules ---------- */
.module-label{
  margin: 0 0 .9rem;
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-blue-deep);
}

/* Narrower desktops: trim the rail and gutter so the text measure
   stays close to the 680–760px target. */
@media (max-width: 1200px){
  .article-shell{ grid-template-columns: minmax(0,1fr) 226px; gap: 2.5rem; }
}

/* =========================================================
   Tablet / mobile — TOC stacks above the article, never sticky
   ========================================================= */
@media (max-width: 1023px){
  .article-shell{ grid-template-columns: minmax(0,1fr); gap: 2.5rem; }
  .article-toc{
    position: static;
    max-height: none;
    overflow: visible;
    order: -1;                       /* TOC above the body */
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    border: 1px solid rgba(16,24,32,.12);
    border-radius: 6px;
    background: var(--c-blue-ice);
  }
  .toc-dot{ display: none; }         /* rail dot is desktop-only */
  .article-body{ max-width: none; }
}
@media (max-width: 600px){
  .cue-grid{ grid-template-columns: minmax(0,1fr); }
  .author-block{ grid-template-columns: minmax(0,1fr); gap: 1.1rem; padding: 1.35rem; }
  .author-avatar{ width: 84px; height: 84px; }
  .coach-note{ padding: 1.25rem 1.2rem; }
  .train-module{ padding: 1.35rem 1.2rem 1.25rem; }
  .article-body p{ font-size: 1.04rem; }
  .keep-training-list a{ grid-template-columns: minmax(0,1fr) auto; }
}

@media (prefers-reduced-motion: reduce){
  .toc-dot{ transition: none; }
  .keep-training-list a{ transition: none; }
  html{ scroll-behavior: auto; }
}
