/* ==========================================================================
   n1-free-pdf.css
   Fully self-contained styles for the "Free Study Material" PDF component.
   Loaded ONLY on the N1 Reading pages (page-id-516 JA / page-id-342 EN),
   AFTER the jlptc-child theme's own stylesheet (see functions.php snippet).

   Deliberately does NOT reuse any shared LP classes (.container,
   .btn-primary, .serif, .eyebrow, etc.) and does NOT rely on custom
   properties defined elsewhere, so it renders identically regardless of
   what the rest of the page's CSS does. Every rule below is scoped under
   .n1pdf / .n1pdf-modal — nothing here can leak onto the rest of the site.
   ========================================================================== */

/* ── Component-scoped reset (NOT "all: revert") ──
   Only resets box model, heading/paragraph spacing, list markers, and
   link underlines within this component. Form controls, buttons, and
   images are left alone here and styled explicitly below instead. */
.n1pdf,
.n1pdf *,
.n1pdf *::before,
.n1pdf *::after,
.n1pdf-modal,
.n1pdf-modal *,
.n1pdf-modal *::before,
.n1pdf-modal *::after {
  box-sizing: border-box;
}
.n1pdf :where(h1, h2, h3, h4, p, ul, ol, li),
.n1pdf-modal :where(h1, h2, h3, h4, p, ul, ol, li) {
  margin: 0;
  padding: 0;
  border: 0;
}
.n1pdf :where(ul, ol),
.n1pdf-modal :where(ul, ol) {
  list-style: none;
}
.n1pdf a,
.n1pdf-modal a {
  text-decoration: none;
}
.n1pdf img,
.n1pdf svg {
  display: block;
  max-width: 100%;
}

/* ── Design tokens (local to this component only) ── */
.n1pdf {
  --n1pdf-teal: #154D57;
  --n1pdf-teal-mid: #1e6a77;
  --n1pdf-mint: #bdeee0;
  --n1pdf-mint-pill: #d9f2e9;
  --n1pdf-text: #2a2a2a;
  --n1pdf-text-mid: #5a5a5a;
  --n1pdf-text-light: #8a8a8a;
  --n1pdf-line: #e2ddd7;
  --n1pdf-ff-body: "DM Sans", "Noto Sans JP", sans-serif;
  --n1pdf-ff-serif: "Cormorant Garamond", "Noto Serif JP", serif;
}

/* ── Section shell ── */
.n1pdf {
  position: relative;
  overflow: hidden;
  background: var(--n1pdf-teal);
  padding: 72px 24px;
  font-family: var(--n1pdf-ff-body);
}
.n1pdf__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}
.n1pdf__glow--a { width: 420px; height: 420px; background: rgba(255,255,255,0.07); top: -160px; left: -120px; }
.n1pdf__glow--b { width: 320px; height: 320px; background: rgba(255,255,255,0.06); bottom: -140px; right: 10%; }

.n1pdf__inner {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
}

/* ── Main two-column area ── */
.n1pdf__main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 56px;
  align-items: center;
  margin-bottom: 20px;
}

.n1pdf__badge {
  display: inline-block;
  background: var(--n1pdf-mint-pill);
  color: var(--n1pdf-teal);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
}

.n1pdf__title {
  display: block;
  color: #fff;
  font-family: var(--n1pdf-ff-body);
  font-weight: 700;
  font-size: clamp(2.3rem, 3.6vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 20px 0 16px;
}
.n1pdf__title-accent {
  color: var(--n1pdf-mint);
  white-space: nowrap;
}

.n1pdf__description {
  display: block;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  line-height: 1.85;
  margin: 0 0 28px;
  max-width: 480px;
}

.n1pdf__download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--n1pdf-teal);
  font-family: var(--n1pdf-ff-body);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 19px 34px;
  border-radius: 50px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.n1pdf__download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
}
.n1pdf__icon { flex-shrink: 0; }

.n1pdf__note {
  display: block;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  margin-top: 16px;
}

.n1pdf__cover {
  display: flex;
  justify-content: center;
  position: relative;
  padding-bottom: 24px;
}
.n1pdf__cover::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100%, 320px);
  aspect-ratio: 700 / 989;
  background: #fdfbf8;
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.16);
  z-index: 1;
  transform: translate(-50%, calc(-50% - 12px)) rotate(-5deg) translateX(-16px);
}
.n1pdf__cover img {
  position: relative;
  z-index: 2;
  width: min(100%, 320px);
  height: auto;
  border-radius: 14px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.25);
  transform: rotate(-2deg);
}

/* ── Live Walkthrough card ── */
.n1pdf__live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  background: #fff;
  border-radius: 18px;
  padding: 28px 34px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}
.n1pdf__live-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 320px;
  min-width: 260px;
}
.n1pdf__live-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(21,77,87,0.08);
  color: var(--n1pdf-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.n1pdf__live-title {
  display: block;
  font-family: var(--n1pdf-ff-body);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--n1pdf-text);
  margin: 0 0 4px;
}
.n1pdf__live-desc {
  display: block;
  font-family: var(--n1pdf-ff-body);
  color: var(--n1pdf-text-mid);
  font-size: 0.86rem;
  line-height: 1.6;
}
.n1pdf__live-schedule {
  display: block;
  font-family: var(--n1pdf-ff-body);
  color: var(--n1pdf-text);
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.6;
  margin-top: 12px;
}
.n1pdf__live-meta {
  display: block;
  font-family: var(--n1pdf-ff-body);
  color: var(--n1pdf-text-light);
  font-size: 0.8rem;
  margin-top: 4px;
}
.n1pdf__live-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  text-align: right;
}
.n1pdf__live-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--n1pdf-teal);
  color: #fff;
  font-family: var(--n1pdf-ff-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 40px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.n1pdf__live-btn:hover { opacity: 0.9; }
.n1pdf__live-caption {
  font-family: var(--n1pdf-ff-body);
  font-size: 0.78rem;
  color: var(--n1pdf-text-light);
}

/* ── Responsive (PC completed first — this is the follow-up pass) ── */
@media (max-width: 900px) {
  .n1pdf__main { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .n1pdf__description { margin-left: auto; margin-right: auto; }
  .n1pdf__cover { order: 2; }
  .n1pdf__cover { padding-bottom: 16px; }
  .n1pdf__cover img { max-width: 230px; margin: 0 auto; transform: rotate(-1deg); }
  .n1pdf__cover::before { width: min(100%, 230px); transform: translate(-50%, calc(-50% - 8px)) rotate(-4deg) translateX(-12px); }
  .n1pdf__live { flex-direction: column; justify-content: flex-start; align-items: center; gap: 20px; text-align: center; max-width: 480px; margin: 0 auto; }
  .n1pdf__live-main { flex-direction: column; flex: 1 1 auto; min-width: 0; text-align: center; }
  .n1pdf__live-action { align-items: center; text-align: center; width: 100%; }
}
@media (max-width: 480px) {
  .n1pdf { padding: 56px 20px; }
  .n1pdf__download,
  .n1pdf__live-btn { display: flex; width: 100%; justify-content: center; box-sizing: border-box; }
}

/* ==========================================================================
   Shared modal (email capture → download / live-session booking)
   ========================================================================== */
.n1pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--n1pdf-ff-body, "DM Sans", "Noto Sans JP", sans-serif);
}
.n1pdf-modal.is-open { display: flex; }
.n1pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,30,30,0.55);
}
.n1pdf-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 40px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
  color: #2a2a2a;
}
.n1pdf-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #8a8a8a;
  cursor: pointer;
}
.n1pdf-modal__close:hover { color: #154D57; }
.n1pdf-modal__eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #154D57;
  margin: 0 0 10px;
}
.n1pdf-modal__title {
  display: block;
  font-family: "Cormorant Garamond", "Noto Serif JP", serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: #2a2a2a;
  margin: 0 0 10px;
}
.n1pdf-modal__text {
  display: block;
  color: #5a5a5a;
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0 0 20px;
}
.n1pdf-modal__download {
  display: inline-block;
  background: #c45c3e;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 16px 40px;
  border-radius: 50px;
  text-align: center;
}
.n1pdf-modal__secondary {
  font-size: 0.8rem;
  color: #8a8a8a;
  margin-top: 20px;
}
.n1pdf-modal__secondary-link {
  color: #154D57;
  font-weight: 600;
}

/* CF7 form controls inside this modal only */
.n1pdf-modal .wpcf7-form-control-wrap { display: block; margin-bottom: 14px; }
.n1pdf-modal input[type="email"],
.n1pdf-modal input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 1px solid #e2ddd7;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #2a2a2a;
}
.n1pdf-modal input[type="submit"] {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 40px;
  background: #154D57;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 4px;
  font-family: var(--n1pdf-ff-body, "DM Sans", "Noto Sans JP", sans-serif);
}
.n1pdf-modal input[type="submit"]:hover { opacity: 0.9; }
.n1pdf-modal label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: #8a8a8a;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .n1pdf-modal__dialog { padding: 32px 22px; border-radius: 16px; }
}