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

/* ===== Design Tokens ===== */
:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --header: #111111;
  --accent: #E8003D;
  --text: #1A1A1A;
  --text-sub: #5A5A5A;
  --text-muted: #9A9A9A;
  --border: #E2E0DA;
  --border-hover: #E8003D;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 10px 28px rgba(0,0,0,0.13);
  --radius: 5px;
}

/* ===== Base ===== */
body {
  font-family: "Noto Sans JP", "Hiragino Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
header {
  background: var(--header);
  padding: 0 20px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 0 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--accent);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 6px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(232, 0, 61, 0.12);
  border: 1px solid rgba(232, 0, 61, 0.28);
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.logo-link:hover .logo-icon {
  background: rgba(232, 0, 61, 0.22);
}

.header-brand h1 {
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
  transform: scaleY(1.18);
  transform-origin: left center;
  display: inline-block;
}

h1 .accent,
.footer-brand .accent {
  color: var(--accent);
}

.tagline {
  font-size: 0.73rem;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.06em;
}

.updated-at {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-bottom: 2px;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* ===== Language Toggle ===== */
.lang-toggle {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.lang-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: "Syne", sans-serif;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.lang-btn + .lang-btn {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ===== Main ===== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 20px 64px;
}

/* ===== Section ===== */
section {
  margin-bottom: 60px;
}

section h2 {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

section h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sec-badge {
  display: inline-block;
  padding: 3px 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  border-radius: 2px;
  font-family: "Syne", sans-serif;
}

.sec-badge.new {
  background: #1A1A1A;
}

.sec-badge.all {
  background: #6B6B6B;
}

.sec-badge.rakuten {
  background: #BF0000;
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* ===== Card entrance animation ===== */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Card ===== */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.15s ease;
  animation: cardIn 0.38s ease both;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}

.card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Card image */
.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.card-no-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #EFEDE8, #E4E0D8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C8C4BC;
  font-size: 1.8rem;
}

/* Card body */
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.description {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.8;
  flex: 1;
  margin-bottom: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 8px;
}

.posted-at {
  font-size: 0.66rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.link-btn {
  display: inline-block;
  padding: 4px 11px;
  background: var(--accent);
  color: #fff;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: opacity 0.14s;
}

.card:hover .link-btn {
  opacity: 0.88;
}

/* ===== Affiliate Buttons ===== */
.aff-links {
  display: flex;
  gap: 6px;
  padding: 0 16px 14px;
  flex-wrap: wrap;
}

.aff-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.14s;
}

.aff-btn:hover { opacity: 0.82; }

.aff-btn.amazon {
  background: #FF9900;
  color: #111;
}

.aff-btn.rakuten {
  background: #BF0000;
  color: #fff;
}

/* ===== Ad Card ===== */
.ad-card.ad-card-embed {
  overflow: hidden;
  padding: 10px;
  text-align: center;
}

.embed-wrap {
  text-align: center;
  margin-top: 6px;
}

.embed-wrap a {
  display: inline-block;
}

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

.ad-card {
  background: #FFFCF2;
  border: 1px solid #EDE4C0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ad-card > a {
  display: block;
  padding: 13px 15px 15px;
  text-decoration: none;
  color: inherit;
}

.ad-label {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  color: #907010;
  background: #FFF3B0;
  border: 1px solid #E8D870;
  border-radius: 2px;
  padding: 1px 5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ad-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 10px;
}

.ad-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.shop-btn {
  display: inline-block;
  padding: 4px 12px;
  background: #BF0000;
  color: #fff;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 700;
}

.shop-btn.yahoo {
  background: #FF0033;
}

.shop-btn.amazon {
  background: #FF9900;
  color: #111;
}

/* ===== Work Filter ===== */
.work-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
  white-space: nowrap;
}

.filter-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-count {
  font-size: 0.68rem;
  opacity: 0.7;
}

.filter-active-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.filter-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
  font-family: "Noto Sans JP", sans-serif;
  transition: border-color 0.14s, color 0.14s;
}

.filter-clear:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== States ===== */
.loading,
.empty {
  color: var(--text-muted);
  font-size: 0.86rem;
  padding: 12px 0;
}

/* ===== Load More ===== */
.load-more-btn {
  display: block;
  margin: 36px auto 0;
  padding: 13px 52px;
  background: var(--header);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s;
}

.load-more-btn:hover {
  background: var(--accent);
}

/* ===== Footer ===== */
footer {
  background: var(--header);
  color: rgba(255, 255, 255, 0.32);
  text-align: center;
  padding: 28px 20px 32px;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.footer-brand {
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

footer p + p {
  margin-top: 4px;
}

/* ===== Section Header Row ===== */
.section-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.section-header-row h2 {
  flex: 1;
  margin-bottom: 0;
}

/* ===== View Toggle ===== */
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.view-btn {
  background: var(--surface);
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, color 0.14s;
}

.view-btn + .view-btn {
  border-left: 1px solid var(--border);
}

.view-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.view-btn.active {
  background: var(--header);
  color: #fff;
}

/* ===== List Mode ===== */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.list-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: cardIn 0.38s ease both;
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}

.list-row:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.list-row > a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
}

.list-row-body {
  flex: 1;
  min-width: 0;
}

.list-row .product-name {
  -webkit-line-clamp: 1;
  margin-bottom: 4px;
}

.list-row .description {
  -webkit-line-clamp: 1;
  margin-bottom: 0;
  font-size: 0.76rem;
}

.list-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.list-row .aff-links {
  padding: 0 16px 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: -2px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .header-brand h1 { font-size: 1.6rem; }
  .tagline { display: none; }
  .updated-at { display: none; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  main { padding: 28px 14px 48px; }
  .lang-btn { padding: 4px 8px; font-size: 0.62rem; }
}
