/*
 * 雪道情報（/yuki/）共通レイアウト
 */

:root {
    --yuki-blue: #086fbd;
    --yuki-blue-dark: #174d8f;
    --yuki-blue-pale: #eaf5fc;
    --yuki-border: #cbddea;
    --yuki-text: #243746;
    --yuki-shadow: 0 12px 32px rgba(25, 74, 112, 0.12);
}

html {
    background: #eaf2f7;
}

body {
    min-width: 0;
    color: var(--yuki-text);
    background:
        linear-gradient(180deg, #f7fbfe 0, #eaf2f7 420px, #eaf2f7 100%);
    font-size: 16px;
    line-height: 1.75;
}

body > .container-lg {
    max-width: none;
    padding-right: 0;
    padding-left: 0;
}

#page > header > div,
#page > article,
.container-lg > .page-header > div,
.container-lg > article,
body > .col-xl-7 {
    width: calc(100% - 32px);
    max-width: 940px !important;
    margin-right: auto;
    margin-left: auto;
    flex: 0 0 auto;
}

#page > header > div,
.container-lg > .page-header > div {
    overflow: hidden;
    background: #fff;
    box-shadow: var(--yuki-shadow);
}

#page > header img,
.page-header > div > a:first-child img {
    display: block;
    width: 100%;
    height: auto;
}

#page > article,
.container-lg > article {
    position: relative;
    min-height: 240px;
    padding-right: 38px;
    padding-left: 38px;
    background-color: #fff;
    box-shadow: var(--yuki-shadow);
}

a {
    text-underline-offset: 0.16em;
}

a:focus-visible {
    outline: 3px solid #f5a623;
    outline-offset: 3px;
}

/* /yuki/ トップ */
#page > article > .card {
    overflow: hidden;
    max-width: 700px;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(8, 111, 189, 0.16);
}

#page > article > .card .card-header {
    padding: 16px 20px;
    border: 0 !important;
    background: linear-gradient(135deg, var(--yuki-blue-dark), var(--yuki-blue)) !important;
}

#page > article > .card .card-header .h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.4;
}

#page > article > .card .card-body {
    padding: 22px 20px;
    border: 1px solid var(--yuki-border) !important;
    border-top: 0 !important;
    font-size: 1rem;
}

#page > article > .card .card-body a {
    display: inline-block;
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.55;
}

#page > article > p.h2 {
    position: relative;
    margin-bottom: 28px !important;
    color: var(--yuki-blue-dark);
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: 0.12em;
}

#page > article > p.h2::after {
    display: block;
    width: 56px;
    height: 4px;
    margin: 12px auto 0;
    border-radius: 99px;
    background: var(--yuki-blue);
    content: "";
}

#page > article > p.h2 + .d-flex {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 24px;
    max-width: 760px;
    padding-right: 0 !important;
    padding-left: 0 !important;
}

#page > article > p.h2 + .d-flex > div {
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 0 !important;
    flex: none;
}

#page > article > p.h2 + .d-flex > div > a,
#page > article > p.h2 + .d-flex > div > img {
    display: block;
    width: 100%;
    height: auto !important;
    aspect-ratio: 245 / 150;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(25, 74, 112, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#page > article > p.h2 + .d-flex > div > a > img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    object-position: center;
    background: transparent;
}

#page > article > p.h2 + .d-flex > div > .col-12:empty {
    display: none;
}

#page > article > p.h2 + .d-flex a:hover {
    box-shadow: 0 10px 25px rgba(25, 74, 112, 0.22);
    transform: translateY(-3px);
}

#page > article > p.h2 + .d-flex img {
    display: block;
    width: 100%;
    min-width: 0 !important;
    height: auto;
    border-radius: 0;
    aspect-ratio: 245 / 150;
    object-fit: cover;
    background: transparent;
}

/* 画像・リンク設定前の外部リンクバナー枠 */
.yuki-external-links {
    display: flex;
    width: 100%;
    max-width: 640px;
    margin: 44px auto 0;
    flex-direction: column;
    gap: 16px;
}

.yuki-external-links__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
    padding-left: 8px;
}

.yuki-external-links--row {
    max-width: none;
    margin: 28px 0 18px;
}

.yuki-external-links--row .yuki-external-links__list {
    flex-direction: row;
    align-items: stretch;
}

.yuki-external-links--row .yuki-external-banner {
    flex: 1 1 0;
    min-width: 0;
}

.yuki-external-links--row .yuki-external-banner__label {
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.yuki-external-links--row .yuki-external-banner__label br {
    display: block;
}

.yuki-external-links__edit {
    margin: -4px 0 4px;
    text-align: right;
}

.yuki-external-links h2 {
    margin: 0 0 4px;
    color: var(--yuki-blue-dark);
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.yuki-external-banner {
    display: flex;
    min-height: 100px;
    padding: 18px 28px;
    align-items: center;
    justify-content: center;
    border: 2px dashed #8db8d5;
    border-radius: 10px;
    background: #f3f9fd;
    color: var(--yuki-blue-dark);
    font-size: clamp(1.5rem, 3.2vw, 1.95rem);
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.yuki-external-links__list .yuki-external-banner__label {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

/* style.css の entry-content 外部リンクアイコンと同じ判定 */
.yuki-external-links__list a.yuki-external-banner[href^="http://"]:not([href*="cgi.hrr.mlit.go.jp/takada/"],[href*="www.hrr.mlit.go.jp/takada/"],[href*="www.hrr.mlit.go.jp/bosai/"],[href*="dk-press.net/test2/"],[href*="takada.dk-press.net/cms/"]):after,
.yuki-external-links__list a.yuki-external-banner[href^="https://"]:not([href*="cgi.hrr.mlit.go.jp/takada/"],[href*="www.hrr.mlit.go.jp/takada/"],[href*="www.hrr.mlit.go.jp/bosai/"],[href*="dk-press.net/test2/"],[href*="takada.dk-press.net/cms/"]):after,
.yuki-external-links__list a.yuki-external-banner[href^="//"]:not([href*="www.hrr.mlit.go.jp/takada/"],[href*="www.hrr.mlit.go.jp/bosai/"]):after {
    font-family: "FontAwesome";
    content: "\f08e";
    padding-left: 5px;
}

.yuki-external-banner.has-image {
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: 0 6px 18px rgba(25, 74, 112, 0.14);
}

a.yuki-external-banner {
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.yuki-external-banner:hover {
    color: var(--yuki-blue-dark);
    box-shadow: 0 10px 25px rgba(25, 74, 112, 0.22);
    transform: translateY(-2px);
}

.yuki-external-banner__image {
    display: block;
    width: 100%;
    height: auto;
}

/* /yuki/ 配下ページの共通ヘッダー */
.page-header {
    margin: 0;
    padding: 0;
    border: 0;
}

.yuki-nav,
.page-header .yuki-nav.d-flex.flex-wrap {
    display: flex;
    width: 100%;
    flex-wrap: nowrap !important;
    align-items: stretch;
}

.yuki-nav__item {
    width: 25%;
    min-width: 0;
    flex: 1 1 0;
}

.page-header .yuki-nav > div,
.page-header .d-flex.flex-wrap > div {
    overflow: hidden;
    min-width: 0;
}

.page-header .yuki-nav a,
.page-header .yuki-nav img,
.page-header .d-flex.flex-wrap a,
.page-header .d-flex.flex-wrap img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.yuki-nav__item img {
    aspect-ratio: 245 / 150;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.yuki-nav a {
    position: relative;
}

.yuki-nav a.active::after {
    position: absolute;
    inset: 0;
    border: 4px solid #fff;
    content: "";
    pointer-events: none;
}

.page-header .d-flex.flex-wrap a {
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.page-header .d-flex.flex-wrap a:hover {
    filter: brightness(1.04);
}

.page-header h3.river {
    min-height: 66px;
    padding: 15px 28px !important;
    background: linear-gradient(135deg, var(--yuki-blue-dark), #2869af) !important;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    line-height: 1.35;
}

/* 本文 */
.container-lg > article .entry-content > .col-sm-9 {
    width: 100%;
    max-width: 800px;
    flex: 0 0 100%;
}

.container-lg > article .entry-content p {
    line-height: 1.85;
}

.container-lg > article .entry-content h2,
.container-lg > article .entry-content h3,
.container-lg > article .entry-content h4,
.container-lg > article .entry-content h5 {
    line-height: 1.5;
}

.container-lg > article .entry-content h2,
.container-lg > article .entry-content h3,
.container-lg > article .entry-content h4 {
    border-radius: 5px;
}

.container-lg > article .entry-content .html {
    overflow-wrap: break-word;
}

.container-lg > article .entry-content > .col-sm-9 {
    min-width: 0;
}

.container-lg > article .entry-content img {
    height: auto;
}

.container-lg > article .uk-card,
.container-lg > article .shadow {
    border-radius: 8px;
    box-shadow: 0 5px 18px rgba(25, 74, 112, 0.14) !important;
}

.container-lg > article .table {
    margin-bottom: 1.5rem;
    color: var(--yuki-text);
    background: #fff;
}

.container-lg > article .table th {
    border-color: #bdd4e4;
    background-color: #e8f3fa !important;
    color: #173f67 !important;
}

.yuki-parking {
    table-layout: fixed;
    width: 100%;
}

.yuki-parking th,
.yuki-parking td {
    white-space: normal !important;
    word-break: break-word;
}

.yuki-parking th:nth-child(1),
.yuki-parking td:nth-child(1) { width: 10%; }
.yuki-parking th:nth-child(2),
.yuki-parking td:nth-child(2) { width: 28%; }
.yuki-parking th:nth-child(3),
.yuki-parking td:nth-child(3) { width: 48%; }
.yuki-parking th:nth-child(4),
.yuki-parking td:nth-child(4) { width: 14%; }

.container-lg > article .table td {
    border-color: #d5e2eb;
}

.container-lg > article .table-striped tbody tr:nth-of-type(odd) {
    background-color: #f5f9fc;
}

.yuki-stacked-contents {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding-top: 1.5rem;
}

.yuki-stacked-section__title {
    margin: 0;
    padding: 0.85rem 1.4rem;
    background: #294e99;
    color: #fff;
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
    font-weight: 700;
    line-height: 1.45;
}

.yuki-stacked-section__edit {
    margin-top: 0.75rem;
    text-align: right;
}

.yuki-stacked-section .entry-content > .col-sm-9 {
    width: 100%;
    max-width: none;
    flex: 0 0 100%;
}

/* 子ページ一覧 */
.container-lg > article > .d-flex.flex-wrap.mt-5 {
    margin-top: 2rem !important;
}

.container-lg > article > .d-flex.flex-wrap.mt-5 > div {
    margin-bottom: 1.5rem !important;
}

.container-lg > article > .d-flex.flex-wrap.mt-5 .shadow {
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.container-lg > article > .d-flex.flex-wrap.mt-5 .shadow:hover {
    box-shadow: 0 9px 24px rgba(25, 74, 112, 0.22) !important;
    transform: translateY(-3px);
}

/* フッター */
body > .col-xl-7 {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

body > .col-xl-7 .site-footer {
    padding: 28px 20px 18px !important;
    border-top: 6px solid var(--yuki-blue) !important;
    background: #f7fafc !important;
    box-shadow: 0 12px 32px rgba(25, 74, 112, 0.1);
}

body > .col-xl-7 .site-footer a {
    color: #174d7b;
}

body > .col-xl-7 .site-footer p {
    margin-bottom: 0;
    color: #526778;
}

@media (max-width: 767.98px) {
    html {
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body {
        max-width: 100%;
        overflow-x: hidden;
        font-size: 15px;
        line-height: 1.7;
    }

    #page,
    .container-lg,
    #page > header,
    .container-lg > .page-header {
        max-width: 100%;
        overflow-x: hidden;
    }

    #page > header > div,
    #page > article,
    .container-lg > .page-header > div,
    .container-lg > article,
    body > .col-xl-7 {
        box-sizing: border-box;
        width: 100%;
        max-width: 100% !important;
        margin-right: 0;
        margin-left: 0;
    }

    #page > article,
    .container-lg > article {
        overflow-x: hidden;
        padding-right: 12px;
        padding-left: 12px;
    }

    #page > article img,
    .container-lg > article img,
    #page > article video,
    .container-lg > article video,
    #page > article iframe,
    .container-lg > article iframe,
    #page > article table,
    .container-lg > article table,
    #page > article .table,
    .container-lg > article .table,
    #map,
    .leaflet-container {
        max-width: 100%;
    }

    #map,
    .leaflet-container {
        overflow: hidden;
    }

    .yuki-external-links__list .yuki-external-banner {
        font-size: clamp(1.4rem, 5.8vw, 1.85rem);
    }

    #page > article {
        padding-top: 28px !important;
        padding-bottom: 32px !important;
    }

    #page > article > .card {
        margin-bottom: 34px !important;
    }

    #page > article > .card .card-header {
        padding: 13px 12px;
    }

    #page > article > .card .card-body {
        padding: 17px 12px;
    }

    #page > article > p.h2 + .d-flex > div {
        padding: 0 !important;
    }

    #page > article > p.h2 + .d-flex {
        gap: 12px;
    }

    .yuki-external-links {
        margin-top: 34px;
        gap: 12px;
    }

    .yuki-external-links__list,
    .yuki-external-links--row .yuki-external-links__list {
        flex-direction: column;
        gap: 12px;
    }

    .yuki-external-banner {
        min-height: 82px;
        padding: 14px 16px;
    }

    #page > article > p.h2 + .d-flex a {
        border-radius: 7px;
    }

    .yuki-nav__item {
        width: 25%;
        flex-basis: 0;
    }

    .yuki-nav a.active::after {
        border-width: 2px;
    }

    .page-header #navxt-breadcrumbs,
    .page-header #navxt-breadcrumbs a,
    .page-header #navxt-breadcrumbs span {
        white-space: normal;
    }

    .page-header h2.river {
        min-height: 0;
        padding: 12px 16px !important;
        overflow: visible;
        font-size: clamp(1.1rem, 4.5vw, 1.45rem);
        text-align: left !important;
        white-space: normal;
    }

    .yuki-parking {
        font-size: 0.82rem;
    }

    .yuki-parking th,
    .yuki-parking td {
        padding: 0.45rem 0.35rem;
    }

    .yuki-parking .fa-2x {
        font-size: 1.35em;
    }

    .container-lg > article {
        padding-top: 8px !important;
        padding-bottom: 32px !important;
    }

    .container-lg > article .entry-content p {
        padding-right: 8px !important;
        padding-left: 8px !important;
        text-align: left !important;
    }

    .container-lg > article .entry-content .tab08,
    .container-lg > article .entry-content .tab18,
    .container-lg > article .entry-content .tabHan,
    .container-lg > article .entry-content .tab08 a,
    .container-lg > article .entry-content .tab18 a,
    .container-lg > article .entry-content .tabHan a,
    .container-lg > article .entry-content .tab08 h5,
    .container-lg > article .entry-content .tab18 h5,
    .container-lg > article .entry-content .tabHan h5,
    .container-lg > article .entry-content .tab08 p,
    .container-lg > article .entry-content .tab18 p,
    .container-lg > article .entry-content .tabHan p {
        text-align: center !important;
    }

    .container-lg > article .entry-content h2,
    .container-lg > article .entry-content h3,
    .container-lg > article .entry-content h4 {
        padding-right: 14px !important;
        padding-left: 14px !important;
    }

    .container-lg > article > .d-flex.flex-wrap.mt-5 > div {
        padding-right: 7px;
        padding-left: 7px;
    }

    body > .col-xl-7 .site-footer {
        padding: 22px 14px 16px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #page > article > p.h2 + .d-flex a,
    .container-lg > article > .d-flex.flex-wrap.mt-5 .shadow,
    .page-header .d-flex.flex-wrap a {
        transition: none;
    }
}
