/*
Theme Name: FAF Lite
Theme URI: https://fitnessasfun.com/
Author: FitnessAsFun
Description: A fast, minimal theme for FitnessAsFun. Zero external requests, no icon fonts, no CSS frameworks — system fonts only. Built to match the site's tools design language.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: faf-lite
*/

/* ============================= tokens ============================= */
:root{
  --bg:#ffffff; --soft:#f8fafc; --fg:#0f172a; --muted:#64748b; --line:#e2e8f0;
  --accent:#e11d48; --accent-fg:#ffffff; --radius:14px;
  --wrap:1180px; --read:68ch; --header-h:88px;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji",sans-serif;
}
/* Light mode only, deliberately. Telling the browser the page is light also
   keeps form controls, scrollbars and the URL bar from rendering dark. */
:root{ color-scheme:light; }

/* ============================= base ============================= */
*,*::before,*::after{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;}
body{
  margin:0;background:var(--bg);color:var(--fg);font-family:var(--sans);
  font-size:17px;line-height:1.7;-webkit-font-smoothing:antialiased;overflow-x:hidden;
}
img,video,iframe{max-width:100%;height:auto;}
figure{margin:1.5rem 0;}
a{color:var(--accent);text-decoration:none;}
a:hover{text-decoration:underline;}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px;}
h1,h2,h3,h4,h5,h6{line-height:1.2;margin:2rem 0 .75rem;font-weight:800;text-wrap:balance;letter-spacing:-.01em;}
h1{font-size:clamp(1.75rem,4vw,2.5rem);}
h2{font-size:clamp(1.35rem,2.6vw,1.75rem);}
h3{font-size:1.2rem;}
p,ul,ol,blockquote,table{margin:0 0 1.15rem;}
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0;}
blockquote{border-left:3px solid var(--accent);margin-left:0;padding:.25rem 0 .25rem 1rem;color:var(--muted);font-style:italic;}
code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.9em;}
pre{background:var(--soft);padding:1rem;border-radius:10px;overflow-x:auto;}
table{width:100%;border-collapse:collapse;}
th,td{padding:.55rem .6rem;border-bottom:1px solid var(--line);text-align:left;}
th{font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);}
.wp-block-table{overflow-x:auto;}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap;}
.skip-link:focus{position:fixed;top:8px;left:8px;z-index:999;background:var(--bg);padding:.6rem 1rem;border:1px solid var(--line);border-radius:8px;width:auto;height:auto;clip:auto;}

/* ============================= layout ============================= */
.wrap{max-width:var(--wrap);margin:0 auto;padding:0 1.15rem;}
.site-main{min-height:55vh;padding:2rem 0 3.5rem;}
.entry-content > *{max-width:var(--read);}
.entry-content > .alignwide,.entry-content > .alignfull,
.entry-content > .wp-block-table,.entry-content > figure,
.entry-content > .faf-hub,.entry-content > .faf-tool{max-width:none;}

/* ============================= header ============================= */
.site-header{
  position:sticky;top:0;z-index:50;background:color-mix(in srgb,var(--bg) 88%,transparent);
  backdrop-filter:saturate(1.6) blur(10px);-webkit-backdrop-filter:saturate(1.6) blur(10px);
  border-bottom:1px solid var(--line);
}
@supports not (backdrop-filter:blur(1px)){ .site-header{background:var(--bg);} }
.header-inner{display:flex;align-items:center;gap:1rem;min-height:var(--header-h);}
.brand{display:flex;align-items:center;gap:.55rem;font-weight:800;font-size:1.15rem;color:var(--fg);letter-spacing:-.02em;}
.brand:hover{text-decoration:none;}
.brand img{max-height:64px;width:auto;display:block;}
@media (min-width:901px){ .brand img{max-height:74px;} }
@media (max-width:480px){ .brand img{max-height:52px;} }
/* footer lockup stays a touch smaller than the header */
.site-footer .brand img{max-height:56px;}
.nav{margin-left:auto;}
.nav ul{display:flex;align-items:center;gap:.25rem;list-style:none;margin:0;padding:0;}
.nav li{position:relative;}
.nav a{
  display:block;padding:.5rem .7rem;border-radius:9px;color:var(--fg);
  font-size:.93rem;font-weight:600;white-space:nowrap;
}
.nav a:hover{background:var(--soft);color:var(--accent);text-decoration:none;}
.nav .current-menu-item > a{color:var(--accent);}
/* dropdowns */
.nav .sub-menu{
  display:none;position:absolute;top:100%;left:0;z-index:60;
  min-width:250px;max-width:min(320px,calc(100vw - 2rem));
  flex-direction:column;align-items:stretch;gap:1px;   /* not centred like the top bar */
  background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:.3rem;
  box-shadow:0 10px 30px rgba(15,23,42,.12);
}
/* The nav is right-aligned, so the last item's dropdown would spill off the
   right edge of the viewport — anchor it to the right instead. */
.nav > ul > li:last-child > .sub-menu{left:auto;right:0;}
.nav li:hover > .sub-menu,.nav li:focus-within > .sub-menu{display:flex;}
.nav .sub-menu a{
  white-space:normal;font-weight:500;text-align:left;
  line-height:1.3;padding:.5rem .65rem;font-size:.9rem;
}
/* mobile toggle (CSS-only, but keyboard-reachable) */
.nav-toggle{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;}
.nav-toggle:focus-visible + .nav-btn{outline:2px solid var(--accent);outline-offset:2px;}
.nav-btn{
  display:none;margin-left:auto;background:transparent;border:1px solid var(--line);
  border-radius:10px;padding:.45rem .6rem;cursor:pointer;color:var(--fg);line-height:0;
}
.nav-btn svg{width:20px;height:20px;}
@media (min-width:901px){ .nav-toggle{display:none;} }
@media (max-width:900px){
  .nav-btn{display:block;}
  .nav{
    margin-left:0;position:absolute;top:100%;left:0;right:0;background:var(--bg);
    border-bottom:1px solid var(--line);max-height:0;overflow:hidden;transition:max-height .25s ease;
  }
  .nav-toggle:checked ~ .nav{max-height:80vh;overflow-y:auto;}
  .nav ul{flex-direction:column;align-items:stretch;gap:0;padding:.5rem 1.15rem 1rem;}
  .nav a{padding:.7rem .25rem;border-bottom:1px solid var(--line);border-radius:0;}
  .nav .sub-menu{display:flex;position:static;border:0;box-shadow:none;padding:0 0 0 .9rem;min-width:0;}
}
@media (prefers-reduced-motion:reduce){ .nav{transition:none;} html{scroll-behavior:auto;} }

/* ============================= cards / archive ============================= */
.page-head{padding:2rem 0 .5rem;}
.page-head h1{margin:0 0 .35rem;}
.page-head p{color:var(--muted);margin:0;}
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:1.35rem;margin:1.75rem 0;}
.card{
  display:flex;flex-direction:column;background:var(--bg);border:1px solid var(--line);
  border-radius:var(--radius);overflow:hidden;transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease;
}
.card:hover{transform:translateY(-2px);box-shadow:0 10px 28px rgba(15,23,42,.09);border-color:var(--accent);}
.card__media{display:block;aspect-ratio:16/9;background:var(--soft);overflow:hidden;}
.card__media img{width:100%;height:100%;object-fit:cover;display:block;}
.card__body{padding:1rem 1.1rem 1.2rem;display:flex;flex-direction:column;gap:.45rem;flex:1;}
.card__title{font-size:1.06rem;font-weight:700;line-height:1.3;margin:0;}
.card__title a{color:var(--fg);}
.card__title a:hover{color:var(--accent);text-decoration:none;}
.card__meta{font-size:.78rem;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
.card__excerpt{font-size:.93rem;color:var(--muted);margin:0;}
.card__more{margin-top:auto;font-size:.85rem;font-weight:700;color:var(--accent);padding-top:.35rem;}
@media (prefers-reduced-motion:reduce){ .card{transition:none;} }

/* ==================== single layout + sidebar ==================== */
/* Two columns on desktop. No align-items:start — the <aside> must stretch
   to the row height so the sticky block inside it has room to travel, and
   it naturally stops at the end of the article (never overlaps the footer). */
.post-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:2.75rem;}
.post-main{min-width:0;}
.sidebar__sticky{position:sticky;top:calc(var(--header-h) + 16px);}
.sidebar__widgets{margin-top:1.5rem;}
@media (max-width:1023px){
  .post-layout{grid-template-columns:1fr;gap:0;}
  .sidebar__sticky{position:static;}
}

/* ---- ad slots ---- */
.ad-slot{display:flex;flex-direction:column;align-items:center;gap:.35rem;margin:0 0 1.25rem;}
.ad-label{
  font-size:.65rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:var(--muted);opacity:.75;align-self:flex-start;
}
/* Reserve the exact height up-front → zero layout shift when the ad fills in. */
.ad-slot--sidebar{min-height:600px;width:300px;}
.ad-slot--sidebar .adsbygoogle{width:300px;height:600px;background:var(--soft);border-radius:10px;}
.ad-placeholder{
  width:300px;height:600px;display:flex;align-items:center;justify-content:center;text-align:center;
  background:var(--soft);border:1px dashed var(--line);border-radius:10px;
  color:var(--muted);font-size:.85rem;line-height:1.5;padding:1rem;
}
.ad-placeholder small{opacity:.8;}
/* Desktop-only: hidden here AND never initialised (see inc/ads.php). */
@media (max-width:1023px){ .ad-slot--sidebar{display:none;} }

/* ---- #2 below the nav (desktop only) ---- */
.ad-slot--belownav{
  max-width:var(--wrap);margin:1rem auto 0;padding:0 1.15rem;
  min-height:90px;align-items:stretch;
}
.ad-slot--belownav .adsbygoogle{width:100%;height:90px;background:var(--soft);border-radius:10px;}
@media (max-width:1023px){ .ad-slot--belownav{display:none;} }

/* ---- #1 / #4 in-content ---- */
/* Reserved height matches the served size at each breakpoint -> no CLS.
   Generous vertical margin keeps >=150px between consecutive units. */
.ad-slot--incontent{
  margin:2.25rem 0;padding:0;min-height:280px;align-items:stretch;
  max-width:var(--read);
}
.ad-slot--incontent .adsbygoogle{width:100%;height:280px;background:var(--soft);border-radius:10px;}
@media (max-width:767px){
  .ad-slot--incontent{min-height:250px;}
  .ad-slot--incontent .adsbygoogle{height:250px;}
}

/* ============================= single ============================= */
.entry-header{padding:1.5rem 0 .5rem;}
.entry-header h1{margin:0 0 .6rem;}
.entry-meta{font-size:.85rem;color:var(--muted);display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;}
.entry-meta .dot{opacity:.5;}
.featured{margin:1.5rem 0;border-radius:var(--radius);overflow:hidden;border:1px solid var(--line);}
.featured img{width:100%;display:block;}
.entry-content{font-size:1.05rem;}
.entry-content ul,.entry-content ol{padding-left:1.35rem;}
.entry-content li{margin-bottom:.4rem;}
.entry-content img{border-radius:10px;}
.entry-footer{margin-top:2.5rem;padding-top:1.5rem;border-top:1px solid var(--line);}
.tags a{
  display:inline-block;font-size:.8rem;font-weight:600;padding:.25rem .6rem;margin:0 .3rem .4rem 0;
  border:1px solid var(--line);border-radius:999px;color:var(--muted);
}
.tags a:hover{border-color:var(--accent);color:var(--accent);text-decoration:none;}
.post-nav{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:1.75rem;}
.post-nav a{
  display:block;padding:1rem;border:1px solid var(--line);border-radius:var(--radius);
  color:var(--fg);font-weight:600;font-size:.95rem;line-height:1.35;
}
.post-nav a:hover{border-color:var(--accent);text-decoration:none;}
.post-nav span{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:.3rem;font-weight:700;}
.post-nav .next{text-align:right;}
@media (max-width:640px){ .post-nav{grid-template-columns:1fr;} }

/* ============================= pagination ============================= */
.pagination{display:flex;flex-wrap:wrap;gap:.4rem;justify-content:center;margin:2.5rem 0 0;}
.pagination .page-numbers{
  display:inline-block;padding:.5rem .85rem;border:1px solid var(--line);border-radius:10px;
  color:var(--fg);font-weight:600;font-size:.9rem;
}
.pagination .page-numbers:hover{border-color:var(--accent);color:var(--accent);text-decoration:none;}
.pagination .current{background:var(--accent);border-color:var(--accent);color:var(--accent-fg);}

/* ============================= search ============================= */
.searchform{display:flex;gap:.5rem;max-width:460px;}
.searchform input[type=search]{
  flex:1;padding:.65rem .8rem;border:1px solid var(--line);border-radius:10px;
  background:var(--soft);color:var(--fg);font-size:1rem;font-family:inherit;
}
.searchform button{
  padding:.65rem 1.1rem;border:0;border-radius:10px;background:var(--accent);
  color:var(--accent-fg);font-weight:700;cursor:pointer;font-size:.95rem;font-family:inherit;
}

/* ============================= footer ============================= */
.site-footer{border-top:1px solid var(--line);background:var(--soft);padding:2.5rem 0 2rem;margin-top:2rem;}
.footer-grid{display:flex;flex-wrap:wrap;gap:1.5rem;align-items:flex-start;justify-content:space-between;}
.footer-about{max-width:34ch;}
.footer-about .brand{margin-bottom:.5rem;}
.footer-about p{color:var(--muted);font-size:.9rem;margin:0;}
.footer-nav ul{display:flex;flex-wrap:wrap;gap:.35rem 1.1rem;list-style:none;margin:0;padding:0;}
.footer-nav a{color:var(--muted);font-size:.9rem;font-weight:600;}
.footer-nav a:hover{color:var(--accent);}
.footer-bottom{
  margin-top:2rem;padding-top:1.25rem;border-top:1px solid var(--line);
  color:var(--muted);font-size:.83rem;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:space-between;
}
.widget{margin-bottom:1.5rem;}
.widget ul{list-style:none;margin:0;padding:0;}
.widget li{margin-bottom:.35rem;font-size:.92rem;}

/* ============================= misc ============================= */
.notice{background:var(--soft);border:1px solid var(--line);border-radius:var(--radius);padding:1.5rem;text-align:center;color:var(--muted);}
.aligncenter{margin-left:auto;margin-right:auto;display:block;}
.alignleft{float:left;margin:0 1.25rem 1rem 0;}
.alignright{float:right;margin:0 0 1rem 1.25rem;}
.wp-caption-text,figcaption{font-size:.83rem;color:var(--muted);text-align:center;margin-top:.4rem;}
