/* ================================================================
   GTheme — Compact Premium Archive & Issue Cards (OJS 3.3)
   Revision based on GTheme v12 Archive Fix.
   Goal: compact, tidy cards that never stretch awkwardly when only
   one issue exists, while still scaling cleanly for multiple issues.
   ================================================================ */

.gtheme-archive-page {
    width: 100%;
}

.gtheme-archive-heading {
    position: relative;
    margin: 10px 0 28px;
    padding: 0 0 18px;
}

.gtheme-archive-heading__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--gtheme-mid);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.gtheme-archive-heading h1 {
    margin: 0;
    color: var(--gtheme-dark);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.08;
    letter-spacing: -.025em;
}

.gtheme-archive-heading__rule {
    width: 54px;
    height: 3px;
    margin-top: 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gtheme-mid), var(--gtheme-accent));
}

/*
 * IMPORTANT: auto-fill + capped tracks prevents one archive issue
 * from stretching across the entire content column.
 */
.gtheme-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 380px));
    justify-content: start;
    gap: 22px;
    align-items: start;
    margin-top: 8px;
}

.gtheme-archive-grid__item {
    width: 100%;
    min-width: 0;
    max-width: 380px;
}

.gtheme-issue-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .055);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.gtheme-issue-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--gtheme-mid) 28%, rgba(15,23,42,.08));
    box-shadow: 0 18px 42px rgba(15, 23, 42, .09);
}

.gtheme-issue-card__header {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: linear-gradient(118deg, var(--gtheme-dark), var(--gtheme-mid));
}

.gtheme-issue-card__series {
    min-width: 0;
    color: #fff;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.gtheme-issue-card__date {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    color: rgba(255,255,255,.82);
    font-size: 9px;
    line-height: 1.25;
    white-space: nowrap;
}

.gtheme-issue-card__date span {
    color: rgba(255,255,255,.62);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.gtheme-issue-card__date time {
    color: #fff;
    font-size: 9px;
    font-weight: 800;
}

.gtheme-issue-card__body {
    min-width: 0;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    padding: 18px;
}

.gtheme-prose a.gtheme-issue-card__cover {
    width: 118px;
    min-width: 118px;
    align-self: start;
    display: block;
    overflow: hidden;
    border-radius: 10px;
    background: #f8fafc;
    color: inherit !important;
    box-shadow: 0 7px 18px rgba(15,23,42,.12);
    transition: transform .2s ease, box-shadow .2s ease;
}

.gtheme-prose a.gtheme-issue-card__cover:hover {
    color: inherit !important;
    transform: translateY(-2px);
    box-shadow: 0 11px 24px rgba(15,23,42,.17);
}

.gtheme-issue-card__cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 172px;
    object-fit: contain;
    background: #fff;
}

.gtheme-issue-card__cover--placeholder {
    min-height: 168px;
    padding: 14px;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    background: linear-gradient(145deg, var(--gtheme-dark), var(--gtheme-mid)) !important;
}

.gtheme-issue-card__cover--placeholder span,
.gtheme-issue-card__cover--placeholder strong {
    color: #fff;
}

.gtheme-issue-card__cover--placeholder span {
    opacity: .7;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.gtheme-issue-card__cover--placeholder strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.22;
}

.gtheme-issue-card__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2px 0 0;
}

.gtheme-issue-card__title {
    width: 100%;
    margin: 0 0 8px !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px !important;
    line-height: 1.22;
    letter-spacing: -.015em;
}

.gtheme-prose .gtheme-issue-card__title a {
    color: var(--gtheme-dark) !important;
    font-weight: 600;
}

.gtheme-prose .gtheme-issue-card__title a:hover {
    color: var(--gtheme-mid) !important;
}

.gtheme-issue-card__description {
    width: 100%;
    margin: 0 0 14px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.gtheme-issue-card__description p {
    margin: 0;
}

.gtheme-issue-card__description--fallback {
    color: #64748b;
}

.gtheme-prose a.gtheme-issue-card__action {
    margin-top: auto;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid color-mix(in srgb, var(--gtheme-mid) 28%, transparent);
    border-radius: 9px;
    background: var(--gtheme-soft);
    color: var(--gtheme-mid) !important;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    transition: background-color .2s ease, color .2s ease, transform .2s ease, border-color .2s ease;
}

.gtheme-prose a.gtheme-issue-card__action:hover,
.gtheme-prose a.gtheme-issue-card__action:focus-visible {
    background: var(--gtheme-mid);
    border-color: var(--gtheme-mid);
    color: #fff !important;
    transform: translateY(-1px);
}

.gtheme-issue-card__action svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.gtheme-archive-pagination {
    margin-top: 30px;
}

.gtheme-archive-empty {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 22px;
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,.04);
}

.gtheme-archive-empty__icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--gtheme-soft);
    color: var(--gtheme-mid);
}

.gtheme-archive-empty p {
    margin: 0;
}

html.dark .gtheme-issue-card,
html.dark .gtheme-archive-empty {
    background: #111827;
    border-color: rgba(255,255,255,.08);
}

html.dark .gtheme-archive-heading h1,
html.dark .gtheme-prose .gtheme-issue-card__title a {
    color: #f8fafc !important;
}

html.dark .gtheme-issue-card__description {
    color: #cbd5e1;
}

html.dark .gtheme-prose a.gtheme-issue-card__action {
    background: rgba(255,255,255,.06);
    color: var(--gtheme-accent) !important;
    border-color: rgba(255,255,255,.10);
}

html.dark .gtheme-prose a.gtheme-issue-card__action:hover,
html.dark .gtheme-prose a.gtheme-issue-card__action:focus-visible {
    background: var(--gtheme-mid);
    color: #fff !important;
}

@media (max-width: 760px) {
    .gtheme-archive-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 360px));
        gap: 18px;
    }
}

@media (max-width: 410px) {
    .gtheme-archive-grid,
    .gtheme-archive-grid__item {
        max-width: none;
    }

    .gtheme-issue-card__header {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .gtheme-issue-card__date {
        align-items: flex-start;
        flex-direction: row;
        gap: 6px;
    }

    .gtheme-issue-card__body {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 14px;
        padding: 15px;
    }

    .gtheme-prose a.gtheme-issue-card__cover {
        width: 104px;
        min-width: 104px;
    }

    .gtheme-issue-card__cover img {
        max-height: 150px;
    }

    .gtheme-issue-card__title {
        font-size: 16px !important;
    }

    .gtheme-issue-card__description {
        -webkit-line-clamp: 3;
        font-size: 11px;
    }
}

@media (max-width: 330px) {
    .gtheme-issue-card__body {
        grid-template-columns: 1fr;
    }

    .gtheme-prose a.gtheme-issue-card__cover {
        width: min(150px, 70%);
        min-width: 0;
        justify-self: center;
    }

    .gtheme-issue-card__content {
        align-items: center;
        text-align: center;
    }

    .gtheme-prose a.gtheme-issue-card__action {
        width: 100%;
    }
}
