/* ============================================
   AND TOOLS - 共通スタイル
   Mobile-first / BEM方言準拠
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  line-height: 1.8;
  color: #333;
  background-color: #f8f9fa;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #059669;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Layout --- */
.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout__main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* --- Header --- */
.header {
  background-color: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #065f46;
  letter-spacing: 0.05em;
}

.header__logo:hover {
  text-decoration: none;
  opacity: 0.8;
}

.header__nav {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
}

.header__navLink {
  color: #6b7280;
}

.header__navLink:hover {
  color: #065f46;
  text-decoration: none;
}

/* --- Footer --- */
.footer {
  background-color: #1f2937;
  color: #9ca3af;
  padding: 32px 16px;
  font-size: 0.8125rem;
  margin-top: auto;
}

.footer__inner {
  max-width: 960px;
  margin: 0 auto;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.footer__link {
  color: #d1d5db;
}

.footer__copyright {
  color: #6b7280;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.breadcrumb__item {
  color: #6b7280;
}

.breadcrumb__separator {
  color: #d1d5db;
}

.breadcrumb__current {
  color: #374151;
}

/* --- Tool Page --- */
.toolPage {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.toolPage__header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.toolPage__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
}

.toolPage__description {
  margin-top: 8px;
  font-size: 0.9375rem;
  color: #6b7280;
}

.toolPage__body {
  padding: 24px;
}

.toolPage__content {
  padding: 32px 24px;
  border-top: 1px solid #f3f4f6;
}

.toolPage__content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-top: 32px;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 4px solid #059669;
}

.toolPage__content h2:first-child {
  margin-top: 0;
}

.toolPage__content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #374151;
  margin-top: 24px;
  margin-bottom: 8px;
}

.toolPage__content p {
  margin-bottom: 16px;
  color: #4b5563;
}

.toolPage__content ul,
.toolPage__content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.toolPage__content li {
  margin-bottom: 8px;
  color: #4b5563;
}

/* --- Tool Input/Output --- */
.toolInput {
  margin-bottom: 20px;
}

.toolInput__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.toolInput__field {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
  color: #111827;
  transition: border-color 0.2s;
  font-family: inherit;
}

.toolInput__field:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.toolInput__field_type_number {
  font-family: 'Noto Sans JP', monospace;
  font-variant-numeric: tabular-nums;
}

.toolInput__hint {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: #9ca3af;
}

.toolInput__unit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toolInput__unitText {
  font-size: 0.9375rem;
  color: #6b7280;
  white-space: nowrap;
}

.toolResult {
  background-color: #ecfdf5;
  border: 2px solid #a7f3d0;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

.toolResult__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 8px;
}

.toolResult__value {
  font-size: 2rem;
  font-weight: 700;
  color: #064e3b;
  font-variant-numeric: tabular-nums;
}

.toolResult__sub {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 4px;
}

.toolResult__breakdown {
  margin-top: 16px;
  border-top: 1px solid #a7f3d0;
  padding-top: 16px;
}

.toolResult__row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9375rem;
}

.toolResult__rowLabel {
  color: #4b5563;
}

.toolResult__rowValue {
  font-weight: 600;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn_type_primary {
  background-color: #059669;
  color: #fff;
}

.btn_type_primary:hover {
  background-color: #047857;
}

.btn_type_secondary {
  background-color: #f3f4f6;
  color: #374151;
}

.btn_type_secondary:hover {
  background-color: #e5e7eb;
}

.btn_type_copy {
  background-color: #10b981;
  color: #fff;
  font-size: 0.875rem;
  padding: 8px 16px;
}

.btn_type_copy:hover {
  background-color: #059669;
}

/* --- Ad Slot (CLS対策: 固定サイズ placeholder) --- */
.adSlot {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9fafb;
  border-radius: 8px;
  margin: 24px 0;
  overflow: hidden;
}

.adSlot_position_top {
  min-height: 100px;
}

.adSlot_position_bottom {
  min-height: 250px;
}

/* --- Tool Card (トップページ用) --- */
.toolCard {
  display: block;
  background-color: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid #f3f4f6;
}

.toolCard:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

.toolCard__icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.toolCard__name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.toolCard__description {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.6;
}

.toolCard__badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
}

.toolCard__badge_type_popular {
  background-color: #fef3c7;
  color: #92400e;
}

.toolCard__badge_type_new {
  background-color: #d1fae5;
  color: #065f46;
}

/* --- Top Page --- */
.topHero {
  text-align: center;
  padding: 40px 16px 32px;
}

.topHero__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

.topHero__subtitle {
  font-size: 1rem;
  color: #6b7280;
  margin-top: 8px;
}

.toolGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 16px 40px;
  max-width: 960px;
  margin: 0 auto;
}

/* --- Related Tools --- */
.relatedTools {
  padding: 24px;
  border-top: 1px solid #f3f4f6;
}

.relatedTools__title {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 16px;
}

.relatedTools__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* --- FAQ (構造化データ用) --- */
.faq {
  margin-top: 24px;
}

.faq__item {
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 0;
}

.faq__question {
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

.faq__answer {
  color: #4b5563;
  font-size: 0.9375rem;
}

/* --- About Table --- */
.aboutTable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.aboutTable th,
.aboutTable td {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 0.9375rem;
}

.aboutTable th {
  width: 140px;
  font-weight: 600;
  color: #374151;
  background-color: #f9fafb;
  white-space: nowrap;
}

.aboutTable td {
  color: #4b5563;
}

/* --- Contact Form --- */
.contactForm__required {
  font-size: 0.75rem;
  color: #ef4444;
  margin-left: 4px;
}

/* --- Utility --- */
.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Responsive (Tablet) --- */
@media (min-width: 640px) {
  .toolGrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .relatedTools__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toolPage__header {
    padding: 32px 32px 20px;
  }

  .toolPage__body {
    padding: 32px;
  }

  .toolPage__content {
    padding: 40px 32px;
  }

  .topHero__title {
    font-size: 2rem;
  }
}

/* --- Responsive (Desktop) --- */
@media (min-width: 960px) {
  .toolGrid {
    grid-template-columns: repeat(3, 1fr);
  }

  .relatedTools__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .layout__main {
    padding: 32px 24px;
  }

  .toolResult__value {
    font-size: 2.5rem;
  }
}
