/* =========================================================
   CartworthyUK — Shared Stylesheet
   Colour palette:
     --navy      : #0d1b2a  (background, header)
     --navy-mid  : #1a2e45  (cards, footer)
     --navy-light: #243b55  (hover states)
     --accent    : #3b82f6  (buttons, links)
     --accent-hov: #2563eb
     --text      : #e8edf2  (primary text on dark)
     --muted     : #94a3b8  (secondary text)
     --white     : #ffffff
   ========================================================= */

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #0d1b2a;
  color: #e8edf2;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #3b82f6; text-decoration: none; }
a:hover { color: #93c5fd; text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ----- Layout Wrapper ----- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { flex: 1; }

/* ----- Header / Nav ----- */
.site-header {
  background-color: #0d1b2a;
  border-bottom: 1px solid #243b55;
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  height: 80px;
  width: auto;
}

@media (max-width: 480px) {
  .site-logo { height: 52px; }
}

.site-nav a {
  color: #e8edf2;
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: 1.5rem;
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover { color: #3b82f6; text-decoration: none; }

/* ----- Hero / Intro (homepage) ----- */
.hero {
  text-align: center;
  padding: 3.5rem 1.25rem 2.5rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.05rem;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto;
}

/* ----- Section Heading ----- */
.section-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #243b55;
}

/* ----- Post-card Grid (homepage list of guides) ----- */
/* To add a new guide: copy one .post-card block in index.html and update text/href */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.post-card {
  background-color: #1a2e45;
  border: 1px solid #243b55;
  border-radius: 10px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.post-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.post-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b82f6;
}

.post-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

.post-card p {
  font-size: 0.9rem;
  color: #94a3b8;
  flex: 1;
}

.post-card a.read-more {
  align-self: flex-start;
  margin-top: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #3b82f6;
}

.post-card a.read-more:hover { color: #93c5fd; }

/* ----- Product Card (used inside post pages) ----- */
/* To add a new product: copy one .product-card block in the post HTML */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 3rem;
}

.product-card {
  background-color: #1a2e45;
  border: 1px solid #243b55;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.product-card-image {
  background-color: #243b55;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 1rem;
}

.product-card-image img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 4px;
}

/* Placeholder shown when no real image is supplied yet */
.img-placeholder {
  width: 100%;
  height: 180px;
  background-color: #1a2e45;
  border: 2px dashed #3b82f6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #94a3b8;
  font-size: 0.78rem;
  padding: 0.5rem;
}

.product-card-body {
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-card-rank {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #3b82f6;
}

.product-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.product-card-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #34d399; /* green price tag */
}

.product-card-blurb {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
  flex: 1;
}

/* "Shop on Amazon" button */
.btn-amazon {
  display: inline-block;
  margin-top: 0.75rem;
  align-self: flex-start;
  background-color: #f59e0b;
  color: #0d1b2a;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-amazon:hover {
  background-color: #d97706;
  color: #0d1b2a;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ----- Back link (post pages) ----- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #94a3b8;
  font-size: 0.88rem;
  margin: 1.25rem 0 2rem;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: #e8edf2; text-decoration: none; }
.back-link::before { content: '←'; }

/* ----- Post page header ----- */
.post-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid #243b55;
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.post-header p {
  color: #94a3b8;
  font-size: 1rem;
  max-width: 700px;
}

/* ----- Footer ----- */
.site-footer {
  background-color: #1a2e45;
  border-top: 1px solid #243b55;
  padding: 1.5rem 0;
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: #94a3b8;
}

.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #e8edf2; }

.footer-social {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.social-link {
  color: #94a3b8;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  text-decoration: none;
}

.social-link:hover { color: #e8edf2; text-decoration: none; }

/* ----- Responsive ----- */
@media (max-width: 700px) {
  .product-card {
    grid-template-columns: 1fr;
  }

  .product-card-image {
    min-height: 160px;
  }

  .site-nav { display: none; } /* collapse nav on mobile; extend with a hamburger if needed */
}

@media (max-width: 480px) {
  .hero { padding: 2rem 1rem 1.5rem; }
  .post-grid { grid-template-columns: 1fr; }
}
