/* Article Styling */
article {
    display: flex;
    margin-top: 20px;
    margin-bottom: 20px;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
}

.article-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(355px, 1fr));
    gap: 20px;
    justify-items: center;
    justify-content: center;
    width: calc(100% - 40px);
    margin-top: 20px;
    margin-bottom: 20px;
}

.article {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    width: 100%;
}

.article:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

.article-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.article-title {
    margin: 0;
    text-align: center;
    margin-top: 10px;
}

.article-description {
    text-align: center;
    font-size: 0.9rem;
    width: calc(100% - 20px);
}


.article-detail-image {
    width: calc(100% - 40px);
    height: 400px;
    border-radius: 5px;
    margin-bottom: 20px;
    object-fit: contain;
    background-color: white;
}

.article-detail-title {
    font-size: 2rem;
    color: #ff9e1a;
    margin-bottom: 10px;
}

.article-detail-title,
.article-detail-date {
    width: calc(100% - 40px);
}

.article-detail-date {
    font-size: 1rem;
    color: #ff9e1a;
    margin-bottom: 20px;
}

.article-detail-content {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    width: calc(100% - 60px);
    max-width: 800px;
}

.article-detail-content h2 {
    font-size: 1.5rem;
    color: #003366;
    margin-top: 20px;
    margin-bottom: 10px;
}

.slideshow {
    position: relative;
    width: calc(100% - 40px);
    max-width: 800px;
    height: 400px;
    overflow: hidden;
    background-color: white;
    border-radius: 15px;
}

.slideshow img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    animation: fade 33s infinite;
}

.slideshow img:nth-child(1) { animation-delay: 0s; }
.slideshow img:nth-child(2) { animation-delay: 3s; }
.slideshow img:nth-child(3) { animation-delay: 6s; }
.slideshow img:nth-child(4) { animation-delay: 9s; }
.slideshow img:nth-child(5) { animation-delay: 12s; }
.slideshow img:nth-child(6) { animation-delay: 15s; }
.slideshow img:nth-child(7) { animation-delay: 18s; }
.slideshow img:nth-child(8) { animation-delay: 21s; }
.slideshow img:nth-child(9) { animation-delay: 24s; }
.slideshow img:nth-child(10) { animation-delay: 27s; }
.slideshow img:nth-child(11) { animation-delay: 30s; }

@keyframes fade {
    0% { opacity: 0; }
    3% { opacity: 1; }
    9% { opacity: 1; }
    12% { opacity: 0; }
    100% { opacity: 0; }
}

.diary-entry {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
}

.diary-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.diary-title {
    font-size: 1.8em;
    color: #333;
}

.diary-date {
    font-size: 0.9em;
    color: #777;
}

.diary-content {
    margin-top: 10px;
}

.diary-text {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 15px;
}

.button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal,
.viewer {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active,
.viewer.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 15px;
    max-width: 440px;
    width: calc(100% - 60px);
    border-radius: 10px;
    overflow-y: auto;
    max-height: 90vh;
    position: relative;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
    gap: 15px;
    margin-top: 20px;
    border: none;
    justify-items: center;
}

.gallery img,
.gallery video {
    width: 100%;
    height: 100px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    object-fit: cover;
}

.close-btn,
.viewer-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 50px;
    background: none;
    color: #000000;
    border: none;
    cursor: pointer;
}

.viewer-close {
    color: white;
}

.viewer-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    position: relative;
}

.viewer-content img,
.viewer-content video {
    max-width: 100%;
    max-height: 100%;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    background: none;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 2;
}

.arrow.left {
    left: 20px;
}

.arrow.right {
    right: 20px;
}


@media (max-width: 400px) {
    .slideshow {
        height: 230px;
    }
}