/* reviews360 - simple responsive styles */
:root{
  --bg:#ffffff;
  --text:#737373; /* updated text color */
  --muted:#9b9b9b;
  --accent:#0d907b; /* updated accent color */
  --container:1100px;
  --radius:10px;
  --max-width:1100px;
  --body-font: 'Lato', system-ui, -apple-system, Arial, sans-serif;
  --header-font: 'Maven Pro', system-ui, -apple-system, Arial, sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--body-font), sans-serif; /* Lato */
  font-weight:400;
  color:var(--text);
  background:var(--bg);
  line-height:1.45;
}
.container{max-width:var(--container);margin:0 auto;padding:1rem}
a{color:var(--accent);text-decoration:none}
a:focus{outline:3px solid #cfe3ff;border-radius:4px}
.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.skip-link:focus{position:static;width:auto;height:auto;padding:.5rem;background:#111;color:white}
.site-header{border-bottom:1px solid #e6e9ef;background:linear-gradient(180deg,#fff,#fbfdff);position:relative;z-index:20}
.header-inner{display:flex;align-items:center;justify-content:space-between;padding:0.75rem 1rem}
.brand{font-weight:700;font-size:1.125rem;color:var(--text);font-family:var(--header-font), sans-serif;display:inline-flex;align-items:center}
.brand-logo{display:inline-block;vertical-align:middle;width:40px;height:40px;margin-right:.5rem}
.brand-logo img{width:100%;height:100%;display:block}
.primary-nav ul{list-style:none;margin:0;padding:0;display:flex;gap:1rem}
/* menu button: fixed size to prevent layout shift when swapping icons */
.menu-toggle{display:none;background:transparent;border:1px solid transparent;padding:.2rem;border-radius:6px;width:44px;height:38px;align-items:center;justify-content:center}
.menu-toggle:focus{outline:3px solid #cfe3ff}
/* icon styling inside the button */
.menu-toggle .icon{display:inline-block;vertical-align:middle;color:var(--text);width:20px;height:20px}
.menu-toggle .icon svg{display:block;width:100%;height:100%}
/* Ensure SVG paths use the current text color for stroke and have no fill so icons are visible */
.menu-toggle .icon path,
.menu-toggle .icon svg path{stroke:currentColor;fill:none}
.menu-toggle .hamburger{display:inline-block}
.menu-toggle .close{display:none}
.menu-toggle.open .hamburger{display:none}
.menu-toggle.open .close{display:inline-block}

.hero{margin:1rem 0;padding:1rem;background:#f2f2f2;border-radius:8px;border:1px solid #eef2f6;overflow:hidden}
.hero h1{margin:0 0 .5rem;font-size:1.75rem;font-family:var(--header-font), sans-serif;color:var(--text)}
.hero .lead{color:var(--muted);margin:0}

.search-bar{margin:1rem 0}
.search-bar input{width:100%;padding:.75rem;border-radius:8px;border:1px solid #e4e7eb}
.post-list{margin:1rem 0;padding:1rem;background:#f2f2f2;border-radius:8px}
.post-card{padding:1rem;border-radius:8px;border:1px solid #eef2f6;margin-bottom:1rem;background:#fff}
.post-card h3{margin:.2rem 0}
.post-card .meta{color:var(--muted);font-size:.9rem;margin:.25rem 0}
.snippet{color:#374151}
.about{margin:2rem 0;padding:1rem;border-left:4px solid #eef2f6;background:#f2f2f2;border-radius:6px}
.testimonial{background:#fff;padding:1rem;border-radius:6px;border:1px solid #eef2f6}
.site-footer{border-top:1px solid #e6e9ef;padding:1rem 0;color:var(--muted);text-align:center}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Nav link icon/text behavior: show text on mobile, icons on desktop */
.nav-link .nav-icon { display: none; width:20px; height:20px; vertical-align:middle; }
.nav-link .nav-text { display: inline; }

@media (min-width:801px) {
  /* Desktop: show icons, hide text */
  .nav-link .nav-icon { display: inline-block; margin: 0 0; }
  .nav-link .nav-text { display: none; }
  /* Make sure nav items are centered horizontally on desktop as well */
  .primary-nav ul { justify-content: center; }
}

/* Ensure SVG paths inside nav icons use current color */
.nav-link .nav-icon path { stroke: currentColor; fill: none; }

/* Responsive */
@media (max-width:800px){
  .header-inner{gap:1rem}
  /* position the dropdown absolutely so it doesn't push content */
  .primary-nav{display:block;position:absolute;left:0;right:0;top:100%;background:var(--bg);box-shadow:0 6px 18px rgba(17,24,39,0.06);border-bottom:1px solid #eef2f6;overflow:hidden;max-height:0;opacity:0;pointer-events:none;transition:max-height 300ms ease, opacity 200ms ease}
  /* when open, allow space up to a reasonable max height */
  .primary-nav.open{max-height:400px;opacity:1;pointer-events:auto}
  /* hide the UL by default on mobile when nav is closed to avoid flashes of horizontal list */
  .primary-nav:not(.open) ul{display:none !important}
  /* show column layout only when open */
  .primary-nav.open ul{display:flex !important;flex-direction:column;align-items:center;gap:.5rem;padding:.75rem 0;margin:0}
  .primary-nav a{display:block;padding:.5rem 1rem;width:100%;text-align:center;color:var(--text)}
  .menu-toggle{display:inline-flex}
  .hero h1{font-size:1.5rem}
}

/* When menu open on larger screens keep behavior unchanged */
.primary-nav.open{display:block;padding:0.5rem 1rem}
.primary-nav.open ul{flex-direction:column}

/* Post detail layout */
.post-content{max-width:780px;margin:1rem auto;padding:1rem}
.post-meta{color:var(--muted);font-size:.95rem;margin-bottom:1rem}
/* ranked list with badges implemented via HTML (.rank-badge elements) */
.post-rank{list-style:decimal;margin-left:0;padding-left:0;counter-reset:rank;padding-right:1.5rem}
.post-rank li{list-style:none;display:flex;gap:1rem;align-items:center;margin-bottom:1rem;overflow:hidden}

/* badge element (either contains an <img> for medals or a number for numeric ranks) */
.rank-badge{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;border-radius:50%;box-shadow:0 4px 10px rgba(15,23,42,0.06);margin-right:18px;box-sizing:border-box}
.rank-badge img{display:block;width:60%;height:60%;object-fit:contain}
/* emoji inside medal badges */
.rank-badge .emoji{font-size:1.6rem;line-height:1;display:inline-block}
.rank-badge.medal .emoji{display:inline-block}
.rank-badge.medal{display:inline-flex;align-items:center;justify-content:center;background:#fff;border:1px solid #eee}
.rank-badge.numeric{background:var(--accent);color:#fff;font-weight:700;font-family:var(--header-font), sans-serif}

/* fallback numeric shown when emoji not available */
.rank-badge .fallback-num{display:none;font-weight:700}
.rank-badge.no-emoji .emoji{display:none}
.rank-badge.no-emoji .fallback-num{display:inline-block}

/* Fallback colored badges for top 3 when emoji not available */
.post-rank li:nth-child(1) .rank-badge.no-emoji .fallback-num{
  display:inline-flex;
  width:100%;
  height:100%;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#FFD700; /* gold */
  color:#2b2b2b; /* dark text for contrast */
  font-weight:700;
}
.post-rank li:nth-child(2) .rank-badge.no-emoji .fallback-num{
  display:inline-flex;
  width:100%;
  height:100%;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#C0C0C0; /* silver */
  color:#2b2b2b;
  font-weight:700;
}
.post-rank li:nth-child(3) .rank-badge.no-emoji .fallback-num{
  display:inline-flex;
  width:100%;
  height:100%;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#CD7F32; /* bronze */
  color:#2b2b2b;
  font-weight:700;
}

/* ensure the medal badge border is hidden in fallback so color shows cleanly */
.rank-badge.no-emoji{background:transparent;border:none}

/* responsive tweak for fallback numbers */
@media (max-width:480px){
  .post-rank li:nth-child(1) .rank-badge.no-emoji .fallback-num{font-size:0.95rem}
  .post-rank li:nth-child(2) .rank-badge.no-emoji .fallback-num{font-size:0.95rem}
  .post-rank li:nth-child(3) .rank-badge.no-emoji .fallback-num{font-size:0.95rem}
}

/* Ensure product block expands next to badge */
.post-rank li > .product{flex:1;min-width:0;overflow:hidden}

/* fine tune product grid alignment inside list */
.product{display:grid;grid-template-columns:1fr 140px;gap:1rem;padding:1rem;border:1px solid #eef2f6;border-radius:8px;margin-bottom:1rem;align-items:center}
.price{font-weight:700;color:#0f172a}
.buy-btn{display:inline-block;padding:.5rem .75rem;background:var(--accent);color:white;border-radius:6px}
.small{font-size:.9rem}

/* Product image sizing: keep images contained in the second grid column */
.product img{
  display:block;
  width:100%;       /* fill the grid column width */
  max-width:140px;  /* cap size on larger screens */
  max-height:350px; /* new: don't allow images taller than 350px */
  height:auto;      /* preserve aspect ratio */
  object-fit:contain;/* avoid cropping while fitting */
  border-radius:6px; /* subtle rounding to match cards */
}

/* Responsive image/grid adjustments */
@media (max-width:600px){
  .product{grid-template-columns:1fr 100px}
  .product img{max-width:100px}
}

@media (max-width:380px){
  /* on very small screens reduce image a bit more to keep text legible */
  .product{grid-template-columns:1fr 88px}
  .product img{max-width:88px}
}

/* slightly smaller emoji when embedded next to headings */
.rank-badge .emoji{ font-size:1.2rem; line-height:1; }

/* keep fallback sizing consistent when embedded */
.rank-badge .fallback-num{ font-size:0.95rem; }
