/*
Theme Name: Magarinos Blog
Theme URI: https://magarinosbookkeeping.com/
Author: Marcus
Description: Custom bilingual blog theme for Magarinos Bookkeeping, LLC. Matches the static HTML landing page design system (Montserrat + Nunito Sans, teal/gold/orange palette). Polylang ready.
Version: 1.1.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: magarinos
Tags: blog, two-columns, translation-ready, custom-logo, custom-menu, featured-images
*/

/* ============================================================
   1. DESIGN TOKENS  (identical to index.html v12)
   ============================================================ */
:root{
  --teal-ink:#0A3444;
  --teal-deep:#0E4254;
  --teal-brand:#1C8FAD;
  --aqua-tint:#EDF4F6;
  --aqua-line:#D3E3E8;
  --gold:#E8C25A;
  --gold-deep:#C79A2E;
  --cta:#F08A2E;
  --cta-deep:#D96F14;
  --green:#2E9E7E;
  --green-deep:#1F7D62;
  --white:#FFF;
  --text:#22434E;
  --muted:#5C7883;
  --shadow-lg:0 24px 60px -12px rgba(10,52,68,.25);
  --shadow-md:0 12px 32px -8px rgba(10,52,68,.16);
  --shadow-sm:0 6px 18px -8px rgba(10,52,68,.14);
  --wrap:1120px;
  --radius:14px;
}

/* ============================================================
   2. BASE
   ============================================================ */
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{font-family:'Nunito Sans',system-ui,-apple-system,sans-serif;color:var(--text);background:var(--white);line-height:1.65;font-size:1.0625rem;overflow-x:hidden;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{font-family:'Montserrat',Arial,sans-serif;color:var(--teal-ink);line-height:1.22;font-weight:700;letter-spacing:0}
h1{font-size:clamp(1.9rem,4.2vw,2.9rem);font-weight:800;text-wrap:balance}
h2{font-size:clamp(1.45rem,2.8vw,2rem);font-weight:800;text-wrap:balance}
h3{font-size:1.25rem;font-weight:800}
h4{font-size:1.05rem}
p{margin-bottom:1rem}
a{color:var(--teal-brand);text-decoration-thickness:1px;text-underline-offset:3px}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible{outline:3px solid var(--cta);outline-offset:3px;border-radius:4px}
img{max-width:100%;height:auto;display:block}
.wrap{max-width:var(--wrap);margin:0 auto;padding:0 1.35rem}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}
.skip-link{position:absolute;left:-9999px;top:0;z-index:200;background:var(--cta);color:#fff;padding:.8rem 1.2rem;font-weight:800;font-family:'Montserrat',sans-serif}
.skip-link:focus{left:0}
[hidden]{display:none!important}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}

/* ============================================================
   3. BUTTONS  (three-color CTA system, Von Restorff)
   ============================================================ */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.55rem;background:linear-gradient(180deg,var(--cta),var(--cta-deep));color:#fff;font-weight:800;font-family:'Montserrat',sans-serif;padding:.95rem 1.7rem;border-radius:10px;text-decoration:none;border:none;font-size:1rem;box-shadow:0 8px 22px -6px rgba(240,138,46,.55);transition:transform .18s,box-shadow .18s;cursor:pointer;text-align:center;line-height:1.25}
.btn:hover{transform:translateY(-2px);box-shadow:0 14px 30px -6px rgba(240,138,46,.6);color:#fff}
.btn-green{background:linear-gradient(180deg,var(--green),var(--green-deep));box-shadow:0 8px 22px -6px rgba(46,158,126,.5)}
.btn-green:hover{box-shadow:0 14px 30px -6px rgba(46,158,126,.55)}
.btn-ghost{background:none;color:var(--teal-deep);border:2px solid var(--aqua-line);box-shadow:none}
.btn-ghost:hover{background:var(--aqua-tint);color:var(--teal-deep);box-shadow:none}
.btn-sm{padding:.6rem 1.15rem;font-size:.88rem}
.btn-block{display:flex;width:100%}

/* ============================================================
   4. HEADER
   ============================================================ */
.site-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.93);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--aqua-line);transition:box-shadow .25s}
.site-header.scrolled{box-shadow:0 8px 24px -12px rgba(10,52,68,.18)}
.nav{display:flex;align-items:center;justify-content:space-between;padding:.7rem 0;gap:.9rem}
.logo{display:flex;align-items:center;text-decoration:none;flex-shrink:0}
.logo img{height:52px;width:auto}
.logo-text{font-family:'Montserrat',sans-serif;font-weight:800;font-size:1.1rem;color:var(--teal-deep);text-decoration:none}
.logo-text span{color:var(--gold-deep)}
.nav-links{display:flex;gap:1.25rem;align-items:center;list-style:none;margin:0}
.nav-links a{text-decoration:none;color:var(--teal-ink);font-weight:700;font-size:.92rem;position:relative;font-family:'Nunito Sans',sans-serif}
.nav-links a::after{content:"";position:absolute;left:0;right:100%;bottom:-5px;height:2px;background:var(--gold-deep);transition:right .22s}
.nav-links a:hover::after,.nav-links .current-menu-item>a::after{right:0}
.nav-right{display:flex;align-items:center;gap:.7rem;flex-shrink:0}
.lang-btn{display:inline-flex;align-items:center;gap:.4rem;background:linear-gradient(135deg,#FBF3D9,#F6E8BC);border:1.5px solid var(--gold-deep);color:#6d5716;font-family:'Montserrat',sans-serif;font-weight:800;font-size:.85rem;padding:.5rem 1rem;border-radius:999px;text-decoration:none;transition:transform .18s,box-shadow .18s;white-space:nowrap}
.lang-btn:hover{transform:translateY(-2px);box-shadow:0 8px 18px -6px rgba(199,154,46,.5);color:#6d5716}
.nav-toggle{display:none;flex-direction:column;gap:5px;background:none;border:none;cursor:pointer;padding:.5rem}
.nav-toggle span{display:block;width:24px;height:2.5px;background:var(--teal-ink);border-radius:2px;transition:transform .25s,opacity .2s}
.nav-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(7.5px) rotate(45deg)}
.nav-toggle[aria-expanded="true"] span:nth-child(2){opacity:0}
.nav-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-7.5px) rotate(-45deg)}

/* ============================================================
   5. PAGE HEADER  (blog index / archive intro)
   ============================================================ */
.page-head{background:linear-gradient(160deg,var(--aqua-tint),#fff 70%);border-bottom:1px solid var(--aqua-line);padding:3.2rem 0 2.6rem}
.page-head .eyebrow{display:inline-flex;align-items:center;gap:.55rem;font-size:.78rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--teal-brand);margin-bottom:.9rem;font-family:'Montserrat',sans-serif}
.page-head .eyebrow::before{content:"";width:26px;height:3px;background:linear-gradient(90deg,var(--gold-deep),var(--gold));border-radius:2px}
.page-head p.lede{font-size:1.12rem;color:var(--muted);max-width:44rem;margin-top:.9rem}
.crumbs{font-size:.85rem;color:var(--muted);margin-bottom:1rem}
.crumbs a{color:var(--teal-brand);text-decoration:none}
.crumbs a:hover{text-decoration:underline}
.crumbs span[aria-current]{color:var(--muted)}

/* ============================================================
   6. CARD GRID  (the boxed post list)
   ============================================================ */
.layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:3rem;padding:3.2rem 0 4.4rem;align-items:start}
.layout.full{grid-template-columns:minmax(0,1fr)}
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:1.9rem}
.card{background:#fff;border:1px solid var(--aqua-line);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;box-shadow:var(--shadow-sm);transition:transform .2s,box-shadow .2s,border-color .2s}
.card:hover{transform:translateY(-4px);box-shadow:var(--shadow-md);border-color:#BBD6DE}
.card-media{position:relative;aspect-ratio:16/10;overflow:hidden;background:linear-gradient(135deg,var(--teal-deep),var(--teal-brand))}
.card-media img{width:100%;height:100%;object-fit:cover;transition:transform .5s cubic-bezier(.2,.7,.3,1)}
.card:hover .card-media img{transform:scale(1.05)}
.card-media .mark{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:'Montserrat',sans-serif;font-weight:800;font-size:2.4rem;color:rgba(255,255,255,.28);letter-spacing:.06em}
.card-cat{position:absolute;top:.85rem;left:.85rem;background:rgba(255,255,255,.95);color:var(--teal-deep);font-family:'Montserrat',sans-serif;font-weight:800;font-size:.68rem;letter-spacing:.08em;text-transform:uppercase;padding:.35rem .7rem;border-radius:999px;text-decoration:none;box-shadow:var(--shadow-sm)}
.card-cat:hover{background:var(--gold);color:var(--teal-ink)}
.card-body{padding:1.35rem 1.4rem 1.5rem;display:flex;flex-direction:column;flex:1}
.card-body h2,.card-body h3{font-size:1.16rem;line-height:1.32;margin-bottom:.55rem;text-wrap:balance}
.card-body h2 a,.card-body h3 a{color:var(--teal-ink);text-decoration:none}
.card-body h2 a:hover,.card-body h3 a:hover{color:var(--teal-brand)}
.card-excerpt{font-size:.95rem;color:var(--muted);margin-bottom:1.1rem;flex:1}
.card-meta{display:flex;align-items:center;gap:.7rem;font-size:.8rem;color:var(--muted);border-top:1px solid var(--aqua-line);padding-top:.85rem}
.card-meta .dot{width:3px;height:3px;border-radius:50%;background:var(--gold-deep);flex-shrink:0}
.card-more{margin-top:.9rem;font-family:'Montserrat',sans-serif;font-weight:800;font-size:.88rem;color:var(--cta-deep);text-decoration:none}
.card-more:hover{color:var(--cta)}

/* featured first post */
.card-featured{grid-column:1/-1;flex-direction:row;align-items:stretch}
.card-featured .card-media{flex:0 0 46%;aspect-ratio:auto}
.card-featured .card-body{justify-content:center;padding:2rem 2.2rem}
.card-featured .card-body h2{font-size:1.6rem}
.card-featured .card-excerpt{font-size:1.02rem}
@media(max-width:760px){.card-featured{flex-direction:column}.card-featured .card-media{flex:none;aspect-ratio:16/10}.card-featured .card-body{padding:1.35rem 1.4rem 1.5rem}.card-featured .card-body h2{font-size:1.25rem}}

/* empty state */
.empty{border:2px dashed var(--aqua-line);border-radius:var(--radius);padding:3rem 2rem;text-align:center;background:var(--aqua-tint)}
.empty h2{margin-bottom:.6rem}

/* ============================================================
   7. PAGINATION
   ============================================================ */
.pagination{margin-top:3rem;display:flex;justify-content:center}
.nav-links{flex-wrap:wrap}
.pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:44px;padding:0 .8rem;border:1px solid var(--aqua-line);border-radius:10px;margin:0 .25rem;font-family:'Montserrat',sans-serif;font-weight:700;font-size:.92rem;color:var(--teal-deep);text-decoration:none;background:#fff}
.pagination .page-numbers:hover{background:var(--aqua-tint);border-color:var(--teal-brand)}
.pagination .page-numbers.current{background:var(--teal-deep);border-color:var(--teal-deep);color:#fff}
.pagination .page-numbers::after{display:none}

/* ============================================================
   8. SINGLE POST
   ============================================================ */
.post-hero{padding:2.6rem 0 0}
.post-hero .cat-line{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem}
.tag{background:var(--aqua-tint);border:1px solid var(--aqua-line);color:var(--teal-deep);font-family:'Montserrat',sans-serif;font-weight:800;font-size:.7rem;letter-spacing:.07em;text-transform:uppercase;padding:.32rem .7rem;border-radius:999px;text-decoration:none}
.tag:hover{background:var(--gold);border-color:var(--gold-deep);color:var(--teal-ink)}
.post-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.55rem;font-size:.9rem;color:var(--muted);margin-top:1.1rem}
.post-meta img{width:34px;height:34px;border-radius:50%;object-fit:cover;border:2px solid var(--gold)}
.post-meta strong{color:var(--teal-deep)}
.post-figure{margin:2rem 0;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-md)}
.post-figure figcaption{font-size:.85rem;color:var(--muted);padding:.7rem 1rem;background:var(--aqua-tint)}

/* article typography: 66ch measure */
.entry{max-width:66ch;font-size:1.09rem;line-height:1.78}
.layout.full .entry{margin:0 auto}
.entry > *{margin-bottom:1.35rem}
.entry h2{font-size:1.6rem;margin:2.6rem 0 .9rem;padding-top:.2rem}
.entry h3{font-size:1.24rem;margin:2rem 0 .7rem}
.entry h4{font-size:1.05rem;margin:1.6rem 0 .5rem}
.entry ul,.entry ol{padding-left:1.4rem}
.entry li{margin-bottom:.55rem}
.entry li::marker{color:var(--gold-deep);font-weight:700}
.entry a{color:var(--teal-brand);font-weight:600}
.entry strong{color:var(--teal-ink);font-weight:700}
.entry blockquote{border-left:4px solid var(--gold);background:var(--aqua-tint);padding:1.2rem 1.4rem;border-radius:0 10px 10px 0;font-size:1.08rem;color:var(--teal-deep)}
.entry blockquote p:last-child{margin-bottom:0}
.entry img,.entry figure{border-radius:12px;overflow:hidden}
.entry figcaption{font-size:.85rem;color:var(--muted);margin-top:.5rem;text-align:center}
.entry hr{border:none;height:1px;background:var(--aqua-line);margin:2.6rem 0}
.entry table{width:100%;border-collapse:collapse;font-size:.96rem}
.entry th{background:var(--teal-deep);color:#fff;font-family:'Montserrat',sans-serif;font-weight:700;text-align:left;padding:.75rem .9rem}
.entry td{border-bottom:1px solid var(--aqua-line);padding:.7rem .9rem}
.entry tr:nth-child(even) td{background:var(--aqua-tint)}
.entry code{background:var(--aqua-tint);border:1px solid var(--aqua-line);border-radius:5px;padding:.1rem .4rem;font-size:.92em}
.entry pre{background:var(--teal-ink);color:#DCEBF0;padding:1.2rem;border-radius:10px;overflow-x:auto;font-size:.9rem}
.entry pre code{background:none;border:none;color:inherit}
.entry .wp-caption{max-width:100%}

/* table of contents */
.toc{background:var(--aqua-tint);border:1px solid var(--aqua-line);border-radius:var(--radius);padding:1.2rem 1.4rem;margin-bottom:2rem}
.toc h2{font-size:.95rem!important;margin:0 0 .7rem!important;text-transform:uppercase;letter-spacing:.08em;color:var(--teal-brand)}
.toc ol{margin:0;padding-left:1.2rem}
.toc li{margin-bottom:.4rem;font-size:.95rem}
.toc a{color:var(--teal-deep);text-decoration:none;font-weight:600}
.toc a:hover{color:var(--cta-deep);text-decoration:underline}

/* author box */
.author-box{display:flex;gap:1.4rem;align-items:flex-start;background:linear-gradient(160deg,var(--aqua-tint),#fff);border:1px solid var(--aqua-line);border-radius:var(--radius);padding:1.8rem;margin:3rem 0 0;max-width:66ch}
.layout.full .author-box{margin-left:auto;margin-right:auto}
.author-box img{width:96px;height:96px;border-radius:50%;object-fit:cover;border:3px solid var(--gold);flex-shrink:0}
.author-box h3{font-size:1.1rem;margin-bottom:.15rem}
.author-box .role{font-size:.85rem;color:var(--gold-deep);font-family:'Montserrat',sans-serif;font-weight:800;margin-bottom:.6rem}
.author-box p{font-size:.96rem;color:var(--muted);margin-bottom:.8rem}
@media(max-width:600px){.author-box{flex-direction:column;text-align:center;align-items:center}}

/* post navigation */
.post-nav{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:2.5rem;max-width:66ch}
.layout.full .post-nav{margin-left:auto;margin-right:auto}
.post-nav a{border:1px solid var(--aqua-line);border-radius:12px;padding:1rem 1.2rem;text-decoration:none;display:block;background:#fff;transition:border-color .2s,transform .2s}
.post-nav a:hover{border-color:var(--teal-brand);transform:translateY(-2px)}
.post-nav .lbl{font-family:'Montserrat',sans-serif;font-size:.72rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--gold-deep);display:block;margin-bottom:.35rem}
.post-nav .ttl{color:var(--teal-ink);font-weight:700;font-size:.98rem;line-height:1.35}
.post-nav .next{text-align:right}
@media(max-width:600px){.post-nav{grid-template-columns:1fr}.post-nav .next{text-align:left}}

/* related */
.related{background:var(--aqua-tint);border-top:1px solid var(--aqua-line);padding:3.4rem 0}
.related h2{margin-bottom:1.6rem}

/* ============================================================
   9. SIDEBAR
   ============================================================ */
.sidebar{position:sticky;top:88px;display:flex;flex-direction:column;gap:1.4rem}
.widget{background:#fff;border:1px solid var(--aqua-line);border-radius:var(--radius);padding:1.4rem}
.widget h3,.widget .widget-title{font-size:.95rem;text-transform:uppercase;letter-spacing:.08em;color:var(--teal-brand);margin-bottom:.9rem;font-family:'Montserrat',sans-serif;font-weight:800}
.widget ul{list-style:none}
.widget li{border-bottom:1px solid var(--aqua-line);padding:.55rem 0;font-size:.95rem}
.widget li:last-child{border-bottom:none}
.widget a{color:var(--teal-deep);text-decoration:none;font-weight:600}
.widget a:hover{color:var(--cta-deep)}
.widget-cta{background:linear-gradient(150deg,var(--teal-deep),var(--teal-brand));border:none;color:#EAF4F6;text-align:center;box-shadow:var(--shadow-md)}
.widget-cta h3{color:#fff;text-transform:none;letter-spacing:0;font-size:1.18rem;line-height:1.3}
.widget-cta p{font-size:.94rem;margin-bottom:1.1rem;color:#D6EAEF}
.widget-cta img{width:84px;height:84px;border-radius:50%;object-fit:cover;border:3px solid var(--gold);margin:0 auto .9rem}
.widget-quiz{background:linear-gradient(150deg,#F2FBF7,#E4F5EE);border-color:#BFE5D7;text-align:center}
.widget-quiz h3{color:var(--green-deep);text-transform:none;letter-spacing:0;font-size:1.1rem}
.widget-quiz p{font-size:.92rem;color:#3F6B5D;margin-bottom:1rem}
.searchform{display:flex;gap:.5rem}
.searchform input[type=search]{flex:1;min-width:0;border:1px solid var(--aqua-line);border-radius:9px;padding:.65rem .8rem;font-family:inherit;font-size:.95rem;color:var(--text)}
.searchform button{background:var(--teal-deep);color:#fff;border:none;border-radius:9px;padding:0 .95rem;cursor:pointer;font-weight:800;font-family:'Montserrat',sans-serif}
.searchform button:hover{background:var(--teal-brand)}

/* ============================================================
   10. FOOTER
   ============================================================ */
.site-footer{background:var(--teal-ink);color:#B8D4DC;padding:3rem 0 2.2rem;font-size:.92rem}
.foot-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:2.4rem}
.site-footer h3{color:var(--white);font-size:1rem;margin-bottom:.8rem;font-family:'Montserrat',sans-serif;font-weight:800}
.site-footer a{color:#CFE4E9;text-decoration:none}
.site-footer a:hover{color:var(--gold);text-decoration:underline}
.site-footer ul{list-style:none}
.site-footer li{margin-bottom:.5rem}
.site-footer img.flogo{height:70px;width:auto;margin-bottom:.9rem}
.foot-legal{margin-top:2.4rem;padding-top:1.2rem;border-top:1px solid rgba(255,255,255,.12);text-align:center;font-size:.85rem}
@media(max-width:800px){.foot-grid{grid-template-columns:1fr;gap:1.8rem}}

/* whatsapp float */
.wa{position:fixed;right:1.2rem;bottom:1.2rem;z-index:60;background:#25D366;color:#fff;width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(0,0,0,.25);text-decoration:none}
.wa svg{width:30px;height:30px;fill:#fff}

/* ============================================================
   11. RESPONSIVE
   ============================================================ */
@media(max-width:980px){
  .layout{grid-template-columns:minmax(0,1fr);gap:2.4rem}
  .sidebar{position:static;flex-direction:row;flex-wrap:wrap}
  .sidebar .widget{flex:1 1 280px}
}
@media(max-width:800px){
  .nav-toggle{display:flex}
  .nav-links{position:absolute;top:100%;left:0;right:0;background:#fff;flex-direction:column;align-items:stretch;gap:0;padding:.5rem 1.35rem 1.2rem;border-bottom:1px solid var(--aqua-line);box-shadow:var(--shadow-md);display:none}
  .nav-links.open{display:flex}
  .nav-links li{border-bottom:1px solid var(--aqua-line)}
  .nav-links li:last-child{border-bottom:none}
  .nav-links a{display:block;padding:.85rem 0;font-size:1rem}
  .nav-links a::after{display:none}
  .nav-right .btn{display:none}
  .page-head{padding:2.4rem 0 2rem}
  .layout{padding:2.4rem 0 3.2rem}
  .sidebar{flex-direction:column}
}
@media(max-width:420px){
  .logo img{height:42px}
  .lang-btn{padding:.45rem .75rem;font-size:.78rem}
}

/* WordPress core alignment classes */
.alignleft{float:left;margin:.4rem 1.4rem 1rem 0}
.alignright{float:right;margin:.4rem 0 1rem 1.4rem}
.aligncenter{margin-left:auto;margin-right:auto}
.alignwide,.alignfull{max-width:none;width:auto}
.sticky .card{border-color:var(--gold-deep)}
