/* shared/templates/style.css
 * Plain CSS3, mobile-first, no framework, no build step.
 * Shared across all 診断・比較ツール sites (denki-gas, water-server, sim-hikari).
 *
 * Direction: editorial comparison-guide (navy + gold, serif display,
 * magazine-style ranking). Chosen 2026-09-05 after reviewing three
 * design directions.
 */

:root {
    --color-paper: #f3f4f0;
    --color-surface: #ffffff;
    --color-navy: #1c2340;
    --color-navy-soft: #2c3457;
    --color-line: #dadcd3;
    --color-gold: #9c6b12;
    --color-gold-soft: #f1e6cf;
    --color-muted: #5b5f52;
    --font-serif: "Zen Old Mincho", "Hiragino Mincho ProN", serif;
    --font-gothic: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
    --font-body: "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
    --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

html,
body {
    /* .masthead-rule and other rule dividers stay within .page-container,
       so this is defensive rather than load-bearing; kept for safety. */
    overflow-x: clip;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-paper);
    color: var(--color-navy);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-navy);
    text-decoration: none;
    border-bottom: 1px solid var(--color-gold);
    transition: color 0.15s var(--ease);
}

a:hover {
    color: var(--color-gold);
}

.icon {
    display: inline-block;
    vertical-align: -3px;
    line-height: 0;
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-gold-soft);
    color: var(--color-gold);
    border-bottom: none;
}

.icon-badge-sm {
    width: 22px;
    height: 22px;
}

.page-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* --- Masthead header --- */
.site-header {
    text-align: center;
    padding-top: 24px;
}

.site-header .page-container {
    padding-bottom: 16px;
}

.site-masthead-kicker {
    font-family: var(--font-gothic);
    font-weight: 700;
    font-size: 12px;
    color: var(--color-muted);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.site-header h1 {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 21px;
    margin: 0;
    color: var(--color-navy);
}

.masthead-rule {
    border-top: 3px double var(--color-navy);
    max-width: 780px;
    margin: 0 auto;
}

/* --- Navigation --- */
.site-nav {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-top: 14px;
    font-family: var(--font-gothic);
    font-size: 13px;
}

.site-nav a {
    border-bottom: none;
    color: var(--color-navy);
}

.site-nav a:hover {
    color: var(--color-gold);
}

/* --- Hero --- */
.hero {
    padding: 40px 0 8px;
    text-align: center;
}

.hero h2 {
    /* Headlines carry a manual <br> at the intended line break (see each
       site's index.php) — no max-width/text-wrap:balance here, since a
       ch-based cap on this CJK serif stack wrapped mid-word inside a
       single <br>-delimited line (e.g. splitting 料金 or 比べて). Width
       is bounded by .page-container (720px) instead. */
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 1.9rem);
    line-height: 1.55;
    margin: 0 auto 18px;
    color: var(--color-navy);
}

.hero p {
    max-width: 46ch;
    margin: 0 auto 30px;
    color: var(--color-muted);
    font-size: 15px;
}

.hero-stat {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0 40px 24px;
    border-bottom: 1px solid var(--color-line);
    margin-bottom: 8px;
}

.hero-stat-label {
    font-family: var(--font-gothic);
    font-size: 12px;
    color: var(--color-muted);
    margin-bottom: 6px;
}

.hero-stat-number {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 2.8rem);
    color: var(--color-gold);
    font-variant-numeric: tabular-nums;
}

.hero-stat-unit {
    font-size: 1rem;
    margin-left: 4px;
}

.hero-points {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 24px 0 0;
    padding: 0;
    font-family: var(--font-gothic);
    font-size: 13px;
    color: var(--color-muted);
}

.hero-points li {
    border-bottom: none;
}

/* --- Form --- */
.diagnosis-form {
    max-width: 460px;
    margin: 28px auto 0;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    padding: 28px;
}

.form-field {
    margin-bottom: 16px;
    text-align: left;
}

.form-field label {
    display: block;
    font-family: var(--font-gothic);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.form-field select,
.form-field input[type="number"] {
    width: 100%;
    padding: 8px 2px;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--color-navy);
    border: none;
    border-bottom: 1px solid var(--color-navy);
    border-radius: 0;
    background: transparent;
    transition: border-color 0.15s var(--ease);
}

.form-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%231c2340' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    background-size: 14px;
}

.form-field select:focus-visible,
.form-field input[type="number"]:focus-visible {
    outline: none;
    border-color: var(--color-gold);
}

.form-submit {
    width: 100%;
    padding: 14px;
    font-family: var(--font-gothic);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--color-navy);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s var(--ease);
}

.form-submit:hover {
    background: var(--color-navy-soft);
}

.form-error {
    color: #8c3b32;
    font-size: 13px;
    text-align: left;
    max-width: 460px;
    margin: 0 auto 12px;
}

/* --- Calculation transparency box --- */
.calc-box {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    max-width: 460px;
    margin: 22px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--color-line);
    font-size: 12.5px;
    color: var(--color-muted);
}

.lead-note {
    color: var(--color-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* --- Switching steps --- */
.steps-heading {
    text-align: center;
    font-family: var(--font-gothic);
    font-weight: 700;
    font-size: 12px;
    color: var(--color-muted);
    letter-spacing: 0.06em;
    margin: 44px 0 6px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--color-line);
    border-bottom: 1px solid var(--color-line);
}

.step {
    padding: 22px 18px;
    text-align: center;
    border-right: 1px solid var(--color-line);
}

.step-kanji {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--color-gold);
    margin-bottom: 6px;
}

.step-title {
    font-family: var(--font-gothic);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
}

.step-desc {
    font-size: 12.5px;
    color: var(--color-muted);
    line-height: 1.6;
}

@media (max-width: 560px) {
    .steps {
        grid-template-columns: 1fr;
    }

    .step {
        border-right: none;
        border-bottom: 1px solid var(--color-line);
    }

    .step:last-child {
        border-bottom: none;
    }
}

/* --- Ranking (magazine featured + grid) --- */
.rank-featured {
    display: flex;
    align-items: center;
    gap: 22px;
    padding-bottom: 24px;
    margin-top: 26px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-line);
}

.rank-featured-num {
    font-family: var(--font-serif);
    font-size: 40px;
    color: var(--color-gold);
    flex-shrink: 0;
}

.rank-featured-body {
    flex: 1;
    min-width: 0;
}

.rank-featured-name {
    font-family: var(--font-gothic);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.rank-featured-meta {
    font-size: 12.5px;
    color: var(--color-muted);
}

.rank-featured-cost {
    text-align: right;
    flex-shrink: 0;
}

.rank-featured-badge {
    display: inline-block;
    font-family: var(--font-gothic);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    padding: 1px 7px;
    margin-bottom: 6px;
}

.rank-featured-price {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}

.rank-featured-cost a {
    font-size: 12px;
}

/* --- Comparison table (rank 2+) --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13.5px;
}

.compare-table th,
.compare-table td {
    text-align: left;
    padding: 11px 8px;
    border-bottom: 1px solid var(--color-line);
    vertical-align: top;
    overflow-wrap: break-word;
}

.compare-table th:first-child,
.compare-table td:first-child {
    width: 13%;
}

.compare-table th:last-child,
.compare-table td:last-child {
    width: 28%;
    text-align: right;
}

.compare-table thead th {
    font-family: var(--font-gothic);
    font-weight: 700;
    font-size: 11.5px;
    color: var(--color-muted);
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--color-navy);
}

.compare-table-breakdown {
    display: block;
    color: var(--color-muted);
    font-size: 12px;
    margin-top: 2px;
}

.compare-table-num {
    font-family: var(--font-serif);
    color: var(--color-gold);
}

.compare-table-name a {
    font-family: var(--font-gothic);
    font-weight: 700;
    border-bottom: none;
    color: var(--color-navy);
}

.compare-table-cost {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.compare-table tr.is-highlighted {
    background: var(--color-gold-soft);
}

@media (max-width: 480px) {
    .compare-table {
        font-size: 12.5px;
    }

    .compare-table th:first-child,
    .compare-table td:first-child {
        width: 10%;
    }
}

/* --- Breadcrumbs --- */
.breadcrumbs {
    font-size: 12px;
    color: var(--color-muted);
    margin: 18px 0 -4px;
}

.breadcrumbs a {
    color: var(--color-muted);
    border-bottom: none;
}

.breadcrumbs a:hover {
    color: var(--color-gold);
}

.breadcrumbs-sep {
    margin: 0 6px;
    color: var(--color-line);
}

/* --- Company detail page --- */
.company-detail {
    padding-top: 24px;
    margin-top: 8px;
    border-top: 3px double var(--color-navy);
}

.company-detail .company-feature {
    color: var(--color-muted);
    margin: 0 0 20px;
    font-size: 15px;
}

.company-insight {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    padding: 16px 18px;
    margin: 0 0 20px;
}

.company-insight p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.7;
}

.company-insight p + p {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-line);
}

.company-insight strong {
    display: block;
    font-family: var(--font-gothic);
    font-size: 12px;
    margin-bottom: 3px;
}

.company-insight-good strong {
    color: var(--color-gold);
}

.company-insight-good strong .icon {
    margin-right: 4px;
}

.company-insight-caution strong {
    color: #8c3b32;
}

.company-detail dl {
    margin: 0 0 24px;
}

.company-detail dt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-gothic);
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 16px;
}

.company-detail dd {
    margin: 3px 0 0 34px;
    font-size: 16px;
}

.company-verified-note {
    font-size: 11.5px;
    color: var(--color-muted);
    margin-top: 18px;
}

/* --- Static content pages (ガイド, FAQ, 運営者情報, ポリシー) --- */
.content-block,
.static-page {
    padding-top: 24px;
    margin-top: 8px;
    border-top: 3px double var(--color-navy);
}

.content-block h3,
.static-page h3 {
    font-family: var(--font-serif);
    font-weight: 700;
    margin-top: 28px;
    font-size: 16px;
    color: var(--color-navy);
}

.content-block h3:first-child,
.static-page h3:first-child {
    margin-top: 0;
}

.static-page h2 {
    display: none;
}

.faq-item {
    margin-bottom: 22px;
}

.faq-item .faq-q {
    font-family: var(--font-gothic);
    font-weight: 700;
    margin-bottom: 5px;
}

.faq-item .faq-q::before {
    content: "Q. ";
    color: var(--color-gold);
}

.faq-item .faq-a::before {
    content: "A. ";
    color: var(--color-muted);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.info-table th,
.info-table td {
    text-align: left;
    padding: 14px 8px;
    border-bottom: 1px solid var(--color-line);
    font-size: 14px;
}

.info-table th {
    width: 30%;
    font-family: var(--font-gothic);
    font-weight: 700;
    color: var(--color-muted);
    white-space: nowrap;
}

/* --- PR / advertising disclosure banner ---
 * Must stay legible and clearly visible (no tiny text, no hiding),
 * per Japanese 景品表示法 stealth-marketing disclosure rules.
 */
.pr-notice {
    background: #efe7d2;
    color: #6b5424;
    padding: 10px 20px;
    text-align: center;
    font-size: 13px;
}

/* --- Results (personalized diagnosis) --- */
.results-list {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-line);
}

.result-item:first-child {
    border-top: 1px solid var(--color-line);
}

.result-rank {
    font-family: var(--font-serif);
    font-size: 32px;
    color: var(--color-gold);
    flex-shrink: 0;
    line-height: 1;
}

.result-body {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-family: var(--font-gothic);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.result-meta {
    font-size: 12.5px;
    color: var(--color-muted);
    margin-bottom: 4px;
}

.result-savings {
    font-size: 13px;
    color: #2e6b3a;
}

.result-cost-col {
    text-align: right;
    flex-shrink: 0;
}

.result-cost {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 19px;
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}

.cta-button {
    display: inline-block;
    font-family: var(--font-gothic);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-navy);
    border-bottom: 1px solid var(--color-gold);
}

.cta-button:hover {
    color: var(--color-gold);
}

/* --- Footer --- */
.site-footer {
    margin-top: 40px;
    padding: 22px 0;
    border-top: 3px double var(--color-navy);
    text-align: center;
    font-size: 13px;
    color: var(--color-muted);
}

.site-footer-inner {
    padding-bottom: 0;
}

.site-footer a {
    border-bottom: none;
    color: var(--color-muted);
    margin: 0 10px;
}

.site-footer a:hover {
    color: var(--color-gold);
}
