/* GiftlyPicks site styles.
   Plain CSS. Token names follow the GiftlyPicks Brand Identity system (tokens.json) and DESIGN.md. */

:root {
  /* Color */
  --surface: #fff8f1;
  --surface-card: #ffffff;
  --tint-blush: #fce6e3;
  --ink: #2b2233;
  --ink-muted: #6b5f70;
  --brand: #d94a60; /* large text (24px+ / 19px bold) and shapes only */
  --brand-strong: #b3324a; /* CTA fill, links, small colored text */
  --brand-strong-hover: #9c2840;
  --ribbon-gold: #f2b544; /* never text */
  --pine: #2f7d6d;
  --line: #eadbd2;

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "DM Sans", system-ui, sans-serif;

  /* Spacing scale: 4, 8, 16, 24, 32, 48, 72 */
  --space-1: 4px;
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-18: 72px;

  /* Radius */
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Layout */
  --gutter: 16px;
  --max: 1120px;
  --max-narrow: 760px;
  --section-gap: var(--space-8);
  --transition: 150ms ease;
}

@media (min-width: 768px) {
  :root {
    --gutter: 24px;
    --section-gap: var(--space-12);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition: 0s;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--brand-strong);
  text-underline-offset: 2px;
  transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

a:hover {
  color: var(--brand-strong-hover);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

/* Type styles (DESIGN.md 2.3) */
h1,
h2,
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}

.hero__title {
  font-size: 34px;
  line-height: 40px;
}

h1 {
  font-size: 28px;
  line-height: 34px;
}

h2 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}

h3 {
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: 26px;
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

@media (min-width: 768px) {
  .hero__title {
    font-size: 48px;
    line-height: 54px;
  }

  h1 {
    font-size: 36px;
    line-height: 42px;
  }

  h2 {
    font-size: 26px;
    line-height: 32px;
  }
}

.caption {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}

.muted {
  color: var(--ink-muted);
}

.lede {
  font-size: 18px;
  line-height: 28px;
  color: var(--ink-muted);
  max-width: 60ch;
}

.accent {
  font-style: italic;
  color: var(--brand); /* large text only */
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--narrow {
  max-width: var(--max-narrow);
}

.section {
  padding-top: var(--section-gap);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}

.section__head h2 {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--gutter);
  top: var(--space-2);
  z-index: 10;
  background: var(--surface-card);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
}

/* Signature detail: one gold ribbon per viewport */
.ribbon {
  display: block;
  width: 120px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--ribbon-gold);
}

.ribbon--center {
  margin: 0 auto;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-logo {
  display: inline-block;
  line-height: 0;
}

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

/* Mobile nav: horizontally scrollable chip row under the logo, no JS. */
.site-nav {
  display: flex;
  gap: var(--space-2);
  width: 100%;
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--tint-blush);
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

@media (min-width: 768px) {
  .site-header__inner {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }

  .site-logo img {
    height: 44px;
  }

  .site-nav {
    width: auto;
    gap: var(--space-6);
    overflow: visible;
    padding-bottom: 0;
  }

  .site-nav a {
    padding: 0;
    border: 0;
    background: none;
    font-size: 16px;
  }

  .site-nav a:hover {
    text-decoration: underline;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--space-18);
  background: var(--tint-blush);
  color: var(--ink);
}

.site-footer .ribbon {
  position: relative;
  top: -4px;
}

.site-footer__inner {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.site-footer__wordmark img {
  height: 28px;
  width: auto;
}

.site-footer__tagline {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--space-4);
  font-weight: 500;
}

.site-footer__legal p {
  margin-bottom: var(--space-2);
}

.site-footer__copy {
  color: var(--ink-muted);
}

@media (min-width: 768px) {
  .site-footer__inner {
    grid-template-columns: 1fr 2fr;
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  background: var(--brand-strong);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.btn:hover {
  background: var(--brand-strong-hover);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  border: 2px solid var(--brand-strong);
  color: var(--brand-strong);
  padding: 10px 18px;
}

.btn--secondary:hover {
  background: transparent;
  border-color: var(--brand-strong-hover);
  color: var(--brand-strong-hover);
}

.btn--small {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 14px;
}

/* ---------- Badges, chips, price tag, rating ---------- */

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.badge--top-pick {
  background: var(--ribbon-gold);
  color: var(--ink);
}

.badge--under-10 {
  background: var(--pine);
  color: #fff;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--tint-blush);
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  text-decoration: none;
}

.chip:hover {
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

.chip[aria-current="page"] {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}

.price-tag {
  display: inline-block;
  padding: 2px 12px;
  border-radius: var(--radius-pill);
  background: var(--tint-blush);
  color: var(--ink);
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  white-space: nowrap;
}

.price-tag--small {
  font-size: 15px;
  line-height: 22px;
  padding: 1px 10px;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
}

.rating__stars {
  display: inline-flex;
  gap: 1px;
}

.rating__stars svg {
  width: 14px;
  height: 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

/* ---------- Hero ---------- */

.hero {
  background: var(--surface);
  padding: var(--space-8) 0 var(--space-6);
}

.hero__inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.hero__eyebrow {
  color: var(--brand-strong);
  margin-bottom: var(--space-2);
}

.hero__title {
  max-width: 16ch;
}

.hero__text {
  font-size: 18px;
  line-height: 28px;
  max-width: 48ch;
  margin-bottom: var(--space-6);
}

.hero__art {
  display: none;
}

@media (min-width: 900px) {
  .hero {
    padding: var(--space-12) 0 var(--space-8);
  }

  .hero__inner {
    grid-template-columns: 1fr 280px;
    gap: var(--space-12);
  }

  .hero__art {
    display: block;
    justify-self: end;
  }

  .hero__art img {
    width: 240px;
    height: 240px;
  }
}

/* ---------- Category tiles ---------- */

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--tint-blush);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-decoration: none;
}

.tile:hover {
  border-color: var(--brand-strong);
  color: var(--ink);
}

.tile__icon {
  width: 28px;
  height: 28px;
  color: var(--brand-strong);
}

.tile__label {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  margin: var(--space-2) 0 0;
}

.tile__caption {
  color: var(--ink-muted);
}

@media (min-width: 768px) {
  .tiles {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ---------- Product grid card: the whole card is one link ---------- */

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 560px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1120px) {
  .product-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
}

.product-card:hover {
  border-color: var(--brand-strong);
  color: var(--ink);
}

.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}

.product-card__title {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card:hover .product-card__title {
  color: var(--brand-strong);
}

.product-card__who {
  margin: 0;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

/* ---------- Product row (guide page) ---------- */

.product-rows {
  display: grid;
}

.product-row {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--line);
}

.product-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.product-row__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.product-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-row__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: var(--space-1);
}

.product-row__num {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 36px;
  font-weight: 700;
  color: var(--brand); /* large text: allowed */
  margin: 0 0 var(--space-1);
}

.product-row__body h3 {
  font-size: 22px;
  line-height: 28px;
}

.product-row__meta {
  margin: var(--space-4) 0;
}

.product-row__shipping {
  color: var(--ink-muted);
}

@media (min-width: 720px) {
  .product-row {
    grid-template-columns: 40% 1fr;
    gap: var(--space-6);
    padding: var(--space-12) 0;
  }
}

/* ---------- Guide cards (home, related guides) ---------- */

.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 560px) {
  .guide-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .guide-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
}

.guide-card:hover {
  border-color: var(--brand-strong);
  color: var(--ink);
}

.guide-card__media {
  aspect-ratio: 4 / 3;
  background: var(--tint-blush);
}

.guide-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide-card__body {
  padding: var(--space-4);
}

.guide-card__title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
  margin: 0 0 var(--space-1);
}

.guide-card:hover .guide-card__title {
  color: var(--brand-strong);
}

/* ---------- Guide page ---------- */

.guide {
  padding-top: var(--space-6);
}

.breadcrumbs {
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}

.breadcrumbs a {
  color: var(--ink-muted);
}

.guide-header h1 {
  margin-bottom: var(--space-4);
}

.guide-header .ribbon {
  margin-bottom: var(--space-4);
}

.guide-header__meta {
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}

.disclosure {
  background: var(--tint-blush);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0 0 var(--space-6);
}

.guide-header__intro {
  font-size: 18px;
  line-height: 28px;
}

.favorites {
  background: var(--tint-blush);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: var(--space-8) 0 var(--space-12);
}

.favorites h2 {
  margin-bottom: var(--space-4);
}

.favorites__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.favorites__item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
}

.favorites__item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.favorites__name {
  display: block;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.favorites__name:hover {
  color: var(--brand-strong);
}

.favorites__cta {
  grid-column: 1 / -1;
  justify-self: start;
  font-weight: 700;
}

@media (min-width: 560px) {
  .favorites__item {
    grid-template-columns: 64px 1fr auto;
  }

  .favorites__cta {
    grid-column: auto;
  }
}

.shipping-note {
  margin-top: var(--space-8);
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

/* ---------- Misc ---------- */

.empty {
  color: var(--ink-muted);
  background: var(--surface-card);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* Static pages */
.prose h2 {
  margin-top: var(--space-8);
}

.prose ul {
  padding-left: 1.2em;
  margin: 0 0 var(--space-4);
}

.prose li {
  margin-bottom: var(--space-1);
}

.prose code {
  font-size: 0.9em;
  background: var(--tint-blush);
  padding: 1px 6px;
  border-radius: 6px;
}

.prose__meta {
  margin-top: var(--space-8);
  color: var(--ink-muted);
}

/* 404 */
.not-found__code {
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 112px);
  line-height: 1;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 var(--space-4);
}

.not-found__heading {
  margin-top: var(--space-12);
}

/* ---------- Cookie consent (only rendered when analytics is on; shown by JS) ---------- */

.consent {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 20;
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.consent[hidden] {
  display: none;
}

.consent__text {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
}

/* Accept and Decline: same size, side by side, equally easy to press. */
.consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.consent__actions .btn {
  min-height: 44px;
}

@media (min-width: 768px) {
  .consent {
    left: auto;
    right: var(--space-6);
    bottom: var(--space-6);
    margin: 0;
  }
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-strong);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-button[hidden] {
  display: none;
}

.link-button:hover {
  color: var(--brand-strong-hover);
}
