/* ==========================================================================
   SARASA Journal on Substack — light theme
   ========================================================================== */

.sj {
  overflow: visible;
  --sj-bg: #ffffff;
  --sj-fg: #111111;
  --sj-muted: #6b6b6b;
  --sj-accent: #b8860b;      /* gold, for tags & links */
  --sj-orange: #ff6719;      /* Substack brand */
  --sj-line: rgba(17,17,17,.12);
  --sj-btn-bg: #f4f2ee;

  background: var(--sj-bg);
  color: var(--sj-fg);
  padding: clamp(56px, 8vw, 112px) clamp(20px, 5vw, 64px);
}

/* --- reset theme link styles inside this section --- */
.sj a,
.sj a:hover,
.sj a:focus,
.sj a:visited {
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  color: inherit;
}

/* ---- Head / Brand ---- */
.sj__head { margin-bottom: clamp(36px, 5vw, 60px); }

.sj__brand { display: flex; align-items: center; gap: 18px; }
.sj__brand { transition: opacity .25s ease; }
.sj__brand:hover { opacity: .78; }

.sj__avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--sj-line);
  flex-shrink: 0;
}

.sj__title {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 4px;
  font-size: clamp(24px, 3.6vw, 44px);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.15;
  color: var(--sj-fg);
}
.sj__titlebrand {
  display: inline-flex; align-items: center; gap: 6px;
  letter-spacing: -.01em;
  text-transform: lowercase;
}
.sj__logo {
  width: .78em; height: .78em;
  fill: var(--sj-orange);
  flex-shrink: 0;
}
.sj__handle {
  margin: 0;
  font-size: 12px; letter-spacing: .14em; color: var(--sj-muted);
}

.sj__lead {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--sj-muted);
  font-size: 14px; line-height: 1.9;
}

/* ---- Cards ---- */
.sj__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
}
@media (max-width: 900px) { .sj__grid { grid-template-columns: 1fr; } }

.sj__card {
  display: block;
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.sj__card:hover { transform: translateY(-4px); }

.sj__thumb {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--sj-btn-bg);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.sj__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 30%;
  transition: transform .6s cubic-bezier(.2,.7,.3,1);
}
.sj__card:hover .sj__thumb img { transform: scale(1.05); }
.sj__thumb-fallback {
  color: var(--sj-muted); letter-spacing: .3em; font-size: 12px;
}

.sj__body { padding-top: 18px; display: flex; flex-direction: column; }
.sj__meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; letter-spacing: .14em; color: var(--sj-muted);
  margin-bottom: 10px;
}
.sj__tag { color: var(--sj-accent); }

.sj .sj__cardtitle {
  font-size: clamp(17px, 1.4vw, 21px) !important;
  line-height: 1.45 !important;
  font-weight: 600 !important;
  margin: 0 0 10px !important;
  color: var(--sj-fg) !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  /* 2行で固定：はみ出しても抜粋に被らない */
  height: calc(1.45em * 2) !important;
  max-height: calc(1.45em * 2) !important;
}
.sj .sj__excerpt {
  font-size: 13px !important;
  line-height: 1.85 !important;
  color: var(--sj-muted) !important;
  margin: 0 0 14px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.sj__more {
  font-size: 12px; letter-spacing: .12em;
  color: var(--sj-accent) !important;
}

/* ---- Sections: top 2 / bottom 3 ---- */
.sj__sections {
  margin: clamp(24px, 3vw, 36px) 0 clamp(48px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) { .sj__sections { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .sj__sections { grid-template-columns: repeat(2, 1fr); } }

.sj__btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 64px;
  padding: 0 12px;
  background: var(--sj-btn-bg);
  border: 1px solid var(--sj-line);
  border-radius: 10px;
  color: var(--sj-fg) !important;
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 500;
  letter-spacing: .12em;
  text-align: center;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.sj__btn:hover {
  background: var(--sj-fg);
  border-color: var(--sj-fg);
  color: #ffffff !important;
}

/* ---- CTA ---- */
.sj__cta {
  margin-top: clamp(32px, 4vw, 48px);
  padding: 4px 4px 40px;
  text-align: center;
  line-height: 1;
  overflow: visible;
}
.sj__ctabtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  min-height: 54px;
  padding: 0 44px;
  border: 1px solid var(--sj-fg);
  border-radius: 999px;
  color: var(--sj-fg) !important;
  font-size: 13px;
  line-height: 1;
  letter-spacing: .18em;
  white-space: nowrap;
  margin: 4px 0;
  overflow: visible;
  transition: background .3s ease, color .3s ease;
}
.sj__ctabtn .sj__logo { width: 15px; height: 15px; }
.sj__ctabtn:hover { background: var(--sj-fg); color: #ffffff !important; }

.sj__empty { color: var(--sj-muted); }


/* --- safeguard: prevent parent clipping --- */
.sj, .sj * { overflow: visible; }
.sj__thumb { overflow: hidden; }
.elementor-widget-shortcode .sj { overflow: visible; }


/* lead inline link (HERE) */
.sj__lead a {
  color: var(--sj-accent) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}
.sj__lead a:hover { opacity: .8; }
