/* =============================================
   page.css — Generic content/SEO pages (WithDrAI)
   Uses tokens from common.css
   ============================================= */

/* ─── Global dropdown nav (site-nav) ─── */
.site-nav .mobile-menu {
  display: flex;
  align-items: center;
}
.site-nav .nav-links {
  gap: 1.6rem;
}
.nav-item-has-children {
  position: relative;
}
.nav-parent {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}
.nav-caret {
  font-size: 0.6rem;
  transition: transform 0.25s;
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 240px;
  list-style: none;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(39, 61, 82, 0.14);
  padding: 0.6rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 200;
}
.nav-item-has-children:hover .nav-dropdown,
.nav-item-has-children:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(2px);
}
.nav-item-has-children:hover .nav-caret {
  transform: rotate(180deg);
}
.nav-dropdown li {
  list-style: none;
}
.nav-dropdown a {
  display: block;
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-dropdown a::after { display: none; }
.nav-dropdown a:hover {
  background: var(--warm-gray);
  color: var(--navy);
}

/* ─── Breadcrumb (override broad `nav{position:fixed}` from common.css) ─── */
.breadcrumb {
  position: static;
  padding: 0;
  background: transparent;
  z-index: auto;
}
.breadcrumb .container {
  display: block;
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  font-family: 'DM Sans', 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  color: var(--text-light);
}
.breadcrumb li:not(:last-child)::after {
  content: '/';
  margin-left: 0.4rem;
  color: var(--text-light);
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb [aria-current="page"] { color: var(--navy); font-weight: 500; }

/* ─── Page hero ─── */
.page-hero {
  padding: calc(80px + clamp(2rem, 6vw, 4rem)) 0 clamp(1.5rem, 4vw, 2.5rem);
}
.breadcrumb {
  padding-top: calc(80px + 1rem);
}
.page-hero + * { }
/* When breadcrumb precedes hero, hero should not double the top gap */
.breadcrumb + .page-hero {
  padding-top: clamp(1rem, 3vw, 2rem);
}
.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.15;
  margin: 0.4rem 0 1rem;
}
.page-lead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.9;
  font-weight: 300;
  max-width: 760px;
}

/* ─── Content wrapper ─── */
.page-content {
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3rem, 7vw, 5rem);
}
.container-narrow {
  max-width: 820px;
}

/* ─── Prose (Markdown body) ─── */
.prose {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 2;
}
.prose h2 {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin: 2.6rem 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--gold-soft);
}
.prose h3 {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 700;
  color: var(--navy-deep);
  margin: 2rem 0 0.8rem;
}
.prose h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-deep);
  margin: 1.6rem 0 0.6rem;
}
.prose p { margin: 0 0 1.2rem; }
.prose ul, .prose ol { margin: 0 0 1.4rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { color: var(--navy-deep); font-weight: 700; }
.prose a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--coral); }
.prose blockquote {
  margin: 1.6rem 0;
  padding: 1.2rem 1.6rem;
  background: var(--warm-gray);
  border-left: 4px solid var(--coral);
  border-radius: 0 12px 12px 0;
  color: var(--text-primary);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: none; border-top: 1px solid var(--gold-soft); margin: 2.4rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: 0.92rem; }
.prose th, .prose td { border: 1px solid var(--gold-soft); padding: 0.7rem 0.9rem; text-align: left; }
.prose th { background: var(--warm-gray); color: var(--navy); }

/* ─── Company definition table ─── */
.company-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2.5rem;
}
.company-table th, .company-table td {
  border-bottom: 1px solid var(--gold-soft);
  padding: 1rem 0.6rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
  line-height: 1.8;
}
.company-table th {
  width: 30%;
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}
.company-table td { color: var(--text-primary); }

/* ─── Section title (in-content) ─── */
.page-section-title {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 700;
  color: var(--navy);
  margin: 3rem 0 1.4rem;
}

/* ─── FAQ ─── */
.page-faq { margin-top: 1rem; }
.faq-item {
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  margin-bottom: 0.8rem;
  overflow: hidden;
  background: var(--white);
}
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--navy);
}
.faq-icon { font-size: 1.3rem; color: var(--coral); transition: transform 0.3s; flex-shrink: 0; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.3rem;
}
.faq-item.open .faq-answer {
  max-height: 600px;
  padding: 0 1.3rem 1.2rem;
}
.faq-answer p { color: var(--text-secondary); line-height: 1.9; font-size: 0.92rem; }

/* ─── FAQ hub (grouped) ─── */
.faq-group { margin-bottom: 2.5rem; }
.faq-group .page-section-title { margin-top: 1.5rem; }
.faq-source { margin-top: 0.8rem; }
.faq-source a { font-size: 0.82rem; font-weight: 700; color: var(--coral); text-decoration: none; }
.faq-source a:hover { color: var(--navy); }

/* ─── Resources (whitepaper download) ─── */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.resource-card {
  border: 1px solid var(--gold-soft);
  border-radius: 16px;
  padding: 1.6rem;
  margin-bottom: 1.4rem;
  background: var(--white);
}
.resource-info h2 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 0.4rem; }
.resource-info p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 1rem; }
.resource-form { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.resource-form input:not(.hp-field) {
  flex: 1 1 180px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--off-white);
}
.resource-form button { flex: 0 0 auto; }
.resource-message { flex-basis: 100%; font-size: 0.85rem; margin-top: 0.3rem; }
.resource-message.success { color: var(--coral); }
.resource-message.success a { color: var(--navy); font-weight: 700; }
.resource-message.error { color: #C0554F; }
.resource-empty { text-align: center; padding: 2rem 0; }
.resource-empty p { color: var(--text-secondary); line-height: 1.9; margin-bottom: 1.5rem; }

/* ─── Author / 監修 box ─── */
.author-box {
  display: flex;
  gap: 1.2rem;
  margin: 3rem 0 0;
  padding: 1.6rem;
  background: var(--warm-gray);
  border-radius: 16px;
}
.author-avatar {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 700;
}
.author-role {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 0.2rem;
}
.author-name { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.author-name a { color: inherit; text-decoration: none; }
.author-name a:hover { color: var(--coral); }
.author-title { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.6rem; }
.author-creds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin-bottom: 0.8rem;
}
.author-creds li {
  font-size: 0.7rem;
  color: var(--navy-deep);
  background: var(--white);
  border: 1px solid var(--gold-soft);
  border-radius: 100px;
  padding: 0.2rem 0.7rem;
}
.author-bio { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.8; }

/* ─── Related links ─── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.2rem 1.4rem;
  background: var(--white);
  border: 1px solid var(--gold-soft);
  border-radius: 14px;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(39, 61, 82, 0.1);
  border-color: var(--coral-soft);
}
.related-card-title { font-weight: 700; color: var(--navy); font-size: 0.98rem; }
.related-card-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.7; }
.related-card-arrow { color: var(--coral); font-weight: 700; margin-top: 0.2rem; }

/* ─── Column (Note) ─── */
.column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.6rem;
}
.column-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gold-soft);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.column-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(39, 61, 82, 0.12);
  border-color: var(--coral-soft);
}
.column-thumb {
  aspect-ratio: 16 / 9;
  background: var(--warm-gray);
  overflow: hidden;
}
.column-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.column-card-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.column-date { font-family: 'DM Sans', sans-serif; font-size: 0.72rem; color: var(--text-light); letter-spacing: 0.03em; }
.column-card-title { font-size: 1rem; font-weight: 700; color: var(--navy); line-height: 1.55; }
.column-excerpt { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.75; flex: 1; }
.column-readmore { font-size: 0.8rem; font-weight: 700; color: var(--coral); margin-top: 0.2rem; }
.column-fallback { text-align: center; padding: 3rem 0; }
.column-fallback p { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ─── CTA ─── */
.page-cta {
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) 0;
  background: var(--warm-gray);
}
.page-cta h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1rem;
}
.page-cta p {
  max-width: 640px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
  line-height: 1.9;
  font-weight: 400;
  font-size: 0.95rem;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

/* ─── News ─── */
.news-list { max-width: 760px; }
.news-item {
  display: flex;
  gap: 1.4rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--gold-soft);
}
.news-item time {
  flex-shrink: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: var(--text-light);
  padding-top: 0.15rem;
  min-width: 6.5rem;
}
.news-item-body h2 { font-size: 1.02rem; font-weight: 700; color: var(--navy); margin-bottom: 0.4rem; line-height: 1.6; }
.news-item-body p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.8; }
@media (max-width: 600px) {
  .news-item { flex-direction: column; gap: 0.3rem; }
}

/* ─── Global site footer ─── */
.site-footer { background: var(--warm-gray); padding: 4rem 0 2rem; color: var(--text-light); }
.site-footer-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2.4fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(39, 61, 82, 0.08);
  margin-bottom: 2rem;
}
.site-footer .footer-brand img { height: 36px; margin-bottom: 1rem; }
.site-footer .footer-brand p { font-size: 0.8rem; line-height: 1.8; max-width: 320px; color: var(--text-secondary); }
.site-footer-nav {
  position: static;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.6rem;
  padding: 0;
  background: transparent;
  z-index: auto;
}
.site-footer-nav .container { display: block; }
.site-footer-heading { font-size: 0.82rem; font-weight: 700; margin-bottom: 0.7rem; }
.site-footer-heading a { color: var(--navy); text-decoration: none; }
.site-footer-col ul { list-style: none; }
.site-footer-col li { margin-bottom: 0.5rem; }
.site-footer-col a { font-size: 0.78rem; color: var(--text-secondary); text-decoration: none; font-weight: 300; }
.site-footer-col a:hover { color: var(--navy); }
.site-footer .footer-bottom { justify-content: center; }
.site-footer .footer-bottom p { font-size: 0.72rem; font-family: 'DM Sans', sans-serif; letter-spacing: 0.05em; color: var(--text-secondary); }

/* ─── Mobile ─── */
@media (max-width: 900px) {
  .site-footer-top { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  .site-nav .mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .site-nav .mobile-menu.open { display: block; }
  .site-nav .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.5rem 2rem;
  }
  .site-nav .nav-links > li { border-bottom: 1px solid var(--warm-gray); }
  .nav-parent { padding: 0.9rem 0; justify-content: space-between; }
  .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    min-width: 0;
    padding: 0 0 0.6rem 0.8rem;
  }
  .nav-item-has-children:hover .nav-caret { transform: none; }
  .site-nav .nav-cta { display: inline-block; margin-top: 1rem; text-align: center; }
  .author-box { flex-direction: column; }
  .company-table th { width: 38%; }
}
