/*
Theme Name: Gadget Affiliate Theme
Theme URI: http://example.com/gadget-affiliate-theme
Author: Your Name
Author URI: http://example.com
Description: A neutral, responsive theme designed for Amazon affiliate gadgets.
Version: 4.0.0
Text Domain: gadget-affiliate-theme
*/

:root {
  --ink: #1a1a18;
  --ink-muted: #5a5a54;
  --ink-faint: #9a9a90;
  --cream: #f7f4ef;
  --white: #ffffff;
  --accent: #c8512a;
  --accent-light: #f5ede8;
  --accent-hover: #a83e1f;
  --gold: #b8860b;
  --border: rgba(0,0,0,0.10);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--accent); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* SITE HEADER */
.site-header {
  background: var(--ink);
  padding: 1rem 0;
}

.site-branding {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title-wrapper { display: flex; flex-direction: column; }

.site-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
}

.site-title a { color: var(--white); }
.site-title a:hover { color: var(--accent); }

.site-description {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-top: 0.2rem;
}

.custom-logo { max-height: 48px; width: auto; display: block; }

/* PAGE MASTHEAD (front-page hero) */
.page-masthead {
  background: var(--ink);
  color: var(--white);
  text-align: center;
  padding: 4rem 2rem 3.5rem;
  position: relative;
  overflow: hidden;
}

.page-masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(255,255,255,0.015) 40px,
    rgba(255,255,255,0.015) 80px
  );
}

.masthead-eyebrow {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
  position: relative;
}

.masthead-eyebrow::before,
.masthead-eyebrow::after { content: '—'; margin: 0 0.6em; opacity: 0.5; }

.masthead-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  max-width: 800px;
  margin: 0 auto 1.2rem;
  position: relative;
  color: var(--white);
}

.masthead-title em { font-style: italic; color: var(--accent); }

.masthead-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  font-weight: 300;
}

/* SECTION DIVIDER */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 3rem 0 2.5rem;
}

.section-divider-line { flex: 1; height: 1px; background: var(--border); }

.section-divider-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  white-space: nowrap;
}

/* PRODUCT CARDS — Editorial numbered style */
.products-grid { display: flex; flex-direction: column; }

.product-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.product-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }

.card-number-col {
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 0.5rem;
  gap: 0.4rem;
}

.card-num {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.card-num-label {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.product-card.featured .card-number-col { background: var(--accent); }

.card-body { padding: 1.5rem 2rem; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.card-category {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.card-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); }

.card-rating { text-align: right; flex-shrink: 0; }

.card-reviews {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.card-verdict {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  font-style: italic;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-thumbnail { margin: 0.75rem 0 1rem; }

.card-thumbnail img {
  max-height: 150px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.10));
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
}

/* PRICE */
.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #B12704;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.product-price.large { font-size: 1.6rem; color: var(--white); }

/* CARD ACTIONS */
.card-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-secondary {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 500;
  transition: color 0.15s;
}

.btn-secondary:hover { color: var(--accent); }

/* CTA BUTTON */
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.6em 1.3em;
  border-radius: 2px;
  letter-spacing: 0.04em;
  transition: background 0.15s, transform 0.1s;
}

.card-cta:hover { background: var(--accent-hover); color: #fff; }
.card-cta:active { transform: scale(0.98); }

.card-cta.cta-large {
  font-size: 1rem;
  padding: 0.85em 2em;
  border-radius: 3px;
}

/* SPECS GRID */
.card-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.2rem;
}

.spec-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.spec-value { font-size: 0.88rem; font-weight: 500; color: var(--ink); }

/* PROS / CONS */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
}

.pros-cons-head {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.pros-col .pros-cons-head { color: #3a7a3a; }
.cons-col .pros-cons-head { color: var(--ink-faint); }
.pros-cons ul { list-style: none; }

.pros-cons li {
  padding: 0.25rem 0;
  color: var(--ink-muted);
  display: flex;
  gap: 0.5em;
  align-items: flex-start;
}

.pros-cons li::before { flex-shrink: 0; margin-top: 0.1em; }
.pros-col li::before { content: '+'; color: #3a7a3a; font-weight: 700; }
.cons-col li::before { content: '−'; color: var(--ink-faint); font-weight: 700; }

/* STAR RATINGS */
.rating-stars {
  --rating: 0;
  display: inline-block;
  font-size: 1rem;
  position: relative;
  color: #ddd;
  line-height: 1;
  letter-spacing: -1px;
}

.rating-stars::before { content: '★★★★★'; }

.rating-stars::after {
  content: '★★★★★';
  position: absolute;
  top: 0;
  left: 0;
  color: var(--gold);
  overflow: hidden;
  width: calc(var(--rating) / 5 * 100%);
}

/* PRODUCT RATING ROW */
.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.rating-label { font-size: 0.8rem; color: var(--ink-faint); }

/* SINGLE PRODUCT PAGE */
.single-editorial {
  margin-top: 3rem;
  margin-bottom: 4rem;
}

.single-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2.5rem;
  margin-bottom: 1.5rem;
}

.single-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.single-meta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.single-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.single-gallery {
  background: #fafaf8;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 280px;
}

.single-gallery img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.10));
}

.single-details {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.single-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: var(--ink-muted);
  line-height: 1.8;
}

.single-content h2,
.single-content h3 {
  font-family: var(--serif);
  color: var(--ink);
  margin: 1.5rem 0 0.5rem;
}

.single-pros-cons {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.single-cta-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--ink);
  padding: 1.5rem 2rem;
  border-radius: 4px;
  flex-wrap: wrap;
}

/* SHORTCODE PRODUCT CARD */
.shortcode-product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.shortcode-product-image {
  width: auto;
  max-width: 100%;
  height: 200px;
  object-fit: contain;
  background: #fafaf8;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.08));
}

.shortcode-product-content { padding: 1.25rem; }

.shortcode-product-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.shortcode-product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #B12704;
  margin-bottom: 0.75rem;
}

/* PAGINATION */
.nav-links {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 2rem 0 3rem;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links span {
  padding: 0.4em 0.9em;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  background: var(--white);
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover { background: var(--accent-light); color: var(--accent); }

.nav-links .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* SITE FOOTER */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.4);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.78rem;
  margin-top: auto;
  line-height: 2;
}

.site-footer a { color: rgba(255,255,255,0.4); }
.site-footer a:hover { color: var(--accent); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .product-card { grid-template-columns: 52px 1fr; }
  .card-num { font-size: 1.6rem; }
  .card-body { padding: 1.2rem; }
  .single-layout { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-masthead { padding: 3rem 1.5rem 2.5rem; }
  .card-top { flex-direction: column; }
  .card-rating { text-align: left; }
  .single-cta-footer { flex-direction: column; align-items: flex-start; }
  .single-header { padding: 1.5rem; }
}
