/* Journal pages share the site's navigation and footer. The slightly deeper
   purple keeps the white archive headings and status text readable. */
body.journal-page {
    background: #6c58b7;
}

.journal-page [hidden] {
    display: none !important;
}

.journal-main {
    min-width: 0;
}

.journal-hero {
    margin: 0 auto 28px;
    text-align: center;
    overflow-wrap: anywhere;
}

.journal-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.2;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.journal-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.4rem);
    line-height: 1.5;
}

.journal-controls {
    margin: 0 auto 25px;
}

.year-navigation {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
    padding: 15px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.16);
}

.year-btn {
    min-height: 44px;
    padding: 9px 17px;
    color: #493b7d;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 50px;
    font: 700 1rem/1.3 'Raleway', sans-serif;
    cursor: pointer;
}

.year-btn:hover,
.year-btn[aria-pressed="true"] {
    color: #fff;
    background: #57418f;
    border-color: #fff;
}

.journal-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto;
}

.journal-search input {
    flex: 1 1 280px;
    min-width: 0;
    min-height: 50px;
    padding: 11px 18px;
    color: #333;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 25px;
    box-shadow: var(--shadow);
    font: 500 1rem/1.4 'Raleway', sans-serif;
}

.journal-search input::placeholder {
    color: #615b72;
    opacity: 1;
}

.journal-search input:focus-visible {
    outline: 3px solid #ffdb83;
    outline-offset: 2px;
}

.clear-search,
.reset-search {
    min-height: 44px;
    padding: 9px 16px;
    color: #493b7d;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 24px;
    font: 700 0.95rem/1.3 'Raleway', sans-serif;
    cursor: pointer;
}

.journal-status {
    margin: 15px 0 0;
    text-align: center;
    font-weight: 600;
}

.journal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 360px));
    justify-content: center;
    gap: 30px;
    margin: 0 auto 40px;
}

.journal-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    color: #333;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 15px;
    box-shadow: var(--shadow-strong);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.journal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.journal-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 638 / 902;
    padding: 20px;
    background: #fff;
}

.journal-cover img,
.journal-cover svg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #f4f2fb;
}

.journal-card-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
    overflow-wrap: anywhere;
}

.journal-card-info h2 {
    margin-bottom: 5px;
    color: #5a469e;
    font-size: 1.3rem;
    line-height: 1.35;
}

.journal-period {
    margin-bottom: 15px;
    color: #4b4659;
}

.journal-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: auto;
    padding: 10px 22px;
    color: #fff;
    background: #a0373e;
    border-radius: 50px;
    box-shadow: var(--shadow);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.journal-action:hover {
    background: #842b32;
}

.journal-action.download {
    background: #175f96;
}

.journal-action.download:hover {
    background: #104b79;
}

.journal-empty {
    max-width: 520px;
    margin: 0 auto 30px;
    padding: 30px 20px;
    color: #332c49;
    background: #fff;
    border-radius: 15px;
    text-align: center;
}

.journal-empty p {
    margin-bottom: 16px;
}

.legal-notice {
    max-width: 920px;
    margin: 0 auto 24px;
    padding: 16px 22px;
    color: #fff;
    background: #514181;
    border-left: 4px solid #ffaaa4;
    border-radius: 14px;
    box-shadow: var(--shadow);
    line-height: 1.55;
}

.journal-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .journal-grid {
        gap: 20px;
    }

    .journal-cover {
        padding: 15px;
    }

    .legal-notice {
        padding: 14px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .journal-card {
        transition: none;
    }

    .journal-card:hover {
        transform: none;
    }
}
