/* company.css - 会社概要ページ専用スタイル */

.company-page-main {
    padding: 50px 0 60px;
    background-color: #fff;
    /* White background for seamless look */
}

.company-section {
    padding: 20px 0;
    margin-bottom: 80px;
    /* Increased margin between major categories */
}

/* (Removed last child border removal as it's no longer needed, keeping empty for structure if preferred, or delete) */
.company-section:last-child {
    margin-bottom: 0;
}

.area-section-title {
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: var(--primary-dark);
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

/* Add an elegant golden line under the title */
.area-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
}

.area-section-title i {
    color: var(--accent-gold);
    margin-right: 15px;
}

.company-table {
    width: 100%;
    max-width: 900px;
    /* Removed margin: 0 auto to align left */
    border-collapse: collapse;
}

.company-table th,
.company-table td {
    padding: 15px 15px 15px 0;
    /* Removed left padding, reduced other padding */
    border-bottom: 1px solid #eaeaea;
}

.company-table th {
    width: 30%;
    text-align: left;
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1.1rem;
    position: relative;
    vertical-align: top;
}

/* Small gold dot indicator for table headers */
.company-table th::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--accent-gold);
    border-radius: 50%;
    margin-right: 15px;
    vertical-align: middle;
}

.company-table td {
    color: var(--text-gray);
    line-height: 1.6;
    /* Reduced line-height */
    font-size: 1.05rem;
}

/* CEO Section Styles */
.ceo-message-wrap {
    display: flex;
    gap: 60px;
    align-items: stretch;
    /* Stretch to match height */
    max-width: 1100px;
    margin: 0 auto;
}

.ceo-photo {
    flex: 0 0 450px;
    /* Wider photo */
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    /* For object-fit image */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    /* Soft shadow on image instead of section */
    max-height: 400px;
    /* Constrain image height explicitly */
}

.ceo-photo img {
    width: 100%;
    height: 100%;
    /* Stretch to fill container height */
    object-fit: cover;
    /* Maintain aspect ratio while filling */
    display: block;
}



.ceo-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center text vertically if photo is taller */
    padding: 20px 0;
}

.ceo-slogan {
    font-size: 1.6rem;
    color: var(--primary-dark);
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 25px;
    font-family: 'Noto Serif JP', serif;
    /* Switch to serif for elegant feel */
}

/* Highlight the slogan */
.ceo-slogan .highlight {
    color: var(--accent-gold);
}

.ceo-body {
    color: var(--text-gray);
    line-height: 1.5;
    font-size: 0.95rem;
    margin-bottom: 30px;
    letter-spacing: 0.03em;
}

.ceo-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-dark);
    text-align: right;
    font-family: 'Noto Serif JP', serif;
    margin-top: auto;
    /* Push to bottom if text is shorter than image */
}

/* Locations Section */
.locations-wrap {
    display: flex;
    flex-direction: column;
    /* Force vertical stacking */
    gap: 40px;
    margin-top: 30px;
}

/* Business Details Section */
.business-details-wrap {
    display: flex;
    gap: 40px;
}

.business-details-col {
    flex: 1;
}

.locations-text-area {
    flex: 1;
    min-width: 350px;
}

.location-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.location-list li {
    padding-left: 0;
    position: relative;
    /* margin-bottom handled by grid gap now */
}

.location-group-title {
    font-weight: bold;
    color: var(--primary-dark);
    margin: 15px 0px 5px 0;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

.location-group-title i {
    color: var(--accent-gold);
    margin-right: 10px;
    font-size: 1rem;
}

.location-sub-list {
    margin-left: 25px;
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.6;
    /* Reduced line-height */
}

.location-note {
    margin-top: 40px;
    font-size: 0.95rem;
    color: var(--text-gray);
    background: #fafafa;
    padding: 25px;
    border-left: 4px solid var(--accent-gold);
    border-radius: 0 4px 4px 0;
}

.locations-map-area {
    width: 100%;
    height: 400px;
    /* Reduced map height slightly */
}

.locations-map-area iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Soft shadow on map instead of section */
}

/* Clients List (2-column text) */
.clients-list-2col {
    margin-top: 40px;
}

.client-text-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 columns */
    column-gap: 30px;
    row-gap: 15px;
}

.client-text-list li {
    font-size: 1.05rem;
    color: var(--text-gray);
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
}

/* Custom bullet point */
.client-text-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background-color: var(--accent-gold);
    border-radius: 50%;
}

.clients-date-note {
    margin-top: 30px;
    text-align: right;
    font-size: 0.95rem;
    color: #888;
}

/* =========================================
   Organization Chart (会社組織)
   ========================================= */
.org-chart-wrap {
    background: #fdfdfd;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 40px 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    overflow-x: auto; /* For small screens to allow scrolling if needed, though flex should handle it */
}

.org-level {
    display: flex;
    justify-content: center;
    position: relative;
}

.org-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 24px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    position: relative;
    z-index: 2;
    transition: transform 0.2s, box-shadow 0.2s;
}
.org-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

/* Top styling */
.top-card {
    background-color: var(--primary-dark);
    color: #ffffff;
    border-color: var(--primary-dark);
    font-size: 1.15rem;
    padding: 15px 40px;
}

/* Dept styling */
.dept-card {
    background-color: #f7f7f7;
    color: var(--primary-dark);
    border-top: 3px solid var(--accent-gold);
    font-size: 1.05rem;
}

/* Sec styling */
.sec-card {
    background-color: #ffffff;
    color: #555;
    font-size: 0.95rem;
    border-left: 3px solid #d9d9d9;
    margin-bottom: 10px;
    width: 100%; /* Fill container */
}

/* Connectors */
.org-connector {
    background-color: #ccc;
    margin: 0 auto;
}
.org-connector.vertical {
    width: 2px;
    height: 30px;
}
.org-connector.vertical.short {
    height: 20px;
}

/* Layout for branches */
.level-2-3-wrapper {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    padding-top: 20px;
}

/* Top horizontal line connecting departments */
.level-2-3-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%; /* Approx center of first item */
    right: 15%; /* Approx center of last item */
    height: 2px;
    background-color: #ccc;
}
/* Vertical line up from horizontal line to top card connector */
.level-2-3-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 20px; /* Connects to horizontal */
    background-color: #ccc;
    transform: translateY(-100%);
}

.org-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 180px;
    position: relative;
}
/* Vertical line dropping from horizontal to dept cards */
.org-branch::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 2px;
    height: 20px;
    background-color: #ccc;
}

.org-sections {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 200px;
}

.nested-branch {
    width: 100%;
    min-width: auto;
}
.nested-branch::before {
    display: none; /* remove pseudo-element from nested */
}

/* Toggle Details for Layer 4 */
.org-details-toggle {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}
.org-toggle-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--accent-gold);
    font-weight: bold;
    list-style: none; /* Remove default marker */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafafa;
    transition: background-color 0.2s;
}
.org-toggle-btn:hover {
    background-color: #f0f0f0;
}
.org-toggle-btn::-webkit-details-marker {
    display: none; /* Hide for Safari */
}

.org-details-toggle[open] .org-toggle-btn i {
    transform: rotate(180deg);
    transition: transform 0.3s;
}
.org-details-toggle:not([open]) .org-toggle-btn i {
    transform: rotate(0deg);
    transition: transform 0.3s;
}

.org-details-content {
    padding: 15px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: var(--text-gray);
    background-color: #fff;
}
.org-sub-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.org-sub-list > li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dotted #ccc;
}
.org-sub-list > li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.org-sub-list > li > strong {
    color: var(--primary-dark);
    display: block;
    margin-bottom: 5px;
}
.org-sub-list ul {
    list-style: disc;
    padding-left: 20px;
    color: #666;
}
.grid-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
}

.org-description {
    margin-top: 20px;
    padding: 20px;
    background-color: #fafafa;
    border-left: 4px solid var(--accent-gold);
    color: var(--text-gray);
    line-height: 1.8;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 992px) {
    .ceo-message-wrap {
        flex-direction: column;
        gap: 40px;
    }

    .ceo-photo {
        flex: none;
        width: 100%;
        /* Take full width on mobile */
        max-width: 500px;
        height: auto;
        /* Revert to auto height based on image proportion */
        margin: 0 auto;
    }

    .ceo-photo img {
        height: auto;
    }
}

@media (max-width: 768px) {
    .client-text-list {
        grid-template-columns: 1fr;
        /* 1 column on mobile */
    }

    .company-page-main {
        padding: 50px 0;
    }

    .company-section {
        padding: 30px 0;
        margin-bottom: 40px;
    }

    .area-section-title {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }

    .company-table th,
    .company-table td {
        display: block;
        width: 100%;
        padding: 15px 10px;
    }

    .company-table th {
        border-bottom: none;
        padding-bottom: 5px;
    }

    .company-table td {
        padding-top: 0;
        padding-bottom: 20px;
    }

    .business-details-wrap {
        flex-direction: column;
        gap: 30px;
    }

    .locations-map-area {
        height: 300px;
    }
    
    /* Org Chart Mobile Overrides */
    .org-chart-wrap {
        padding: 20px 10px;
    }
    .level-2-3-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 40px;
        padding-top: 30px;
    }
    .level-2-3-wrapper::before {
        display: none; /* Hide horizontal line */
    }
    .level-2-3-wrapper::after {
        display: none; /* Hide top connector */
    }
    .org-branch::before {
        display: none; /* Hide drop line */
    }
    
    /* Replace lines with single center vertical line for stack */
    .level-2-3-wrapper {
        background-image: linear-gradient(to bottom, #ccc 0%, #ccc 100%);
        background-position: center top;
        background-size: 2px 90%;
        background-repeat: no-repeat;
    }
    .org-branch {
        width: 100%;
        max-width: 280px;
        background: #fdfdfd; /* Hide line behind card */
        padding: 10px 0;
    }
    .org-sections {
        max-width: 100%;
    }
}

/* =========================================
   Organization Chart (Image Style)
   ========================================= */
.org-chart-wrap-new {
    background: #fff;
    padding: 20px 0 40px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.org-level-top {
    text-align: center;
}

.org-box-top {
    display: inline-block;
    background-color: #555;
    color: #fff;
    padding: 12px 40px;
    font-size: 1.15rem;
    font-weight: bold;
    border: 3px solid #fff;
    outline: 1px solid #999;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.org-trunk {
    width: 2px;
    height: 30px;
    background-color: #999;
    margin: 0 auto;
    transform: translateX(-1px); /* 1px center alignment fix */
}

.org-departments {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    position: relative;
    padding-top: 20px;
    min-width: 700px;
}

/* Remove old full-span horizontal line */
.org-departments::before,
.org-departments::after {
    display: none;
}

.org-dept {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Horizontal lines drawn piecemeal to support varying column widths perfectly */
.org-dept::after {
    content: '';
    position: absolute;
    top: -20px; /* exactly at the padding top boundary */
    height: 2px;
    background-color: #999;
    z-index: 1;
}
.org-dept:first-child::after {
    left: 50%;
    width: calc(50% + 30px); /* reaches across gap to next column */
}
.org-dept:not(:first-child):not(:last-child)::after {
    left: 0;
    width: calc(100% + 30px); /* spans entire width plus right gap */
}
.org-dept:last-child::after {
    display: block;
    left: 0;
    width: 50%;
}

/* Drop line from horizontal branch to header */
.org-dept::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 2px;
    height: 20px;
    background-color: #999;
    margin-left: -1px;
}

.org-dept-header {
    text-align: center;
    color: #fff;
    font-weight: bold;
    padding: 14px 10px;
    font-size: 1.05rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.bg-navy { background-color: var(--primary-dark); }
.bg-gold { background-color: var(--accent-gold); }
.bg-gray { background-color: #666666; }

/* New Boxed List Style for Departments */
.org-dept-list-boxed {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; 
    position: relative;
    z-index: 2;
}

.org-dept-list-boxed > li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.org-dept-list-boxed > li::before {
    content: '';
    position: absolute;
    top: -15px; 
    left: 50%;
    width: 2px;
    height: 15px;
    background-color: #999;
    z-index: -1;
    margin-left: -1px;
}

.org-dept-list-boxed > li:first-child::before {
    top: -20px;
    height: 20px;
}

.org-box {
    background: #fff;
    border: 2px solid var(--primary-dark);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: var(--primary-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    width: 80%;
    max-width: 180px;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

/* Horizontal Sub-branches for 業務課 */
.org-sub-branch-new {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 15px;
    padding: 30px 0 0 0; /* Space for dual-line drop */
    margin: 0;
    list-style: none;
    position: relative;
    width: 100%;
}

/* Drop line from 業務課 dropping first */
.org-sub-branch-new::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 15px; /* Drop 15 down */
    background-color: #999;
    z-index: -1;
    margin-left: -1px;
}

.branch-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 140px; 
}

/* Horizontal line branching piecemeal across columns */
.branch-col::after {
    content: '';
    position: absolute;
    top: -15px; /* exactly end of first drop line */
    height: 2px;
    background-color: #999;
    z-index: -1;
}
.branch-col:first-child::after {
    left: 50%;
    width: calc(50% + 15px);
}
.branch-col:not(:first-child):not(:last-child)::after {
    left: 0;
    width: calc(100% + 15px);
}
.branch-col:last-child::after {
    display: block;
    left: 0;
    width: 50%;
}

/* Vertical line dropping to box */
.branch-col::before {
    content: '';
    position: absolute;
    top: -15px; /* start at horizontal branch height */
    left: 50%;
    width: 2px;
    height: 15px; /* drop remaining 15px */
    background-color: #999;
    z-index: -1;
    margin-left: -1px;
}

/* Detailed Leaf lists */
.org-leaf-list {
    list-style: none;
    padding: 15px 0 0 0;
    margin: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Line dropping from location box to first detail */
.org-leaf-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 15px;
    background-color: #999;
    z-index: -1;
    margin-left: -1px;
}

.org-leaf-list > li {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    margin: 0;
}

/* Connection line between leaf items */
.org-leaf-list > li::before {
    content: '';
    position: absolute;
    top: -15px; /* matches gap */
    left: 50%;
    width: 2px;
    height: 15px;
    background-color: #999;
    z-index: -1;
    margin-left: -1px;
}
.org-leaf-list > li:first-child::before {
    display: none;
}

@media (max-width: 768px) {
    .org-departments {
        flex-direction: column;
        align-items: stretch;
        gap: 30px;
        padding-top: 0;
        min-width: 100%;
    }
    .org-departments::before,
    .org-departments::after {
        display: none;
    }
    .org-dept {
        width: 100%;
        margin: 0 auto 20px;
    }
    .org-dept::before,
    .org-dept::after {
        display: none; 
    }
    .org-trunk {
        display: none;
    }

    /* Override branch for mobile */
    .org-sub-branch-new {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding-top: 15px;
    }
    .org-sub-branch-new::after {
        height: 15px; /* shorter drop line */
    }
    .branch-col {
        width: 100%;
    }
    .branch-col::after {
        display: none; /* remove horizontal connections */
    }
    .branch-col::before {
        top: -15px;
        height: 15px;
    }
}

/* =========================================
   Organization Description (Roles & Tasks)
   ========================================= */
.org-description {
    margin-top: 30px;
    padding: 25px 30px;
    background-color: #fafafa;
    border-radius: 6px;
    border: 1px solid #eaeaea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.org-roles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
}

.role-group {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 15px;
}
.role-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.role-dept {
    font-weight: bold;
    color: var(--primary-dark);
    min-width: 140px;
    margin: 0;
    padding-top: 2px;
    font-size: 1.05rem;
}

.role-group dd {
    margin: 0;
    color: var(--text-gray);
    line-height: 1.6;
    flex: 1;
    font-size: 0.95rem;
}
.role-group dd strong {
    color: #444;
}

@media (max-width: 768px) {
    .org-description {
        padding: 20px 15px;
    }
    .role-group {
        flex-direction: column;
        gap: 8px;
    }
    .role-dept {
        min-width: 100%;
        border-bottom: 2px solid var(--accent-gold);
        padding-bottom: 5px;
        margin-bottom: 5px;
        font-size: 1rem;
    }
}

.node-header {
    background-color: #6c7a89; /* 落ち着いたブルーグレー系で塗りつぶし */
    color: #fff !important;
    border-color: #6c7a89 !important; 
}