@font-face {
    font-family: "OradanoGSRR";
    src: url("./asserts/OradanoGSRR.ttf") format("truetype");
}

body {
    margin: 0;
    padding: 20px;
    background-color: #f8f8f8;
}

.back-to-list {
    font-family: "DotGothic16", sans-serif;
}

.newspaper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.parent {
    display: grid;
    grid-template-columns: 2fr 100px 3fr repeat(3, 100px);
    grid-template-rows: repeat(14, 1fr);
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    height: 90vh;
    background-color: white;
    border: 1px solid #ddd;
    padding: 20px;
    margin: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 545mm;
    width: 406mm;
    position: relative;
}

.parent::after {
    background-image: url("./asserts/noise1.png");
    position: absolute;
    z-index: 99;
    opacity: 0.08;
    pointer-events: none;
    content: "";
    background-size: 140px;
    filter: brightness(50%);
    inset: 0;
}

/* 新聞タイトル */
.newspaper-title {
    font-size: 5rem;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(0, 0, 0);
    letter-spacing: 1px;
    writing-mode: vertical-rl;
    font-family: "OradanoGSRR", sans-serif;
}

/* 日付 */
.date {
    font-size: 1.2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bdc3c7;
    background-color: #ecf0f1;
    font-weight: bold;
    font-family: "OradanoGSRR", sans-serif;
}

/* 見出し */
.headline {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    padding: 5px;
    writing-mode: vertical-rl;
    font-family: "OradanoGSRR", sans-serif;
    color: black;
    text-decoration: none;
}

/* 記事本文 */
.article-body {
    font-size: 2rem;
    line-height: 1.4;
    padding: 10px;
    background-color: white;
    text-align: justify;
    overflow-y: auto;
    writing-mode: vertical-rl;
    font-family: "OradanoGSRR", sans-serif;
    overflow-y: hidden;
}

.content {
    border: 1px solid black;
}

.clickable-article {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clickable-article:hover {
    background-color: #f9f9f9;
    border-color: #3498db;
}

.article-body p {
    margin: 0 0 10px 0;
    text-indent: 1em;
}

@media (min-height: 300px) {
    .article-body {
        columns: auto 250px;
        column-gap: 20px;
        column-rule: 1px solid #95a5a6;
    }
}

.title-container {
    grid-area: 1 / 5 / 7 / 7;
    display: grid;
    grid-template-rows: 5fr 1fr;
    height: 97%;
    border: 2px solid #34495e;
}
.article-container-1 {
    grid-area: 1 / 3 / 7 / 5;
    display: grid;
    grid-template-columns: 1fr 100px;
    height: 100%;
}
.article-container-2 {
    grid-area: 7 / 3 / 11 / 7;
    display: grid;
    grid-template-columns: 1fr 100px;
    height: 100%;
}
.article-container-3 {
    grid-area: 11 / 3 / 15 / 7;
    display: grid;
    grid-template-columns: 1fr 100px;
    height: 100%;
}
.article-container-4 {
    grid-area: 1 / 1 / 8 / 3;
    display: grid;
    grid-template-columns: 1fr 100px;
    height: 100%;
}
.article-container-5 {
    grid-area: 8 / 1 / 15 / 3;
    display: grid;
    grid-template-columns: 1fr 100px;
    height: 100%;
}

.newspaper-name-area {
    grid-row: 1 / 2;
}
.date-area {
    grid-row: 2 / 3;
}
.article-1-title {
    grid-column: 2 / 3;
}
.article-1-content {
    grid-column: 1 / 2;
}
.article-2-title {
    grid-column: 2 / 3;
}
.article-2-content {
    grid-column: 1 / 2;
}
.article-3-title {
    grid-column: 2 / 3;
}
.article-3-content {
    grid-column: 1 / 2;
}
.article-4-title {
    grid-column: 2 / 3;
}
.article-4-content {
    grid-column: 1 / 2;
}
.article-5-title {
    grid-column: 2 / 3;
}
.article-5-content {
    grid-column: 1 / 2;
}

/* モーダルスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal-area {
    background-color: #fefefe;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    border: none;
    border-radius: 10px;
    width: 80%;
    max-width: 60vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

#modalTitle {
    margin-top: 0;
    margin-bottom: 20px;
    margin-right: 40px;
    color: #2c3e50;
    font-size: 5vh;
    font-weight: bold;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

#modalContent {
    font-size: 3vh;
    line-height: 1.6;
    color: #333;
    text-align: justify;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@media screen and (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 20px;
        max-height: 85vh;
    }

    .close {
        font-size: 24px;
        top: 10px;
        right: 15px;
    }

    #modalTitle {
        font-size: 1.4rem;
        margin-right: 35px;
    }

    #modalContent {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

@media screen and (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 15px;
        max-height: 90vh;
    }

    .close {
        font-size: 20px;
        top: 8px;
        right: 12px;
    }

    #modalTitle {
        font-size: 1.2rem;
        margin-right: 30px;
        margin-bottom: 15px;
    }

    #modalContent {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* モバイル用レスポンシブレイアウト */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .parent {
        display: flex;
        flex-direction: column;
        height: auto;
        width: 100%;
        max-width: 100%;
        padding: 15px;
        margin: 5px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    /* タイトル部分 */
    .title-container {
        order: 1;
        width: 100%;
        height: auto;
        border: 2px solid #34495e;
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
    }

    .newspaper-title {
        font-size: 2.5rem;
        writing-mode: horizontal-tb;
        text-align: center;
        padding: 15px;
        order: 1;
    }

    .date {
        font-size: 1rem;
        padding: 10px;
        order: 2;
        border-top: 1px solid #bdc3c7;
    }

    /* 記事コンテナ */
    .article-container-1,
    .article-container-2,
    .article-container-3,
    .article-container-4,
    .article-container-5 {
        order: 2;
        width: 100%;
        height: auto;
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
        border: 1px solid #ddd;
        border-radius: 5px;
        overflow: hidden;
    }

    /* 記事タイトル */
    .article-1-title,
    .article-2-title,
    .article-3-title,
    .article-4-title,
    .article-5-title {
        order: 1;
        width: 100%;
        border-bottom: 1px solid #ddd;
    }

    .headline {
        font-size: 1.8rem;
        writing-mode: horizontal-tb;
        text-align: center;
        padding: 15px 10px;
        line-height: 1.3;
        background-color: #f8f9fa;
    }

    /* 記事本文 */
    .article-1-content,
    .article-2-content,
    .article-3-content,
    .article-4-content,
    .article-5-content {
        order: 2;
        width: 100%;
    }

    .article-body {
        font-size: 1rem;
        writing-mode: horizontal-tb;
        text-align: left;
        padding: 15px;
        overflow-y: visible;
        columns: auto;
        column-gap: 0;
        column-rule: none;
        line-height: 1.6;
    }

    .article-body p {
        margin: 0 0 15px 0;
        text-indent: 1em;
    }

    .content {
        border: none;
    }

    .clickable-article:hover {
        background-color: #f0f0f0;
    }
}

/* より小さいモバイル画面用 */
@media screen and (max-width: 480px) {
    body {
        padding: 5px;
    }

    .parent {
        padding: 10px;
        margin: 2px;
    }

    .newspaper-title {
        font-size: 2rem;
        padding: 10px;
    }

    .date {
        font-size: 0.9rem;
        padding: 8px;
    }

    .headline {
        font-size: 1.5rem;
        padding: 12px 8px;
    }

    .article-body {
        font-size: 0.9rem;
        padding: 12px;
        line-height: 1.5;
    }

    .article-body p {
        margin: 0 0 12px 0;
    }

    .article-container-1,
    .article-container-2,
    .article-container-3,
    .article-container-4,
    .article-container-5 {
        margin-bottom: 15px;
    }
}
