/* ============================================================
   肌研究ノート — Home page styles
   ============================================================ */

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
/* Decorative pink wash behind the hero content (restored from original design) */
.hero::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -160px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c-pink-tint) 0%, rgba(251, 229, 223, 0) 68%);
  z-index: 0;
  pointer-events: none;
}

/* Hero feature: real <img> with object-fit: cover (Method 2 — robust approach) */
.hero-feature {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.4;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--c-pink-tint2); /* fallback while image loads */
  z-index: 1;
}
.hero-img,
.hero-feature img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
}

/* Hero headline — line-based block layout (no <br>; controlled by .line) */
.hero-h1 .line { display: block; }

@media (max-width: 880px) {
  /* Hide image on tablet/mobile so text fills width;
     ensure no inherited dark color shows through */
  .hero-feature {
    display: none !important;
    background-color: transparent !important;
  }
  /* Hide leftover floating card from original design if accidentally rendered */
  .feature-card { position: static; width: 100%; margin: 16px 0 0; }
}

/* Mobile (smartphone) — subtle gradient background, compact typography,
   ensure h1 + lead + search box all fit comfortably in viewport. */
@media (max-width: 768px) {
  /* Explicit clean background — prevent any "right-half black" leak */
  .hero {
    background-color: #FEFEFE;
    background-image: linear-gradient(180deg, var(--c-pink-tint2) 0%, var(--c-base) 70%);
  }
  .hero::before { display: none; }  /* hide decorative circle on SP */
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-block: clamp(28px, 6vw, 48px);
  }
  /* User-spec: clamp(2rem, 8vw, 3.5rem) → 32–56px responsive */
  .hero-h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    line-height: 1.4;
    margin: 14px 0 0;
    letter-spacing: 0.01em;
    word-break: keep-all;        /* prevent per-character wrap on JP text */
    overflow-wrap: anywhere;
  }
  .hero-h1 .line { display: block; }
  .hero-sub {
    font-size: 14.5px;
    line-height: 1.85;
    margin: 18px 0 22px;
    max-width: 100%;
  }
  .hero-actions { gap: 10px; }
  .hero-search {
    width: 100%;
    min-width: 0;
    padding: 4px 4px 4px 14px;
    flex-wrap: nowrap;
  }
  .hero-search input {
    font-size: 14px;
    min-width: 0;            /* prevent flex blowout */
  }
  .hero-search .btn {
    padding: 9px 14px;
    font-size: 12.5px;
    flex-shrink: 0;
  }
  .hero-trust { gap: 16px; margin-top: 22px; }
  .hero-trust .t b { font-size: 22px; }
}
.hero-inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
  padding-block: clamp(48px, 7vw, 92px); position: relative; z-index: 1;
}
.hero-h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(34px, 5vw, 56px); line-height: 1.42;
  letter-spacing: 0.02em; margin: 22px 0 0; color: var(--c-ink); text-wrap: balance;
}
.hero-h1 .hl {
  background: linear-gradient(transparent 62%, var(--c-pink) 62%);
  padding: 0 2px;
}
.hero-sub {
  font-size: 16px; line-height: 2; color: var(--c-ink-soft);
  margin: 26px 0 32px; max-width: 460px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-search {
  display: flex; align-items: center; gap: 10px; background: var(--c-paper);
  border: 1px solid var(--c-line); border-radius: 99px; padding: 6px 6px 6px 20px;
  box-shadow: var(--shadow-sm); width: min(380px, 100%); cursor: text;
  transition: border-color .25s, box-shadow .25s;
}
.hero-search:hover { border-color: var(--c-pink); box-shadow: var(--shadow-md); }
.hero-search input {
  border: none; outline: none; background: transparent; flex: 1;
  font-family: var(--f-body); font-size: 15px; color: var(--c-ink);
}
.hero-search input::placeholder { color: var(--c-ink-faint); }
.hero-search .btn { padding: 11px 18px; }

.hero-trust { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.hero-trust .t { display: flex; flex-direction: column; }
.hero-trust .t b { font-family: var(--f-display); font-size: 26px; font-weight: 700; color: var(--c-pink-deep); }
.hero-trust .t span { font-family: var(--f-ui); font-size: 11.5px; letter-spacing: .08em; color: var(--c-ink-faint); margin-top: 3px; }

/* featured */
.hero-feature { position: relative; }
.hero-feature .ph { width: 100%; aspect-ratio: 4/4.4; border-radius: 16px; box-shadow: var(--shadow-md); }
.feature-card {
  position: absolute; left: -28px; bottom: 34px; width: 76%;
  background: var(--c-paper); border-radius: 12px; padding: 22px 24px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--c-line-soft);
}
.feature-card .pin { display:inline-flex; align-items:center; gap:6px; font-family:var(--f-ui); font-size:11px; font-weight:600; letter-spacing:.12em; color:var(--c-sage-deep); margin-bottom:10px; white-space:nowrap; }
.feature-card h2 { font-family: var(--f-display); font-weight: 600; font-size: 21px; line-height: 1.5; margin: 0 0 12px; }
.feature-card .more { display:inline-flex; align-items:center; gap:7px; font-family:var(--f-ui); font-size:13px; font-weight:600; color:var(--c-pink-deep); }
.feature-card:hover .more { gap: 11px; }
.feature-card .more svg { transition: transform .25s; }

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-feature { order: -1; }
  .feature-card { position: static; width: 100%; margin-top: -56px; margin-left: auto; margin-right: auto; width: 88%; }
}

/* ---------- Section header ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.sec-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: .03em; margin: 8px 0 0; }
.sec-link { font-family: var(--f-ui); font-size: 13px; font-weight: 600; color: var(--c-sage-deep); display: inline-flex; align-items: center; gap: 7px; }
.sec-link:hover { gap: 11px; color: var(--c-pink-deep); }
.sec-link svg { transition: transform .25s; }

/* ---------- Category tabs ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 34px; }
.tab {
  font-family: var(--f-ui); font-size: 13.5px; font-weight: 500; letter-spacing: .03em;
  padding: 9px 18px; border-radius: 99px; border: 1px solid var(--c-line);
  background: var(--c-paper); color: var(--c-ink-soft); cursor: pointer;
  transition: all .22s;
}
.tab:hover { border-color: var(--c-pink); color: var(--c-pink-deep); }
.tab[data-active="true"] { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }

.empty-state { text-align: center; padding: 60px 0; color: var(--c-ink-faint); font-family: var(--f-ui); }

/* ---------- Category section ---------- */
.cat-band { background: var(--c-sage-tint); }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 820px) { .cat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px) { .cat-grid { grid-template-columns: 1fr; } }
.cat-card {
  position: relative; background: var(--c-paper); border-radius: 12px; padding: 28px 26px;
  border: 1px solid var(--c-line-soft); overflow: hidden; cursor: pointer;
  transition: transform .35s, box-shadow .35s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat-card .num { position: absolute; top: 14px; right: 18px; font-family: var(--f-display); font-size: 44px; font-weight: 700; color: var(--c-sage-tint); line-height: 1; transition: color .3s; }
.cat-card:hover .num { color: var(--c-pink-tint); }
.cat-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--c-pink-tint); display:grid; place-items:center; color: var(--c-pink-deep); margin-bottom: 18px; }
.cat-card h3 { font-family: var(--f-display); font-weight: 600; font-size: 19px; margin: 0 0 8px; }
.cat-card p { font-size: 13px; color: var(--c-ink-soft); line-height: 1.8; margin: 0 0 16px; }
.cat-card .go { font-family: var(--f-ui); font-size: 12.5px; font-weight: 600; color: var(--c-sage-deep); display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Newsletter ---------- */
.nl { background: var(--c-ink); color: #fff; border-radius: 20px; padding: clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.nl::before { content:""; position:absolute; right:-80px; top:-80px; width:320px; height:320px; border-radius:50%; background: rgba(242,169,154,.18); }
.nl::after { content:""; position:absolute; left:-60px; bottom:-90px; width:260px; height:260px; border-radius:50%; background: rgba(123,175,142,.16); }
.nl-inner { position: relative; z-index:1; display:grid; grid-template-columns: 1.2fr 1fr; gap:40px; align-items:center; }
.nl h2 { font-family: var(--f-display); font-weight: 700; font-size: clamp(24px,3.4vw,34px); line-height:1.5; margin: 14px 0 16px; }
.nl p { color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.9; max-width: 460px; }
.nl-form { display:flex; gap:10px; background: rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.18); border-radius:99px; padding:6px 6px 6px 20px; }
.nl-form input { flex:1; background:transparent; border:none; outline:none; color:#fff; font-family:var(--f-body); font-size:15px; }
.nl-form input::placeholder { color: rgba(255,255,255,.5); }
.nl-note { font-family: var(--f-ui); font-size: 11.5px; color: rgba(255,255,255,.5); margin-top: 14px; }
.nl-ok { display:flex; align-items:center; gap:10px; font-family:var(--f-ui); color:var(--c-pink); font-weight:600; }
@media (max-width: 760px){ .nl-inner { grid-template-columns: 1fr; gap:26px; } }

/* ============================================================
   Writer strip (home page) — vertical card layout
   ============================================================ */
.hw-band { background: var(--c-pink-tint2); }
.hw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 767px) {
  .hw-grid { grid-template-columns: 1fr; max-width: 440px; margin-inline: auto; }
}

.hw-card {
  display: flex;
  flex-direction: column;
  background: #FEFEFE;
  border: 0.5px solid var(--c-line);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform .35s, box-shadow .35s, border-color .35s;
}
/* Top accent border that appears on hover */
.hw-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--c-pink);
  opacity: 0;
  transition: opacity .3s;
}
.hw-card[data-tone="sage"]::before { background: var(--c-sage); }
.hw-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-line);
}
.hw-card:hover::before { opacity: 1; }

/* Avatar — 80px circle */
.hw-av {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 30px;
  color: #fff;
  background: linear-gradient(145deg, var(--c-pink) 0%, var(--c-pink-deep) 100%);
  box-shadow: 0 4px 12px rgba(197, 100, 80, .22);
  overflow: hidden;
  margin-bottom: 14px;
}
.hw-card[data-tone="sage"] .hw-av {
  background: linear-gradient(145deg, var(--c-sage) 0%, var(--c-sage-deep) 100%);
  box-shadow: 0 4px 12px rgba(76, 131, 102, .22);
}
.hw-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* Name + handle row */
.hw-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--c-ink);
  margin: 0;
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.hw-handle {
  font-family: var(--f-ui);
  font-size: 11px;
  color: var(--c-ink-faint);
  font-weight: 400;
  letter-spacing: .02em;
}

/* Credentials badge (chip-style) */
.hw-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  background: var(--c-sage-tint);
  color: var(--c-sage-deep);
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 11px;
  border-radius: 99px;
  margin-top: 10px;
  white-space: nowrap;
}
.hw-card[data-tone="pink"] .hw-badge {
  background: var(--c-pink-tint);
  color: var(--c-pink-deep);
}

/* Specialty list */
.hw-spec {
  font-family: var(--f-ui);
  font-size: 12.5px;
  color: var(--c-ink-soft);
  margin-top: 12px;
  line-height: 1.5;
  letter-spacing: .02em;
}

/* Short description */
.hw-short {
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-ink-soft);
  margin: 12px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1; /* push CTA down */
}

/* CTA link at the bottom */
.hw-cta {
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-pink-deep);
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .25s;
}
.hw-card[data-tone="sage"] .hw-cta { color: var(--c-sage-deep); }
.hw-card:hover .hw-cta { gap: 10px; }
.hw-cta svg { transition: transform .25s; }
.hw-card:hover .hw-cta svg { transform: translateX(2px); }

/* ============================================================
   Archive headers — author hero + category/tag sec-head
   ============================================================ */

/* Author archive hero (reuses .w-hero scaffold from writers.css) */
.archive-author-hero {
    background: linear-gradient(180deg, var(--c-pink-tint, #FBE5DF) 0%, var(--c-paper, #FEFEFE) 100%);
}
.archive-author-av {
    width: 96px;
    height: 96px;
    margin: 22px auto 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--c-paper, #fff);
    box-shadow: 0 4px 18px rgba(26, 26, 26, 0.08);
    display: grid;
    place-items: center;
}
.archive-author-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.archive-author-role {
    font-family: var(--f-ui);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--c-pink-deep, #C97A6A);
    margin: 14px 0 0;
}
.archive-author-meta {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    margin-top: 26px;
    flex-wrap: wrap;
    justify-content: center;
}
.archive-author-count {
    font-family: var(--f-ui);
    font-size: 12.5px;
    color: var(--c-ink-soft, #5B5B5B);
    letter-spacing: .04em;
}
.archive-author-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--f-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--c-pink-deep, #C97A6A);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
}
.archive-author-link:hover { opacity: .75; }

/* Category / tag archive header (sec-head extension) */
.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.archive-header .archive-desc {
    font-size: 14.5px;
    line-height: 1.95;
    color: var(--c-ink-soft, #5B5B5B);
    margin: 14px 0 0;
    max-width: 680px;
}
.archive-header .archive-count {
    font-family: var(--f-ui);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--c-ink-soft, #5B5B5B);
    background: var(--c-paper, #fff);
    border: 1px solid var(--c-line, #E6E2DC);
    border-radius: 999px;
    padding: 8px 14px;
}

@media (max-width: 600px) {
    .archive-header { flex-direction: column; align-items: flex-start; }
    .archive-author-meta { gap: 12px; }
}
