/* ------------------------------------------------------------------
   伍楽園サイト 追加スタイル
   旧テーマ (soda) のCSSはそのまま使い、崩れていた箇所だけここで補正する。
   ------------------------------------------------------------------ */

/* --- 0. Drupal core のCSSを読み込まなくなった分の補い --------------- */
.element-invisible {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    overflow: hidden;
    height: 1px;
    width: 1px;
    word-wrap: normal;
}
.element-invisible.element-focusable:active,
.element-invisible.element-focusable:focus {
    position: static !important;
    clip: auto;
    overflow: visible;
    height: auto;
    width: auto;
}

/* --- 1. 画像の引き伸ばし防止 --------------------------------------
   旧テーマは img { width:100% } を全画像に効かせていたため、
   小さい画像やロゴまで横いっぱいに伸びていた。 */
img {
    max-width: 100%;
    height: auto;
}
.header-nav .basic-wrapper img,
.footer .logo,
.post-body img,
.block-block img {
    width: auto;
}
.project-img img,
.owl-portfolio-slider img {
    width: 100%;
}

/* --- 2. 施工事例グリッド ------------------------------------------
   旧サイトは複数画像のURLが連結されて壊れていたので、1枚目だけを
   指定サイズで表示する。 */
.projects-grid .project-img {
    overflow: hidden;
    background: #eee;
}
.projects-grid .project-img img {
    display: block;
    object-fit: cover;
}
.projects-grid:not(.masonry) .project-img img {
    aspect-ratio: 700 / 550;
}
.projects-grid .project-img img.no-image {
    aspect-ratio: 700 / 550;
    background: #e5e5e5;
}
.projects-grid .project-title {
    font-size: 15px;
    line-height: 1.5;
}

/* タッチ端末ではホバーが起きず事例名が一度も出ないので、画像の下に置く */
@media (hover: none), (max-width: 767px) {
    /* 旧テーマの hover 用指定を打ち消すため !important を使っている */
    .projects-grid .project-item .project-intro,
    .projects-grid .project-item:hover .project-intro {
        position: static !important;
        height: auto !important;
        padding: 12px 4px 24px !important;
        background: none !important;
        text-align: left !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
    .projects-grid .project-item .project-title {
        margin: 0 0 4px !important;
        color: #333 !important;
        font-size: 15px !important;
        line-height: 1.5;
    }
    .projects-grid .project-item .project-descr {
        color: #8a8a8a !important;
        font-size: 12px !important;
    }
}

/* 絞り込みボタン */
.filter {
    margin-bottom: 30px;
}
.filter a {
    cursor: pointer;
}

/* --- 3. 見出しバナー ----------------------------------------------
   旧テーマの既定画像（青緑のテクスチャ）はサイトの色と合わないので、
   画像が未設定のページは落ち着いた緑の単色にする。 */
.parallax.inner-banner.pages {
    background-color: #3c4a3f;
    background-position: center center;
    background-size: cover;
}
.parallax.inner-banner.pages.no-banner {
    background-image: none;
}
/* 明るい写真を背景にすると白い見出しが読めなくなるので、薄く暗さを重ねる */
.parallax.inner-banner.pages {
    position: relative;
}
.parallax.inner-banner.pages:not(.no-banner)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, .32);
    pointer-events: none;
}
.parallax.inner-banner.pages > .container {
    position: relative;
    z-index: 1;
}
/* スマホでは見出しが大きすぎて折り返し、帯からはみ出していた */
@media (max-width: 767px) {
    .parallax.inner-banner.pages {
        padding: 90px 0 60px;
    }
    .parallax.inner-banner h1.heading {
        font-size: 28px;
        line-height: 1.45;
    }
    .parallax.inner-banner p.sub {
        margin-top: 10px;
        font-size: 13px;
        line-height: 1.8;
    }
    .inner-banner .col-xs-offset-2 {
        width: 100%;
        margin-left: 0;
        padding: 0 20px;
    }
}

/* --- 4. ブログ一覧 -------------------------------------------------
   旧サイトは一覧に本文を全部出していたので抜粋表示にした。 */
.post.standand-post {
    margin-bottom: 40px;
}
.post-format .date .post-cat {
    margin-left: 12px;
    padding: 2px 10px;
    border-radius: 2px;
    background: #f0f0f0;
    color: #777;
    font-size: 11px;
    vertical-align: middle;
}
.post-format .content h3 {
    line-height: 1.5;
}
.post-body {
    line-height: 1.9;
    word-wrap: break-word;
}
.post-body p {
    margin-bottom: 1em;
}

/* 前後の記事 */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0 0;
    border-top: 1px solid #e5e5e5;
}
.post-nav a {
    max-width: 48%;
    font-size: 13px;
    line-height: 1.6;
}
.post-nav .next {
    margin-left: auto;
    text-align: right;
}

/* --- 5. サイドバー -------------------------------------------------- */
.sidebar .recent-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .recent-posts li {
    overflow: hidden;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.sidebar .recent-posts img {
    float: left;
    width: 72px;
    height: 54px;
    margin-right: 12px;
    object-fit: cover;
}
.sidebar .recent-posts .recent-title {
    display: block;
    font-size: 13px;
    line-height: 1.5;
}
.sidebar .recent-posts .recent-date {
    display: block;
    margin-left: 84px;
    color: #999;
    font-size: 11px;
}
.sidebar ul.circled li.active > a {
    font-weight: 700;
}

/* --- 6. 本文中の表 --------------------------------------------------
   会社概要の表が狭い画面で横にはみ出していた。 */
.standard-table {
    width: 100%;
    border-collapse: collapse;
}
.standard-table th,
.standard-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: top;
    line-height: 1.8;
}
.standard-table th {
    width: 22%;
    background: #fafafa;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    .standard-table,
    .standard-table tbody,
    .standard-table tr,
    .standard-table th,
    .standard-table td {
        display: block;
        width: 100%;
    }
    .standard-table th {
        border-bottom: 0;
        white-space: normal;
    }
    .standard-table td {
        padding-top: 6px;
    }
    /* 工事経歴など列の多い表は横スクロールで見せる */
    .table-scroll .standard-table,
    .table-scroll .standard-table tbody,
    .table-scroll .standard-table tr,
    .table-scroll .standard-table th,
    .table-scroll .standard-table td {
        display: revert;
        width: auto;
    }
    .table-scroll .standard-table {
        width: 100%;
        min-width: 560px;
    }
}

/* --- 7. フッター ---------------------------------------------------- */
.footer .footer-tel {
    margin-top: 18px;
}
.footer .footer-tel .tel-number {
    font-size: 20px;
    font-weight: 700;
}
.footer .footer-tel a {
    color: #fff;
}

/* --- 8. お問い合わせページ ------------------------------------------
   見出し (h3.line / h4.line) と電話番号 (p.tel) は旧テーマの指定をそのまま使う。 */
.post-body p.tel img,
.block-block p.tel img {
    width: auto;
    max-width: 100%;
}

/* --- 8b. お問い合わせフォーム ---------------------------------------- */
.contact-form {
    max-width: 760px;
}
.contact-form .form-row {
    margin-bottom: 22px;
}
.contact-form label {
    display: block;
    margin-bottom: 7px;
    color: #444;
    font-size: 14px;
    font-weight: 600;
}
.contact-form .req {
    margin-left: 4px;
    color: #c0392b;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form .form-note {
    margin: 7px 0 0;
    color: #8a8a8a;
    font-size: 12px;
    line-height: 1.7;
}
.contact-form textarea {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d8d8d8;
    border-radius: 3px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
}
.contact-form textarea {
    min-height: 180px;
    resize: vertical;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: #a0d23c;
    outline: 2px solid rgba(160, 210, 60, .3);
}
/* 自動投稿よけの隠し欄 */
.contact-form .form-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.contact-form .form-privacy {
    margin: 10px 0 24px;
    padding: 16px 18px;
    background: #f4f5f3;
    border-radius: 3px;
}
.contact-form .form-privacy p {
    margin: 0 0 10px;
    color: #666;
    font-size: 13px;
    line-height: 1.8;
}
.contact-form .form-agree {
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}
.contact-form .form-agree input {
    margin-right: 8px;
}
.contact-form .form-submit {
    text-align: center;
}
.contact-form .form-submit .btn {
    min-width: 220px;
    border: 0;
    cursor: pointer;
}
.form-errors {
    margin-bottom: 24px;
    padding: 14px 18px;
    background: #fdeceb;
    border: 1px solid #f2c0bd;
    border-radius: 3px;
    color: #a3221b;
}
.form-errors p {
    margin: 0 0 6px;
    font-weight: 700;
}
.form-errors ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
}
.form-done {
    padding: 36px 24px;
    background: #f1f6ec;
    border: 1px solid #cfe3bd;
    border-radius: 3px;
    text-align: center;
}
.form-done-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
}
.form-done p {
    line-height: 1.9;
}

@media (max-width: 767px) {
    .contact-form .form-submit .btn {
        width: 100%;
        min-width: 0;
    }
}

/* --- 8c. 下書き・予約投稿の下見の帯 ------------------------------------
   管理画面にログインしている人にだけ出る。公開側には出ない。 */
.preview-bar {
    padding: 12px 0;
    background: #8a6d1f;
    color: #fff;
    font-size: 13px;
    line-height: 1.7;
}
.preview-bar .preview-label {
    display: inline-block;
    margin-right: 10px;
    padding: 2px 10px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .22);
    font-weight: 700;
}
.preview-bar .preview-note {
    color: rgba(255, 255, 255, .92);
}
.preview-bar .preview-edit {
    margin-left: 12px;
    color: #fff;
    text-decoration: underline;
    white-space: nowrap;
}

/* --- 9. モバイルメニュー -------------------------------------------- */
@media (max-width: 991px) {
    .header-nav .navbar-nav {
        margin: 0;
        background: rgba(0, 0, 0, .85);
    }
    .header-nav .navbar-nav > li > a {
        padding: 14px 20px;
        color: #fff;
    }
}

/* --- 10. ページャ ---------------------------------------------------- */
ul.pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0;
    margin: 30px 0 0;
    list-style: none;
}
ul.pager li {
    display: inline-block;
}
ul.pager li a,
ul.pager li.pager-current {
    display: block;
    min-width: 36px;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 2px;
    text-align: center;
    font-size: 13px;
    line-height: 1.2;
}
ul.pager li.pager-current {
    background: #333;
    border-color: #333;
    color: #fff;
}
