/**
 * Styles for News Detail Page (お知らせ詳細 - single.php)
 * Follows design system and components of Yamada Dental Clinic Orthodontics
 */

/* --- Container & Card Area --- */
.news-detail-main {
    width: 100%;
}

.news-detail-container {
    width: 100%;
    background-color: #f2f2f2;
    padding-top: 120px;
    padding-bottom: 160px;
    box-sizing: border-box;
}

.news-detail-inner {
    width: 1280px;
    margin: 0 auto;
    box-sizing: border-box;
}

.news-detail-card {
    background-color: #ffffff;
    border-radius: 30px;
    padding: 100px 90px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

/* --- Header Section --- */
.news-detail-header {
    margin-bottom: 40px;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.news-detail-tag {
    background-color: #2faa87;
    color: #ffffff;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 5px;
    display: inline-block;
    text-decoration: none;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.news-detail-tag:hover {
    background-color: #268f71;
    opacity: 0.9;
}

.news-detail-date {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: #575757;
    letter-spacing: 0.8px;
}

.news-detail-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 1.5;
    color: #333333;
    letter-spacing: 0.96px;
    margin: 0 0 32px 0;
    word-break: break-word;
}

.news-detail-header-line {
    width: 100%;
    height: 1px;
    background-color: #ebdccb;
    margin-bottom: 40px;
}

/* --- Featured Image Thumbnail --- */
.news-detail-thumbnail {
    width: 100%;
    max-height: 500px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 50px;
}

.news-detail-thumbnail img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 20px;
}

/* --- Entry Body Content --- */
.news-detail-body {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 2.0;
    color: #575757;
    letter-spacing: 0.85px;
    word-break: break-word;
}

.news-detail-body p {
    margin-top: 0;
    margin-bottom: 28px;
}

.news-detail-body p:last-child {
    margin-bottom: 0;
}

/* Headings inside content */
.news-detail-body h2 {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 1.5;
    color: #63574d;
    letter-spacing: 1.2px;
    margin: 56px 0 24px 0;
    padding: 0 0 14px 0;
    border-bottom: 2px solid #ebdccb;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-detail-body h2::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #2faa87;
    border-top-left-radius: 16px;
    border-top-right-radius: 2px;
    border-bottom-left-radius: 2px;
    border-bottom-right-radius: 16px;
    flex-shrink: 0;
}

.news-detail-body h3 {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.6;
    color: #63574d;
    letter-spacing: 1px;
    margin: 44px 0 20px 0;
    padding-left: 14px;
    border-left: 4px solid #2faa87;
}

.news-detail-body h4 {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.6;
    color: #575757;
    letter-spacing: 0.5px;
    margin: 36px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ebdccb;
}

/* Links inside content */
.news-detail-body a {
    color: #2faa87;
    text-decoration: underline;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.news-detail-body a:hover {
    color: #268f71;
    opacity: 0.85;
}

/* Lists */
.news-detail-body ul {
    list-style: none;
    padding-left: 0;
    margin: 24px 0;
}

.news-detail-body ul li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 12px;
    line-height: 1.8;
}

.news-detail-body ul li::before {
    content: '●';
    position: absolute;
    left: 4px;
    top: 0;
    color: #2faa87;
    font-size: 10px;
}

.news-detail-body ol {
    margin: 24px 0;
    padding-left: 24px;
}

.news-detail-body ol li {
    margin-bottom: 12px;
    line-height: 1.8;
}

/* Blockquotes */
.news-detail-body blockquote {
    margin: 32px 0;
    padding: 24px 30px;
    background-color: #faf9f6;
    border-left: 4px solid #2faa87;
    border-radius: 8px;
    color: #63574d;
    font-style: normal;
}

.news-detail-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Tables */
.news-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    font-size: 16px;
}

.news-detail-body table th,
.news-detail-body table td {
    padding: 14px 18px;
    border: 1px solid #ebdccb;
}

.news-detail-body table th {
    background-color: #f7f4ef;
    color: #63574d;
    font-weight: 600;
    text-align: left;
}

/* Images & Figures */
.news-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 20px 0;
    display: block;
}

.news-detail-body figure {
    margin: 32px 0;
}

.news-detail-body figcaption {
    font-size: 14px;
    color: #888888;
    text-align: center;
    margin-top: 8px;
}

/* Multipage post pagination */
.page-links {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ebdccb;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* --- Post Navigation & Back Button --- */
.news-detail-nav {
    margin-top: 80px;
    padding-top: 50px;
    border-top: 1px solid #ebdccb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.news-detail-nav-item {
    flex: 1;
}

.news-detail-nav-prev {
    display: flex;
    justify-content: flex-start;
}

.news-detail-nav-center {
    display: flex;
    justify-content: center;
    flex: 0 0 auto;
}

.news-detail-nav-next {
    display: flex;
    justify-content: flex-end;
}

.news-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    color: #575757;
    letter-spacing: 0.8px;
    transition: color 0.25s ease;
    max-width: 280px;
}

.news-nav-link:hover {
    color: #2faa87;
}

.news-nav-arrow {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f1f1f1;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.news-nav-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-top: 2px solid #575757;
    border-right: 2px solid #575757;
    box-sizing: border-box;
    transition: border-color 0.25s ease;
}

.news-nav-arrow--prev::after {
    transform: translate(-40%, -50%) rotate(-135deg);
}

.news-nav-arrow--next::after {
    transform: translate(-60%, -50%) rotate(45deg);
}

.news-nav-link:hover .news-nav-arrow {
    background-color: #2faa87;
}

.news-nav-link:hover .news-nav-arrow::after {
    border-color: #ffffff;
}

.news-nav-link:hover .news-nav-arrow--prev {
    transform: translateX(-4px);
}

.news-nav-link:hover .news-nav-arrow--next {
    transform: translateX(4px);
}

.news-nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Back to list button */
.news-back-to-list-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background-color: #63574d;
    color: #ffffff;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.8px;
    padding: 14px 36px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0px 4px 12px rgba(99, 87, 77, 0.15);
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.news-back-to-list-btn:hover {
    background-color: #2faa87;
    transform: translateY(-2px);
    box-shadow: 0px 6px 16px rgba(47, 170, 135, 0.25);
}

.news-back-arrow-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.25s ease;
}

.news-back-to-list-btn:hover .news-back-arrow-circle {
    background-color: rgba(255, 255, 255, 0.35);
}

.news-back-arrow-icon {
    width: 14px;
    height: 14px;
    transform: rotate(90deg);
}

/* --- Responsive Layout (1800px and below) --- */
@media (max-width: 1800px) {
    .news-detail-container {
        padding-top: 6.25vw;
        padding-bottom: 8.333vw;
    }

    .news-detail-inner {
        width: 66.667vw;
    }

    .news-detail-card {
        border-radius: 1.563vw;
        padding: 5.208vw 4.688vw;
    }

    .news-detail-title {
        font-size: 1.667vw;
        margin-bottom: 1.667vw;
    }

    .news-detail-header-line {
        margin-bottom: 2.083vw;
    }

    .news-detail-body {
        font-size: 0.885vw;
    }

    .news-detail-body h2 {
        font-size: 1.25vw;
    }

    .news-detail-body h3 {
        font-size: 1.042vw;
    }

    .news-detail-nav {
        margin-top: 4.167vw;
        padding-top: 2.604vw;
    }


    /* Auto-generated PC Liquid (vw) Layout Rules */
    .news-detail-container {
        padding-top: 6.250vw;
        padding-bottom: 8.333vw;
    }

    .news-detail-meta {
        gap: 0.833vw;
        margin-bottom: 1.250vw;
    }

    .news-detail-tag {
        letter-spacing: 0.042vw;
        padding: 0.208vw 0.625vw;
        border-radius: 0.260vw;
    }

    .news-detail-date {
        letter-spacing: 0.042vw;
    }

    .news-detail-title {
        letter-spacing: 0.050vw;
        margin: 0 0 1.667vw 0;
    }

    .news-detail-header-line {
        height: 1.0px;
    }

    .news-detail-thumbnail img {
        max-height: 26.042vw;
        border-radius: 1.042vw;
    }

    .news-detail-body p {
        margin-bottom: 1.458vw;
    }

    .news-detail-body h2::before {
        width: 0.833vw;
        height: 0.833vw;
    }

    .news-detail-body h3 {
        letter-spacing: 0.052vw;
        margin: 2.292vw 0 1.042vw 0;
        padding-left: 0.729vw;
    }

    .news-detail-body h4 {
        letter-spacing: 0.026vw;
        margin: 1.875vw 0 0.833vw 0;
        padding-bottom: 0.417vw;
    }

    .news-detail-body ul li {
        padding-left: 1.146vw;
        margin-bottom: 0.625vw;
    }

    .news-detail-body ul li::before {
        left: 0.208vw;
    }

    .news-detail-body ol {
        margin: 1.250vw 0;
        padding-left: 1.250vw;
    }

    .news-detail-body ol li {
        margin-bottom: 0.625vw;
    }

    .news-detail-body table th,
    .news-detail-body table td {
        padding: 0.729vw 0.938vw;
    }

    .news-detail-body figure {
        margin: 1.667vw 0;
    }

    .news-detail-body figcaption {
        margin-top: 0.417vw;
    }

    .news-nav-link {
        gap: 0.625vw;
        letter-spacing: 0.042vw;
        max-width: 14.583vw;
    }

    .news-nav-arrow {
        width: 1.667vw;
        height: 1.667vw;
    }

    .news-nav-arrow::after {
        width: 0.365vw;
        height: 0.365vw;
    }

    .news-back-arrow-circle {
        width: 1.250vw;
        height: 1.250vw;
    }

    .news-back-arrow-icon {
        width: 0.729vw;
        height: 0.729vw;
    }


    /* Auto-fixed missing PC Liquid (vw) Layout Rules */
    .news-detail-header {
        margin-bottom: 2.083vw;
    }

    .news-detail-header-line {
        height: 1.0px;
    }

    .news-detail-thumbnail {
        max-height: 26.042vw;
        border-radius: 1.042vw;
        margin-bottom: 2.604vw;
    }

    .news-detail-body {
        letter-spacing: 0.044vw;
    }

    .news-detail-body h2 {
        letter-spacing: 0.062vw;
        margin: 2.917vw 0 1.250vw 0;
        padding: 0 0 0.729vw 0;
        gap: 0.625vw;
    }

    .news-detail-body ul {
        margin: 1.250vw 0;
    }

    .news-detail-body blockquote {
        margin: 1.667vw 0;
        padding: 1.250vw 1.562vw;
        border-radius: 0.417vw;
    }

    .news-detail-body table {
        margin: 1.667vw 0;
    }

    .news-detail-body img {
        border-radius: 0.833vw;
        margin: 1.042vw 0;
    }

    .page-links {
        margin-top: 2.083vw;
        padding-top: 1.042vw;
        gap: 0.521vw;
    }

    .news-detail-nav {
        gap: 1.042vw;
    }

    .news-back-to-list-btn {
        gap: 0.833vw;
        letter-spacing: 0.042vw;
        padding: 0.729vw 1.875vw;
        border-radius: 2.604vw;
    }
}

/* --- Tablet Layout (1024px and below) --- */
@media (max-width: 1024px) {
    .news-detail-container {
        padding-top: 60px;
        padding-bottom: 80px;
        padding-left: 40px;
        padding-right: 40px;
    }

    .news-detail-inner {
        width: 100%;
    }

    .news-detail-card {
        padding: 60px 40px;
        border-radius: 20px;
    }

    .news-detail-title {
        font-size: 26px;
        margin-bottom: 24px;
    }

    .news-detail-body {
        font-size: 16px;
        line-height: 1.9;
    }

    .news-detail-body h2 {
        font-size: 22px;
        margin: 44px 0 20px 0;
    }

    .news-detail-body h3 {
        font-size: 19px;
        margin: 36px 0 16px 0;
    }

    .news-detail-nav {
        margin-top: 60px;
        padding-top: 36px;
    }

    .news-nav-link {
        font-size: 15px;
        max-width: 200px;
    }

    .news-back-to-list-btn {
        padding: 12px 28px;
        font-size: 15px;
    }
}

/* --- Mobile Layout (590px and below) --- */
@media (max-width: 590px) {
    .news-detail-container {
        padding-top: 40px;
        padding-bottom: 60px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .news-detail-card {
        padding: 40px 20px;
        border-radius: 16px;
    }

    .news-detail-meta {
        gap: 12px;
        margin-bottom: 16px;
    }

    .news-detail-tag {
        font-size: 13px;
        padding: 3px 10px;
    }

    .news-detail-date {
        font-size: 13px;
    }

    .news-detail-title {
        font-size: 20px;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .news-detail-header-line {
        margin-bottom: 28px;
    }

    .news-detail-thumbnail {
        border-radius: 12px;
        margin-bottom: 30px;
    }

    .news-detail-thumbnail img {
        border-radius: 12px;
    }

    .news-detail-body {
        font-size: 15px;
        line-height: 1.85;
    }

    .news-detail-body table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .news-detail-body p {
        margin-bottom: 22px;
    }

    .news-detail-body h2 {
        font-size: 18px;
        margin: 36px 0 16px 0;
        gap: 8px;
    }

    .news-detail-body h2::before {
        width: 12px;
        height: 12px;
    }

    .news-detail-body h3 {
        font-size: 17px;
        margin: 30px 0 14px 0;
        padding-left: 10px;
        border-left-width: 3px;
    }

    .news-detail-body h4 {
        font-size: 16px;
        margin: 24px 0 12px 0;
    }

    .news-detail-nav {
        margin-top: 40px;
        padding-top: 30px;
        flex-direction: column;
        gap: 24px;
        align-items: stretch;
    }

    .news-detail-nav-item {
        width: 100%;
        display: flex;
    }

    .news-detail-nav-prev {
        justify-content: flex-start;
        order: 1;
    }

    .news-detail-nav-next {
        justify-content: flex-end;
        order: 2;
    }

    .news-detail-nav-center {
        justify-content: center;
        order: 3;
        margin-top: 10px;
    }

    .news-nav-link {
        font-size: 14px;
        max-width: 100%;
    }

    .news-nav-arrow {
        width: 28px;
        height: 28px;
    }

    .news-back-to-list-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }

    .news-back-arrow-circle {
        width: 30px;
        height: 30px;
    }

    .news-back-arrow-icon {
        width: 18px;
        height: 18px;
    }
}