/*
Theme Name: Woodworking DIY
Theme URI: https://woodworkingdiy.com/
Author: Woodworking DIY
Author URI: https://woodworkingdiy.com/
Description: A warm, craftsman-styled theme for Woodworking DIY. Elegant oak-and-walnut palette, sawtooth section dividers, and a subtle wood-grain texture. Built for a woodworking plans & content site.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
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: woodworking-diy
Tags: custom-menu, featured-images, custom-logo, threaded-comments, translation-ready, blog, one-column, two-columns
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  /* Wood palette */
  --walnut:      #2A1C11;  /* deep dark brown - header/footer, headings */
  --walnut-2:    #3A2818;  /* slightly lighter walnut */
  --oak:         #9B6A3C;  /* medium warm oak - links, accents */
  --oak-deep:    #7E5228;  /* hover oak */
  --tan:         #CBA073;  /* light oak highlight */
  --parchment:   #F7F1E6;  /* page background */
  --parchment-2: #F0E7D6;  /* alt band background */
  --card:        #FFFDF9;  /* card / surface */
  --barn:        #A83A2C;  /* barn-red CTA */
  --barn-deep:   #8C2E22;  /* CTA hover */
  --brass:       #BC8A3D;  /* fine rules / metallic accents */

  /* Ink */
  --ink:      #2E2419;
  --muted:    #6E5D49;
  --line:     #E4D8C2;
  --line-2:   #D8C7A9;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Metrics */
  --wrap: 1160px;
  --wrap-narrow: 760px;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(42, 28, 17, 0.08);
  --shadow-md: 0 10px 30px rgba(42, 28, 17, 0.12);
  --shadow-lg: 0 24px 60px rgba(42, 28, 17, 0.18);

  /* Subtle vertical wood-grain, used sparingly as a texture layer */
  --grain: repeating-linear-gradient(
      90deg,
      rgba(123, 82, 40, 0.00) 0px,
      rgba(123, 82, 40, 0.035) 1px,
      rgba(123, 82, 40, 0.00) 3px,
      rgba(123, 82, 40, 0.00) 9px
  );
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--parchment);
  background-image: var(--grain);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--oak-deep); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--barn); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--walnut);
  line-height: 1.15;
  margin: 0 0 .55em;
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 640; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1.15em; }

blockquote {
  margin: 1.8em 0;
  padding: 0.4em 0 0.4em 1.4em;
  border-left: 4px solid var(--brass);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--walnut-2);
}

code, pre { font-family: var(--font-mono); font-size: .92em; }
pre { background: var(--walnut); color: #F3E7D3; padding: 1.1em 1.3em; border-radius: var(--radius); overflow-x: auto; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

::selection { background: var(--tan); color: var(--walnut); }

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding: 76px 0; }
.section--tight { padding: 52px 0; }
.band-parchment-2 { background: var(--parchment-2); }
.band-walnut { background: var(--walnut); color: #EBDFCB; }
.band-walnut h1, .band-walnut h2, .band-walnut h3 { color: #FBF3E4; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--oak);
  margin: 0 0 .9em;
  display: inline-block;
}
.band-walnut .eyebrow { color: var(--tan); }

.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head p { color: var(--muted); font-size: 1.12rem; margin-top: .2em; }
.band-walnut .section-head p { color: #C9B79C; }

/* ==========================================================================
   4. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1;
  padding: 16px 30px;
  border-radius: var(--radius);
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
  text-align: center;
}
.btn--primary {
  background: var(--barn);
  color: #FFF6EF;
  box-shadow: 0 6px 0 var(--barn-deep), var(--shadow-sm);
}
.btn--primary:hover { background: var(--barn-deep); color: #fff; transform: translateY(2px); box-shadow: 0 4px 0 #6f241a, var(--shadow-sm); }
.btn--wood {
  background: linear-gradient(180deg, var(--oak) 0%, var(--oak-deep) 100%);
  color: #FFF7EC;
  box-shadow: 0 6px 0 #5c3c1c, var(--shadow-sm);
}
.btn--wood:hover { color: #fff; transform: translateY(2px); box-shadow: 0 4px 0 #4a3016, var(--shadow-sm); }
.btn--ghost {
  background: transparent;
  color: var(--walnut);
  border: 2px solid var(--line-2);
  padding: 14px 28px;
}
.btn--ghost:hover { border-color: var(--oak); color: var(--oak-deep); }
.btn--lg { font-size: 1.15rem; padding: 19px 40px; }

/* ==========================================================================
   5. Sawtooth divider (signature element - echoes the saw blade in the logo)
   ========================================================================== */
.sawtooth {
  display: block;
  width: 100%;
  height: 16px;
  line-height: 0;
  background-image: linear-gradient(135deg, var(--brass) 25%, transparent 25%),
                    linear-gradient(225deg, var(--brass) 25%, transparent 25%);
  background-size: 22px 16px;
  background-position: 0 0;
  opacity: .55;
}
.sawtooth--dark {
  background-image: linear-gradient(135deg, var(--walnut) 25%, transparent 25%),
                    linear-gradient(225deg, var(--walnut) 25%, transparent 25%);
  opacity: 1;
}

/* ==========================================================================
   6. Top promo bar
   ========================================================================== */
.promo-bar {
  background: var(--barn);
  color: #FFF3EC;
  text-align: center;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .01em;
  padding: 10px 18px;
}
.promo-bar a { color: #FFF; text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   7. Header / navigation
   ========================================================================== */
.site-header {
  background: var(--parchment);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(1.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  max-width: var(--wrap);
  margin: 0 auto;
}
.site-brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.site-brand img { width: 56px; height: 56px; border-radius: 50%; box-shadow: var(--shadow-sm); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text .name {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 1.35rem;
  color: var(--walnut);
}
.brand-text .tag {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--oak);
}

.main-nav { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; flex-wrap: nowrap; }
.main-nav a {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  color: var(--walnut);
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--barn); background: var(--parchment-2); }

/* Header search toggle + dropdown panel */
.search-toggle {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--line-2);
  border-radius: 10px;
  background: transparent;
  color: var(--walnut);
  cursor: pointer;
  transition: .18s;
}
.search-toggle:hover,
.search-toggle[aria-expanded="true"] { color: var(--barn); border-color: var(--oak); background: var(--parchment-2); }
.header-search { border-top: 1px solid var(--line); background: var(--parchment); }
.header-search[hidden] { display: none; }
.header-search-inner { max-width: var(--wrap); margin: 0 auto; padding: 16px 24px; }
.header-search .search-form { max-width: 620px; margin: 0 auto; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--walnut); margin: 4px 0; transition: .2s; }

/* ==========================================================================
   8. Hero
   ========================================================================== */
.hero { position: relative; padding: 70px 0 40px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 420px at 50% -8%, rgba(203,160,115,0.28), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; max-width: 900px; margin: 0 auto; }
.hero h1 { margin-bottom: .35em; }
.hero h1 .accent { color: var(--barn); }
.hero .lede { font-size: 1.28rem; color: var(--muted); max-width: 680px; margin: 0 auto 1.6em; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.hero-note { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); margin-top: 14px; letter-spacing: .04em; }

.hero-media {
  position: relative;
  max-width: 860px;
  margin: 46px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 6px solid var(--card);
}
.hero-media img { width: 100%; display: block; }
.hero-media .play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 84px; height: 60px; border-radius: 14px; background: var(--barn);
  display: grid; place-items: center; box-shadow: var(--shadow-md);
}
.hero-media .play::after { content: ""; border-left: 22px solid #fff; border-top: 13px solid transparent; border-bottom: 13px solid transparent; margin-left: 5px; }

/* ==========================================================================
   9. Feature / category cards
   ========================================================================== */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.card .card-num {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--oak);
  display: block;
  margin-bottom: 12px;
}
.card h3 { margin-bottom: .35em; }
.card p { color: var(--muted); margin: 0; font-size: 1rem; }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checklist li { position: relative; padding-left: 38px; font-weight: 600; color: var(--ink); }
.checklist li::before {
  content: "✔";
  position: absolute; left: 0; top: -1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--oak); color: #fff;
  display: grid; place-items: center; font-size: .8rem;
}

/* Stat row */
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 30px; text-align: center; min-width: 190px;
  box-shadow: var(--shadow-sm);
}
.stat .num { font-family: var(--font-display); font-size: 2.4rem; color: var(--barn); font-weight: 640; line-height: 1; }
.stat .label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* ==========================================================================
   10. CTA band
   ========================================================================== */
.cta-band { text-align: center; position: relative; }
.cta-band .wrap { position: relative; z-index: 2; }
.cta-band h2 { color: #FBF3E4; }
.cta-band p { color: #D6C4A9; font-size: 1.16rem; max-width: 620px; margin: 0 auto 1.8em; }

/* ==========================================================================
   11. Content (single / page)
   ========================================================================== */
.page-hero { padding: 58px 0 30px; text-align: center; }
.page-hero .eyebrow { margin-bottom: 1em; }
.page-hero h1 { max-width: 820px; margin: 0 auto .3em; }
.page-hero .meta { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); letter-spacing: .05em; }

.article { padding: 20px 0 70px; }
.entry-content { font-size: 1.11rem; }
.entry-content > * { max-width: var(--wrap-narrow); margin-left: auto; margin-right: auto; }
.entry-content h2 { margin-top: 1.7em; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content img,
.entry-content .wp-block-image { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .5em; }
.entry-content .alignwide { max-width: 1000px; }
.entry-content .alignfull { max-width: 100%; }
.featured-image { margin: 0 0 40px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }

/* Info / tip box (matches your affiliate-disclosure box conventions) */
.tip-box {
  background: var(--parchment-2);
  border: 1px solid var(--line-2);
  border-left: 5px solid var(--brass);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 1.6em auto;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: var(--wrap-narrow);
}
.tip-box .tip-icon { font-size: 1.4rem; line-height: 1; }
.tip-box p { margin: 0; font-size: .98rem; color: var(--walnut-2); }
.gold-box { border-left-color: var(--brass); }

/* ==========================================================================
   12. Blog listing
   ========================================================================== */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card .thumb { aspect-ratio: 40 / 21; overflow: hidden; background: var(--parchment-2); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card .cat { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--oak); margin-bottom: 8px; }
.post-card h3 { font-size: 1.28rem; margin-bottom: .4em; }
.post-card h3 a { color: var(--walnut); }
.post-card h3 a:hover { color: var(--barn); }
.post-card .excerpt { color: var(--muted); font-size: .98rem; margin: 0 0 16px; }
.post-card .read-more { margin-top: auto; font-weight: 800; color: var(--oak-deep); font-size: .95rem; }
.post-card .read-more:hover { color: var(--barn); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 52px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px; font-weight: 700; color: var(--walnut); background: var(--card);
}
.pagination .page-numbers.current { background: var(--oak); color: #fff; border-color: var(--oak); }
.pagination .page-numbers:hover { border-color: var(--oak); color: var(--barn); }

/* ==========================================================================
   13. Sidebar & widgets
   ========================================================================== */
.content-with-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 28px; box-shadow: var(--shadow-sm); }
.widget-title { font-size: 1.15rem; margin-bottom: .8em; padding-bottom: .5em; border-bottom: 2px solid var(--brass); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--walnut); font-weight: 600; }
.widget a:hover { color: var(--barn); }

/* ==========================================================================
   14. Footer
   ========================================================================== */
.site-footer { background: var(--walnut); color: #C9B79C; padding: 60px 0 28px; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; margin-bottom: 42px; }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.footer-brand img { width: 54px; height: 54px; border-radius: 50%; }
.footer-brand .name { font-family: var(--font-display); font-size: 1.35rem; color: #FBF3E4; font-weight: 640; }
.site-footer p { color: #B7A488; font-size: .98rem; max-width: 42ch; }
.footer-col h4 { color: #F0E2CB; font-size: 1.05rem; font-family: var(--font-body); font-weight: 800; letter-spacing: .02em; margin-bottom: 1em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #C9B79C; font-weight: 600; }
.footer-col a:hover { color: var(--tan); }
.footer-bottom {
  border-top: 1px solid rgba(203,160,115,.22);
  padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: .86rem; color: #9E8B70;
}
.footer-bottom a { color: #B7A488; }
.footer-bottom .disclaimer { font-family: var(--font-mono); font-size: .74rem; max-width: 60ch; line-height: 1.5; }

/* ==========================================================================
   15. Comments & forms
   ========================================================================== */
input[type=text], input[type=email], input[type=url], input[type=search], input[type=password], textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--oak); outline-offset: 1px; border-color: var(--oak); }
.comment-list { list-style: none; padding: 0; }
.comment-body { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }

.search-form { display: flex; gap: 8px; }
.search-form .btn { padding: 12px 20px; }

/* ==========================================================================
   16. Accessibility
   ========================================================================== */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 200; background: var(--walnut); color: #fff; padding: 10px 16px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--oak); outline-offset: 2px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   17. Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .content-with-sidebar { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--parchment); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none; padding: 12px 0;
    flex: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; padding: 0 16px; flex-wrap: wrap; }
  .main-nav a { padding: 12px 14px; font-size: 1rem; }
  .nav-toggle { display: block; }
}
@media (max-width: 782px) {
  .section { padding: 56px 0; }
  .hero { padding: 46px 0 24px; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .brand-text .tag { display: none; }
  .btn--lg { width: 100%; justify-content: center; }
}
