/*
Theme Name: Great Buy Guide Wirecutter Mobile Fix 2
Theme URI: https://example.com
Author: ChatGPT
Description: Wirecutter-inspired clean review + deals layout. Classic theme, Gutenberg-compatible.
Version: 1.0.5
License: GPLv2 or later
Text Domain: gbg-wirecutter
*/

:root{
  --bg:#ffffff;
  --text:#111111;
  --muted:#666666;
  --border:#e5e5e5;
  --max:1200px;
  --serif: ui-serif, Georgia, 'Times New Roman', Times, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
}


/* Mobile overflow hard-fix (iOS Safari) */
*,*::before,*::after{box-sizing:border-box}
html,body{width:100%;max-width:100%;overflow-x:hidden}
@supports (overflow: clip){
  html,body{overflow-x:clip}
}
img,video,iframe,embed,object,svg,table,pre,code{max-width:100%}
*{box-sizing:border-box}
/*
  Mobile fix notes:
  - Prevent full-page horizontal scroll (iOS Safari can be sensitive).
  - Force header layout to wrap so the search bar is always visible.
*/
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:var(--sans);width:100%;max-width:100%;overflow-x:hidden;}
body{overflow-x:hidden;}
a{color:inherit;text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto;display:block}
.container{max-width:var(--max);margin:0 auto;padding:0 18px}
.hr{height:1px;background:var(--border);margin:0}
.muted{color:var(--muted)}
.small{font-size:12px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid #111;padding:10px 14px;border-radius:10px;
  font-weight:700;background:#111;color:#fff;text-decoration:none;
  white-space:nowrap;
}
.btn:hover{opacity:.9;text-decoration:none}
.btn-outline{background:#fff;color:#111}
.btn-outline:hover{background:#f7f7f7}
.badge{display:inline-block;border:1px solid var(--border);padding:4px 8px;border-radius:999px;font-size:12px}

/* Header */
.site-header{position:sticky;top:0;background:#fff;z-index:50}
.header-top{display:flex;gap:14px;align-items:center;padding:14px 0;flex-wrap:wrap}
.header-top .logo{flex:0 0 auto}
.header-top .searchbar{flex:1 1 360px;min-width:0}
.logo{font-family:var(--serif);font-weight:800;font-size:32px;letter-spacing:-.5px}
.logo a:hover{text-decoration:none}
.header-actions{display:flex;gap:10px;justify-content:flex-end;align-items:center}
.searchbar{
  width:100%;display:flex;align-items:center;border:1px solid var(--border);
  border-radius:999px;padding:10px 14px;gap:10px
}
.searchbar input{
  border:none;outline:none;
  /* width:1% is a well-known flex trick to prevent iOS overflow issues */
  width:1%;flex:1 1 auto;min-width:0;
  font-size:16px;background:transparent;
}
.nav-cats{border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.nav-cats ul{list-style:none;margin:0;padding:10px 0;display:flex;gap:22px;overflow:auto;white-space:nowrap}
.nav-cats a{font-weight:700}
.disclaimer{padding:10px 0;text-align:center;font-size:13px;color:#333}

/* Home hero grid */
.home-hero{display:grid;grid-template-columns:280px 1fr 280px;gap:24px;padding:22px 0}
@media (max-width: 1024px){
  .header-top{display:flex;gap:14px;align-items:center;padding:14px 0;flex-wrap:wrap}
.header-top .logo{flex:0 0 auto}
.header-top .searchbar{flex:1 1 360px;min-width:0}
  .home-hero{grid-template-columns:1fr}
}
.panel-title{
  font-family:var(--serif);font-size:34px;font-weight:800;display:flex;align-items:center;gap:12px;margin:0 0 14px
}
.panel-title:before{content:"";height:2px;flex:1;background:#111;max-width:90px}
.latest-list{display:flex;flex-direction:column;gap:18px}
.latest-item .t{font-weight:800;font-size:18px;line-height:1.2}
.latest-item .d{font-size:12px;color:var(--muted);margin-top:6px}
.hero-card{border-top:2px solid #111}
.hero-thumb{aspect-ratio: 16/9;background:#f3f3f3;border:1px solid var(--border)}
.hero-title{
  font-family:var(--serif);
  font-size:52px;line-height:1.02;margin:14px 0 6px;font-weight:900;
  letter-spacing:-.6px
}
.hero-byline{color:var(--muted);font-size:14px;margin:0 0 10px}
.deals-box .panel-title{font-size:34px}
.deals-list{display:flex;flex-direction:column;gap:18px}
.deal-row{display:grid;grid-template-columns:84px 1fr;gap:12px;align-items:start}
.deal-row img{width:84px;height:84px;object-fit:contain;border:1px solid var(--border);background:#fff}
.deal-row .name{font-weight:800;line-height:1.2}
.price{margin-top:6px;font-weight:800}
.price s{color:var(--muted);font-weight:600;margin-left:6px}
.deal-meta{font-size:12px;color:var(--muted);margin-top:4px}

/* Post grid + content */
.section{padding:24px 0}
.h2{font-family:var(--serif);font-size:34px;margin:0 0 14px}
.post-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
@media (max-width: 900px){.post-grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width: 560px){.post-grid{grid-template-columns:1fr}}
.card{border:1px solid var(--border);border-radius:14px;overflow:hidden;background:#fff}
.card .thumb{aspect-ratio: 16/10;background:#f3f3f3;border-bottom:1px solid var(--border)}
.card .body{padding:14px}
.card .title{font-weight:900;font-size:18px;line-height:1.2;margin:0 0 6px}
.card .excerpt{color:var(--muted);font-size:14px;margin:0}

/* Single */
.single-wrap{display:grid;grid-template-columns:1fr 320px;gap:28px;padding:24px 0}
@media (max-width: 1024px){.single-wrap{grid-template-columns:1fr}}
.single-title{font-family:var(--serif);font-size:48px;line-height:1.05;margin:0 0 10px;font-weight:900}
.single-meta{color:var(--muted);font-size:14px;margin:0 0 14px}
.prose{font-size:18px;line-height:1.65}
.prose h2{font-family:var(--serif);font-size:28px;margin-top:28px}
.prose h3{font-size:20px;margin-top:22px}
.sidebar .card{position:sticky;top:120px}

/* Verdict box */
.verdict{
  border:1px solid var(--border);border-left:6px solid #111;border-radius:14px;
  padding:14px 14px 14px 16px;background:#fafafa;margin:18px 0
}
.verdict .kicker{font-weight:900;text-transform:uppercase;letter-spacing:.06em;font-size:12px}
.verdict .pick{font-family:var(--serif);font-size:28px;font-weight:900;margin:4px 0}
.verdict .why{color:var(--muted);margin:0 0 10px}
.verdict .cta{display:flex;gap:10px;flex-wrap:wrap}

/* Footer */
.site-footer{border-top:1px solid var(--border);padding:26px 0;margin-top:28px}
.footer-grid{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:center}



@media (max-width: 768px){
  /* Use flex (not grid) on small screens to avoid Safari grid/overflow quirks */
  .header-top{display:flex;gap:14px;align-items:center;padding:14px 0;flex-wrap:wrap}
.header-top .logo{flex:0 0 auto}
.header-top .searchbar{flex:1 1 360px;min-width:0}
  .logo{order:1}
    .searchbar{order:3;width:100%;max-width:100%;}
  .logo a{font-size:22px}
  .btn{padding:8px 10px;font-size:13px}
  .searchbar{padding:9px 12px}
  .nav-cats ul{gap:16px;padding:8px 0;-webkit-overflow-scrolling:touch}
  .hero-title{font-size:34px}
  .single-title{font-size:34px}
}


/* Hard clamps to prevent horizontal scroll on mobile */
img, video, iframe, embed, object{max-width:100%; height:auto}
.wp-block-image img{max-width:100%; height:auto}
pre, code{max-width:100%; overflow:auto}
table{max-width:100%; display:block; overflow:auto}


/* Mobile header like Wirecutter/NYT: centered brand + full-width search + horizontal menu */
@media (max-width: 768px){
  .header-top{display:flex !important;flex-direction:column;align-items:stretch;gap:10px;padding:14px 0}
  .header-top .logo{width:100%;text-align:center}
  .header-top .logo a{display:inline-block;font-size:40px;line-height:1.05}
  .header-top .searchbar{width:100%}
  /* hide any legacy buttons (Account/Subscribe/etc.) if present */
  .header-actions,.header-right,.header-ctas,.account,.subscribe,.login,.btn-login,.btn-subscribe{display:none !important}
  /* keep cat menu but avoid page-level scroll */
  .nav-cats .container{overflow:hidden}
  .nav-cats ul{padding:10px 0 10px 0;margin:0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
}

