/*
Theme Name: Tanda Lab
Theme URI: https://tandalab.xsrv.jp/
Author: Tanda Laboratory
Description: A lightweight, editable WordPress theme for the Cognitive Psychology Laboratory. Uses the laboratory logo colors and a spacious card-based layout.
Version: 2.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tanda-lab
*/

:root {
  --lab-cyan: #65cfe7;
  --lab-cyan-deep: #159eb9;
  --lab-orange: #ebaf59;
  --lab-orange-deep: #d58b2f;
  --lab-charcoal: #5e5e5e;
  --lab-ink: #20282b;
  --lab-muted: #687579;
  --lab-paper: #f7f6f1;
  --lab-white: #ffffff;
  --lab-line: rgba(32, 40, 43, 0.12);
  --lab-shadow: 0 18px 50px rgba(35, 52, 57, 0.10);
  --lab-radius: 24px;
  --lab-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--lab-paper);
  color: var(--lab-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }
a { color: var(--lab-cyan-deep); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--lab-orange-deep); }
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }

.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px;
  margin: -1px; overflow: hidden; padding: 0; position: absolute!important; width: 1px; word-wrap: normal!important;
}
.screen-reader-text:focus {
  background: #fff; clip: auto!important; clip-path: none; color: #111; display: block;
  height: auto; left: 8px; padding: 12px 16px; top: 8px; width: auto; z-index: 100000;
}

.lab-container { width: min(calc(100% - 40px), var(--lab-width)); margin-inline: auto; }
.site-main { min-height: 60vh; overflow: hidden; }

.site-topbar {
  background: var(--lab-ink); color: rgba(255,255,255,.74); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
}
.site-topbar .lab-container { padding-block: 7px; }
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(247,246,241,.94);
  border-bottom: 1px solid var(--lab-line); backdrop-filter: blur(16px);
}
.header-inner { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.site-branding { flex: 0 1 490px; }
.site-branding a { display: inline-flex; align-items: center; text-decoration: none; }
.site-branding img { display: block; width: min(100%, 470px); max-height: 74px; object-fit: contain; object-position: left center; }
.site-title-text { font-size: 22px; font-weight: 800; color: var(--lab-ink); }

.primary-menu { list-style: none; display: flex; align-items: center; gap: 28px; margin: 0; padding: 0; }
.primary-menu a {
  position: relative; color: var(--lab-ink); font-size: 13px; font-weight: 800;
  letter-spacing: .1em; text-decoration: none; text-transform: uppercase; padding-block: 8px;
}
.primary-menu a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 3px;
  border-radius: 3px; background: linear-gradient(90deg,var(--lab-cyan),var(--lab-orange)); transition: right .25s ease;
}
.primary-menu a:hover::after, .primary-menu .current-menu-item > a::after, .primary-menu .current_page_item > a::after { right: 0; }
.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--lab-line); border-radius: 50%;
  background: #fff; align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle-lines, .nav-toggle-lines::before, .nav-toggle-lines::after {
  display: block; width: 19px; height: 2px; background: var(--lab-ink); border-radius: 2px; transition: .2s ease;
}
.nav-toggle-lines { position: relative; }
.nav-toggle-lines::before, .nav-toggle-lines::after { content: ""; position: absolute; left: 0; }
.nav-toggle-lines::before { top: -6px; }
.nav-toggle-lines::after { top: 6px; }
.nav-open .nav-toggle-lines { background: transparent; }
.nav-open .nav-toggle-lines::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle-lines::after { top: 0; transform: rotate(-45deg); }

/* Common Gutenberg widths */
.entry-content > :where(*:not(.alignfull):not(.alignwide)), .page-content > :where(*:not(.alignfull):not(.alignwide)) {
  width: min(calc(100% - 40px), 900px); margin-left: auto; margin-right: auto;
}
.entry-content > .alignwide, .page-content > .alignwide { width: min(calc(100% - 40px), var(--lab-width)); margin-left: auto; margin-right: auto; }
.entry-content > .alignfull, .page-content > .alignfull { width: 100%; margin-left: auto; margin-right: auto; }
.entry-content > * + *, .page-content > * + * { margin-top: 1.5rem; }
.entry-content { padding-bottom: 110px; }
.entry-content h2, .entry-content h3 { line-height: 1.3; letter-spacing: -.025em; }
.entry-content h2 { margin-top: 3.2em; font-size: clamp(30px,4vw,48px); }
.entry-content h3 { margin-top: 2.3em; font-size: clamp(22px,2.4vw,30px); }
.entry-content p { color: #39474b; }
.entry-content ul { padding-left: 1.3em; }

.lab-hero {
  position: relative; isolation: isolate; min-height: 690px; display: grid; align-items: center;
  padding: 90px 0 100px; background:
    radial-gradient(circle at 87% 22%, rgba(101,207,231,.38) 0 11%, transparent 11.3%),
    radial-gradient(circle at 75% 65%, rgba(235,175,89,.35) 0 17%, transparent 17.3%),
    linear-gradient(135deg, #fff 0 58%, #eef8fa 58% 72%, #fff7ec 72% 100%);
  border-bottom: 1px solid var(--lab-line); overflow: hidden;
}
.lab-hero::before, .lab-hero::after { content: ""; position: absolute; z-index: -1; border: 2px solid rgba(32,40,43,.10); transform: rotate(14deg); }
.lab-hero::before { width: 330px; height: 330px; border-radius: 50%; right: 8%; top: 20%; }
.lab-hero::after { width: 160px; height: 260px; right: 23%; top: 46%; border-radius: 80px; }
.lab-hero-inner { width: min(calc(100% - 40px), var(--lab-width)); margin: 0 auto; position: relative; }
.lab-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 24px; color: var(--lab-charcoal);
  font-size: 12px; font-weight: 900; letter-spacing: .21em; text-transform: uppercase;
}
.lab-eyebrow::before { content: ""; width: 34px; height: 4px; border-radius: 4px; background: linear-gradient(90deg,var(--lab-cyan),var(--lab-orange)); }
.lab-hero h1 { max-width: 850px; margin: 0; font-size: clamp(48px,8.2vw,104px); line-height: .98; letter-spacing: -.065em; font-weight: 900; }
.lab-hero h1 em { color: var(--lab-cyan-deep); font-style: normal; }
.lab-hero h1 strong { color: var(--lab-orange-deep); font-weight: 900; }
.lab-hero-lead { max-width: 690px; margin: 34px 0 0; color: #435256; font-size: clamp(17px,2vw,21px); line-height: 1.9; }
.lab-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.lab-button, .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 13px 24px;
  border: 1px solid var(--lab-ink); border-radius: 999px; background: var(--lab-ink); color: #fff!important;
  font-size: 14px; font-weight: 800; letter-spacing: .04em; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s;
}
.lab-button:hover, .wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(32,40,43,.16); background: var(--lab-cyan-deep); }
.lab-button.is-outline, .is-style-outline > .wp-block-button__link { background: rgba(255,255,255,.64); color: var(--lab-ink)!important; }
.lab-button.is-outline:hover, .is-style-outline > .wp-block-button__link:hover { background: #fff; }

.lab-section { padding: 105px 0; }
.lab-section.is-white { background: #fff; }
.lab-section.is-dark { background: var(--lab-ink); color: #fff; }
.lab-section-head { width: min(calc(100% - 40px), var(--lab-width)); margin: 0 auto 48px; display: grid; grid-template-columns: .55fr 1.45fr; gap: 60px; align-items: end; }
.lab-section-number { color: var(--lab-cyan-deep); font-size: 12px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }
.lab-section-title { margin: 0; font-size: clamp(34px,5vw,62px); line-height: 1.05; letter-spacing: -.045em; }
.lab-section-intro { margin: 16px 0 0; color: var(--lab-muted); max-width: 680px; }
.lab-section.is-dark .lab-section-intro { color: rgba(255,255,255,.70); }

.lab-grid { width: min(calc(100% - 40px), var(--lab-width)); margin: 0 auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.lab-card {
  position: relative; min-height: 310px; padding: 30px; border: 1px solid var(--lab-line); border-radius: var(--lab-radius);
  background: rgba(255,255,255,.88); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.lab-card:hover { transform: translateY(-6px); box-shadow: var(--lab-shadow); border-color: rgba(21,158,185,.35); }
.lab-card::after { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%; right: -50px; bottom: -55px; background: rgba(101,207,231,.18); }
.lab-card:nth-child(2n)::after { background: rgba(235,175,89,.20); }
.lab-card-kicker { margin: 0 0 52px; color: var(--lab-cyan-deep); font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.lab-card h3 { margin: 0 0 16px!important; font-size: 27px!important; line-height: 1.25; }
.lab-card p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--lab-muted); }
.lab-card-link { position: absolute; inset: 0; z-index: 3; }
.lab-card-arrow { position: absolute; right: 24px; top: 24px; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: var(--lab-ink); color: #fff; }

.lab-band { width: min(calc(100% - 40px), var(--lab-width)); margin: 0 auto; border-radius: 32px; overflow: hidden; display: grid; grid-template-columns: repeat(3,1fr); box-shadow: var(--lab-shadow); }
.lab-band-item { min-height: 190px; padding: 32px; background: var(--lab-cyan); }
.lab-band-item:nth-child(2) { background: var(--lab-orange); }
.lab-band-item:nth-child(3) { background: var(--lab-charcoal); color: #fff; }
.lab-band-label { display: block; margin-bottom: 45px; font-size: 11px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; opacity: .72; }
.lab-band-item strong { display: block; font-size: 23px; line-height: 1.35; }

.page-hero { padding: 82px 0 70px; background: linear-gradient(120deg,#fff 0 72%,rgba(101,207,231,.22) 72% 86%,rgba(235,175,89,.24) 86%); border-bottom: 1px solid var(--lab-line); }
.page-hero .lab-container { position: relative; }
.page-hero-kicker { color: var(--lab-cyan-deep); font-size: 12px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }
.page-hero h1 { margin: 12px 0 0; font-size: clamp(48px,7vw,88px); line-height: 1; letter-spacing: -.055em; }
.page-hero h1::after { content: "."; color: var(--lab-orange); }

.lab-profile { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; padding: 34px; border-radius: var(--lab-radius); background: #fff; border: 1px solid var(--lab-line); }
.lab-profile-visual { aspect-ratio: 1; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(145deg,rgba(101,207,231,.30),rgba(235,175,89,.26)); font-size: 52px; font-weight: 900; color: var(--lab-charcoal); }
.lab-profile h2 { margin-top: 0!important; }
.lab-meta { color: var(--lab-cyan-deep); font-weight: 800; }
.lab-list-card { padding: 28px 30px; background: #fff; border: 1px solid var(--lab-line); border-radius: 18px; }
.lab-list-card h3 { margin-top: 0!important; }


/* C.V. and researchmap data */
.lab-cv-list {
  width: min(calc(100% - 40px), 980px); margin: 0 auto; padding: 0; list-style: none;
  counter-reset: lab-citation; display: grid; gap: 14px;
}
.lab-citation {
  counter-increment: lab-citation; position: relative; padding: 22px 24px 22px 70px;
  border: 1px solid var(--lab-line); border-radius: 18px; background: #fff;
  color: #344247; line-height: 1.85; overflow-wrap: anywhere;
}
.lab-citation::before {
  content: counter(lab-citation, decimal-leading-zero); position: absolute; left: 22px; top: 22px;
  color: var(--lab-cyan-deep); font-size: 12px; font-weight: 900; letter-spacing: .08em;
}
.lab-citation em { color: var(--lab-ink); }
.lab-citation a { font-size: .92em; }
.lab-data-note, .lab-source-note {
  width: min(calc(100% - 40px), 980px); margin-left: auto!important; margin-right: auto!important;
  padding: 15px 18px; border-left: 4px solid var(--lab-orange); border-radius: 0 12px 12px 0;
  background: rgba(235,175,89,.10); color: var(--lab-muted); font-size: 14px;
}
.lab-timeline {
  width: min(calc(100% - 40px), 980px); margin: 0 auto; position: relative; display: grid; gap: 0;
}
.lab-timeline::before {
  content: ""; position: absolute; left: 185px; top: 10px; bottom: 10px; width: 1px; background: var(--lab-line);
}
.lab-timeline-item {
  position: relative; display: grid; grid-template-columns: 160px 1fr; gap: 50px; padding: 22px 0;
}
.lab-timeline-item::before {
  content: ""; position: absolute; left: 179px; top: 31px; width: 13px; height: 13px;
  border: 3px solid var(--lab-paper); border-radius: 50%; background: var(--lab-cyan-deep); box-shadow: 0 0 0 1px rgba(21,158,185,.22);
}
.lab-timeline-item:nth-child(2n)::before { background: var(--lab-orange-deep); }
.lab-timeline-date { padding-top: 4px; color: var(--lab-muted); font-size: 13px; font-weight: 800; text-align: right; }
.lab-timeline-body { padding: 20px 24px; border: 1px solid var(--lab-line); border-radius: 18px; background: #fff; }
.lab-timeline-body h3 { margin: 0!important; font-size: 20px!important; }
.lab-timeline-body p { margin: 7px 0 0; }

.lab-contact-box { position: relative; padding: clamp(30px,6vw,64px); border-radius: 32px; background: var(--lab-ink); color: #fff; overflow: hidden; }
.lab-contact-box::after { content: ""; position: absolute; width: 270px; height: 270px; border-radius: 50%; right: -70px; bottom: -110px; background: linear-gradient(135deg,var(--lab-cyan),var(--lab-orange)); opacity: .75; }
.lab-contact-box h2 { margin-top: 0!important; color: #fff; }
.lab-contact-box p { color: rgba(255,255,255,.72); max-width: 720px; }
.lab-contact-box a { color: #fff; }

.site-footer { background: #fff; border-top: 1px solid var(--lab-line); }
.footer-main { padding: 64px 0 42px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; }
.footer-logo { max-width: 430px; }
.footer-copy { max-width: 600px; color: var(--lab-muted); font-size: 14px; }
.footer-nav { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px 24px; align-content: start; }
.footer-nav a { color: var(--lab-ink); text-decoration: none; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.footer-bottom { border-top: 1px solid var(--lab-line); padding: 18px 0; color: var(--lab-muted); font-size: 12px; }

.wp-block-separator { border: 0; border-top: 1px solid var(--lab-line); }
.wp-block-table table { border-collapse: collapse; width: 100%; background: #fff; }
.wp-block-table td, .wp-block-table th { border: 1px solid var(--lab-line); padding: 14px; }
.wp-block-quote { margin-left: 0; padding: 20px 26px; border-left: 5px solid var(--lab-cyan); background: rgba(101,207,231,.08); }

@media (max-width: 900px) {
  .site-topbar { display: none; }
  .header-inner { min-height: 78px; }
  .site-branding { flex-basis: 330px; }
  .site-branding img { max-height: 56px; }
  .nav-toggle { display: inline-flex; flex: 0 0 auto; }
  .site-navigation {
    display: none; position: fixed; inset: 78px 0 0; background: rgba(247,246,241,.98); padding: 34px 24px; overflow-y: auto;
  }
  .nav-open .site-navigation { display: block; }
  .primary-menu { display: grid; gap: 0; }
  .primary-menu li { border-bottom: 1px solid var(--lab-line); }
  .primary-menu a { display: block; padding: 18px 4px; font-size: 18px; }
  .primary-menu a::after { display: none; }
  .lab-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lab-section-head { grid-template-columns: 1fr; gap: 14px; }
  .lab-band { grid-template-columns: 1fr; }
  .lab-band-item { min-height: auto; }
  .lab-band-label { margin-bottom: 20px; }
  .lab-profile { grid-template-columns: 180px 1fr; }
  .footer-main { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .lab-container, .entry-content > :where(*:not(.alignfull):not(.alignwide)), .page-content > :where(*:not(.alignfull):not(.alignwide)), .entry-content > .alignwide, .page-content > .alignwide,
  .lab-hero-inner, .lab-grid, .lab-section-head, .lab-band { width: min(calc(100% - 28px), var(--lab-width)); }
  .site-branding { flex-basis: 250px; }
  .site-branding img { max-height: 46px; }
  .lab-hero { min-height: 620px; padding: 72px 0 80px; }
  .lab-hero h1 { font-size: clamp(45px,15vw,70px); }
  .lab-hero::before { width: 230px; height: 230px; right: -70px; top: 10%; }
  .lab-section { padding: 78px 0; }
  .lab-grid { grid-template-columns: 1fr; }
  .lab-card { min-height: 270px; }
  .page-hero { padding: 62px 0 52px; }
  .lab-profile { grid-template-columns: 1fr; padding: 22px; }
  .lab-profile-visual { max-width: 180px; }
  .footer-nav { grid-template-columns: 1fr 1fr; }

  .lab-citation { padding: 20px 18px 20px 54px; }
  .lab-citation::before { left: 17px; top: 21px; }
  .lab-timeline::before { left: 7px; }
  .lab-timeline-item { grid-template-columns: 1fr; gap: 8px; padding: 17px 0 17px 28px; }
  .lab-timeline-item::before { left: 1px; top: 27px; }
  .lab-timeline-date { text-align: left; padding: 0; }
  .lab-timeline-body { padding: 18px; }
}
