/* ============================================================
   detail.css — 墓碑詳細ページ (grave_detail.php)
   ============================================================ */

/* ===== LAYOUT ===== */
.detail-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem 5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
}

/* ---- 1280px ---- */
@media (max-width: 1280px) {
    .detail-wrap {
        max-width: 960px;
        padding: 3.5rem 2rem 4.5rem;
    }
}

/* ---- 960px ---- */
@media (max-width: 960px) {
    .detail-wrap {
        grid-template-columns: minmax(0, 1fr);
        padding: 2.5rem 1.2rem 4rem;
        gap: 2rem;
    }

    .detail-gallery {
        max-width: 600px;
        width: 90%;
        margin: 0 auto;
    }
}

/* ===== GALLERY ===== */
.detail-gallery {
    position: static;
    min-width: 0;
}

.detail-body {
    min-width: 0;
}


.gallery-main {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--paper-mid);
    border: 1px solid rgba(201,168,76,0.15);
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.gallery-thumbs {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: calc((100% - 2 * 0.6rem) / 3);
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid rgba(201,168,76,0.15);
    opacity: 1;
    transition: opacity 0.2s, border-color 0.2s;
}

.gallery-thumb:hover {
    opacity: 1;
}

.gallery-thumb.active {
    border-color: var(--gold);
    opacity: 1;
}

/* ===== NO IMAGE ===== */
.detail-no-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--paper-mid);
    border: 1px solid rgba(201,168,76,0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: var(--text-sub);
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.detail-no-image span {
    font-size: 2.5rem;
    opacity: 0.3;
}

/* ===== TEXT BODY ===== */
.detail-body {
    padding-top: 0.5rem;
}

.detail-label {
    font-size: 1rem;
    letter-spacing: 0.25em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    font-family: 'Cinzel', serif;
}

.detail-name {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    letter-spacing: 0.05em;
}

/* ===== META ===== */
.detail-meta {
    margin-top: 0.4rem;
}

.detail-meta-row {
    display: flex;
    gap: 1.2rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(201,168,76,0.1);
}

.detail-meta-row:first-child {
    border-top: 1px solid rgba(201,168,76,0.1);
}

.detail-meta-row dt {
    font-size: 1rem;
    letter-spacing: 0.15em;
    color: var(--text-sub);
    white-space: nowrap;
    padding-top: 0.1rem;
    min-width: 3.5rem;
}

.detail-meta-row dd {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.6;
}

.detail-date {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.08em;
    color: var(--gold-light);
    font-size: 1rem !important;
}

.kyureki-note {
    margin-left: 0.4em;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--gold-light);
    opacity: 0.85;
    vertical-align: middle;
}

/* ===== COMMENT ===== */
.detail-comment {
    margin-top: 1.8rem;
    padding: 1.4rem 1.6rem;
    background: var(--paper-light);
    border-left: 3px solid var(--gold);
}

.detail-comment p {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-main);
}

/* ===== VIEW COUNT ===== */
.detail-views {
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: var(--text-sub, #888);
    letter-spacing: 0.04em;
}

/* ===== BACK BUTTON ===== */
.detail-back {
    margin-top: 2.5rem;
}

.detail-back .btn-outline {
    margin-bottom: 0.75rem;
}

/* ---- 600px ---- */
@media (max-width: 600px) {
    .detail-gallery {
        width: 100%;
        max-width: none;
    }
}

/* ---- 375px ---- */
@media (max-width: 375px) {
    .detail-wrap { padding: 2rem 0.8rem 3rem; gap: 1.5rem; }
    .detail-name { font-size: 1.6rem; }
    .detail-comment { padding: 1rem 1.2rem; }
}

/* ===== BTN (shared with main.css) ===== */
.btn-outline {
    display: inline-block;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.7rem 2rem;
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
    background: var(--gold);
    color: var(--ink);
}

/* ===== NEIGHBOR STRIP ===== */
.neighbor-strip {
    max-width: 1100px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.neighbor-strip__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.neighbor-strip__title {
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
}

.neighbor-strip__sub {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--text-sub);
    margin-left: 0.5em;
    text-transform: none;
}

.neighbor-strip__arrows {
    display: flex;
    gap: 0.4rem;
}

.neighbor-strip__arrow {
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.3);
    color: var(--gold);
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    line-height: 1;
    padding: 0;
}

.neighbor-strip__arrow:hover {
    background: rgba(201,168,76,0.2);
    border-color: var(--gold);
}

.neighbor-strip__track {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,168,76,0.25) transparent;
}

.neighbor-strip__track::-webkit-scrollbar {
    height: 3px;
}
.neighbor-strip__track::-webkit-scrollbar-track {
    background: transparent;
}
.neighbor-strip__track::-webkit-scrollbar-thumb {
    background: rgba(201,168,76,0.3);
    border-radius: 2px;
}

.neighbor-card {
    flex: 0 0 190px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.neighbor-card__img {
    width: 190px;
    height: 142px;
    overflow: hidden;
    background: var(--paper-mid);
    border: 2px solid rgba(201,168,76,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.neighbor-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.neighbor-card__noimg {
    font-size: 1.5rem;
    opacity: 0.25;
}

.neighbor-card__name {
    font-size: 0.95rem;
    color: var(--text-sub);
    text-align: center;
    letter-spacing: 0.04em;
    line-height: 1.3;
    transition: color 0.2s;
    width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.neighbor-card:hover .neighbor-card__img {
    border-color: rgba(201,168,76,0.5);
}

.neighbor-card:hover .neighbor-card__name {
    color: var(--gold);
}

.neighbor-card--current .neighbor-card__img {
    border-color: var(--gold);
}

.neighbor-card--current .neighbor-card__name {
    color: var(--gold);
    font-weight: 600;
}

@media (max-width: 600px) {
    .neighbor-strip { padding: 0 1rem; }
    .neighbor-card  { flex: 0 0 140px; }
    .neighbor-card__img  { width: 140px; height: 105px; }
    .neighbor-card__name { width: 140px; font-size: 0.88rem; }
}
