:root {
    --orange: #f49a00;
    --cream: #fff1d8;
    --ink: #2c231b;
    --line: #4d3b2c;
    --panel: #ffffff;
    --error: #8a2432;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    display: grid;
    padding: 12px 0;
    color: var(--ink);
    background: #fffaf1;
    font-family: "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 0;
    place-items: center;
}


/* ========================================
   検索結果ページ
======================================== */

.result-page {
    width: min(1180px, calc(100% - 36px));
    min-height: calc(100vh - 24px);
    margin: 0 auto;
    padding: 38px 30px 26px;

    background:
        linear-gradient(to bottom,
            var(--orange) 0 106px,
            var(--cream) 106px);

    border: 3px solid var(--line);
    box-shadow: 0 18px 36px rgba(76, 54, 28, 0.2);
}


/* ========================================
   白い検索結果ボックス
======================================== */

.result-box {
    margin-top: 34px;
    overflow: hidden;
    background: var(--panel);
    border: 3px solid var(--line);
    box-shadow: 10px 10px 0 rgba(77, 59, 44, 0.15);
}

.box-title {
    padding: 9px 16px;
    color: var(--ink);
    background: #fff7e8;
    border-bottom: 3px solid var(--line);
    font-size: 16px;
    font-weight: 900;
}


/* ========================================
   写真＋情報
======================================== */

.result-content {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    padding: 22px;
}


/* ========================================
   写真
======================================== */

.photo-area {
    min-width: 0;
}

.photo-frame {
    position: relative;

    width: 100%;
    height: min(470px, calc(100vh - 205px));
    min-height: 330px;
    max-height: 470px;

    overflow: hidden;

    background: #fffaf1;
    border: 3px solid var(--line);
}

.result-photo {
    display: block;

    width: 100%;
    max-width: 100%;

    height: 100%;
    max-height: 100%;

    object-fit: contain;
}

.photo-error {
    position: absolute;
    inset: 0;

    display: none;

    padding: 18px;

    align-content: center;
    justify-items: center;

    background: #fff8ed;
    color: #6f4b15;

    text-align: center;
}

.photo-error strong {
    display: block;

    margin-bottom: 7px;

    color: var(--ink);

    font-size: 15px;
}

.photo-error span {
    display: block;

    font-size: 12px;
}


/* ========================================
   右側情報
======================================== */

.information-area {
    min-width: 0;
}

.information-label {
    margin: 0 0 3px;

    color: #8b6124;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.16em;
}

.result-name {
    margin: 0 0 12px;

    color: var(--ink);

    font-family:
        "Yu Mincho",
        "Hiragino Mincho ProN",
        serif;

    font-size: clamp(28px, 2.8vw, 38px);
    font-weight: 700;
    line-height: 1.3;
}


/* ========================================
   詳細情報
======================================== */

.details {
    display: block;

    width: 100%;

    margin: 0;
    padding: 0;

    border-top: 2px solid rgba(77, 59, 44, 0.28);
}


/* 1行 */
.detail-row {
    display: grid;

    grid-template-columns: 150px minmax(0, 1fr);

    width: 100%;

    height: 40px;
    min-height: 40px;

    margin: 0;
    padding: 0;

    border-bottom: 2px solid rgba(77, 59, 44, 0.28);
}


/* 左右共通 */
.detail-row dt,
.detail-row dd {
    margin: 0;
}


/* 左側
   名前 / 誕生年 / 出身地 など
*/
.detail-row dt {
    display: flex;

    height: 100%;

    align-items: center;
    justify-content: flex-start;

    padding: 0 12px;

    background: #fff8ed;
    color: #6f4b15;

    font-size: 13px;
    font-weight: 900;
    line-height: 1.3;

    text-align: left;
}


/* 右側
   ねこ / 2002年 / 埼玉県 など
*/
.detail-row dd {
    display: flex;

    height: 100%;
    min-width: 0;

    align-items: center;
    justify-content: flex-start;

    padding: 0 12px;

    color: #3a2d22;

    font-size: 14px;
    line-height: 1.4;

    text-align: left;

    overflow-wrap: anywhere;
    white-space: normal;
}


/* コメント */
.comment-cell {
    display: flex;

    align-items: center;
    justify-content: flex-start;

    line-height: 1.4;

    text-align: left;
    white-space: normal;
}


/* ========================================
   ボタン
======================================== */

.result-actions {
    display: flex;

    gap: 12px;

    margin-top: 14px;
}

.search-back-button,
.memory-button,
.back-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 190px;
    min-height: 34px;

    padding: 6px 20px;

    color: var(--ink);
    background: #fff7e8;

    border: 2px solid var(--line);

    font-size: 13px;
    font-weight: 900;

    text-decoration: none;
}

.search-back-button:hover,
.memory-button:hover,
.back-button:hover {
    background: #ffe0a3;
}


/* ========================================
   エラー画面
======================================== */

.error-page {
    display: grid;

    min-height: 100vh;

    padding: 25px;

    place-items: center;

    background: #fffaf1;
}

.error-box {
    width: min(100%, 650px);

    overflow: hidden;

    background: var(--panel);

    border: 3px solid var(--line);

    box-shadow: 10px 10px 0 rgba(77, 59, 44, 0.15);
}

.error-content {
    padding: 50px 25px;

    text-align: center;
}

.error-icon {
    display: grid;

    width: 56px;
    height: 56px;

    margin: 0 auto 18px;

    border-radius: 50%;

    background: #fff1d8;
    color: var(--error);

    font-size: 29px;
    font-weight: 900;

    place-items: center;
}

.error-content h1 {
    margin: 0 0 15px;

    color: var(--ink);

    font-size: 23px;
}

.error-content p {
    margin: 0 0 25px;

    color: #6f4b15;
}


/* ========================================
   スマホ
======================================== */

@media (max-width: 650px) {

    body {
        display: block;

        padding: 0;
    }

    .result-page {
        width: 100%;
        min-height: 100vh;

        margin: 0;

        padding: 36px 14px 24px;

        border-right: 0;
        border-left: 0;
    }

    .result-content {
        display: block;

        padding: 18px;
    }

    .photo-area {
        max-width: 290px;

        margin: 0 auto 22px;
    }

    .detail-row {
        grid-template-columns: 112px minmax(0, 1fr);

        height: 44px;
        min-height: 44px;
    }

    .detail-row dt {
        padding: 0 10px;
    }

    .detail-row dd {
        padding: 0 10px;
    }

    .result-actions {
        flex-direction: column;

        gap: 10px;
    }

    .search-back-button,
    .memory-button,
    .back-button {
        width: 100%;
    }
}


/* ========================================
   小さいスマホ
======================================== */

@media (max-width: 420px) {

    .result-content {
        padding: 13px;
    }

    .detail-row {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .detail-row dt {
        font-size: 12px;
    }

    .detail-row dd {
        font-size: 14px;
    }

    .error-page {
        padding: 12px;
    }

    .error-content {
        padding: 38px 18px;
    }

    .error-content h1 {
        font-size: 20px;
    }
}