/* General Styles */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f4f4f4;
    font-size: 1.1em; /* フォントサイズを少し大きく */
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 20px 0;
}

h1,
h2,
h3,
h4 {
    color: #333;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #0056b3;
    text-decoration: none;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9em;
}

.text-center {
    text-align: center;
}

/* Header */
header {
    background: #fff;
    color: #333;
    padding-top: 20px;
    min-height: 70px;
    border-bottom: #ddd 1px solid;
}

header h1 {
    float: left;
    margin: 0;
}

header h1 a {
    color: #333;
    text-decoration: none;
    font-size: 1.3em; /* フォントサイズを1.3emに設定 */
}

header h1 a:hover {
    color: #007bff;
}

header nav {
    float: right;
    margin-top: 10px;
}

header ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

header li {
    display: inline;
    padding: 0 15px;
}

header a {
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 16px;
}

header a:hover {
    color: #007bff;
    font-weight: bold;
}

/* Hero Section */
#hero {
    background-image: url(../images/haikei.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: center;
    padding: 100px 0;
    color: #000;
}

#hero h2 {
    color: #000;
    font-size: 3em;
    margin-bottom: 10px;
}

#hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #000;
}

/* Features Section */
#features {
    padding: 40px 0;
    background: #fff;
    text-align: center;
}

#features .container {
    /* Flexbox設定を削除 */
}

.feature-grid {
    display: flex;
    justify-content: space-around; /* アイテム間に均等なスペース */
    flex-wrap: nowrap; /* 折り返しを禁止 */
    margin-top: 30px;
    width: 100%; /* 親要素の幅いっぱいに */
}

.feature-item {
    flex-basis: 30%; /* 各アイテムの基準幅 */
    flex-grow: 1; /* 余ったスペースを均等に分配 */
    padding: 20px;
    margin: 10px; /* アイテム間のマージン */
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    background-color: #fff;
    display: flex; /* 内部要素をFlexboxで制御 */
    flex-direction: column; /* 縦方向に並べる */
    justify-content: space-between; /* 上下均等配置 */
    align-items: center; /* 中央揃え */
    text-align: center; /* テキスト中央揃え */
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: 100%; /* 下側に吹き出しの先端 */
    left: 50%;
    border: 15px solid transparent;
    border-top: 15px solid #ddd; /* 吹き出しの枠線 */
    transform: translateX(-50%);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: 100%; /* 下側に吹き出しの先端 */
    left: 50%;
    border: 13px solid transparent;
    border-top: 13px solid #fff; /* 吹き出しの本体 */
    transform: translateX(-50%);
    margin-top: -2px; /* 枠線との隙間調整 */
}

.speaking-image {
    max-width: 25vw; /* 画像のサイズをビューポート幅の1/4に設定 */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-top: 30px;
    display: block; /* 中央寄せのためにブロック要素に */
    margin-left: auto; /* 中央寄せ */
    margin-right: auto; /* 中央寄せ */
}

/* Responsive Design */
@media(max-width: 768px) {
    .feature-grid {
        flex-wrap: wrap; /* スマホでは折り返す */
    }

    .feature-item {
        flex-basis: 90%; /* スマホでは幅を広げる */
    }

    .speech-bubble::before,
    .speech-bubble::after {
        left: 50%; /* 吹き出しの向きを下に */
        top: 100%;
        border-right: 15px solid transparent; /* 向きを下に */
        border-top: 15px solid #ddd;
        transform: translateX(-50%);
        margin-right: 0;
        margin-top: -2px;
    }

    .speech-bubble::after {
        border-right: 13px solid transparent; /* 向きを下に */
        border-top: 13px solid #fff;
    }

    header h1,
    header nav,
    header h1 a,
    header nav ul {
        float: none;
        text-align: center;
        width: 100%;
    }

    header li {
        margin-bottom: 5px;
    }

    .feature-item,
    .service-item {
        flex-basis: 90%;
    }

    .attorney-profile {
        flex-direction: column;
        text-align: center;
    }

    .attorney-profile .profile-img {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .office-details dt,
    .office-details dd {
        float: none;
        width: 100%;
        margin-left: 0;
    }
}
#services-overview {
    padding: 40px 0;
    background: #f9f9f9;
    text-align: center;
}

.service-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 30px;
}

.service-item {
    flex-basis: 22%;
    padding: 20px;
    margin: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* News Section */
#news {
    padding: 40px 0;
    background: #fff;
}

#news ul {
    list-style: none;
    padding: 0;
}

#news li {
    padding: 10px 0;
    border-bottom: 1px dotted #ddd;
}

#news li:last-child {
    border-bottom: none;
}

#news time {
    font-weight: bold;
    margin-right: 10px;
    color: #555;
}

/* Page Title Section (for inner pages) */
#page-title {
    background: #007bff;
    color: #fff;
    padding: 50px 0;
    text-align: center;
}

#page-title h2 {
    color: #fff;
    font-size: 2.5em;
    margin: 0;
}

/* Service Detail Section */
#service-detail {
    padding: 40px 0;
    background: #fff;
}

#service-detail h3 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}

#service-detail ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 30px;
}

#service-detail li {
    margin-bottom: 10px;
}

/* Office Info Section */
#office-info {
    padding: 40px 0;
    background: #fff;
}

.attorney-profile {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.attorney-profile .profile-img {
    border-radius: 50%;
    margin-right: 20px;
}

.office-details dt {
    font-weight: bold;
    float: left;
    width: 120px;
    margin-bottom: 10px;
}

.office-details dd {
    margin-left: 140px;
    margin-bottom: 10px;
}

/* Contact Form Section */
#contact-form {
    padding: 40px 0;
    background: #fff;
}

#contact-form form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.form-group textarea {
    resize: vertical;
}

.form-group .required {
    color: #dc3545;
    font-weight: normal;
}

#contact-info {
    padding: 40px 0;
    background: #f9f9f9;
    text-align: center;
}

/* Footer */
footer {
    padding: 20px;
    margin-top: 30px;
    color: #fff;
    background-color: #333;
    text-align: center;
}

/* Responsive Design */
@media(max-width: 768px) {
    header h1,
    header nav,
    header h1 a,
    header nav ul {
        float: none;
        text-align: center;
        width: 100%;
    }

    header li {
        margin-bottom: 5px;
    }

    .feature-item,
    .service-item {
        flex-basis: 90%;
    }

    .attorney-profile {
        flex-direction: column;
        text-align: center;
    }

    .attorney-profile .profile-img {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .office-details dt,
    .office-details dd {
        float: none;
        width: 100%;
        margin-left: 0;
    }
}

/* Page Top Button */
#page-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: none; /* Initially hidden */
    z-index: 999;
    padding: 10px 15px;
    border-radius: 50%;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}

#page-top:hover {
    background-color: #0056b3;
}
