/* =========================================================
   THEME VARIABLES (single source of truth)
========================================================= */
:root{
  --brand: #ff7000;
  --brand-dark: #c94f1f;
  --ink: #0f172a;
  --muted: rgba(15,23,42,.62);
  --border: rgba(15,23,42,.10);
  --soft: rgba(232,101,45,.08);
  --bg-soft: #f8fafc;
  --bs-primary: #ff7000;
  --bs-primary-rgb: 232, 101, 45;
}

/* =========================================================
   BASE
========================================================= */
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
}

a{ color: var(--brand); text-decoration:none; }
a:hover{ color: var(--brand-dark); text-decoration:underline; }

.soft{ background: var(--bg-soft); }

/* =========================================================
   NAV / HERO
========================================================= */
.navbar-brand{ letter-spacing:.2px; }

.nav-link{
  color: var(--ink);
}

.nav-link:hover,
.nav-link:focus{
  color: var(--brand);
}

.hero {
  background: radial-gradient(
    1200px 600px at 10% 0%,
    rgba(232,101,45,0.22) 0%,
    rgba(255,255,255,0.92) 55%,
    #ffffff 100%
  );
  border-bottom: 1px solid rgba(15,23,42,.08);
}
.hero h1{ letter-spacing:-.02em; }

/* Badge should be orange */
.badge-soft {
  background: rgba(232,101,45,.12);
  color: var(--brand);
  border: 1px solid rgba(232,101,45,.30);
}
/* ===== Buttons: keep pill shape globally, but colors per-variant ===== */
.btn{
  border-radius: 999px;
  font-weight: 700;
}

/* Primary buttons should be solid orange */
.btn-primary{
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus{
  background-color: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
  color: #fff !important;
}

/* Outline-primary pills (your 4 top buttons) */
.btn-outline-primary{
  color: var(--brand) !important;
  border-color: rgba(232,101,45,.45) !important;
  background: transparent !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus{
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

/* If Search/About are outline-secondary, keep them orange-ish too */
.btn-outline-secondary{
  color: var(--brand) !important;
  border-color: rgba(232,101,45,.35) !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus{
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

/* Kill blue focus ring on buttons/inputs */
.btn:focus,
.btn:focus-visible,
.form-control:focus,
.form-select:focus{
  box-shadow: 0 0 0 .25rem rgba(232,101,45,.22) !important;
  border-color: rgba(232,101,45,.55) !important;
}

/* =========================================================
   ARTICLE TYPOGRAPHY
========================================================= */
.article .lede{
  font-size:1.15rem;
  line-height:1.7;
  color:var(--muted);
}

.article .content{
  /*font-family:"Source Serif 4", Georgia, "Times New Roman", serif;*/
  font-size:1.08rem;
  line-height:1.85;
}

.article .content p{ margin:0 0 1.1rem; }

.article .content h2{
  font-family:Inter, system-ui, sans-serif;
  margin:2.4rem 0 1rem;
  padding-bottom:10px;
  border-bottom:3px solid var(--brand);
  letter-spacing:-.02em;
}

.article .content h3{
  font-family:Inter, system-ui, sans-serif;
  font-size:1.4rem;
  letter-spacing:-.01em;
}

.article .content ul,
.article .content ol{
  padding-left:1.25rem;
  margin:0 0 1.1rem;
}

.article .content hr{
  border:0;
  height:1px;
  background:linear-gradient(to right, transparent, rgba(15,23,42,.9), transparent);
  margin:2rem 0;
}

.article .content img{
  width:100%;
  height:auto;
  display:block;
}

/* ===== Amazon grid + cards (clean, no overrides) ===== */

.amz-grid{
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.amz-grid.cols-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.amz-grid.cols-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Mobile: single column */
@media (max-width: 768px){
  .amz-grid.cols-2,
  .amz-grid.cols-3{
    grid-template-columns: 1fr;
  }
}

.amz-card{
  border: 1px solid var(--brand);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

/* Base layout (1-column / standalone cards) */
.amz-card__link{
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  padding: 0;               /* keep padding on card, not link */
}

/* ✅ THIS prevents the “huge image” problem on 1-col cards */
.amz-card__img{
  width: 240px;
  height: 240px;
  max-width: 240px;
  max-height: 240px;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (max-width: 992px){
  .amz-card__img{
    width: 180px;
    height: 180px;
    max-width: 180px;
    max-height: 180px;
  }
}

.amz-card__body{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.amz-card__title{
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 3;
}


.amz-card__byline{
  font-size: 0.9rem;
  line-height: 1.2;
}

.amz-card__desc{
  font-size: 0.95rem;
  line-height: 1.2;
}

.amz-card__cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;

  /* Let it shrink safely instead of overflowing weirdly */
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;

  border: 1px solid rgba(232,101,45,0.35);
  background: rgba(232,101,45,0.10);

  /* Default (1-col): under the text */
  width: fit-content;
  margin-top: 10px;
}

/* ===== 2-up cards (desktop) ===== */
.amz-grid.cols-2 .amz-card__img{
  width: 140px;
  height: 140px;
  max-width: 140px;
  max-height: 140px;
}

/*
  ✅ Your requested behavior:
  Under ~1200px, make 2-col behave like 3-col (stack + CTA pinned bottom)
*/
@media (max-width: 1199.98px){
  .amz-grid.cols-2{
    grid-template-columns: 1fr; /* stack rows */
  }

  .amz-grid.cols-2 .amz-card{
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .amz-grid.cols-2 .amz-card__link{
    flex-direction: column;
    align-items: stretch;
    height: 100%;
  }

  .amz-grid.cols-2 .amz-card__img{
    width: 100%;
    max-width: none;
    height: 170px;
    max-height: 170px;
    object-fit: contain;
  }

  .amz-grid.cols-2 .amz-card__body{
    flex: 1 1 auto;
  }

  .amz-grid.cols-2 .amz-card__cta{
    margin-top: auto;       /* pin to bottom */
    width: 100%;
    justify-content: center;
  }
}

/* ===== 3-up cards (stacked + CTA pinned bottom) ===== */
.amz-grid.cols-3{
  align-items: stretch;
}

.amz-grid.cols-3 .amz-card{
  height: 100%;
  display: flex;
  flex-direction: column;
}

.amz-grid.cols-3 .amz-card__link{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  gap: 10px;
}

.amz-grid.cols-3 .amz-card__img{
  width: 100%;
  max-width: none;
  height: 160px;
  max-height: 160px;
  object-fit: contain;
}

.amz-grid.cols-3 .amz-card__body{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
}

.amz-grid.cols-3 .amz-card__title{
  -webkit-line-clamp: 2;
}

.amz-grid.cols-3 .amz-card__cta{
  margin-top: auto;         /* pin to bottom */
  width: 100%;
  justify-content: center;
}

.amz-card__link,
.amz-card__link:hover,
.amz-card__link * {
  text-decoration: none !important;
  color: inherit;
}

.amz-card{
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.amz-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.14);
  border-color: var(--brand);
}

.amz-card:hover .amz-card__cta{
  background: rgba(232,101,45,0.18);
  border-color: var(--brand);
}

/* =========================================================
   MOBILE: stacked Amazon cards (title -> image -> CTA)
========================================================= */
@media (max-width: 768px){
  .amz-card__link{
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .amz-card__title{ grid-row: 1; }
  .amz-card__img{ 
    grid-row: 2;
    width: 100%;
    max-width: none;
    height: 180px;
    object-fit: contain;
  }
  .amz-card__byline{ grid-row: 3; }
  .amz-card__desc{ 
    grid-row: 4;
    font-size: 0.95rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
  .amz-card__cta{ 
    grid-row: 5;
    width: 100%;
    justify-content: center;
  }

  /* Make these grid items by “lifting” them out visually */
  .amz-card__body{
    display: contents; /* safe here because grid placement is explicit */
  }
}