/* =============================================================================
   Velorex Music — homepage "From the Journal" strip + newsletter/social block
   Markup: #home-journal and .home-connect in index.html.
   JS: initHomeJournal() in src/js/storefront/blog.js (the social block is
   static and needs none).

   Colours are tokens, so both themes work. The QR codes themselves are always
   dark-on-white (src/img/qr/*.svg): an inverted code scans unreliably on many
   phone cameras, so they sit on their own white tile in BOTH themes.
   ============================================================================= */

/* ---- From the Journal ------------------------------------------------------ */
.home-journal .section-header { align-items: flex-end; }
.home-journal .section-header .btn { flex-shrink: 0; }
#home-journal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 1024px) {
  #home-journal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Two columns of three cards leaves one orphan; show the newest two. */
  #home-journal-grid > .blog-card:nth-child(3) { display: none; }
}
@media (max-width: 640px) {
  #home-journal-grid { grid-template-columns: 1fr; gap: 1rem; }
  #home-journal-grid > .blog-card:nth-child(3) { display: block; }
}

/* ---- Newsletter + follow --------------------------------------------------- */
.home-connect {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}
.home-connect .newsletter-card {
  display: flex; flex-direction: column; justify-content: center;
  padding: 2.5rem 2rem;
}

.social-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 20px);
  background: var(--surface);
  padding: 2rem;
  text-align: center;
}
.social-card-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 0.5rem;
}
.social-card-title span { color: var(--secondary); }
.social-card-sub { color: var(--text-muted); margin: 0 0 1.5rem; font-size: 0.95rem; }

.social-qr-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.social-qr {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
  min-width: 0;
  padding: 0.75rem 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg, var(--surface));
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.social-qr:hover, .social-qr:focus-visible { border-color: var(--net, var(--secondary)); transform: translateY(-2px); outline: none; }
.social-qr-code {
  width: 100%; max-width: 116px; height: auto; aspect-ratio: 1;
  background: #ffffff;
  border-radius: 8px;
  padding: 2px;
}
.social-qr-name { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.social-qr-name i { color: var(--net, var(--secondary)); }
.social-qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; }
.social-qr-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}
.social-qr-action:hover, .social-qr-action:focus-visible {
  border-color: var(--net, var(--secondary));
  color: var(--text);
}

/* Each network's own colour, for the icon and the hover edge only. */
.social-qr[data-net="instagram"] { --net: #e1306c; }
.social-qr[data-net="youtube"]   { --net: #ff0000; }
.social-qr[data-net="whatsapp"]  { --net: #25d366; }
.social-qr[data-net="facebook"]  { --net: #1877f2; }

/* Side by side would squeeze both cards; stack them. */
@media (max-width: 1024px) {
  .home-connect { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .social-qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* On phones, show direct profile links instead of scannable on-screen codes. */
@media (max-width: 640px) {
  .social-card { padding: 1.5rem 1.1rem; }
  .social-card-title { font-size: 1.6rem; }
  .social-card-sub { display: block; margin-bottom: 1rem; font-size: 0.82rem; }
  .social-qr-grid { gap: 0.6rem; }
  .social-qr { padding: 0.7rem 0.35rem; gap: 0.45rem; }
  .social-qr-code { display: none; }
  .social-qr-name { font-size: 0.82rem; }
  .social-qr-actions { gap: 0.25rem; }
  .social-qr-action { min-height: 2.15rem; padding: 0.35rem 0.45rem; font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  .social-qr { transition: none; }
  .social-qr:hover, .social-qr:focus-visible { transform: none; }
}
