/*
Theme Name: Coffee Machine Lab
Theme URI: https://coffeemachinelab.com
Author: Coffee Machine Lab
Description: Bold, high-contrast theme for Coffee Machine Lab, an independent coffee-equipment testing and Amazon affiliate site. Includes a Product custom post type and an affiliate product shortcode.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: cml
*/

:root{
  --cml-black:#141210;
  --cml-black-soft:#1f1a17;
  --cml-orange:#f4741e;
  --cml-orange-dark:#d9600f;
  --cml-cream:#f4efe6;
  --cml-text:#141210;
  --cml-muted:#6b6560;
  --cml-border:#e8e2d8;
}

*{box-sizing:border-box}

body{
  font-family:"Helvetica Neue",Arial,sans-serif;
  color:var(--cml-text);
  background:var(--cml-cream);
  margin:0;
  line-height:1.6;
}

h1,h2,h3{font-weight:800;letter-spacing:-0.01em;margin:0}
a{color:inherit;text-decoration:none}

.cml-container{max-width:1200px;margin:0 auto;padding:0 28px}

/* Utility bars */
.cml-topbar{background:var(--cml-black);color:#d8cfc4;font-size:.72em;letter-spacing:.06em;text-transform:uppercase;padding:10px 0}
.cml-topbar .cml-container{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px}
.cml-topbar strong{color:#fff}

/* Header */
.cml-site-header{background:var(--cml-cream);padding:18px 0;border-bottom:1px solid var(--cml-border)}
.cml-site-header .cml-container{display:flex;align-items:center;justify-content:space-between;gap:20px}
.cml-logo{display:flex;align-items:center;gap:10px;font-weight:800;font-size:1.05em}
.cml-logo .cml-logo-mark{background:var(--cml-orange);color:#fff;width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:.8em}
.cml-nav ul{list-style:none;display:flex;gap:24px;margin:0;padding:0}
.cml-nav a{font-weight:600;font-size:.95em;border-bottom:2px solid transparent;padding-bottom:4px}
.cml-nav a:hover,.cml-nav .current-menu-item a{border-color:var(--cml-orange)}
.cml-btn{display:inline-block;background:var(--cml-orange);color:#fff !important;padding:11px 20px;border-radius:8px;font-weight:700;font-size:.92em}
.cml-btn:hover{background:var(--cml-orange-dark)}

/* Mobile menu toggle (checkbox hack, no JS needed) */
.cml-menu-toggle-checkbox{display:none}
.cml-menu-toggle-btn{display:none;flex-direction:column;justify-content:center;gap:5px;width:34px;height:34px;cursor:pointer}
.cml-menu-toggle-btn span{display:block;width:100%;height:2px;background:var(--cml-black)}
.cml-nav-mobile-cta{display:none}

/* Hero */
.cml-hero{background:var(--cml-black);color:#fff;padding:80px 0 60px}
.cml-hero .cml-eyebrow{color:var(--cml-orange);font-size:.78em;letter-spacing:.1em;text-transform:uppercase;font-weight:700;margin-bottom:14px}
.cml-hero h1{font-size:3.2em;line-height:1.02;margin-bottom:18px}
.cml-hero h1 .cml-accent{color:var(--cml-orange)}
.cml-hero p{color:#c9c1b7;font-size:1.1em;max-width:520px;margin-bottom:26px}
.cml-hero-ctas{display:flex;gap:14px;flex-wrap:wrap}
.cml-btn-outline{border:1px solid #fff;color:#fff !important;padding:10px 20px;border-radius:8px;font-weight:700;font-size:.92em}

/* Trust bar */
.cml-trustbar{background:var(--cml-orange);color:#fff;padding:16px 0;font-weight:700;font-size:.85em}
.cml-trustbar .cml-container{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px}

/* Section headers */
.cml-section{padding:64px 0}
.cml-section-head{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:30px;flex-wrap:wrap}
.cml-section-head .cml-eyebrow{color:var(--cml-orange);font-size:.78em;letter-spacing:.1em;text-transform:uppercase;font-weight:700;margin-bottom:8px;display:block}
.cml-section-head h2{font-size:2.1em}
.cml-section-head p{color:var(--cml-muted);max-width:340px;margin:0}
.cml-section-dark{background:var(--cml-black-soft);color:#fff}
.cml-section-dark .cml-muted-text{color:#a89f95}

/* Product cards */
.cml-product-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:22px}
.cml-product-card{background:#fff;border-radius:14px;overflow:hidden;border:1px solid var(--cml-border)}
.cml-product-card .cml-thumb{position:relative;aspect-ratio:4/3;background:#ddd;overflow:hidden}
.cml-product-card .cml-thumb img{width:100%;height:100%;object-fit:cover}
.cml-product-card .cml-badge{position:absolute;top:12px;left:12px;background:var(--cml-orange);color:#fff;font-size:.7em;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:5px 10px;border-radius:5px}
.cml-product-card .cml-body{padding:18px}
.cml-product-card .cml-kicker{font-size:.72em;text-transform:uppercase;letter-spacing:.06em;color:var(--cml-muted);font-weight:700}
.cml-product-card .cml-stars{float:right;color:var(--cml-orange);font-size:.85em}
.cml-product-card h3{font-size:1.15em;margin:6px 0 6px}
.cml-product-card .cml-desc{color:var(--cml-muted);font-size:.92em;margin-bottom:14px}
.cml-product-card .cml-price-row{display:flex;justify-content:space-between;align-items:center}
.cml-product-card .cml-price{font-weight:700}

/* Dark variant cards (Top Picks This Month) */
.cml-dark-card{position:relative;border-radius:14px;overflow:hidden;min-height:280px;display:flex;flex-direction:column;justify-content:flex-end;padding:22px;color:#fff}
.cml-dark-card::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(20,18,16,.1),rgba(20,18,16,.92));z-index:0}
.cml-dark-card img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1}
.cml-dark-card .cml-rank{color:var(--cml-orange);font-size:.78em;font-weight:700;text-transform:uppercase;position:relative;z-index:1}
.cml-dark-card h3{position:relative;z-index:1;margin:8px 0}
.cml-dark-card p{position:relative;z-index:1;color:#d8cfc4;font-size:.9em;margin-bottom:10px}
.cml-dark-card a{position:relative;z-index:1;color:var(--cml-orange);font-weight:700;font-size:.9em}

/* Category bento grid */
.cml-cat-grid{display:grid;grid-template-columns:2fr 1fr 1fr;grid-template-rows:auto auto;gap:18px}
.cml-cat-grid .cml-cat-tile:first-child{grid-row:span 2}
.cml-cat-tile{position:relative;border-radius:14px;overflow:hidden;min-height:180px;color:#fff;display:flex;flex-direction:column;justify-content:flex-end;padding:20px}
.cml-cat-tile::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(20,18,16,.15),rgba(20,18,16,.85));z-index:0}
.cml-cat-tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1}
.cml-cat-tile .cml-tile-num{position:relative;z-index:1;color:var(--cml-orange);font-size:.72em;text-transform:uppercase;font-weight:700;letter-spacing:.05em}
.cml-cat-tile h3{position:relative;z-index:1;font-size:1.25em;margin-top:6px}
.cml-cat-tile .cml-arrow{position:relative;z-index:1;align-self:flex-end;width:34px;height:34px;border:1px solid #fff;border-radius:50%;display:flex;align-items:center;justify-content:center;margin-top:12px}
@media (max-width:800px){.cml-cat-grid{grid-template-columns:1fr}.cml-cat-grid .cml-cat-tile:first-child{grid-row:auto}}

/* Blog cards */
.cml-blog-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:26px}
.cml-blog-card img{border-radius:12px;aspect-ratio:16/10;object-fit:cover;margin-bottom:14px}
.cml-blog-card .cml-kicker{color:var(--cml-orange);font-size:.75em;text-transform:uppercase;font-weight:700;letter-spacing:.05em}
.cml-blog-card h3{font-size:1.25em;margin:8px 0}
.cml-blog-card p{color:var(--cml-muted);font-size:.92em}
.cml-blog-card .cml-readmore{color:var(--cml-orange);font-weight:700;font-size:.9em}

/* Email CTA band */
.cml-cta-band{background:var(--cml-orange);color:#fff;padding:56px 0}
.cml-cta-band .cml-container{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:24px}
.cml-cta-band h2{font-size:2em;max-width:440px}
.cml-cta-form{display:flex;gap:10px;flex-wrap:wrap}
.cml-cta-form input{padding:12px 16px;border-radius:8px;border:none;min-width:220px}
.cml-cta-form button{background:var(--cml-black);color:#fff;border:none;padding:12px 22px;border-radius:8px;font-weight:700;cursor:pointer}

/* Filter tabs (Best Sellers) */
.cml-filter-tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:28px}
.cml-filter-tabs button{background:#fff;border:1px solid var(--cml-border);padding:9px 16px;border-radius:8px;font-weight:600;font-size:.88em;cursor:pointer}
.cml-filter-tabs button.active{background:var(--cml-orange);color:#fff;border-color:var(--cml-orange)}

/* Stat row (About page) */
.cml-stat-row{display:flex;gap:50px;margin-top:30px;flex-wrap:wrap}
.cml-stat-row .cml-stat-num{font-size:2.4em;font-weight:800;color:var(--cml-orange)}
.cml-stat-row .cml-stat-label{color:var(--cml-muted);font-size:.82em;text-transform:uppercase;letter-spacing:.04em}

/* Footer */
.cml-site-footer{background:var(--cml-black);color:#c9c1b7;padding:48px 0 24px}
.cml-footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:30px;margin-bottom:30px}
.cml-site-footer a{color:#c9c1b7}
.cml-site-footer a:hover{color:#fff}
.cml-footer-bottom{border-top:1px solid #33302c;padding-top:18px;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;font-size:.8em;color:#8a8177}

@media (max-width:860px){
  .cml-footer-grid{grid-template-columns:1fr;gap:24px}
  .cml-cat-grid{grid-template-columns:1fr}
  .cml-cat-grid .cml-cat-tile:first-child{grid-row:auto}
}

@media (max-width:780px){
  .cml-site-header .cml-container{position:relative;flex-wrap:wrap}
  .cml-header-cta-desktop{display:none}
  .cml-menu-toggle-btn{display:flex}

  .cml-nav{
    display:none;
    position:absolute;
    top:100%;
    left:0;
    right:0;
    background:var(--cml-cream);
    border-bottom:1px solid var(--cml-border);
    padding:16px 28px 24px;
    z-index:50;
  }
  .cml-nav ul{flex-direction:column;gap:0}
  .cml-nav ul li{border-bottom:1px solid var(--cml-border)}
  .cml-nav ul li a{display:block;padding:14px 0}
  .cml-nav-mobile-cta{display:inline-block;margin-top:16px}

  .cml-menu-toggle-checkbox:checked ~ .cml-nav{display:block}
}

@media (max-width:700px){
  .cml-container{padding:0 18px}
  .cml-hero{padding:56px 0 40px}
  .cml-hero h1{font-size:2.1em}
  .cml-hero p{font-size:1em}
  .cml-hero-ctas{flex-direction:column;align-items:stretch}
  .cml-hero-ctas a{text-align:center}

  .cml-topbar .cml-container{flex-direction:column;align-items:flex-start;gap:4px}
  .cml-trustbar .cml-container{flex-direction:column;align-items:flex-start;gap:8px}

  .cml-section{padding:44px 0}
  .cml-section-head{flex-direction:column;align-items:flex-start}
  .cml-section-head h2{font-size:1.6em}
  .cml-section-head p{max-width:none}

  .cml-product-grid,.cml-blog-grid{grid-template-columns:1fr}

  .cml-cta-band .cml-container{flex-direction:column;align-items:flex-start}
  .cml-cta-form{width:100%}
  .cml-cta-form input{flex:1;min-width:0}

  .cml-filter-tabs{overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;padding-bottom:6px}
  .cml-filter-tabs button{flex:0 0 auto}

  .cml-stat-row{gap:28px}
}
