/*
Theme Name: AIやまらぼ
Theme URI: https://yamatoll.com/
Author: AIやまらぼ編集部
Description: AIニュースと実務ガイドのための軽量な独立系メディアテーマ。
Version: 0.3.14
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: ai-yamalab
*/

:root {
  --ink: #112037;
  --muted: #5f6e83;
  --line: #dbe3ec;
  --paper: #ffffff;
  --canvas: #f3f7fa;
  --blue: #3156d9;
  --blue-dark: #203ba4;
  --blue-pale: #e9efff;
  --lime: #9bca57;
  --lime-dark: #567e25;
  --lime-pale: #eff8df;
  --orange: #f3a34b;
  --red: #d9485f;
  --shadow: 0 18px 50px rgba(17, 32, 55, 0.1);
  --radius: 18px;
  --radius-sm: 10px;
  --content: 760px;
  --wide: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

body.admin-bar .site-header { top: 32px; }

img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  clip: auto;
  color: var(--ink);
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.wrap { width: min(calc(100% - 40px), var(--wide)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(219, 227, 236, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.05em;
  border-radius: 12px 12px 16px 16px;
  background: linear-gradient(145deg, var(--blue), #6d87eb);
  transform: rotate(-3deg);
  box-shadow: 0 8px 18px rgba(49, 86, 217, 0.22);
}
.brand-copy { display: grid; line-height: 1.15; }
.brand-name { font-size: 1.22rem; font-weight: 900; letter-spacing: 0.02em; }
.brand-tagline { margin-top: 4px; color: var(--muted); font-size: 0.68rem; font-weight: 700; }

.main-navigation { margin-left: auto; }
.main-navigation ul { display: flex; align-items: center; gap: 5px; padding: 0; margin: 0; list-style: none; }
.main-navigation a { display: block; padding: 10px 11px; color: var(--ink); font-size: 0.88rem; font-weight: 800; text-decoration: none; border-radius: 9px; }
.main-navigation a:hover, .main-navigation .current-menu-item > a { color: var(--blue); background: var(--blue-pale); }
.header-search { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink); border-radius: 50%; text-decoration: none; background: var(--canvas); }
.menu-toggle { display: none; margin-left: auto; padding: 9px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: #fff; font-weight: 800; }

.breaking-bar { color: #fff; background: var(--ink); }
.breaking-inner { min-height: 39px; display: flex; align-items: center; gap: 16px; overflow: hidden; }
.breaking-label { flex: 0 0 auto; color: #dff7b9; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.breaking-link { overflow: hidden; color: #fff; font-size: 0.83rem; font-weight: 700; text-decoration: none; white-space: nowrap; text-overflow: ellipsis; }

.site-main { min-height: 60vh; }
.hero { padding: 48px 0 34px; }
.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  min-height: 490px;
  overflow: hidden;
  border: 1px solid #d9e2ed;
  border-radius: 28px;
  background: #eaf2f9;
  box-shadow: var(--shadow);
}
.hero-copy { z-index: 2; align-self: center; padding: 58px 30px 58px 58px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--blue); font-size: 0.77rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 20px; height: 3px; border-radius: 3px; background: var(--lime); }
.hero h1 { max-width: 700px; margin: 0; font-size: clamp(2.25rem, 4.4vw, 4.35rem); line-height: 1.14; letter-spacing: -0.045em; }
.hero h1 em { color: var(--blue); font-style: normal; }
.hero-lead { max-width: 620px; margin: 22px 0 0; color: #43536b; font-size: 1.05rem; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 29px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 900; text-decoration: none; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 10px 22px rgba(49, 86, 217, 0.22); }
.button-primary:hover { color: #fff; background: var(--blue-dark); }
.button-secondary { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.82); }
.hero-visual { position: relative; min-height: 420px; }
.hero-visual picture { display: block; width: 100%; height: 100%; }
.hero-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #eaf2f9 0, rgba(234,242,249,.2) 27%, transparent 50%); }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; object-position: 61% center; }
.hero-caption { position: absolute; z-index: 2; right: 18px; bottom: 18px; padding: 8px 12px; color: #344157; background: rgba(255,255,255,.88); border-radius: 999px; font-size: .72rem; font-weight: 800; backdrop-filter: blur(8px); }

.topic-strip { padding: 8px 0 22px; }
.topic-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.topic-list a { min-height: 64px; display: flex; align-items: center; justify-content: center; padding: 10px; color: var(--ink); text-align: center; text-decoration: none; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); font-size: .82rem; font-weight: 850; }
.topic-list a:hover { border-color: #afc0f8; color: var(--blue); transform: translateY(-2px); }

.section { padding: 50px 0; }
.section-white { background: var(--paper); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-title { margin: 0; font-size: clamp(1.55rem, 2.5vw, 2.15rem); line-height: 1.3; letter-spacing: -0.03em; }
.section-title small { display: block; margin-bottom: 5px; color: var(--blue); font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.section-link { flex: 0 0 auto; font-size: .85rem; font-weight: 900; }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #dfe8f5, #f0f5fa); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .post-card-media img { transform: scale(1.025); }
.post-card-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #8190a6; font-size: .75rem; font-weight: 900; letter-spacing: .08em; }
.post-card-body { padding: 18px 19px 20px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 11px; margin-bottom: 10px; color: var(--muted); font-size: .73rem; font-weight: 750; }
.post-category { color: var(--blue); font-weight: 900; text-decoration: none; }
.post-card-title { margin: 0; font-size: 1.08rem; line-height: 1.55; letter-spacing: -.015em; }
.post-card-title a { color: var(--ink); text-decoration: none; }
.post-card-title a:hover { color: var(--blue); }
.post-card-excerpt { margin: 10px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.75; }

.editorial-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 24px; }
.editorial-list { display: grid; gap: 12px; }
.compact-card { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.compact-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.compact-card > .post-card-placeholder { min-height: 112px; border-radius: 10px; background: linear-gradient(135deg, #dfe8f5, #f0f5fa); }
.compact-card h3 { margin: 5px 0 0; font-size: 1rem; line-height: 1.55; }
.compact-card h3 a { color: var(--ink); text-decoration: none; }
.lab-card { position: relative; overflow: hidden; padding: 28px; color: #fff; border-radius: var(--radius); background: linear-gradient(155deg, #182844, #2b4abb); }
.lab-card::after { content: ""; position: absolute; right: -38px; bottom: -55px; width: 170px; height: 170px; border-radius: 45% 55% 50% 50%; background: rgba(155,202,87,.2); }
.lab-card h2 { position: relative; z-index: 1; margin: 0; font-size: 1.35rem; }
.lab-card p { position: relative; z-index: 1; color: #dce5fb; font-size: .88rem; }
.lab-card .button { position: relative; z-index: 1; color: var(--ink); background: #fff; }

.archive-header { padding: 54px 0 30px; }
.archive-header h1 { margin: 0; font-size: clamp(2rem,4vw,3.5rem); line-height: 1.25; letter-spacing: -.04em; }
.archive-description { max-width: 720px; color: var(--muted); }
.author-archive-image { width: 96px; height: 96px; margin: 10px 0 16px; object-fit: cover; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 8px 24px rgba(17,32,55,.12); }
.archive-grid { padding-bottom: 60px; }
.pagination { margin-top: 35px; }
.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
.page-numbers { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 10px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.page-numbers.current { color: #fff; border-color: var(--blue); background: var(--blue); }

.article-shell { display: grid; grid-template-columns: minmax(0, var(--content)); justify-content: center; padding: 50px 20px 70px; }
.article { min-width: 0; padding: 36px 46px 48px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 12px 36px rgba(17,32,55,.055); }
.breadcrumbs { margin-bottom: 23px; color: var(--muted); font-size: .73rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 5px; color: #a1adbd; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.entry-header h1 { margin: 0; font-size: clamp(1.9rem,4vw,3rem); line-height: 1.35; letter-spacing: -.035em; }
.entry-header .post-meta { margin-top: 16px; }
.entry-thumbnail { margin: 28px -18px 32px; overflow: hidden; border-radius: 15px; }
.entry-thumbnail img { width: 100%; display: block; }
.entry-content { overflow-wrap: anywhere; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { margin: 2.2em 0 .75em; padding-bottom: .35em; border-bottom: 3px solid var(--lime); font-size: 1.55rem; line-height: 1.45; }
.entry-content h3 { margin: 1.9em 0 .65em; padding-left: .75em; border-left: 4px solid var(--blue); font-size: 1.25rem; line-height: 1.5; }
.entry-content p { margin: 1.15em 0; }
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content blockquote { margin: 1.7em 0; padding: 20px 22px; border: 0; border-left: 4px solid var(--blue); border-radius: 0 12px 12px 0; background: var(--blue-pale); }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; white-space: nowrap; }
.entry-content th, .entry-content td { padding: 11px 13px; border: 1px solid var(--line); text-align: left; }
.entry-content th { background: #eef3f8; }
.entry-content pre { padding: 18px; overflow-x: auto; color: #ecf2ff; border-radius: 12px; background: #15233b; }
.entry-content code { padding: .12em .32em; border-radius: 4px; background: #edf1f6; font-size: .9em; }
.entry-content pre code { padding: 0; background: transparent; }

.ai-disclosure { display: grid; grid-template-columns: auto 1fr; gap: 13px; margin: 26px 0; padding: 17px 18px; border: 1px solid #c9dca9; border-radius: 13px; background: var(--lime-pale); }
.ai-disclosure-icon { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; border-radius: 50% 50% 48% 52%; background: var(--lime-dark); font-size: .72rem; font-weight: 950; }
.ai-disclosure strong { display: block; margin-bottom: 2px; }
.ai-disclosure p { margin: 0; color: #496035; font-size: .79rem; line-height: 1.65; }
.affiliate-link-disclosure { margin: 0 0 24px; padding: 12px 14px; color: #5f4b22; border: 1px solid #ead49d; border-radius: 10px; background: #fff9e9; font-size: .76rem; line-height: 1.7; }
.source-box { margin-top: 34px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #f7f9fb; }
.source-box h2 { margin: 0 0 10px; font-size: 1.05rem; }
.source-box a { overflow-wrap: anywhere; }
.correction-history { margin-top: 20px; padding: 20px; border: 1px solid #e6d5a7; border-radius: 13px; background: #fffaf0; }
.correction-history h2 { margin: 0 0 10px; font-size: 1.05rem; }
.correction-history p { margin-bottom: 0; }
.article-ad { min-height: 120px; margin-top: 32px; }
.author-box { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 18px; align-items: center; margin-top: 34px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #f7f9fb; }
.author-box picture { display: block; width: 100px; height: 100px; }
.author-box img { width: 100px; height: 100px; object-fit: cover; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 7px 20px rgba(17,32,55,.1); }
.author-box-label { margin: 0; color: var(--blue); font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.author-box h2 { margin: 2px 0 4px; font-size: 1.05rem; line-height: 1.45; }
.author-box p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.7; }
.author-box-links { margin-top: 7px !important; }
.related-posts { margin-top: 36px; }
.related-posts > h2 { margin: 0 0 13px; font-size: 1.25rem; }
.related-posts-grid { display: grid; gap: 9px; }
.related-posts-grid a { display: flex; justify-content: space-between; gap: 18px; padding: 13px 15px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.related-posts-grid a:hover { color: var(--blue); border-color: #afc0f8; }
.related-posts-grid time { flex: 0 0 auto; color: var(--muted); font-size: .72rem; }

.advertisement { position: relative; min-height: 302px; margin-block: 34px; padding-top: 22px; overflow: hidden; contain: layout paint; }
.advertisement-label { position: absolute; top: 0; left: 50%; color: #7a8799; font-size: .65rem; line-height: 1; letter-spacing: .08em; transform: translateX(-50%); }
.advertisement-middle { margin-block: 36px; }
.ad-slot { min-width: 0; min-height: 280px; display: grid; place-items: center; overflow: hidden; color: #8a97a8; border: 1px dashed #c8d1dc; border-radius: 10px; background: #f8fafc; font-size: .68rem; }
.ad-slot iframe, .ad-slot ins, .ad-slot > div { max-width: 100%; }
.ai-yamalab-ad-preview { width: 100%; min-height: 280px; display: grid; place-items: center; align-content: center; gap: 4px; text-align: center; }
.ai-yamalab-ad-preview strong { color: #66758a; font-size: .78rem; }
.ai-yamalab-ad-preview span { color: #8996a8; font-size: .68rem; }

.page-shell { padding: 50px 0 70px; }
.page-card { padding: 40px 48px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); }
.wpcf7-form-control-wrap,
.wpcf7 input:not([type="submit"]),
.wpcf7 textarea,
.wpcf7 select { width: 100%; max-width: 100%; }
.not-found { max-width: 700px; margin: 80px auto; padding: 45px; text-align: center; border-radius: 22px; background: #fff; }
.search-form { display: flex; gap: 8px; }
.search-field { min-width: 0; flex: 1; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.search-submit { padding: 10px 15px; color: #fff; border: 0; border-radius: 9px; background: var(--blue); font-weight: 900; }

.site-footer { padding: 50px 0 25px; color: #dce3ee; background: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 40px; }
.footer-brand { color: #fff; }
.footer-brand .brand-tagline { color: #b8c4d5; }
.footer-copy { max-width: 430px; color: #b8c4d5; font-size: .82rem; }
.footer-heading { margin: 0 0 10px; color: #fff; font-size: .85rem; }
.footer-menu { padding: 0; margin: 0; list-style: none; }
.footer-menu a { color: #c9d3e1; font-size: .8rem; text-decoration: none; }
.footer-menu a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 38px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); color: #9eacbf; font-size: .72rem; }

@media (max-width: 980px) {
  body.admin-bar .site-header { top: 46px; }
  .menu-toggle { display: block; }
  .header-search { margin-left: 0; }
  .main-navigation { display: none; position: absolute; inset: 76px 0 auto; padding: 12px 20px 20px; border-bottom: 1px solid var(--line); background: #fff; }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { align-items: stretch; flex-direction: column; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-copy { padding: 45px 40px 20px; }
  .hero-visual { min-height: 390px; }
  .hero-visual::after { background: linear-gradient(180deg, #eaf2f9 0, rgba(234,242,249,.1) 30%, transparent 55%); }
  .topic-list { grid-template-columns: repeat(3,1fr); }
  .post-grid { grid-template-columns: repeat(2,1fr); }
  .article-shell { grid-template-columns: minmax(0,var(--content)); }
}

@media (max-width: 680px) {
  .wrap, .narrow { width: min(calc(100% - 28px), var(--wide)); }
  .header-inner { min-height: 66px; gap: 10px; }
  .brand-mark { width: 35px; height: 35px; }
  .brand-tagline { display: none; }
  .brand-name { font-size: 1.05rem; }
  .main-navigation { inset: 66px 0 auto; }
  .breaking-inner { gap: 10px; }
  .hero { padding-top: 22px; }
  .hero-panel { min-height: 0; border-radius: 20px; }
  .hero-copy { padding: 30px 23px 12px; }
  .hero h1 { font-size: 2.18rem; }
  .hero-lead { font-size: .92rem; }
  .hero-actions .button { width: 100%; }
  .hero-visual { min-height: 300px; }
  .hero-caption { right: 10px; bottom: 10px; }
  .topic-list { grid-template-columns: repeat(2,1fr); }
  .post-grid { grid-template-columns: 1fr; }
  .editorial-grid { grid-template-columns: 1fr; }
  .compact-card { grid-template-columns: 110px minmax(0,1fr); gap: 12px; }
  .section { padding: 38px 0; }
  .article-shell { display: block; padding: 18px 0 45px; }
  .article { padding: 24px 20px 35px; border-right: 0; border-left: 0; border-radius: 0; }
  .entry-header h1 { font-size: 1.72rem; line-height: 1.4; letter-spacing: -.025em; }
  .entry-thumbnail { margin-inline: -8px; }
  .entry-content h2 { font-size: 1.35rem; }
  .author-box { grid-template-columns: 72px minmax(0,1fr); gap: 13px; padding: 16px; }
  .author-box picture, .author-box img { width: 72px; height: 72px; }
  .advertisement { min-height: 272px; margin-block: 28px; }
  .ad-slot, .ai-yamalab-ad-preview { min-height: 250px; }
  .related-posts-grid a { align-items: flex-start; flex-direction: column; gap: 4px; }
  .page-card { padding: 28px 21px; border-radius: 15px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
