/*
Theme Name: Maple Leaf
Theme URI: https://mapleleafagency.co.za
Author: Maple Leaf Agency
Author URI: https://mapleleafagency.co.za
Description: A lightweight, block-aware brand theme for Maple Leaf Agency — a digital growth partner for South African business. Carries the brand palette and the Fraunces + Hanken Grotesk type pairing, with full-width support for Gutenberg and Elementor. Rooted in South Africa, built for growth.
Version: 1.0.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: maple-leaf
Tags: business, blog, custom-colors, custom-logo, custom-menu, featured-images, block-styles, wide-blocks, full-width-template
*/

/* ============================================================
   MAPLE LEAF — design tokens
   ============================================================ */
:root{
  --ml-forest:#134E36;
  --ml-forest-deep:#0C3826;
  --ml-maple:#C56A2D;
  --ml-maple-soft:#E08A45;
  --ml-maple-red:#A23A28;
  --ml-paper:#F6F0E4;
  --ml-paper-soft:#FBF7EE;
  --ml-sage:#DCE6D8;
  --ml-ink:#211C14;
  --ml-ink-soft:#6A6255;
  --ml-line:rgba(33,28,20,.12);
  --ml-content:720px;
  --ml-wide:1080px;
  --ml-radius:16px;
}

/* ============================================================
   Base
   ============================================================ */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:'Hanken Grotesk',system-ui,-apple-system,sans-serif;
  color:var(--ml-ink);
  background:var(--ml-paper);
  line-height:1.65;
  font-size:18px;
  -webkit-font-smoothing:antialiased;
}
/* subtle paper grain */
body::before{
  content:"";position:fixed;inset:0;z-index:9999;pointer-events:none;opacity:.035;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img{max-width:100%;height:auto}
a{color:var(--ml-forest);text-underline-offset:3px}
a:hover{color:var(--ml-maple)}

h1,h2,h3,h4,h5,h6{
  font-family:'Fraunces',Georgia,serif;
  color:var(--ml-forest);
  line-height:1.08;
  font-weight:500;
  letter-spacing:-.01em;
  margin:0 0 .5em;
}
h1{font-size:clamp(2.4rem,5vw,3.6rem)}
h2{font-size:clamp(1.9rem,3.6vw,2.7rem)}
h3{font-size:1.4rem;font-weight:600}
p{margin:0 0 1rem}

/* ============================================================
   Layout — full-bleed capable content (Gutenberg/Elementor)
   ============================================================ */
.ml-main{width:100%}
.entry-content > *{
  max-width:var(--ml-content);
  margin-left:auto;margin-right:auto;
  padding-left:22px;padding-right:22px;
}
.entry-content > .alignwide{max-width:var(--ml-wide)}
.entry-content > .alignfull{max-width:none;padding-left:0;padding-right:0}
/* full-width groups keep inner content readable */
.entry-content .alignfull > .wp-block-group__inner-container,
.entry-content .alignfull.is-layout-constrained > *{
  max-width:var(--ml-wide);margin-left:auto;margin-right:auto;
  padding-left:22px;padding-right:22px;
}

/* ============================================================
   Header
   ============================================================ */
.ml-header{
  position:sticky;top:0;z-index:50;
  background:rgba(246,240,228,.86);
  backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid var(--ml-line);
}
.ml-header__bar{
  max-width:var(--ml-wide);margin:0 auto;padding:14px 22px;
  display:flex;align-items:center;justify-content:space-between;gap:20px;
}
.ml-brand{display:flex;align-items:center;gap:12px;text-decoration:none}
.ml-brand svg{width:34px;height:37px;flex:none}
.ml-brand__name{font-family:'Fraunces',serif;font-weight:600;font-size:1.2rem;color:var(--ml-forest);line-height:1}
.ml-brand img{max-height:46px;width:auto}
.ml-nav{display:flex;align-items:center;gap:26px}
.ml-nav ul{list-style:none;margin:0;padding:0;display:flex;gap:24px}
.ml-nav a{
  text-decoration:none;color:var(--ml-ink);font-weight:600;font-size:.92rem;
}
.ml-nav a:hover{color:var(--ml-maple)}
.ml-header__cta{
  background:var(--ml-maple);color:#fff !important;font-weight:600;font-size:.86rem;
  padding:10px 18px;border-radius:40px;text-decoration:none;white-space:nowrap;
}
.ml-header__cta:hover{background:var(--ml-maple-red);color:#fff}
.ml-burger{display:none;background:none;border:0;cursor:pointer;padding:8px}
.ml-burger span{display:block;width:24px;height:2px;background:var(--ml-forest);margin:5px 0;transition:.3s}

@media(max-width:880px){
  .ml-nav{
    position:absolute;top:100%;left:0;right:0;background:var(--ml-paper);
    flex-direction:column;align-items:flex-start;gap:0;padding:10px 22px 22px;
    border-bottom:1px solid var(--ml-line);display:none;
  }
  .ml-nav.is-open{display:flex}
  .ml-nav ul{flex-direction:column;gap:0;width:100%}
  .ml-nav li{width:100%;border-bottom:1px solid var(--ml-line)}
  .ml-nav a{display:block;padding:14px 0}
  .ml-burger{display:block}
}

/* ============================================================
   Buttons (Gutenberg .wp-block-button + theme buttons)
   ============================================================ */
.wp-block-button__link,.ml-btn{
  background:var(--ml-maple);color:#fff;border:0;border-radius:40px;
  padding:14px 28px;font-family:'Hanken Grotesk',sans-serif;font-weight:600;
  font-size:1rem;text-decoration:none;display:inline-block;cursor:pointer;
  transition:transform .15s ease,background .2s ease;
}
.wp-block-button__link:hover,.ml-btn:hover{background:var(--ml-maple-red);color:#fff;transform:translateY(-1px)}
.is-style-outline .wp-block-button__link,.ml-btn--ghost{
  background:transparent;color:var(--ml-forest);box-shadow:inset 0 0 0 2px var(--ml-forest);
}
.is-style-outline .wp-block-button__link:hover,.ml-btn--ghost:hover{
  background:var(--ml-forest);color:var(--ml-paper)
}
/* buttons placed on dark bands */
.has-forest-background-color .wp-block-button__link,
.has-forest-deep-background-color .wp-block-button__link{background:var(--ml-maple)}
.has-forest-background-color .is-style-outline .wp-block-button__link{
  color:var(--ml-paper);box-shadow:inset 0 0 0 2px var(--ml-maple-soft)
}

/* ============================================================
   Section bands & helpers
   ============================================================ */
.has-forest-background-color,.has-forest-deep-background-color{color:var(--ml-paper)}
.has-forest-background-color h1,.has-forest-background-color h2,.has-forest-background-color h3,
.has-forest-deep-background-color h1,.has-forest-deep-background-color h2,.has-forest-deep-background-color h3{color:var(--ml-paper)}
.has-maple-background-color{color:#fff}
.has-maple-background-color h1,.has-maple-background-color h2,.has-maple-background-color h3{color:#fff}

.ml-eyebrow{
  font-family:'Hanken Grotesk',sans-serif !important;font-weight:600;font-size:.74rem !important;
  letter-spacing:.2em;text-transform:uppercase;color:var(--ml-maple) !important;
}
.has-forest-background-color .ml-eyebrow,.has-maple-background-color .ml-eyebrow{color:var(--ml-maple-soft) !important}

/* cards */
.ml-card{
  background:var(--ml-paper-soft);border:1px solid var(--ml-line);border-radius:var(--ml-radius);
  padding:30px;height:100%;
}
.has-forest-background-color .ml-card{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.16)}

/* ============================================================
   Posts / articles
   ============================================================ */
.ml-article-header{
  background:var(--ml-forest);color:var(--ml-paper);padding:72px 22px 60px;text-align:center;
}
.ml-article-header h1{color:var(--ml-paper);max-width:18ch;margin:0 auto .4em}
.ml-article-meta{font-size:.85rem;color:rgba(246,240,228,.7);letter-spacing:.04em}
.ml-article-body{max-width:var(--ml-content);margin:0 auto;padding:56px 22px}
.ml-article-body h2{margin-top:1.6em}
.ml-article-body h3{margin-top:1.4em}
.ml-article-body img{border-radius:var(--ml-radius)}
.ml-article-body blockquote{
  border-left:3px solid var(--ml-maple);margin:1.5em 0;padding:.4em 0 .4em 1.4em;
  font-family:'Fraunces',serif;font-style:italic;font-size:1.25rem;color:var(--ml-forest);
}
.ml-tag{
  display:inline-block;background:var(--ml-sage);color:var(--ml-forest-deep);
  font-size:.78rem;font-weight:600;padding:4px 12px;border-radius:30px;margin:2px;text-decoration:none;
}

/* archive grid */
.ml-archive{max-width:var(--ml-wide);margin:0 auto;padding:56px 22px;
  display:grid;grid-template-columns:repeat(3,1fr);gap:26px}
.ml-card-post{background:var(--ml-paper-soft);border:1px solid var(--ml-line);border-radius:var(--ml-radius);
  overflow:hidden;display:flex;flex-direction:column}
.ml-card-post .thumb{aspect-ratio:16/10;background:var(--ml-sage);overflow:hidden}
.ml-card-post .thumb img{width:100%;height:100%;object-fit:cover}
.ml-card-post .body{padding:22px;display:flex;flex-direction:column;gap:8px;flex:1}
.ml-card-post h3{font-size:1.15rem;margin:0}
.ml-card-post .excerpt{font-size:.92rem;color:var(--ml-ink-soft)}
.ml-card-post a.more{margin-top:auto;font-weight:600;color:var(--ml-maple);text-decoration:none}
@media(max-width:880px){.ml-archive{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.ml-archive{grid-template-columns:1fr}}

.ml-page-title{max-width:var(--ml-wide);margin:0 auto;padding:64px 22px 0}

/* ============================================================
   Footer
   ============================================================ */
.ml-footer{background:var(--ml-forest-deep);color:rgba(246,240,228,.72);padding:56px 22px 30px;margin-top:0}
.ml-footer__grid{max-width:var(--ml-wide);margin:0 auto;display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:34px}
.ml-footer__brand svg{width:42px;height:46px;margin-bottom:14px}
.ml-footer__brand .n{font-family:'Fraunces',serif;color:var(--ml-paper);font-size:1.3rem;font-weight:600}
.ml-footer__brand p{font-size:.9rem;margin-top:10px;max-width:34ch}
.ml-footer h4{font-family:'Hanken Grotesk',sans-serif;color:var(--ml-paper);font-size:.78rem;letter-spacing:.16em;text-transform:uppercase;margin:0 0 14px}
.ml-footer ul{list-style:none;margin:0;padding:0}
.ml-footer li{margin-bottom:9px}
.ml-footer a{color:rgba(246,240,228,.72);text-decoration:none;font-size:.92rem}
.ml-footer a:hover{color:var(--ml-maple-soft)}
.ml-footer__base{max-width:var(--ml-wide);margin:32px auto 0;padding-top:20px;border-top:1px solid rgba(255,255,255,.12);
  display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;font-size:.82rem}
@media(max-width:760px){.ml-footer__grid{grid-template-columns:1fr;gap:26px}}

/* ============================================================
   Utility / accessibility
   ============================================================ */
.screen-reader-text{position:absolute !important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}
.skip-link{position:absolute;left:-9999px}
.skip-link:focus{left:8px;top:8px;background:#fff;padding:10px 16px;z-index:100000;border-radius:8px}
