/*
Theme Name: RoofToYard
Theme URI: https://rooftoyard.com/
Author: RoofToYard
Description: Custom lightweight theme for RoofToYard - home exterior cost guides and calculators. Fast, no jQuery, self-hosted fonts, built for AdSense and Rank Math.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rooftoyard
*/

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face{font-family:"Barlow Condensed";font-style:normal;font-weight:600;font-display:swap;src:url(assets/fonts/barlow-condensed-latin-600-normal.woff2) format("woff2")}
@font-face{font-family:"Barlow Condensed";font-style:normal;font-weight:700;font-display:swap;src:url(assets/fonts/barlow-condensed-latin-700-normal.woff2) format("woff2")}
@font-face{font-family:"Source Serif 4";font-style:normal;font-weight:400;font-display:swap;src:url(assets/fonts/source-serif-4-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"Source Serif 4";font-style:italic;font-weight:400;font-display:swap;src:url(assets/fonts/source-serif-4-latin-400-italic.woff2) format("woff2")}
@font-face{font-family:"Source Serif 4";font-style:normal;font-weight:600;font-display:swap;src:url(assets/fonts/source-serif-4-latin-600-normal.woff2) format("woff2")}

/* ---------- Tokens ---------- */
:root{
  --ink:#1C2B36;        /* slate roof */
  --ink-2:#34444F;
  --steel:#5B6B77;      /* galvanized */
  --line:#C8D1D7;
  --panel:#EDF1F3;
  --paper:#FFFFFF;
  --tape:#F4B400;       /* tape-measure yellow */
  --tape-soft:#FFF4CC;
  --lawn:#2F6B47;
  --lawn-tint:#E5EFE7;
  --brick:#9C3A2C;
  --display:"Barlow Condensed","Arial Narrow",Arial,sans-serif;
  --text:"Source Serif 4",Georgia,"Times New Roman",serif;
  --wrap:1180px;
  --measure:720px;
  --gap:clamp(1rem,2.5vw,1.75rem);
}

/* ---------- Base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--text);font-size:1.125rem;line-height:1.65;font-optical-sizing:auto;-webkit-font-smoothing:antialiased}
img,svg,video{max-width:100%;height:auto}
img{display:block}
a{color:var(--ink);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.18em;text-decoration-color:var(--steel)}
a:hover{text-decoration-color:var(--tape);text-decoration-thickness:.2em}
:focus-visible{outline:3px solid var(--tape);outline-offset:2px;box-shadow:0 0 0 6px var(--ink)}
h1,h2,h3,h4{font-family:var(--display);font-weight:700;line-height:1.05;color:var(--ink);margin:0 0 .5em;letter-spacing:.005em}
h1{font-size:clamp(2.4rem,4.6vw,3.6rem)}
h2{font-size:clamp(1.8rem,3vw,2.25rem)}
h3{font-size:1.45rem;line-height:1.15}
h4{font-size:1.2rem}
p{margin:0 0 1.1em}
.screen-reader-text,.sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}
.skip-link{position:absolute;left:1rem;top:-4rem;z-index:100;background:var(--tape);color:var(--ink);padding:.6rem 1rem;font-family:var(--display);font-weight:700;text-decoration:none}
.skip-link:focus{top:1rem}
.wrap{width:min(100% - 2*var(--gap),var(--wrap));margin-inline:auto}
.num,.tabular{font-variant-numeric:tabular-nums}

/* ---------- Header ---------- */
.site-header{position:relative;background:var(--paper);z-index:20}
.site-header::after{content:"";display:block;height:12px;background:
  repeating-linear-gradient(90deg,var(--ink) 0 1px,transparent 1px 40px) bottom/100% 12px no-repeat,
  repeating-linear-gradient(90deg,var(--steel) 0 1px,transparent 1px 8px) bottom/100% 6px no-repeat;
  border-bottom:2px solid var(--ink)}
.header-row{display:flex;align-items:center;gap:1.5rem;min-height:72px}
.brand{display:flex;align-items:center;gap:.55rem;text-decoration:none;color:var(--ink);flex-shrink:0}
.brand:hover{text-decoration:none}
.brand-mark{width:34px;height:34px;flex-shrink:0}
.brand-name{font-family:var(--display);font-weight:700;font-size:1.7rem;line-height:1;letter-spacing:.01em}
.brand .custom-logo{max-height:44px;width:auto}
.primary-nav{margin-left:auto}
.primary-nav ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.1rem 1.35rem}
.primary-nav a{font-family:var(--display);font-weight:600;font-size:1.25rem;text-decoration:none;padding:.35rem 0;display:inline-block;border-bottom:3px solid transparent}
.primary-nav a:hover,.primary-nav .current-menu-item>a,.primary-nav .current-cat>a,.primary-nav .current-menu-parent>a{border-bottom-color:var(--tape)}
.header-tools{display:flex;align-items:center;gap:.5rem}
.icon-btn{appearance:none;background:none;border:2px solid var(--ink);color:var(--ink);width:42px;height:42px;display:inline-grid;place-items:center;cursor:pointer;padding:0}
.icon-btn:hover{background:var(--tape)}
.icon-btn svg{width:20px;height:20px}
.menu-toggle{display:none}
.header-search{border-top:1px solid var(--line);background:var(--panel);padding:1rem 0}
.header-search[hidden]{display:none}

/* ---------- Search form ---------- */
.search-form{display:flex;max-width:640px;border:2px solid var(--ink);background:var(--paper)}
.search-form input[type=search]{flex:1;min-width:0;border:0;padding:.8rem 1rem;font:inherit;font-size:1.05rem;color:var(--ink);background:transparent}
.search-form input[type=search]:focus{outline:none}
.search-form:focus-within{box-shadow:0 0 0 3px var(--tape)}
.search-form button{border:0;background:var(--ink);color:var(--paper);font-family:var(--display);font-weight:700;font-size:1.1rem;padding:0 1.3rem;cursor:pointer}
.search-form button:hover{background:var(--ink-2)}

/* ---------- Buttons ---------- */
.btn{display:inline-block;font-family:var(--display);font-weight:700;font-size:1.1rem;padding:.65rem 1.2rem;border:2px solid var(--ink);background:var(--ink);color:var(--paper);text-decoration:none;cursor:pointer}
.btn:hover{background:var(--tape);color:var(--ink);text-decoration:none}
.btn--ghost{background:transparent;color:var(--ink)}
.text-link{font-family:var(--display);font-weight:600;font-size:1.1rem}

/* ---------- Hero ---------- */
.hero{padding:clamp(2rem,5vw,4rem) 0 clamp(1.5rem,4vw,3rem)}
.hero-grid{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(1.5rem,4vw,3.5rem);align-items:center}
.hero h1{font-size:clamp(2.6rem,5.4vw,4.7rem);line-height:.98;margin-bottom:.35em;max-width:12ch}
.hero-lede{font-size:1.2rem;color:var(--ink-2);max-width:34ch;margin-bottom:1.4rem}
.hero .search-form{max-width:none}
.parts{list-style:none;margin:1.4rem 0 0;padding:0;display:flex;flex-wrap:wrap;gap:.5rem}
.parts a{display:inline-flex;align-items:center;gap:.4rem;font-family:var(--display);font-weight:600;font-size:1.02rem;text-decoration:none;border:1.5px solid var(--line);padding:.3rem .7rem .3rem .5rem;background:var(--paper)}
.parts a:hover{border-color:var(--ink);background:var(--tape-soft)}
.parts svg{width:18px;height:18px}
.hero-figure{margin:0}
.hero-figure figcaption{font-family:var(--display);font-weight:600;color:var(--steel);font-size:1rem;margin-top:.4rem;text-align:right}

/* House drawing */
.house{width:100%;height:auto;overflow:visible}
.house .ln{fill:none;stroke:var(--ink);stroke-width:1.5}
.house .thin{fill:none;stroke:var(--ink);stroke-width:1;opacity:.55}
.house .part .shape{fill:var(--paper);stroke:var(--ink);stroke-width:2;transition:fill .15s ease}
.house .part .shape.alt{fill:var(--panel)}
.house .ground{fill:var(--lawn-tint)}
.house .ground-line{stroke:var(--lawn);stroke-width:2}
.house .part{cursor:pointer}
.house a{text-decoration:none}
.house .part .tag{font-family:var(--display);font-weight:600;font-size:19px;fill:var(--ink);text-decoration:none}
.house .part .lead{stroke:var(--ink);stroke-width:1;fill:none}
.house .part .dot{fill:var(--ink)}
.house .part:hover .shape,.house .part:focus .shape,.house .part:focus-visible .shape{fill:var(--tape)}
.house .part:hover .tag,.house .part:focus-visible .tag{text-decoration:underline;text-decoration-thickness:2px}
.house .part:focus{outline:none}
.house .part:focus-visible .hit{stroke:var(--ink);stroke-width:2;stroke-dasharray:4 3}
.house .hit{fill:transparent;stroke:none}
.house .door{fill:var(--panel);stroke:var(--ink);stroke-width:2}

/* ---------- Sections ---------- */
.section{padding-block:clamp(2.5rem,6vw,4.5rem)}
.section--panel{background:var(--panel)}
.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;margin-bottom:1.5rem;border-bottom:2px solid var(--ink);padding-bottom:.5rem}
.section-head h2{margin:0}
.section-intro{color:var(--ink-2);max-width:60ch;margin-top:-.6rem;margin-bottom:1.6rem}

/* Tools (calculators) */
.tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.5rem 2rem;list-style:none;margin:0;padding:0}
.tool a{display:grid;grid-template-columns:44px 1fr;gap:.2rem .9rem;text-decoration:none;padding:1rem 0 .4rem;border-top:3px solid var(--line)}
.tool a:hover{border-top-color:var(--tape)}
.tool svg{grid-row:span 2;width:44px;height:44px;color:var(--ink)}
.tool-name{font-family:var(--display);font-weight:700;font-size:1.4rem;line-height:1.1}
.tool-blurb{font-size:1rem;color:var(--steel);line-height:1.5}

/* Guides list */
.guides{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 3rem;list-style:none;margin:0;padding:0}
.guide{padding:1.1rem 0 1.2rem;border-bottom:1px solid var(--line);display:grid;grid-template-columns:1fr auto;gap:0 1.2rem}
.guide>*{grid-column:1}
.guide-thumb{grid-column:2!important;grid-row:1/span 4;width:128px;aspect-ratio:4/3;object-fit:cover;background:var(--panel)}
.guide-cat{font-family:var(--display);font-weight:600;font-size:1rem;color:var(--lawn);text-decoration:none}
.guide-cat:hover{text-decoration:underline}
.guide h3{font-size:1.45rem;margin:.1rem 0 .35rem}
.guide h3 a{text-decoration:none}
.guide h3 a:hover{text-decoration:underline;text-decoration-color:var(--tape);text-decoration-thickness:.15em}
.guide p{font-size:1rem;color:var(--ink-2);margin:0 0 .4rem}
.guide-meta{font-family:var(--display);font-weight:600;font-size:.98rem;color:var(--steel);display:flex;gap:1rem;flex-wrap:wrap}
.empty-note{background:var(--tape-soft);border-left:6px solid var(--tape);padding:1rem 1.2rem;max-width:60ch}

/* Method band */
.method{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2rem}
.method h3{font-size:1.35rem;margin-bottom:.35rem}
.method p{font-size:1.02rem;color:var(--ink-2);margin:0}

/* ---------- Archive ---------- */
.archive-head{padding:clamp(2rem,4vw,3rem) 0 1.2rem;border-bottom:2px solid var(--ink);margin-bottom:.5rem}
.archive-head .crumbs{margin-bottom:.8rem}
.archive-title{display:flex;align-items:center;gap:.8rem;margin:0 0 .4rem}
.archive-title svg{width:48px;height:48px;flex-shrink:0}
.archive-desc{max-width:64ch;color:var(--ink-2);font-size:1.12rem}
.archive-desc p:last-child{margin-bottom:0}
.archive-count{font-family:var(--display);font-weight:600;color:var(--steel)}
.archive-body{padding-block:1rem 4rem}

/* ---------- Breadcrumbs ---------- */
.crumbs{font-family:var(--display);font-weight:600;font-size:1rem;color:var(--steel)}
.crumbs ol{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.3rem}
.crumbs li:not(:last-child)::after{content:"/";margin-left:.4rem;color:var(--line)}
.crumbs a{color:var(--steel);text-decoration:none}
.crumbs a:hover{color:var(--ink);text-decoration:underline}
.crumbs p{margin:0}

/* ---------- Single post ---------- */
.post-shell{padding-block:clamp(1.5rem,4vw,3rem) 4rem}
.post-layout{display:grid;grid-template-columns:minmax(0,var(--measure)) 260px;gap:3.5rem;justify-content:space-between}
.post-head{max-width:var(--measure);margin-bottom:1.6rem}
.post-head .crumbs{margin-bottom:1rem}
.post-head h1{margin-bottom:.45em}
.post-meta{font-family:var(--display);font-weight:600;font-size:1.05rem;color:var(--steel);display:flex;flex-wrap:wrap;gap:.3rem 1.3rem;align-items:center}
.post-meta a{color:var(--ink);text-decoration:none}
.post-meta a:hover{text-decoration:underline}
.post-meta .updated{color:var(--lawn)}
.post-hero{margin:0 0 2rem}
.post-hero img{width:100%;aspect-ratio:16/9;object-fit:cover}
.post-hero figcaption{font-size:.9rem;color:var(--steel);margin-top:.4rem}

/* Entry content */
.entry{max-width:var(--measure)}
.entry>*:first-child{margin-top:0}
.entry h2{font-size:2rem;margin:2.2em 0 .55em;scroll-margin-top:1.5rem}
.entry h3{font-size:1.5rem;margin:1.8em 0 .5em;scroll-margin-top:1.5rem}
.entry h4{margin:1.5em 0 .4em}
.entry ul,.entry ol{padding-left:1.3em;margin:0 0 1.2em}
.entry li{margin-bottom:.35em}
.entry li::marker{color:var(--steel)}
.entry blockquote{margin:1.6em 0;padding:.2em 0 .2em 1.2em;border-left:4px solid var(--ink);font-style:italic;color:var(--ink-2)}
.entry figure{margin:1.8em 0}
.entry figcaption,.entry .wp-element-caption{font-size:.92rem;color:var(--steel);margin-top:.45rem}
.entry hr{border:0;border-top:1px solid var(--line);margin:2.4em 0}
.entry .wp-block-table{margin:1.8em 0;overflow-x:auto}
.entry table{width:100%;border-collapse:collapse;font-size:1rem;font-variant-numeric:tabular-nums}
.entry th{font-family:var(--display);font-weight:700;font-size:1.05rem;text-align:left;background:var(--panel);border-bottom:2px solid var(--ink);padding:.6rem .75rem}
.entry td{padding:.6rem .75rem;border-bottom:1px solid var(--line);vertical-align:top}
.entry tbody tr:hover td{background:#F7F9FA}
.entry .rty-answer,.entry .quick-answer{background:var(--tape-soft);border-left:6px solid var(--tape);padding:1rem 1.25rem;margin:0 0 1.8em}
.entry .rty-answer>*:last-child,.entry .quick-answer>*:last-child{margin-bottom:0}
.entry .rty-note{background:var(--panel);padding:1rem 1.25rem;margin:1.6em 0;font-size:1rem}
.entry .wp-block-button__link{font-family:var(--display);font-weight:700;border-radius:0;background:var(--ink)}

/* TOC */
.toc-aside{position:relative}
.toc{position:sticky;top:1.5rem;border-top:3px solid var(--ink);padding-top:.8rem}
.toc-title{font-family:var(--display);font-weight:700;font-size:1.15rem;margin:0 0 .5rem}
.toc ol{list-style:none;margin:0;padding:0;counter-reset:toc}
.toc li{margin:0}
.toc a{display:block;font-family:var(--display);font-weight:600;font-size:1.02rem;line-height:1.25;text-decoration:none;color:var(--steel);padding:.35rem 0 .35rem .7rem;border-left:3px solid var(--line)}
.toc a:hover{color:var(--ink);border-left-color:var(--ink)}
.toc a.is-active{color:var(--ink);border-left-color:var(--tape)}
.toc-inline{display:none;border:2px solid var(--ink);margin:0 0 1.8rem;background:var(--paper)}
.toc-inline summary{font-family:var(--display);font-weight:700;font-size:1.15rem;padding:.7rem 1rem;cursor:pointer}
.toc-inline ol{margin:0;padding:0 1rem 1rem 2.2rem}
.toc-inline a{font-family:var(--display);font-weight:600;font-size:1.05rem;text-decoration:none}
.sidebar-widgets{margin-top:2rem}
.widget{margin-bottom:2rem}
.widget-title{font-family:var(--display);font-size:1.2rem}

/* Ad slots */
.ad-slot{margin:2rem 0;text-align:center;min-height:0}
.ad-slot:empty{display:none}

/* Author box */
.author-box{display:grid;grid-template-columns:72px 1fr;gap:1rem;border-top:2px solid var(--ink);margin-top:3rem;padding-top:1.4rem;max-width:var(--measure)}
.author-box img{width:72px;height:72px;border-radius:50%}
.author-box h2{font-size:1.35rem;margin:0 0 .3rem}
.author-box p{font-size:1rem;color:var(--ink-2);margin:0 0 .4rem}
.author-box .text-link{font-size:1rem}

/* Related */
.related{margin-top:3rem;max-width:var(--measure)}
.related h2{font-size:1.6rem;border-bottom:2px solid var(--ink);padding-bottom:.4rem}
.related ul{list-style:none;margin:0;padding:0}
.related li{border-bottom:1px solid var(--line)}
.related a{display:block;padding:.75rem 0;font-family:var(--display);font-weight:600;font-size:1.25rem;text-decoration:none}
.related a:hover{text-decoration:underline;text-decoration-color:var(--tape)}

/* ---------- Pages ---------- */
.page-shell{padding-block:clamp(1.5rem,4vw,3rem) 4rem}
.page-shell .post-head{margin-bottom:1.2rem}
.page-shell.is-tool .entry,.page-shell.is-tool .post-head{max-width:880px}
.page-shell .entry{margin-inline:0}

/* ---------- Pagination ---------- */
.pagination{margin-top:2.5rem}
.pagination .nav-links{display:flex;flex-wrap:wrap;gap:.4rem}
.pagination .page-numbers{font-family:var(--display);font-weight:700;font-size:1.1rem;min-width:44px;height:44px;display:inline-grid;place-items:center;padding:0 .7rem;border:2px solid var(--ink);text-decoration:none}
.pagination .page-numbers.current{background:var(--ink);color:var(--paper)}
.pagination a.page-numbers:hover{background:var(--tape)}

/* ---------- 404 / search ---------- */
.notfound{padding-block:4rem;max-width:720px}
.notfound .search-form{margin:1.5rem 0 2rem}

/* ---------- Footer ---------- */
.site-footer{background:var(--ink);color:#D3DCE2;margin-top:0;padding-top:3rem;font-size:1rem}
.site-footer a{color:var(--paper);text-decoration-color:rgba(255,255,255,.35)}
.site-footer a:hover{text-decoration-color:var(--tape)}
.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:2rem 3rem;padding-bottom:2.2rem}
.footer-brand .brand{color:var(--paper)}
.footer-brand .brand-mark{color:var(--tape)}
.footer-brand p{margin:.8rem 0 0;max-width:38ch;line-height:1.55}
.footer-col h2{font-size:1.25rem;color:var(--paper);margin-bottom:.7rem}
.footer-col ul{list-style:none;margin:0;padding:0}
.footer-col li{margin-bottom:.35rem}
.footer-col a{font-family:var(--display);font-weight:600;font-size:1.08rem;text-decoration:none}
.footer-col a:hover{text-decoration:underline}
.footer-base{border-top:1px solid rgba(255,255,255,.18);padding:1.2rem 0 1.6rem;font-size:.92rem;display:flex;flex-wrap:wrap;justify-content:space-between;gap:.6rem 2rem;color:#AFBDC7}
.footer-base p{margin:0;max-width:80ch}

/* ---------- Responsive ---------- */
@media (max-width:1100px){
  .post-layout{grid-template-columns:minmax(0,1fr)}
  .toc-aside{display:none}
  .toc-inline{display:block}
}
@media (max-width:1180px){
  .menu-toggle{display:inline-grid}
  .primary-nav{position:absolute;left:0;right:0;top:100%;background:var(--paper);border-bottom:2px solid var(--ink);display:none;margin:0}
  .primary-nav.is-open{display:block}
  .primary-nav ul{flex-direction:column;gap:0;padding:.5rem var(--gap) 1rem}
  .primary-nav a{display:block;padding:.6rem 0;border-bottom:1px solid var(--line);font-size:1.3rem}
  .header-tools{margin-left:auto}
}
@media (max-width:1024px){
  .hero-grid{grid-template-columns:1fr}
  .hero h1{max-width:16ch}
  .tools{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:760px){
  body{font-size:1.0625rem}
  .guides{grid-template-columns:1fr}
  .method{grid-template-columns:1fr;gap:1.4rem}
  .footer-grid{grid-template-columns:1fr 1fr}
  .footer-brand{grid-column:1/-1}
  .house .part .tag,.house .part .lead,.house .part .dot{display:none}
  .hero-figure figcaption{text-align:left}
  .guide-thumb{width:96px}
}
@media (max-width:520px){
  .tools{grid-template-columns:1fr}
  .brand-name{font-size:1.5rem}
  .footer-grid{grid-template-columns:1fr}
  .author-box{grid-template-columns:56px 1fr}
  .author-box img{width:56px;height:56px}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important;scroll-behavior:auto!important}
}
@media print{
  .site-header,.site-footer,.toc-aside,.toc-inline,.ad-slot,.related,.author-box,.skip-link,.sidebar-widgets{display:none!important}
  body{font-size:11pt}
  a{text-decoration:none}
}
