@charset "utf-8";

/* ==========================================================================
   変数定義：ARIGAブランドカラー
   ========================================================================== */
:root {
    --main-navy: #00244b;
    --gold: #c5a059;
    --gold-grad-fade: linear-gradient(90deg, transparent 0%, #f9f0b8 50%, transparent 100%);
    --bg-white: #ffffff;
    --bg-sub-gray: #f7f7f7;
    --text-black: #1a1a1a;
    --text-white: #ffffff;
    --text-gray: #888888;
}

/* ==========================================================================
   基本設定：フッター固定（白残り根絶）工法
   ========================================================================== */
html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    font-family: 'Noto Serif JP', serif, "Hiragino Mincho ProN", "MS Mincho";
    line-height: 1.8;
    margin: 0;
    padding: 0;
    color: var(--text-black);
    background-color: var(--bg-white);
    letter-spacing: 0.05em;
}

main {
    flex: 1;
}

.container-wide {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
}

.container-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   ヘッダー：1.7rem完全同期仕様
   ========================================================================== */
header {
    background-color: var(--main-navy);
    padding: 25px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

header .container-wide {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    margin-right: 20px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: 0.2em;
    color: #ffffff;
    white-space: nowrap;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 50px;
}

nav ul li a {
    text-decoration: none;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    position: relative;
    padding-bottom: 8px;
    transition: 0.3s;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold-grad-fade);
    transition: 0.4s;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a:hover {
    color: var(--gold);
}

.nav-unshown {
    display: none;
}

/* ==========================================================================
   ヒーロー / セクション装飾
   ========================================================================== */
#hero {
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background-color: var(--main-navy);
}

.hero-title {
    font-size: 3.8rem;
    letter-spacing: 0.35em;
    line-height: 1.3;
}

ruby.hero-phi {
    display: inline-flex;
    flex-direction: column-reverse;
    vertical-align: bottom;
    letter-spacing: 0;
}

rt.hero-phi {
    font-size: 0.35em;
    line-height: 1.0;
    margin-bottom: -0.1em;
    color: #ffffff;
    text-align: center;
    width: 100%;
}

.hero-line-gold {
    width: 100px;
    height: 1px;
    background: var(--gold);
    margin: 40px auto;
}

.btn-primary {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    border: 1px solid #fff;
    padding: 15px 55px;
    border-radius: 50px;
    font-size: 1rem;
    letter-spacing: 0.25em;
    font-weight: 700;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: #fff;
    color: var(--main-navy);
}

section {
    padding: 140px 0;
}

section.bg-gray {
    background-color: var(--bg-sub-gray);
}

section.bg-white {
    background-color: var(--bg-white);
}

.section-title {
    color: var(--main-navy);
    font-size: 2.4rem;
    letter-spacing: 0.35em;
    text-align: center;
    display: block;
    margin-bottom: 80px;
}

/* ==========================================================================
   グループ会社
   ========================================================================== */
.company-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.company-card-link {
    text-decoration: none;
    color: inherit;
}

.company-card {
    background: #fff;
    padding: 50px 35px;
    border-bottom: 5px solid var(--gold);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
    height: 100%;
    box-sizing: border-box;
}

.company-card:hover {
    transform: translateY(-10px);
}

.company-card h4 {
    font-size: 1.5rem;
    color: var(--main-navy);
    margin: 0 0 20px;
}

.card-sub-text {
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 20px;
}

/* ==========================================================================
   ニュースセクション
   ========================================================================== */
.news-inner,
.container-news {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.news-item-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

.news-item-link:hover {
    background: #fafafa;
}

.news-date {
    width: 140px;
    font-weight: 700;
    color: var(--gold);
    font-size: 1.15rem;
    flex-shrink: 0;
    text-align: left;
}

.news-content {
    flex: 1;
    padding-left: 40px;
    border-left: 1px solid #eee;
    text-align: left;
}

.news-badge {
    display: inline-block;
    background: var(--main-navy);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 12px;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.news-more-btn {
    text-align: center;
    margin-top: 80px;
}

.btn-secondary {
    display: inline-block;
    color: var(--main-navy);
    text-decoration: none;
    border: 1px solid var(--main-navy);
    padding: 18px 80px;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    transition: 0.4s;
    position: relative;
    background: transparent;
}

.btn-secondary:hover {
    background: var(--main-navy);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 36, 75, 0.2);
}

.btn-secondary::after {
    content: '>';
    margin-left: 15px;
    font-family: serif;
    transition: 0.4s;
}

.btn-secondary:hover::after {
    margin-left: 25px;
}

/* ==========================================================================
   about.html専用：精密余白
   ========================================================================== */
.message-section-wrapper {
    padding: 100px 0;
    background-color: var(--bg-white);
}

.message-layout {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.message-image {
    flex: 0 0 320px;
    text-align: center;
}

.image-placeholder {
    width: 100%;
    height: 420px;
    background-color: var(--main-navy);
    background-image: url('images/president.png');
    background-size: cover;
    background-position: center;
}

.message-body {
    flex: 1;
    text-align: justify;
}

#philosophy {
    background-color: var(--main-navy);
    color: var(--text-white);
    padding: 100px 0;
    text-align: center;
}

#philosophy h2 {
    font-size: 3.5rem;
    letter-spacing: 0.35em;
    line-height: 1.4;
    margin-bottom: 40px;
}

ruby.phi-ruby {
    display: inline-flex;
    flex-direction: column-reverse;
    vertical-align: bottom;
    letter-spacing: 0;
}

rt.phi-ruby {
    font-size: 0.35em;
    line-height: 1.0;
    margin-bottom: -0.1em;
    color: #ffffff;
    text-align: center;
    width: 100%;
}

.milestone-section {
    background-color: var(--bg-sub-gray);
    padding: 100px 0;
}

.milestone-container {
    display: flex;
    justify-content: center;
}

.milestone-item {
    display: flex;
    margin-bottom: 40px;
    border-left: 2px solid var(--gold);
    padding-left: 30px;
}

.milestone-year {
    font-weight: 700;
    width: 140px;
    color: var(--main-navy);
    flex-shrink: 0;
}

.profile-section {
    padding: 100px 0;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 60px;
}

.profile-table th {
    width: 25%;
    text-align: left;
    padding: 25px;
    border-bottom: 1px solid #eee;
    background: var(--bg-sub-gray);
    color: var(--main-navy);
    vertical-align: top;
}

.profile-table td {
    padding: 25px;
    border-bottom: 1px solid #eee;
}

/* ==========================================================================
   グループ企業詳細
   ========================================================================== */
.company-detail-block {
    margin-bottom: 120px;
    padding-bottom: 60px;
    border-bottom: 1px solid #eee;
}

.company-detail-block:last-child {
    border-bottom: none;
}

.company-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.company-num {
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: 700;
    border-bottom: 2px solid var(--gold);
}

.company-name-main {
    font-size: 2.2rem;
    color: var(--main-navy);
    letter-spacing: 0.15em;
    margin: 0;
}

.company-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.company-visual {
    width: 100%;
    height: 350px;
    background-color: var(--bg-sub-gray);
    background-size: cover;
    background-position: center;
}

.company-description h5 {
    font-size: 1.25rem;
    color: var(--main-navy);
    margin-bottom: 20px;
    position: relative;
    padding-left: 15px;
}

.company-description h5::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.2em;
    background: var(--gold);
}

.company-link-btn {
    margin-top: 30px;
}

/* ==========================================================================
   フッター
   ========================================================================== */
footer {
    background-color: var(--main-navy);
    color: #fff;
    padding: 80px 0 40px;
    border-top: 1px solid rgba(197, 160, 89, 0.2);
    width: 100%;
}

.footer-main-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.5rem;
    letter-spacing: 0.25em;
    color: #fff;
    margin: 0;
    text-align: center;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 50px;
    font-size: 0.95rem;
}

.footer-nav a {
    color: #bbb;
    text-decoration: none;
    letter-spacing: 0.15em;
    transition: 0.3s;
}

.footer-nav a:hover {
    color: var(--gold);
}

.footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 35px;
    text-align: center;
}

.footer-copyright p {
    font-size: 0.75rem;
    color: #666;
    letter-spacing: 0.12em;
    margin: 0;
}

/* ==========================================================================
   レスポンシブ：スマホ・タブレット対応
   ========================================================================== */
@media (max-width: 1024px) {
    .company-grid {
        grid-template-columns: 1fr;
    }

    .company-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* ヒーローエリアのスマホ補正（左右余白追加） */
    #hero {
        height: auto;
        min-height: 60vh;
        padding: 80px 20px !important;
        box-sizing: border-box;
    }

    .hero-title {
        font-size: 1.8rem !important;
        letter-spacing: 0.15em;
        line-height: 1.8;
        padding: 0 10px;
        word-break: keep-all;
    }

    /* 「業」の部分をスマホでブロック化（改行） */
    .hero-title span {
        display: block;
        margin-bottom: 0.3em;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .logo img {
        height: 40px;
        margin-right: 10px;
    }

    section {
        padding: 80px 0;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 50px;
    }

    .message-layout {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .message-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 320px;
    }

    #philosophy h2 {
        font-size: 2.2rem;
        letter-spacing: 0.2em;
    }

    .news-item-link {
        flex-direction: column;
        text-align: center;
        padding: 25px 0;
    }

    .news-content {
        padding-left: 0;
        border-left: none;
        margin-top: 15px;
        text-align: center;
    }

    .news-date {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }

    .footer-nav ul {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================================================
   【緊急施工】スマホ左右余白の絶対確保
   ========================================================================== */
@media (max-width: 768px) {

    /* 1. ヒーローエリアの幅自体を絞る */
    .hero-content {
        width: calc(100% - 40px) !important;
        /* 左右20pxずつ、合計40px分を強制的に削る */
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* 2. タイトルの文字サイズと行間を再定義 */
    .hero-title {
        font-size: 1.6rem !important;
        /* 確実に1行に収まりやすくするため、少し小さめに */
        line-height: 1.8 !important;
        padding: 0 !important;
        /* 外側で隙間を作るので、内側は0でOK */
        text-align: center !important;
        display: block !important;
    }

    /* 3. 「業」のルビが詰まらないようにする */
    ruby.hero-phi {
        margin-bottom: 0.5em !important;
    }
}

/* ==========================================================================
   【最終施工】スマホでのメインコピー1行死守設定
   ========================================================================== */
@media (max-width: 768px) {

    /* 1. タイトルの強制1行化 */
    .hero-title {
        display: block !important;
        width: 100% !important;
        font-size: 1.4rem !important;
        /* 1行に収まる限界サイズ */
        white-space: nowrap !important;
        /* 絶対に改行させない（最重要） */
        letter-spacing: 0.05em !important;
        /* 文字間を詰めて横幅を稼ぐ */
        padding: 0 15px !important;
        /* 左右に15pxの隙間を物理的に確保 */
        box-sizing: border-box !important;
        text-align: center !important;
        margin: 0 auto !important;
    }

    /* 2. ルビ（わざ）のサイズと位置を1行用に再調整 */
    ruby.hero-phi {
        display: inline-flex !important;
        flex-direction: column-reverse !important;
        vertical-align: baseline !important;
        margin-right: 0.1em !important;
    }

    rt.hero-phi {
        font-size: 0.4em !important;
        line-height: 1.0 !important;
        margin-bottom: -0.2em !important;
    }

    /* 3. 背景（#hero）の高さも最適化 */
    #hero {
        height: 50vh !important;
        /* スマホでは間延びしないよう高さを抑える */
        min-height: 300px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }
}

/* ==========================================================================
   【広報決定版】スマホ1行死守 ＆ 左右余白確保
   ========================================================================== */
@media (max-width: 768px) {

    /* 1. ヒーローエリアのコンテナに左右の隙間（20pxずつ）を強制 */
    #hero .hero-content {
        width: 100% !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
    }

    /* 2. 文字をスマホの幅に合わせて自動で縮小させ、1行に固定 */
    .hero-title {
        display: block !important;
        width: 100% !important;
        /* vw（画面幅連動）を使い、画面が狭くなれば文字も自動で小さくする魔法 */
        font-size: 6.2vw !important;
        white-space: nowrap !important;
        /* 絶対に改行させない */
        letter-spacing: 0.05em !important;
        /* 文字間を詰めて1行の収まりを良くする */
        line-height: 1.2 !important;
        margin-bottom: 30px !important;
    }

    /* 3. ルビ（わざ）が重ならないよう調整 */
    ruby.hero-phi {
        margin-right: 0.1em !important;
    }

    rt.hero-phi {
        font-size: 0.4em !important;
        margin-bottom: 0.1em !important;
    }
}

/* 4. 極端に小さいスマホ（幅320px以下）でもはみ出さないための念押し */
@media (max-width: 350px) {
    .hero-title {
        font-size: 5.8vw !important;
    }
}

/* ==========================================================================
   【緊急・最終施工】現状の全てのデザインを維持し、indexの文字だけを直す
   ========================================================================== */
@media (max-width: 768px) {

    /* 他のページ（about等）に影響を与えないよう、indexのIDのみを狙い撃ちします */
    #philosophy .container-content,
    #hero .hero-content {
        padding: 0 20px !important;
        /* 左右の余白を死守 */
        width: 100% !important;
        box-sizing: border-box !important;
    }

    #philosophy h2,
    .hero-title {
        /* 文字を1.8remまで下げて、横幅に確実に収めます */
        font-size: 1.8rem !important;
        /* これまでの「1行強制」命令をここで完全に解除し、自然な改行を許可します */
        white-space: normal !important;
        line-height: 1.6 !important;
        letter-spacing: 0.1em !important;
        word-break: keep-all !important;
        display: block !important;
        width: 100% !important;
    }

    /* ルビが崩れないよう固定 */
    ruby.phi-ruby,
    ruby.hero-phi {
        display: inline-flex !important;
        flex-direction: column-reverse !important;
        vertical-align: bottom !important;
    }
}

/* --- フッター社名のスマホはみ出し防止 --- */
@media (max-width: 768px) {
    #footer-company-name {
        /* スマホではヘッダーと同じ1.15remまで下げて、1行に収めます */
        font-size: 1.15rem !important;
        letter-spacing: 0.05em !important;
        white-space: nowrap !important;
    }
}

/* --- フッターロゴと社名のスマホ同期 --- */
@media (max-width: 768px) {
    #footer-company-name {
        font-size: 1.15rem !important;
        /* ヘッダーと同期 */
        letter-spacing: 0.05em !important;
    }

    footer img {
        height: 28px !important;
        /* スマホではロゴも少し小さく */
    }
}

@media (max-width: 350px) {
    #footer-company-name {
        font-size: 0.9rem !important;
    }

    footer img {
        height: 22px !important;
    }
}

/* --- 沿革（マイルストーン）のスマホ完全中央揃え --- */
@media (max-width: 768px) {

    /* コンテナの余白をリセットして中央へ */
    .milestone-container {
        padding: 0 !important;
        display: block !important;
        text-align: center !important;
    }

    .milestone-list {
        display: inline-block !important;
        padding: 0 !important;
        margin: 0 auto !important;
        text-align: center !important;
        width: 100% !important;
    }

    .milestone-item {
        display: block !important;
        /* 縦に並べる */
        border-left: none !important;
        /* 右寄りの最大の原因（左線）を消去 */
        padding-left: 0 !important;
        /* 左の隙間をゼロに */
        margin-bottom: 40px !important;
        text-align: center !important;
        /* 文字を真ん中へ */
        width: 100% !important;
    }

    .milestone-year {
        display: block !important;
        width: auto !important;
        margin: 0 auto 10px !important;
        padding: 0 !important;
        color: var(--gold) !important;
        font-size: 1.2rem !important;
        font-weight: 700 !important;
    }

    /* 年の下の内容も中央へ */
    .milestone-item span:last-child {
        display: block !important;
        width: 100% !important;
        line-height: 1.6 !important;
    }
}

/* --- スマホ時のみ、ボタンの左右余白を30pxに絞る --- */
@media (max-width: 768px) {

    .btn-primary,
    .btn-secondary {
        padding-left: 20px !important;
        padding-right: 20px !important;

    }
}

/* ==========================================================================
   【最終施工】ボタン位置の完全センター固定 ＆ スマホ幅調整
   ========================================================================== */

/* 1. PC・スマホ共通：ボタンを囲むエリアを中央揃えに強制する */
.hero-btn-area,
.news-more-btn {
    display: flex !important;
    justify-content: center !important;
    /* 横方向の中央 */
    align-items: center !important;
    width: 100% !important;
    margin-top: 40px !important;
    text-align: center !important;
}

/* 2. PC版のボタン幅（50px）を維持しつつ、インラインブロックで中央配置を安定させる */
.btn-primary,
.btn-secondary {
    display: inline-block !important;
    margin: 0 auto !important;
    /* HTML側のstyle="padding: 15px 50px;"をPCではそのまま活かします */
}

/* 3. スマホ時（768px以下）のみ、ボタンのサイズとはみ出しを制御する */
@media (max-width: 768px) {

    .btn-primary,
    .btn-secondary {
        /* スマホの狭い画面では、左右の余白を50pxから30pxへ強制的に絞る */
        padding-left: 30px !important;
        padding-right: 30px !important;

        /* 文字が絶対に改行されないようにし、ボタンの形を維持 */
        white-space: nowrap !important;

        /* スマホでの文字サイズ微調整 */
        font-size: 0.95rem !important;
    }

    /* ボタンエリアのスマホ用余白調整 */
    .hero-btn-area {
        margin-top: 30px !important;
        padding: 0 10px !important;
    }
}
/* --- アーカイブ・ギャラリーセクション（新規追加） --- */
.archive-records {
    padding: 60px 0;
    background: #fafafa;
}

.records-grid {
    display: grid;
    /* 1枚あたり最低320pxを確保し、画面幅に合わせて自動で列数を変える */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 40px auto 0;
}

.record-item {
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.record-image img {
    width: 100%;
    height: 220px;
    object-fit: cover; /* 比率が違う写真が来ても自動で揃える */
    display: block;
}

.record-caption {
    margin-top: 15px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #333;
    text-align: center;
    font-weight: 500;
}

/* スマホ表示のレスポンシブ制御 */
@media (max-width: 600px) {
    .records-grid {
        grid-template-columns: 1fr; /* スマホでは強制的に1列 */
        gap: 20px;
    }
    .record-image img {
        height: auto; /* スマホでは写真の全体を見せる */
    }
}