/* =========================================================
   ミチサーチ
   public_html/assets/css/michisearch.css
   ========================================================= */

:root {
  --ms-primary: #155e75;
  --ms-primary-dark: #164e63;
  --ms-primary-soft: #ecfeff;
  --ms-accent: #2563eb;
  --ms-text: #1f2937;
  --ms-muted: #64748b;
  --ms-border: #dbe4ea;
  --ms-surface: #ffffff;
  --ms-background: #f5f8fa;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
img { max-width: 100%; }
a { color: var(--ms-primary); }

.ms-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9999;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 6px;
  background: #111827;
  color: #fff;
}
.ms-skip-link:focus { transform: translateY(0); }

.ms-body {
  background: var(--ms-background);
  color: #222;
}

/* Header
   --------------------------------------------------------- */

.ms-header {
  background: #ffffff;
  border-bottom: 1px solid var(--ms-border);
}

.ms-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 14px;
}

.ms-brand {
  margin-bottom: 12px;
}

.ms-logo {
  display: inline-block;
  color: var(--ms-primary);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.ms-logo:hover {
  text-decoration: underline;
}

.ms-tagline {
  margin: 6px 0 0;
  color: #555;
  font-size: 0.95rem;
}

.ms-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.95rem;
}

.ms-nav a {
  color: #333;
  text-decoration: none;
}

.ms-nav a:hover {
  color: var(--ms-primary);
  text-decoration: underline;
}

/* Layout
   --------------------------------------------------------- */

.ms-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 20px 56px;
}



/* Two-column blog layout and sidebar
   --------------------------------------------------------- */

.ms-site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 32px;
  align-items: start;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.ms-main-column,
.ms-site-layout>.ms-container {
  min-width: 0;
}

/* 記事本文PHPが持つ既存のmain.ms-containerを、グリッド内では内側カラムとして使う */
.ms-site-layout>.ms-container {
  max-width: none;
  margin: 0;
  padding: 0;
}

.ms-sidebar {
  min-width: 0;
}

.ms-sidebar-section {
  margin: 0 0 22px;
  overflow: hidden;
  border: 1px solid var(--ms-border);
  border-radius: 12px;
  background: #ffffff;
}

.ms-sidebar-section:last-child {
  margin-bottom: 0;
}

.ms-sidebar-title {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ms-border);
  color: #111827;
  font-size: 1.05rem;
  line-height: 1.4;
}

.ms-sidebar-body {
  padding: 16px 18px;
}

.ms-sidebar-ad {
  min-height: 120px;
  overflow: hidden;
}

.ms-sidebar-ad:empty {
  display: none;
}

.ms-sidebar-list,
.ms-sidebar-category-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ms-sidebar-list li,
.ms-sidebar-category-list li {
  border-bottom: 1px solid #eef0f3;
}

.ms-sidebar-list li:last-child,
.ms-sidebar-category-list li:last-child {
  border-bottom: 0;
}

.ms-sidebar-list a,
.ms-sidebar-category-list a {
  display: block;
  padding: 12px 18px;
  color: #1f2937;
  line-height: 1.55;
  text-decoration: none;
}

.ms-sidebar-list a:hover,
.ms-sidebar-category-list a:hover {
  background: #f8fafc;
  color: var(--ms-primary);
  text-decoration: underline;
}

.ms-sidebar-post-title {
  display: block;
  font-weight: 700;
}

.ms-sidebar-post-meta {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 0.82rem;
}

.ms-sidebar-category-link {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ms-sidebar-count {
  flex: 0 0 auto;
  min-width: 2em;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 1020px) {
  .ms-site-layout {
    grid-template-columns: minmax(0, 1fr);
    width: min(880px, calc(100% - 32px));
    gap: 28px;
  }

  .ms-sidebar {
    order: 2;
  }
}

.ms-article {
  background: #ffffff;
  border: 1px solid var(--ms-border);
  border-radius: 14px;
  padding: 34px 34px 40px;
  font-size: 1.08rem;
  line-height: 1.95;
}

.ms-article-header {
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ms-border);
}

.ms-article-category {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.ms-article-category a {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--ms-primary);
  text-decoration: none;
}

.ms-article-category a:hover {
  text-decoration: underline;
}

.ms-article h1 {
  margin: 0 0 18px;
  color: #111827;
  font-size: 2rem;
  line-height: 1.35;
}

.ms-article-lead {
  margin: 0;
  color: #444;
  font-size: 1.05rem;
}

.ms-article h2 {
  margin: 42px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ms-border);
  color: #111827;
  font-size: 1.45rem;
  line-height: 1.45;
}

.ms-article h3 {
  margin: 32px 0 12px;
  color: #1f2937;
  font-size: 1.2rem;
  line-height: 1.5;
}

.ms-article p {
  margin: 0 0 1.1em;
}

.ms-article strong {
  color: #111827;
  font-weight: 700;
}

.ms-article ul {
  margin: 1em 0 1.4em;
  padding-left: 1.4em;
}

.ms-article li {
  margin: 0.35em 0;
}

/* Tables
   --------------------------------------------------------- */

.ms-table-wrap {
  margin: 24px 0 30px;
  overflow-x: auto;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.ms-table,
.ms-data-table {
  width: 100%;
  min-width: 680px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: #1f2937;
  font-size: 0.98rem;
  line-height: 1.65;
}

.ms-table th,
.ms-table td,
.ms-data-table th,
.ms-data-table td {
  padding: 13px 15px;
  text-align: left;
  vertical-align: top;
}

.ms-table thead th,
.ms-data-table thead th {
  background: #eef2f7;
  color: #111827;
  font-weight: 700;
  line-height: 1.45;
}

.ms-table tbody td,
.ms-data-table tbody td {
  border-top: 1px solid var(--ms-border);
}

.ms-table th+th,
.ms-table td+td,
.ms-data-table th+th,
.ms-data-table td+td {
  border-left: 1px solid var(--ms-border);
}

.ms-table tbody tr:nth-child(even) td,
.ms-data-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.ms-table tbody tr:hover td,
.ms-data-table tbody tr:hover td {
  background: #f1f5f9;
}

.ms-table th:first-child,
.ms-table td:first-child,
.ms-data-table th:first-child,
.ms-data-table td:first-child {
  white-space: nowrap;
}

.ms-table td span[lang="en"],
.ms-data-table td span[lang="en"] {
  color: var(--ms-primary);
  font-weight: 600;
}

/* Examples
   --------------------------------------------------------- */

.ms-example {
  margin: 20px 0;
  padding: 14px 16px;
  border: none;
  border-radius: 6px;
  background: #f8fafc;
}

.ms-example p {
  margin: 0;
}

.ms-example-en {
  color: #111827;
  font-size: 1.08rem;
  font-weight: 700;
}

.ms-example-ja {
  margin-top: 6px !important;
  color: #555;
  font-size: 0.95rem;
}

/* Footer in article
   --------------------------------------------------------- */

.ms-article-footer {
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid var(--ms-border);
}

.ms-tags {
  color: #555;
  font-size: 0.92rem;
}

.ms-tags span {
  display: inline-block;
  margin: 4px 4px 0 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
}

/* Site footer
   --------------------------------------------------------- */

.ms-footer {
  background: #ffffff;
  border-top: 1px solid var(--ms-border);
}

.ms-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px;
  color: #555;
  font-size: 0.92rem;
}

.ms-footer-brand {
  margin-bottom: 16px;
}

.ms-footer-blog-name {
  color: var(--ms-primary);
  font-weight: 700;
  text-decoration: none;
}

.ms-footer-blog-name:hover {
  text-decoration: underline;
}

.ms-footer-description {
  margin: 6px 0 0;
}

.ms-footer-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.ms-footer a {
  color: #333;
}

.ms-footer a:hover {
  color: var(--ms-primary);
}

.ms-footer-extra {
  margin: 10px 0;
}

.footer-copyright {
  margin-top: 10px;
  color: #666;
}

/* Responsive
   --------------------------------------------------------- */

@media (max-width: 640px) {
  .ms-site-layout {
    width: calc(100% - 24px);
    padding: 24px 0 40px;
  }

  .ms-sidebar-section {
    border-radius: 10px;
  }

  .ms-header-inner {
    padding: 16px 16px 12px;
  }

  .ms-logo {
    font-size: 1.45rem;
  }

  .ms-container {
    padding: 24px 12px 40px;
  }

  .ms-article {
    border-radius: 10px;
    padding: 24px 18px 30px;
    font-size: 1.04rem;
  }

  .ms-article h1 {
    font-size: 1.55rem;
  }

  .ms-article h2 {
    font-size: 1.28rem;
  }

  .ms-nav {
    gap: 6px 12px;
  }

  .ms-footer-links ul {
    display: block;
  }

  .ms-footer-links li {
    margin: 5px 0;
  }

  .ms-table-wrap {
    margin: 20px -6px 26px;
    border-radius: 8px;
  }

  .ms-table,
  .ms-data-table {
    min-width: 640px;
    font-size: 0.93rem;
  }

  .ms-table th,
  .ms-table td,
  .ms-data-table th,
  .ms-data-table td {
    padding: 10px 12px;
  }

  .ms-breadcrumbs-inner {
    padding: 9px 16px;
  }

  .ms-breadcrumbs ol {
    font-size: 0.8rem;
  }

  .ms-breadcrumbs [aria-current="page"] span {
    max-width: 18em;
  }
}

.ms-header-image-link {
  display: block;
  max-width: 600px;
  text-decoration: none;
}

.ms-header-image {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
}

.ms-tagline {
  margin: 10px 0 0;
  color: #555;
  font-size: 0.95rem;
}

.ms-back-to-category {
  margin: 36px 0 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.98rem;
}

.ms-back-to-category a {
  color: var(--ms-primary);
  font-weight: 700;
  text-decoration: none;
}

.ms-back-to-category a:hover {
  text-decoration: underline;
}

/* Breadcrumbs
   --------------------------------------------------------- */

.ms-breadcrumbs {
  border-bottom: 1px solid var(--ms-border);
  background: #ffffff;
}

.ms-breadcrumbs-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 11px 20px;
}

.ms-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  color: #6b7280;
  font-size: 0.86rem;
  line-height: 1.6;
  list-style: none;
}

.ms-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.ms-breadcrumbs li+li::before {
  margin-right: 8px;
  color: #9ca3af;
  content: "›";
}

.ms-breadcrumbs a {
  color: #374151;
  text-decoration: none;
}

.ms-breadcrumbs a:hover {
  color: var(--ms-primary);
  text-decoration: underline;
}

.ms-breadcrumbs [aria-current="page"] span {
  display: inline-block;
  max-width: 38em;
  overflow: hidden;
  color: #6b7280;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Featured images and article cards
   --------------------------------------------------------- */

.ms-featured-image {
  margin: 0 0 30px;
  overflow: hidden;
  border-radius: 12px;
  background: #eef2f7;
}

.ms-featured-image img {
  display: block;
  width: 100%;
  height: auto;
}

.ms-featured-image figcaption {
  padding: 10px 14px;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.6;
}

.ms-post-list {
  display: grid;
  gap: 20px;
}

.ms-post-card {
  overflow: hidden;
  border: 1px solid var(--ms-border);
  border-radius: 12px;
  background: #ffffff;
}

.ms-post-card> :not(.ms-post-thumbnail) {
  margin-right: 20px;
  margin-left: 20px;
}

.ms-post-card> :last-child {
  margin-bottom: 20px;
}

.ms-post-card h3 {
  margin-top: 18px;
}

.ms-post-thumbnail {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #eef2f7;
}

.ms-post-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.ms-post-thumbnail:hover img {
  transform: scale(1.02);
}

@media (min-width: 760px) {
  .ms-post-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ms-home-page .ms-category-section:first-of-type .ms-post-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ms-featured-image {
    margin-right: -6px;
    margin-left: -6px;
    border-radius: 8px;
  }
}

/* Responsive default ads
   --------------------------------------------------------- */

.ad-default {
  display: flex;
  width: 100%;
  min-height: 280px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-default .adsbygoogle {
  width: 100%;
  min-height: 280px;
}

.ms-sidebar-ad-section .ms-sidebar-body {
  padding: 12px;
}

.ms-sidebar-ad {
  display: flex;
  min-height: 300px;
  align-items: stretch;
  justify-content: center;
}

.ms-sidebar-ad .ad-default {
  aspect-ratio: 1 / 1;
}

.ms-sidebar-ad .ad-default,
.ms-sidebar-ad .adsbygoogle {
  min-height: 300px;
}

.ms-post-card--ad {
  display: flex;
  min-width: 0;
  min-height: 100%;
}

.ms-post-card--ad>.ms-post-card-ad {
  display: flex;
  width: 100%;
  min-height: 320px;
  margin: 0;
  padding: 12px;
  flex-direction: column;
  box-sizing: border-box;
}

.ms-post-card-ad .ad-default {
  aspect-ratio: 1 / 1;
  flex: 1 1 auto;
}

.ms-post-card-ad .ad-default,
.ms-post-card-ad .adsbygoogle {
  min-height: 300px;
}

.ms-ad-label {
  display: block;
  margin: 0 0 8px;
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 640px) {

  .ad-default,
  .ad-default .adsbygoogle,
  .ms-sidebar-ad,
  .ms-sidebar-ad .ad-default,
  .ms-sidebar-ad .adsbygoogle,
  .ms-post-card-ad .ad-default,
  .ms-post-card-ad .adsbygoogle {
    min-height: 280px;
  }

  .ms-post-card--ad>.ms-post-card-ad {
    min-height: 300px;
  }
}

/* Michisearch-specific components
   --------------------------------------------------------- */
.ms-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ms-primary-dark);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.ms-logo::before {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ms-primary), var(--ms-accent));
  color: #fff;
  content: "M";
  font-size: 1.05rem;
  font-weight: 800;
}
.ms-logo:hover { text-decoration: none; opacity: 0.88; }

.ms-hero {
  margin: -34px -34px 34px;
  padding: 54px 42px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(135deg, #ecfeff, #eff6ff);
}
.ms-hero-kicker {
  margin: 0 0 10px;
  color: var(--ms-primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.ms-hero h1 { margin-bottom: 14px; }
.ms-hero-lead { margin: 0; color: #334155; font-size: 1.08rem; }

.ms-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.ms-category-tile {
  display: flex;
  min-height: 150px;
  padding: 20px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--ms-border);
  border-radius: 12px;
  background: #fff;
  color: var(--ms-text);
  text-decoration: none;
}
.ms-category-tile:hover {
  border-color: var(--ms-primary);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.ms-category-tile strong { color: var(--ms-primary-dark); font-size: 1.12rem; }
.ms-category-tile span { margin-top: 12px; color: var(--ms-muted); font-size: 0.9rem; line-height: 1.6; }

.ms-post-card-body { padding: 0 20px 20px; }
.ms-post-card > .ms-post-card-body { margin: 0; }
.ms-post-card-body h2,
.ms-post-card-body h3 { margin-top: 18px; }
.ms-post-card-body h2 a,
.ms-post-card-body h3 a { color: #111827; text-decoration: none; }
.ms-post-card-body h2 a:hover,
.ms-post-card-body h3 a:hover { color: var(--ms-primary); text-decoration: underline; }
.ms-card-meta { color: var(--ms-muted); font-size: 0.9rem; }

.ms-empty-state {
  padding: 24px;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
}
.ms-empty-state p { margin: 0; }

.ms-tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.ms-tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--ms-border);
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
}
.ms-tag-cloud a:hover { border-color: var(--ms-primary); background: var(--ms-primary-soft); }
.ms-tag-cloud span {
  min-width: 1.7em;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.78rem;
  text-align: center;
}

.ms-preview-notice {
  display: flex;
  margin: 0 0 24px;
  padding: 12px 14px;
  gap: 8px 14px;
  flex-wrap: wrap;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
}

.ms-tags a {
  display: inline-block;
  margin: 4px 4px 0 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  text-decoration: none;
}
.ms-tags a:hover { background: var(--ms-primary-soft); color: var(--ms-primary); }
.ms-tags-label { margin-right: 6px; }

.ms-footer-note { max-width: 820px; color: #64748b; font-size: 0.82rem; line-height: 1.7; }
.ms-footer-copyright { margin-top: 12px; color: #64748b; }

@media (max-width: 760px) {
  .ms-category-grid { grid-template-columns: 1fr; }
  .ms-category-tile { min-height: 0; }
  .ms-hero { margin: -24px -18px 28px; padding: 36px 22px; }
}

/* BEGIN MICHISEARCH LEGAL PAGES
   --------------------------------------------------------- */

.ms-legal-page {
  max-width: 980px;
  margin: 0 auto;
}

.ms-legal-page h2 {
  scroll-margin-top: 24px;
}

.ms-legal-page ol {
  margin: 1em 0 1.4em;
  padding-left: 1.6em;
}

.ms-legal-page li {
  margin: 0.45em 0;
}

.ms-legal-page a {
  overflow-wrap: anywhere;
}

.ms-policy-updated {
  margin-top: 42px !important;
  padding-top: 18px;
  border-top: 1px solid var(--ms-border);
  color: var(--ms-muted);
  font-size: 0.92rem;
}

.ms-contact-email {
  display: flex;
  margin: 28px 0 34px;
  justify-content: center;
}

.ms-contact-email img {
  display: block;
  width: min(100%, 520px);
  height: auto;
}

.ms-contact-notice {
  margin: 30px 0;
  padding: 2px 22px 18px;
  border: 1px solid var(--ms-border);
  border-radius: 12px;
  background: #f8fafc;
}

.ms-contact-notice h2 {
  margin-top: 22px;
}

@media (max-width: 640px) {
  .ms-contact-email {
    margin: 22px 0 28px;
  }

  .ms-contact-notice {
    padding: 1px 16px 14px;
  }
}

/* END MICHISEARCH LEGAL PAGES */
