/* dsq.css */

/* ------------------------------
   ルート変数（色の集中管理）
------------------------------ */
:root {
    --primary-color: #00A86B; /* 新しいデザインの緑系（メインカラー） */
    --secondary-color: #007bff; /* 以前のデザインの青系（サブ/リンクカラー） */
    --primary-bg-light: #F8F8F8; /* about.htmlの薄い背景色 */
    --text-color-dark: #333;
    --border-color: #ddd;
    --gap-size: 30px;
}

/* ------------------------------
   基本設定・共通コンポーネント
------------------------------ */
body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.8;
    color: var(--text-color-dark);
    background-color: #f4f4f9;
}

*, *::before, *::after {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.3s;
}

a:hover {
    color: #0056b3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 60px 0;
}

.primary-bg-light {
    background-color: var(--primary-bg-light);
}

/* ------------------------------
   ヘッダー
------------------------------ */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color-dark);
}

.header-logo-image {
    width: 150px;
    height: auto;
    margin-right: 15px;
}

.company-name {
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
    padding: 0;
    margin: 0;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 700;
}

.nav-active {
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
    color: #0056b3;
}

.nav-link:hover {
    color: var(--secondary-color);
}

.nav-contact {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link.nav-contact:hover {
    background-color: #0056b3;
    color: #fff;
}

/* ------------------------------
   ヒーローセクション (index.html)
------------------------------ */
.hero-section {
    background-image: url('image_3.jpg'); 
    background-color: #004d99;
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 250px;
    padding: 20px;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

.animated-text {
    font-size: 3em; 
    font-weight: 700;
    overflow: hidden; 
    animation: flow-in 10s ease-out infinite;
}

@keyframes flow-in {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

/* ------------------------------
   ページタイトルセクション (全ページ)
------------------------------ */
/* about.html の新しいタイトルバー */
.page-title-section {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0;
    text-align: center;
}

/* 旧CSSのタイトルセクション (about.html以外) */
.page-title2-section {
    padding: 50px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background-image: url('image_1.png');
    background-size: cover;
    background-position: center;
}

.page-title {
    font-size: 3rem;
    color: #ffffff;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.page-title2 {
    font-size: 3rem;
    color: #000000;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

/* ------------------------------
   代表挨拶セクション (about.html向け修正)
------------------------------ */
.message-section {
    padding: 4rem 0;
}

.message-content-grid {
    display: grid;
    grid-template-columns: 1.2fr 3fr;
    gap: 3rem;
    align-items: start;
}

.message-image {
    text-align: center;
}

.message-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ceo-name {
    margin-top: 15px;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: normal;
}

.ceo-name strong {
    font-size: 1.3rem;
    color: var(--text-color-dark); /* ★ ここを黒色に修正しました ★ */
}

/* **「もっと見る」機能のスタイル** */
.message-body-hidden {
    max-height: 10em;
    overflow: hidden; 
    transition: max-height 0.7s ease-in-out; 
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); 
    mask-image: linear-gradient(180deg, #000 70%, transparent); 
}

.message-body-hidden.is-open {
    max-height: 3000px;
    -webkit-mask-image: none;
    mask-image: none;
}

.read-more-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin: 25px auto 0;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.read-more-btn:hover {
    background-color: #008756;
}

.message-separator {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}


/* ------------------------------
   会社情報セクション (about.html向け修正)
------------------------------ */
.company-info-section {
    padding: 60px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gap-size);
    align-items: start;
}

.info-block {
    margin-bottom: 30px;
}

.company-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.company-info-table th,
.company-info-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.company-info-table th {
    width: 30%;
    background-color: var(--primary-bg-light);
    font-weight: 700;
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.company-info-table tr:first-child th,
.company-info-table tr:first-child td {
     border-top: 1px solid var(--border-color);
}

/* 事業内容リスト */
.section-subtitle {
    font-size: 1.75rem;
    color: var(--primary-color);
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
    margin-bottom: 25px;
    border-bottom: none;
    display: block;
}

.business-list {
    list-style-type: none;
    padding-left: 0;
}

.business-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 15px;
}

.business-list li::before {
    content: "\f058";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    position: absolute;
    left: 0;
    top: 3px;
    font-size: 0.9rem;
}

.principle-block {
    padding: 20px;
    background-color: var(--primary-bg-light);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.history-link-btn {
    display: block;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s, opacity 0.3s;
    margin-top: 20px;
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    text-decoration: none;
}

.history-link-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.company-info-table td {
    position: relative;
    padding-right: 20px;
}

.history-link {
    display: none;
}

/* ------------------------------
    会社沿革ページ (Flexbox)
------------------------------ */
.history-container {
    width: 100%;
    margin-bottom: 40px;
    background-color: #eaf7ff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    color: #000000; /* ★ 修正済み */
    border-collapse: collapse;
}

.history-row {
    display: flex;
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #000000; /* ★ 修正済み */
}

.history-row.header-row {
    background-color: #f8f8f8;
    font-weight: 700;
    /* ヘッダーの色も黒にする場合は #555 を #000000 に変更 */
    color: #000000; 
    text-align: center;
}

/* 日付と内容のセルに、確実に黒を適用するための修正を加え、既存の定義を上書きします */
.history-date-header,
.history-date-cell {
    flex: 0 0 150px;
    padding-right: 20px;
    /* ? 確実に黒に変更 */
    color: #000000 !important;
}

.history-event-header,
.history-event-cell {
    flex: 1;
    /* ? 確実に黒に変更 */
    color: #000000 !important;
}

.history-row.combined-row .history-date-cell {
    align-self: flex-start;
}

/* 会社沿革ページの見出しを強制的に黒にする */
.page-title.history-title {
    color: #000000 !important;
}

/* ------------------------------
   サービス・お知らせセクション (index.html)
------------------------------ */
.news-and-services-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 50px;
}

.services-section,
.news-section {
    flex: 1;
    min-width: 300px;
}

.news-section {
    background-color: #ffe6f2;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-top: -40px;
    height: 350px;
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-item {
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    font-size: 0.9rem;
    color: #888;
    margin-right: 15px;
}

/* ------------------------------
   営業品目 (services.html)
------------------------------ */
.services-content-section {
    padding: 60px 0;
}

.service-category {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.category-title {
    font-size: 1.5rem;
    color: #004d99;
    border-bottom: 2px solid #004d99;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.service-list {
    list-style-type: none;
    padding-left: 0;
}

.service-list li {
    padding: 10px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #f0f0f0;
}

.service-list li:last-child {
    border-bottom: none;
}

/* ------------------------------
   開発実績 (works.html)
------------------------------ */
.works-section {
    padding: 60px 0;
    text-align: center;
}

.works-title {
    font-size: 3.5rem; /* デスクトップサイズ */
    font-weight: 700;
    color: #333; 
}

.works-content {
    text-align: left;
    margin-top: 40px;
    background-color: #f0fff0;
    border: 1px solid #c0e0c0;
    border-radius: 8px;
    padding: 30px;
}

.works-content h3 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 2px solid #004d99;
    padding-bottom: 10px;
}

.works-content h4 {
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 10px;
    padding-left: 15px;
    border-left: 5px solid #004d99;
}

.works-content h5 {
    font-size: 1.2em;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 5px;
}

.works-category ul {
    list-style-type: none;
    padding-left: 0;
    line-height: 1.8;
}

.works-category li {
    padding-left: 20px;
    position: relative;
}

.works-list {
    margin-left: 20px;
}

.works-list ol {
    padding-left: 20px;
    line-height: 1.8;
}

.works-list ul {
    list-style-type: decimal;
    padding-left: 20px;
}

.works-note {
    margin-top: 40px;
    padding: 15px;
    background-color: var(--primary-bg-light);
    border-left: 5px solid var(--primary-color);
    border-radius: 5px;
}


/* ------------------------------
   お問い合わせ (contact.html)
------------------------------ */
.contact-section {
    padding: 30px 0;
    text-align: center;
}

.contact-title {
    background-color: transparent;
    border: none;
    font-size: 3em;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin: 0 auto 30px;
    padding: 0;
}

.contact-content-box {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin-top: 20px;
}

.contact-info, .contact-map {
    flex: 1;
    background-color: #fff;
    padding: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: left;
}

.contact-info h3, .contact-map h3 {
    font-size: 1.5rem;
    color: #004d99;
    border-bottom: 2px solid #004d99;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.contact-info address {
    font-style: normal;
    line-height: 1.8;
}

.mail-form-link {
    display: inline-block;
    background-color: #004d99;
    color: #fff;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.mail-form-link:hover {
    background-color: #003366;
}

.map-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #c0e0c0;
    border-radius: 5px;
}

/* フォーム共通 */
#contact-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.form-group label {
    flex: 0 0 160px;
    font-weight: 700;
    padding-right: 20px;
}

.form-group input,
.form-group textarea,
.form-group select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

#inquiry-type,
.form-group select#inquiry-type {
    width: 100%;
    flex: 1;
}

.form-buttons button[type="submit"] {
    background-color: var(--secondary-color);
    color: #fff;
    margin-right: 15px;
}

.form-buttons button[type="submit"]:hover {
    background-color: #0056b3;
    opacity: 1;
}


/* ------------------------------
   フッター
------------------------------ */
.footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-nav .footer-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9em;
}

.footer-nav .footer-link:hover {
    text-decoration: underline;
}

/* ------------------------------
   レスポンシブ対応 (768px以下)
------------------------------ */
@media (max-width: 768px) {
    /* ------------------------------
    基本設定
    ------------------------------ */
    body {
        font-size: 13px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* ------------------------------
    ヘッダー
    ------------------------------ */
    .header .container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .logo {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        width: auto;
        text-align: left;
    }
    
    .header-logo-image {
        width: 100px;
        height: auto;
    }

    .company-name {
        font-size: 1rem;
        margin-top: -5px;
        white-space: nowrap;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 8px 15px;
    }

    /* ------------------------------
    ヒーローセクション (index.html)
    ------------------------------ */
    .hero-section {
        height: 250px;
        background-position: center;
        background-size: cover;
        justify-content: center;
        flex-direction: column;
        padding: 0 20px;
    }
    
    .animated-text {
        font-size: 1.5em;
        text-align: center;
        animation: flow-in 8s ease-out infinite;
        margin-bottom: 10px;
    }
    
    .hero-subtitle {
        font-size: 0.9em;
        text-align: center;
    }
    
    /* ------------------------------
    【トップページ】 ビジョンセクションのh2調整（追加）
    ------------------------------ */
    .top-section-title {
        font-size: 1.2rem; /* h2のサイズを小さく調整 */
        white-space: nowrap; /* 念のため折り返しを防ぐ */
    }

    /* ------------------------------
    代表挨拶 (about.html)
    ------------------------------ */
    .message-section {
        padding: 50px 0;
    }
    
    .message-content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .message-image {
        order: -1;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .message-image img {
        width: 100%;
        border-radius: 5px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    
    .ceo-name {
        font-size: 1rem;
        margin-top: 10px;
    }
    
    .message-body-hidden {
        max-height: 15em;
    }

    /* ------------------------------
    サービス＆お知らせセクション
    ------------------------------ */
    .news-and-services-container {
        flex-direction: column;
        gap: 20px;
        margin-top: -20px;
    }

    .services-section {
        order: 1;
        width: 100%;
        padding: 0 15px;
    }
    
    .news-section {
        order: 2;
        width: 80%;
        margin: 0 auto 30px;
        padding: 10px;
        height: auto;
        margin-top: -30px;
        text-align: left;
    }

    .news-item {
        font-size: 0.9rem;
    }
    
    /* ------------------------------
    会社概要 (基本情報テーブル - about.html)
    ------------------------------ */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .company-info-table {
        width: 100%;
        display: block;
    }

    .company-info-table tbody, .company-info-table tr {
        display: block;
    }

    .company-info-table th,
    .company-info-table td {
        display: block;
        width: 100%;
        padding: 10px 20px;
        box-sizing: border-box;
        text-align: left;
    }

    .company-info-table th {
        background-color: #fff;
        border-bottom: none;
        padding-bottom: 0;
        font-weight: 700;
        border-left: 5px solid var(--primary-color);
        color: var(--primary-color);
    }
    
    .page-title2 {
        font-size: 1.5rem;
        text-align: center;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    /* ------------------------------
    開発実績 (works.html)のh2タイトル調整
    ------------------------------ */
    .works-title {
        font-size: 1.8rem; /* モバイル縦向きに最適なサイズに調整 */
        line-height: 1.4;
        padding: 0 5px; 
    }
    
    /* ------------------------------
    お問い合わせページ
    ------------------------------ */
    .contact-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .contact-content-box {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .contact-info, .contact-map {
        width: 90%;
        margin: 0 auto;
        padding: 15px;
    }
    
    .contact-info h3 {
        font-size: 1.2rem;
        border-left: 5px solid var(--primary-color);
        padding-left: 10px;
        color: var(--text-color-dark);
        border-bottom: 2px solid var(--primary-color);
    }
    
    /* フォームの調整 */
    #contact-form {
        padding: 20px;
    }
    
    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-group label {
        flex: auto;
        padding-right: 0;
        margin-bottom: 5px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        flex: auto;
    }
    
    .form-buttons button,
    .form-buttons a {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    /* ------------------------------
    フッター
    ------------------------------ */
    .footer .container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .footer-nav ul {
        flex-direction: column;
        gap: 5px;
        padding: 0;
    }
    
    .footer-link {
        font-size: 0.8rem;
    }
    
    .footer p {
        font-size: 0.7rem;
    }
}

/* ------------------------------
   レスポンシブ対応 (横向き)
------------------------------ */
@media (max-width: 768px) and (orientation: landscape) {
    
    .header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    
    .nav-list {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .nav-link {
        font-size: 0.7rem;
        padding: 5px 8px;
        white-space: nowrap;
    }

    .hero-section {
        height: 150px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }
    
    .animated-text {
        font-size: 1.2em;
    }

    .message-section .container {
        flex-direction: row;
        align-items: flex-start;
        gap: 30px;
    }

    .message-image img {
        width: 100px;
        border-radius: 5px;
    }

    .news-and-services-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
    }
    
    .services-section,
    .news-section {
        flex: 1;
        margin: 0;
        width: auto;
    }
    
    .company-info-table th,
    .company-info-table td {
        display: table-cell;
        width: auto;
    }
    
    .company-info-table th {
        width: 30%;
    }
    
    .contact-content-box {
        flex-direction: row;
    }
}

.contact-map iframe {
    /* HTMLに記述されたwidth属性を上書きし、親要素の幅100%にする */
    width: 100% !important; 
    height: 360px !important; 
}
