/*
Theme Name:  Measir
Theme URI:   https://yoursite.com
Author:      Measir
Description: A clean Amazon affiliate review theme with in-depth product reviews, star ratings, pros/cons, score breakdowns, and Amazon buy buttons.
Version:     1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License:     GNU General Public License v2
Text Domain: measir
*/

:root {
  --gold:#f0a500;--gold-dark:#c07d00;
  --text-primary:#1a1a1a;--text-secondary:#555;--text-muted:#888;
  --bg-page:#f5f5f0;--bg-white:#ffffff;--bg-surface:#fafaf8;
  --border:#e5e5e0;--border-light:#f0f0ea;
  --radius-sm:6px;--radius-md:10px;--radius-lg:14px;--radius-xl:20px;
  --shadow-sm:0 1px 4px rgba(0,0,0,.07);--shadow-md:0 4px 16px rgba(0,0,0,.10);
  --font-sans:'Inter','Segoe UI',system-ui,sans-serif;
  --max-width:1100px;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:var(--font-sans);font-size:16px;line-height:1.7;color:var(--text-primary);background:var(--bg-page);-webkit-font-smoothing:antialiased}
img{max-width:100%;height:auto;display:block}
a{color:var(--gold-dark);text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:var(--max-width);margin:0 auto;padding:0 1.5rem}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}

h1,h2,h3,h4,h5{font-weight:600;line-height:1.3;color:var(--text-primary)}
h1{font-size:clamp(1.6rem,3.5vw,2.2rem)}
h2{font-size:clamp(1.2rem,2.5vw,1.5rem)}
h3{font-size:1.15rem}
p{margin-bottom:1rem;color:var(--text-secondary)}
p:last-child{margin-bottom:0}

/* HEADER */
.site-header{background:var(--bg-white);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:100;box-shadow:var(--shadow-sm);direction:ltr}
.site-header .container{display:flex;align-items:center;justify-content:space-between;height:64px;gap:1.5rem;direction:ltr}
.site-branding{display:flex;align-items:center;gap:10px;flex-shrink:0}
.site-branding .logo-mark{width:36px;height:36px;background:var(--gold);border-radius:var(--radius-md);display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;flex-shrink:0}
.site-branding .site-title{font-size:1.15rem;font-weight:700;color:var(--text-primary)}
.site-branding .site-title span{color:var(--gold)}
.site-branding .site-description{display:none}
/* WordPress custom logo wrapper fix */
.site-branding .custom-logo-link{display:flex;align-items:center;line-height:1}
.site-branding .custom-logo-link img.custom-logo{display:block;height:50px;width:auto;max-width:200px}
.site-branding p.site-title{margin:0;padding:0;font-size:1.15rem;font-weight:700;line-height:1}
.site-branding p.site-title a{color:var(--text-primary);text-decoration:none}
.main-navigation{flex:1;display:flex;align-items:center;justify-content:center;height:64px}
.main-navigation ul{display:flex;align-items:center;list-style:none;gap:.25rem;margin:0;padding:0;direction:ltr;height:100%}
.main-navigation ul li a{display:block;padding:6px 12px;font-size:14px;font-weight:500;color:var(--text-secondary);border-radius:var(--radius-sm);transition:color .15s,background .15s}
.main-navigation ul li a:hover,.main-navigation ul li.current-menu-item>a{color:var(--text-primary);background:var(--bg-surface);text-decoration:none}
.header-search-form{flex-shrink:0}
.header-search-form form{display:flex;align-items:center;background:var(--bg-surface);border:1px solid var(--border);border-radius:25px;padding:5px 14px;gap:6px;direction:ltr}
.header-search-form input[type="search"]{background:none;border:none;outline:none;font-size:13px;color:var(--text-primary);width:150px;font-family:var(--font-sans)}
.header-search-form button{background:none;border:none;cursor:pointer;color:var(--text-muted);font-size:15px;padding:0}
.menu-toggle{display:none;background:none;border:1px solid var(--border);border-radius:var(--radius-sm);padding:6px 10px;cursor:pointer;font-size:18px;color:var(--text-primary)}

/* LAYOUT */
.site-content{padding:2rem 0 3rem}
.layout-with-sidebar{display:flex;gap:2rem;align-items:flex-start}
.content-area{flex:1;min-width:0}
.sidebar{width:280px;flex-shrink:0}

/* HERO */
.hero-band{background:var(--bg-white);border-bottom:1px solid var(--border);padding:3rem 0;margin-bottom:2.5rem}
.hero-band-inner{display:grid;grid-template-columns:1fr 340px;gap:2.5rem;align-items:center}
.hero-kicker{font-size:11px;font-weight:600;color:var(--gold);text-transform:uppercase;letter-spacing:1.5px;margin-bottom:8px}
.hero-band h1{margin-bottom:10px}
.hero-band .hero-desc{font-size:15px;color:var(--text-secondary);margin-bottom:1.5rem}
.hero-stats{display:flex;gap:2rem}
.hstat-n{font-size:1.5rem;font-weight:700;color:var(--gold);line-height:1}
.hstat-l{font-size:12px;color:var(--text-muted);margin-top:3px}
.hero-featured-card{background:var(--bg-surface);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;display:block;transition:border-color .15s,box-shadow .15s}
.hero-featured-card:hover{border-color:var(--gold);box-shadow:var(--shadow-md);text-decoration:none}
.hero-featured-card .card-thumb{height:160px;background:#1a1a2e;display:flex;align-items:center;justify-content:center;font-size:56px;overflow:hidden}
.hero-featured-card .card-thumb img{width:100%;height:100%;object-fit:cover}
.hero-featured-card .card-body{padding:1rem 1.1rem}
.hero-featured-card .card-kicker{font-size:11px;font-weight:600;color:var(--gold);text-transform:uppercase;letter-spacing:1px;margin-bottom:4px}
.hero-featured-card .card-title{font-size:14px;font-weight:600;color:var(--text-primary);line-height:1.4;margin-bottom:8px}
.hero-featured-card .card-footer{display:flex;align-items:center;justify-content:space-between}

/* SECTION LABEL */
.section-label{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:1.5px;margin-bottom:1rem;display:flex;align-items:center;gap:10px}
.section-label::after{content:'';flex:1;height:1px;background:var(--border)}

/* REVIEW CARDS */
.review-cards{display:flex;flex-direction:column;gap:1rem}
.review-card{background:var(--bg-white);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;display:grid;grid-template-columns:120px 1fr;text-decoration:none;color:var(--text-primary);transition:border-color .15s,box-shadow .15s}
.review-card:hover{border-color:var(--gold);box-shadow:var(--shadow-sm);text-decoration:none}
.review-card .card-thumb{background:#1a1a2e;display:flex;align-items:center;justify-content:center;font-size:38px;overflow:hidden}
.review-card .card-thumb img{width:100%;height:100%;object-fit:cover}
.review-card .card-body{padding:.9rem 1rem}
.review-card .card-cat{font-size:11px;font-weight:600;color:var(--gold);text-transform:uppercase;letter-spacing:1px;margin-bottom:3px}
.review-card .card-title{font-size:14px;font-weight:600;color:var(--text-primary);line-height:1.4;margin-bottom:5px}
.review-card .card-excerpt{font-size:13px;color:var(--text-secondary);line-height:1.6;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.review-card .card-footer{display:flex;align-items:center;justify-content:space-between}

/* RATINGS */
.star-rating{display:flex;align-items:center;gap:6px}
.stars{color:var(--gold);font-size:13px;letter-spacing:1px;line-height:1}
.rating-score{font-size:12px;color:var(--text-muted)}

/* VERDICT BADGES */
.verdict-badge{display:inline-block;font-size:11px;font-weight:600;padding:3px 9px;border-radius:var(--radius-sm)}
.verdict-badge.recommended{background:#EAF3DE;color:#27500A}
.verdict-badge.best-in-class{background:#FAEEDA;color:#633806}
.verdict-badge.good{background:#E6F1FB;color:#0C447C}
.verdict-badge.avoid{background:#FCEBEB;color:#A32D2D}

/* SCORE CIRCLE */
.overall-score-circle{width:60px;height:60px;border-radius:50%;border:3px solid var(--gold);display:flex;align-items:center;justify-content:center;flex-direction:column;flex-shrink:0}
.overall-score-circle .score-num{font-size:1.3rem;font-weight:700;color:var(--gold);line-height:1}
.overall-score-circle .score-denom{font-size:10px;color:var(--text-muted)}

/* SINGLE REVIEW */
.review-article{background:var(--bg-white);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}
.review-article .article-hero{height:280px;background:#1a1a2e;display:flex;align-items:center;justify-content:center;font-size:90px;overflow:hidden}
.review-article .article-hero img{width:100%;height:100%;object-fit:cover}
.review-article .article-body{padding:2rem}
.article-kicker{font-size:11px;font-weight:600;color:var(--gold);text-transform:uppercase;letter-spacing:1.5px;margin-bottom:6px}
.article-title{font-size:clamp(1.4rem,3vw,1.9rem);margin-bottom:10px}
.article-meta{display:flex;align-items:center;gap:1.2rem;flex-wrap:wrap;font-size:13px;color:var(--text-muted);margin-bottom:1.75rem;padding-bottom:1.75rem;border-bottom:1px solid var(--border-light)}
.article-meta .meta-item{display:flex;align-items:center;gap:5px}

/* SCORE BOX */
.score-box{border:1px solid var(--border);border-radius:var(--radius-lg);padding:1.25rem;margin-bottom:1.5rem}
.score-box-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}
.score-box-header h3{font-size:14px;margin:0}
.score-rows{display:flex;flex-direction:column;gap:10px}
.score-row{display:grid;grid-template-columns:130px 1fr 32px;align-items:center;gap:10px;font-size:13px}
.score-row .label{color:var(--text-secondary)}
.score-track{height:6px;background:var(--bg-surface);border-radius:3px;overflow:hidden;border:1px solid var(--border-light)}
.score-fill{height:100%;background:var(--gold);border-radius:3px}
.score-row .val{font-size:13px;font-weight:600;text-align:right}

/* PROS / CONS */
.pros-cons-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1.5rem}
.pros-cons-box{border:1px solid var(--border);border-radius:var(--radius-lg);padding:1rem}
.pros-cons-box .pc-title{font-size:13px;font-weight:600;margin-bottom:10px;display:flex;align-items:center;gap:6px}
.pros-cons-box.pros .pc-title{color:#27500A}
.pros-cons-box.cons .pc-title{color:#A32D2D}
.pros-cons-box ul{list-style:none;display:flex;flex-direction:column;gap:7px}
.pros-cons-box ul li{font-size:13px;color:var(--text-secondary);display:flex;gap:8px;align-items:flex-start;line-height:1.5}
.pros-cons-box ul li .icon{font-size:14px;flex-shrink:0;margin-top:1px}
.pros-cons-box.pros ul li .icon{color:#3B6D11}
.pros-cons-box.cons ul li .icon{color:#A32D2D}

/* ARTICLE CONTENT */
.review-content h2{font-size:1.15rem;font-weight:600;margin:2rem 0 .75rem;padding-top:2rem;border-top:1px solid var(--border-light)}
.review-content h2:first-child{border-top:none;padding-top:0;margin-top:0}
.review-content p{font-size:15px;color:var(--text-secondary);line-height:1.8;margin-bottom:1rem}
.review-content ul,.review-content ol{padding-left:1.5rem;margin-bottom:1rem}
.review-content li{font-size:15px;color:var(--text-secondary);line-height:1.7;margin-bottom:4px}

/* SPECS TABLE */
.specs-table{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:1.5rem;border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}
.specs-table thead th{background:var(--bg-surface);padding:10px 12px;text-align:left;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-muted);border-bottom:1px solid var(--border)}
.specs-table tbody tr{border-bottom:1px solid var(--border-light)}
.specs-table tbody tr:last-child{border-bottom:none}
.specs-table tbody tr:hover{background:var(--bg-surface)}
.specs-table tbody td{padding:10px 12px}
.specs-table tbody td:first-child{color:var(--text-secondary);width:160px}
.specs-table tbody td:last-child{font-weight:500}

/* SIDEBAR */
.sidebar-widget{background:var(--bg-white);border:1px solid var(--border);border-radius:var(--radius-lg);padding:1.25rem;margin-bottom:1rem}
.sidebar-widget .widget-title{font-size:13px;font-weight:600;margin-bottom:1rem;color:var(--text-primary)}
/* Gutenberg block widgets in sidebar */
.sidebar-widget .wp-block-latest-posts__list{list-style:none;margin:0;padding:0}
.sidebar-widget .wp-block-latest-posts__list li{padding:.4rem 0;border-bottom:1px solid var(--border)}
.sidebar-widget .wp-block-latest-posts__list li:last-child{border-bottom:none}
.sidebar-widget .wp-block-heading{font-size:13px;font-weight:600;margin:0 0 1rem;color:var(--text-primary)}
.sidebar-widget h2.wp-block-heading,
.sidebar-widget h3.wp-block-heading,
.sidebar-widget h1.wp-block-heading{font-size:13px;font-weight:600;margin:0 0 1rem;color:var(--text-primary)}
.buy-box .product-thumb{height:110px;background:#1a1a2e;border-radius:var(--radius-md);display:flex;align-items:center;justify-content:center;font-size:44px;margin-bottom:1rem;overflow:hidden}
.buy-box .product-thumb img{width:100%;height:100%;object-fit:cover}
.buy-box .product-name{font-size:13px;font-weight:500;line-height:1.4;margin-bottom:6px;color:var(--text-primary)}
.buy-box .price-label{font-size:11px;color:var(--text-muted);margin-bottom:3px}
.buy-box .price{font-size:1.5rem;font-weight:700;color:var(--gold);margin-bottom:4px}
.buy-box .prime-note{font-size:12px;color:var(--text-muted);margin-bottom:1rem;display:flex;align-items:center;gap:5px}
.buy-box .prime-note .check{color:var(--gold)}
.btn-amazon{width:100%;background:var(--gold);color:#000;font-family:var(--font-sans);font-size:14px;font-weight:600;border:none;border-radius:25px;padding:11px 16px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:background .15s,transform .1s;text-decoration:none}
.btn-amazon:hover{background:var(--gold-dark);text-decoration:none;color:#000;transform:translateY(-1px)}
.affiliate-disclosure{font-size:11px;color:var(--text-muted);text-align:center;margin-top:8px;line-height:1.6}
.cat-list{list-style:none;display:flex;flex-direction:column;gap:3px}
.cat-list li a{font-size:13px;color:var(--text-secondary);display:flex;justify-content:space-between;align-items:center;padding:6px 8px;border-radius:var(--radius-sm);transition:background .15s,color .15s}
.cat-list li a:hover{background:var(--bg-surface);color:var(--text-primary);text-decoration:none}
.cat-count{background:var(--bg-surface);font-size:11px;padding:2px 7px;border-radius:10px;color:var(--text-muted)}
.top-rated-list{list-style:none;display:flex;flex-direction:column;gap:8px}
.top-rated-item{display:flex;gap:10px;align-items:center;padding:5px;border-radius:var(--radius-sm);text-decoration:none;color:var(--text-primary);transition:background .15s}
.top-rated-item:hover{background:var(--bg-surface);text-decoration:none}
.top-num{width:22px;height:22px;border-radius:50%;background:var(--bg-surface);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;flex-shrink:0;color:var(--text-muted)}
.top-num.gold{background:#FAEEDA;color:#633806}
.top-rated-item .item-name{font-size:13px;font-weight:500;line-height:1.3}
.top-rated-item .item-score{font-size:12px;color:var(--gold)}
.related-list{display:flex;flex-direction:column;gap:8px}
.related-item{display:flex;gap:10px;align-items:center;padding:6px;border-radius:var(--radius-sm);border:1px solid transparent;text-decoration:none;color:var(--text-primary);transition:background .15s,border-color .15s}
.related-item:hover{background:var(--bg-surface);border-color:var(--border);text-decoration:none}
.related-thumb{width:42px;height:42px;background:var(--bg-surface);border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0;overflow:hidden}
.related-thumb img{width:100%;height:100%;object-fit:cover}
.related-item .item-name{font-size:13px;font-weight:500;line-height:1.3}
.related-item .item-score{font-size:12px;color:var(--gold)}

/* BREADCRUMB */
.breadcrumb{font-size:12px;color:var(--text-muted);margin-bottom:1rem;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.breadcrumb a{color:var(--text-muted)}
.breadcrumb a:hover{color:var(--gold);text-decoration:none}
.breadcrumb .sep{color:var(--border)}

/* PAGINATION */
.pagination{display:flex;gap:6px;justify-content:center;margin-top:2rem}
.pagination a,.pagination span{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--border);border-radius:var(--radius-md);font-size:14px;font-weight:500;color:var(--text-secondary);text-decoration:none;transition:all .15s}
.pagination a:hover{border-color:var(--gold);color:var(--gold);text-decoration:none}
.pagination .current{background:var(--gold);color:#000;border-color:var(--gold)}

/* FOOTER */
.site-footer{background:var(--bg-white);border-top:1px solid var(--border);padding:2.5rem 0}
.footer-inner{display:grid;grid-template-columns:1fr 1fr 1fr;gap:2rem;margin-bottom:2rem}
.footer-col .footer-heading{font-size:13px;font-weight:600;margin-bottom:1rem;color:var(--text-primary)}
.footer-col ul{list-style:none;display:flex;flex-direction:column;gap:6px}
.footer-col ul li a{font-size:13px;color:var(--text-muted);transition:color .15s}
.footer-col ul li a:hover{color:var(--gold);text-decoration:none}
.footer-col p{font-size:13px;color:var(--text-muted);line-height:1.7}
.footer-bottom{border-top:1px solid var(--border-light);padding-top:1.5rem;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem;font-size:12px;color:var(--text-muted)}
.footer-bottom a{color:var(--text-muted)}
.footer-bottom a:hover{color:var(--gold);text-decoration:none}
.footer-affiliate-note{background:var(--bg-surface);border:1px solid var(--border-light);border-radius:var(--radius-md);padding:.75rem 1rem;font-size:12px;color:var(--text-muted);line-height:1.7;margin-bottom:1.5rem}

/* RESPONSIVE */
@media(max-width:900px){
  .hero-band-inner{grid-template-columns:1fr}
  .hero-featured-card{display:none}
  .layout-with-sidebar{flex-direction:column}
  .sidebar{width:100%}
  .footer-inner{grid-template-columns:1fr 1fr}
}
@media(max-width:640px){
  .site-header .container{justify-content:space-between}
  .main-navigation{position:static;flex:0}
  .site-branding{flex:1}
  .header-search-form{display:none!important}
  .main-navigation ul{display:none;position:fixed;top:64px;left:0;right:0;background:var(--bg-white);border-bottom:2px solid var(--gold);box-shadow:var(--shadow-md);flex-direction:column;padding:.5rem 0;z-index:9999;gap:0}
  .main-navigation ul.open{display:flex}
  .main-navigation ul li a{white-space:nowrap;font-size:15px;padding:12px 24px;display:block;color:var(--text-primary);border-bottom:1px solid var(--border)}
  .main-navigation ul li:last-child a{border-bottom:none}
  .main-navigation ul li a:hover{color:var(--gold);background:var(--bg-surface)}
  .menu-toggle{display:flex;align-items:center;justify-content:center;background:none;border:1px solid var(--border);border-radius:6px;padding:6px 10px;font-size:18px;cursor:pointer;color:var(--text-primary)}
  .header-search-form{display:none}
  .review-card{grid-template-columns:90px 1fr}
  .pros-cons-grid{grid-template-columns:1fr}
  .score-row{grid-template-columns:100px 1fr 28px}
  .footer-inner{grid-template-columns:1fr}
  .article-title{font-size:1.15rem!important;line-height:1.4}
  .breadcrumb-current{display:inline-block;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
}

/* ===================== SLIDER ===================== */
.measir-slider-wrap{position:relative;width:100%;overflow:hidden;height:420px;background:#111}
.measir-slider{position:relative;width:100%;height:100%}
.measir-slide{position:absolute;inset:0;opacity:0;transition:opacity .7s ease;pointer-events:none}
.measir-slide.active{opacity:1;pointer-events:auto}
.slide-bg{position:absolute;inset:0;background-size:cover;background-position:center;transition:transform 8s ease}
.measir-slide.active .slide-bg{transform:scale(1.05)}
.slide-bg-fallback{background:linear-gradient(135deg,var(--navy) 0%,#1a2a4a 100%)}
.slide-overlay{position:absolute;inset:0;background:linear-gradient(to right,rgba(0,0,0,.75) 40%,rgba(0,0,0,.2) 100%)}
.slide-content{position:absolute;bottom:0;left:0;right:0;padding:2.5rem 3rem;max-width:600px}
.slide-cat{display:inline-block;background:var(--gold);color:#fff;font-size:11px;font-weight:700;padding:3px 10px;border-radius:20px;text-transform:uppercase;letter-spacing:.5px;margin-bottom:10px}
.slide-title{font-size:1.7rem;font-weight:700;line-height:1.3;margin-bottom:8px;color:#fff}
.slide-title a{color:#fff;text-decoration:none}
.slide-title a:hover{color:var(--gold)}
.slide-date{font-size:13px;color:rgba(255,255,255,.6);margin-bottom:16px}
.slide-btn{display:inline-block;background:var(--gold);color:#fff;padding:9px 22px;border-radius:6px;font-size:13px;font-weight:700;text-decoration:none;transition:opacity .2s}
.slide-btn:hover{opacity:.85}
.slider-arrow{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.15);border:none;color:#fff;font-size:28px;width:44px;height:44px;border-radius:50%;cursor:pointer;z-index:10;transition:background .2s;backdrop-filter:blur(4px)}
.slider-arrow:hover{background:rgba(255,255,255,.3)}
.slider-prev{left:16px}
.slider-next{right:16px}
.slider-dots{position:absolute;bottom:18px;right:2rem;display:flex;gap:7px;z-index:10}
.slider-dot{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.4);cursor:pointer;transition:background .3s,transform .3s}
.slider-dot.active{background:var(--gold);transform:scale(1.3)}
@media(max-width:768px){
  .measir-slider-wrap{height:280px}
  .slide-content{padding:1.5rem}
  .slide-title{font-size:1.1rem}
  .slider-arrow{width:34px;height:34px;font-size:20px}
}
