/**
 * Nippon Snacks — front-end styles for fixed pages.
 */

/* Fixed page titles only — use site accent red (hinomaru / --ns-red). */
body.page .wp-block-post-title,
body.page h1.wp-block-post-title,
body.page .entry-title,
body.page h1.entry-title,
body.page .page-title,
.ns-page > .wp-block-post-title,
.ns-page > h1.wp-block-post-title,
main.ns-page > .wp-block-post-title,
main.ns-page > h1.wp-block-post-title {
  color: var(--ns-red, var(--wp--preset--color--hinomaru-red, #bc002d)) !important;
}

/* START HERE hero — same width as article body, responsive */
.ns-start-here-hero {
  box-sizing: border-box;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  line-height: 0;
}

.ns-start-here-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .ns-start-here-hero {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
  }

  .ns-start-here-hero img {
    max-height: 280px;
  }
}

/* Homepage — Latest Articles: PC only (mobile layout unchanged) */
@media (min-width: 901px) {
  .wp-block-post-template.ns-post-grid.is-flex-container.columns-3,
  ul.ns-post-grid.wp-block-post-template {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px;
  }

  .wp-block-post-template.ns-post-grid.is-flex-container.columns-3 > li,
  .ns-post-grid > li {
    align-items: start;
    column-gap: 22px;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    row-gap: 8px;
    width: auto !important;
    max-width: none !important;
  }

  .ns-post-grid .wp-block-post-featured-image {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin: 0;
  }

  .ns-post-grid .wp-block-post-title {
    grid-column: 2;
    font-size: 1.2rem;
    line-height: 1.35;
    margin-top: 0;
  }

  .ns-post-grid .wp-block-post-excerpt {
    grid-column: 2;
    font-size: 0.95rem;
    line-height: 1.55;
  }
}

/* Affiliate product cards (Amazon Creators API enriched imports) */
.ns-affiliate-box {
  border: 1px solid var(--ns-line, #eadfda);
  border-radius: 8px;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
}

.ns-affiliate-box > h2 {
  color: var(--ns-red, #bc002d);
  margin-top: 0;
}

.ns-affiliate-disclosure {
  color: var(--ns-text, #444444);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ns-affiliate-audience {
  color: var(--ns-text, #444444);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 0.75rem;
}

.ns-affiliate-japan-alt {
  border-top: 1px solid var(--ns-line, #eadfda);
  color: var(--ns-text, #444444);
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 10px 0 0;
  padding-top: 10px;
}

.ns-affiliate-japan-alt a {
  font-weight: 600;
}

.ns-affiliate-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: 1rem;
}

.ns-affiliate-card {
  border: 1px solid var(--ns-line, #eadfda);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ns-affiliate-image img {
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.ns-affiliate-card-body {
  padding: 12px 14px 14px;
}

.ns-affiliate-provider {
  color: var(--ns-red, #bc002d);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ns-affiliate-card h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin: 6px 0 0;
}

.ns-affiliate-price {
  color: var(--ns-text, #444444);
  font-size: 0.9rem;
  margin: 8px 0 0;
}

/* Editorial persona byline (pen name — not a WP user account) */
.ns-byline {
  align-items: flex-start;
  border-top: 1px solid var(--ns-line, #eadfda);
  display: flex;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
}

.ns-byline-avatar {
  align-items: center;
  background: var(--ns-red, #bc002d);
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex: 0 0 3.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  height: 3.25rem;
  justify-content: center;
  letter-spacing: 0.04em;
  line-height: 1;
  width: 3.25rem;
}

.ns-byline-initials {
  display: block;
}

.ns-byline-body {
  flex: 1 1 auto;
  min-width: 0;
}

.ns-byline-label {
  color: var(--ns-red, #bc002d);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

.ns-byline-name {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.25rem;
}

.ns-byline-beats {
  color: var(--ns-text, #444444);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0 0 0.5rem;
}

.ns-byline-bio {
  color: var(--ns-text, #444444);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 0.5rem;
}

.ns-byline-disclosure {
  color: var(--ns-text, #666666);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 600px) {
  .ns-byline {
    gap: 0.85rem;
  }

  .ns-byline-avatar {
    flex-basis: 2.75rem;
    font-size: 0.75rem;
    height: 2.75rem;
    width: 2.75rem;
  }

  .ns-byline-name {
    font-size: 1rem;
  }
}
