/*
 * Golb - default stylesheet
 *
 * Plain CSS for the default templates, no framework, no brand colours:
 * everything derives from the font and the text colour of the site, so
 * the output fits light and dark designs. Adjust the custom properties on
 * .golb, add your own stylesheet to plugin.tx_golb.settings.css or
 * disable this file with the constant plugin.tx_golb.settings.includeCss.
 *
 * Blocks: golb-list, golb-post, golb-terms, golb-flag, golb-pagination,
 * golb-filter, golb-related.
 */

.golb {
    --golb-space: 1rem;
    --golb-space-l: 2rem;
    --golb-radius: 0.375rem;
    --golb-border: rgb(128 128 128 / 35%);
    --golb-surface: rgb(128 128 128 / 8%);
    --golb-surface-strong: rgb(128 128 128 / 18%);
    --golb-muted: 0.72;
    --golb-small: 0.875em;
    --golb-measure: 70ch;

    box-sizing: border-box;
}

.golb *,
.golb *::before,
.golb *::after {
    box-sizing: inherit;
}

.golb img {
    display: block;
    max-width: 100%;
    height: auto;
}

.golb-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Lists ------------------------------------------------------------------ */

.golb-list {
    display: grid;
    gap: var(--golb-space-l);
    margin: 0 0 var(--golb-space-l);
    padding: 0;
    list-style: none;
}

.golb-list__item {
    margin: 0;
    padding: 0;
}

/* List view: one post per row, separated by a line */
.golb-list--list {
    gap: 0;
}

.golb-list--list .golb-list__item {
    padding: var(--golb-space-l) 0;
    border-top: 1px solid var(--golb-border);
}

.golb-list--list .golb-list__item:first-child {
    padding-top: 0;
    border-top: 0;
}

/* Latest view and related posts: cards in a responsive grid */
.golb-list--latest,
.golb-list--related {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: var(--golb-space);
}

.golb-list__empty {
    padding: var(--golb-space);
    border: 1px dashed var(--golb-border);
    border-radius: var(--golb-radius);
    text-align: center;
    opacity: var(--golb-muted);
}

/* Post teaser ------------------------------------------------------------ */

.golb-post {
    position: relative;
}

.golb-post--teaser {
    display: grid;
    gap: var(--golb-space);
}

.golb-list--latest .golb-post--teaser,
.golb-list--related .golb-post--teaser {
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--golb-border);
    border-radius: var(--golb-radius);
    background: var(--golb-surface);
    align-content: start;
}

.golb-list--latest .golb-post__body,
.golb-list--related .golb-post__body {
    padding: 0 var(--golb-space) var(--golb-space);
}

.golb-list--latest .golb-post--teaser:not(:has(.golb-post__image)) .golb-post__body,
.golb-list--related .golb-post--teaser:not(:has(.golb-post__image)) .golb-post__body {
    padding-top: var(--golb-space);
}

/* List view: image beside the text on wider screens */
@media (min-width: 40em) {
    .golb-list--list .golb-post--teaser:has(.golb-post__image) {
        grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
        align-items: start;
    }
}

.golb-post__image {
    display: block;
    margin: 0;
    overflow: hidden;
    border-radius: var(--golb-radius);
    background: var(--golb-surface-strong);
}

.golb-list--latest .golb-post__image,
.golb-list--related .golb-post__image {
    border-radius: 0;
}

.golb-post__image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.golb-post__body > :first-child {
    margin-top: 0;
}

.golb-post__body > :last-child {
    margin-bottom: 0;
}

.golb-post__title {
    margin: 0 0 0.5rem;
    font-size: 1.25em;
    line-height: 1.3;
}

.golb-post__title a {
    color: inherit;
    text-decoration: none;
}

.golb-post__title a:hover,
.golb-post__title a:focus-visible {
    text-decoration: underline;
}

.golb-post__subtitle {
    margin: 0 0 var(--golb-space);
    font-size: 1.125em;
    opacity: var(--golb-muted);
}

.golb-post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    margin: 0 0 0.75rem;
    font-size: var(--golb-small);
    opacity: var(--golb-muted);
}

.golb-post__author-image {
    width: 2em;
    height: 2em;
    border-radius: 50%;
    object-fit: cover;
}

.golb-post__abstract {
    margin: 0 0 0.75rem;
}

.golb-post__more {
    margin: 0.75rem 0 0;
    font-size: var(--golb-small);
}

.golb-post__more-link {
    font-weight: 600;
}

/* Flags (top post, archived) ---------------------------------------------- */

.golb-post__flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0 0 0.5rem;
}

.golb-flag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--golb-surface-strong);
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.golb-flag--archived {
    background: transparent;
    border: 1px solid var(--golb-border);
    opacity: var(--golb-muted);
}

.golb-post--archived .golb-post__title {
    opacity: var(--golb-muted);
}

/* Categories and tags ------------------------------------------------------ */

.golb-terms {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin: 0 0 0.5rem;
    font-size: var(--golb-small);
}

.golb-terms__label {
    opacity: var(--golb-muted);
}

.golb-term {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border: 1px solid var(--golb-border);
    border-radius: 999px;
    line-height: 1.5;
}

.golb-term--link {
    color: inherit;
    text-decoration: none;
}

.golb-term--link:hover,
.golb-term--link:focus-visible {
    background: var(--golb-surface-strong);
    text-decoration: underline;
}

.golb-terms--tags .golb-term::before {
    content: "#";
    opacity: var(--golb-muted);
}

/* Filter notice ------------------------------------------------------------ */

.golb-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: 0 0 var(--golb-space);
    padding: 0.5rem 0.75rem;
    border-radius: var(--golb-radius);
    background: var(--golb-surface);
    font-size: var(--golb-small);
}

/* Pagination --------------------------------------------------------------- */

.golb-pagination__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    margin: var(--golb-space-l) 0;
    padding: 0;
    list-style: none;
}

.golb-pagination__link {
    display: inline-block;
    min-width: 2.5em;
    padding: 0.375em 0.75em;
    border: 1px solid var(--golb-border);
    border-radius: var(--golb-radius);
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.golb-pagination__link:hover,
.golb-pagination__link:focus-visible {
    background: var(--golb-surface-strong);
}

.golb-pagination__link--current {
    border-color: currentColor;
    font-weight: 700;
}

/* Detail rendering (lib.golb.post) ---------------------------------------- */

.golb-post--detail .golb-post__header {
    margin-bottom: var(--golb-space-l);
}

.golb-post--detail .golb-post__title {
    margin-bottom: 0.5rem;
    font-size: 2em;
    line-height: 1.2;
}

.golb-post--detail .golb-post__meta {
    margin-bottom: 0;
}

.golb-post__figure {
    margin: 0 0 var(--golb-space-l);
}

.golb-post__figure .golb-post__image {
    width: 100%;
    border-radius: var(--golb-radius);
}

.golb-post__caption {
    margin-top: 0.5rem;
    font-size: var(--golb-small);
    opacity: var(--golb-muted);
}

.golb-post__abstract--lead {
    margin: 0 0 var(--golb-space-l);
    font-size: 1.125em;
    line-height: 1.5;
}

.golb-post__content {
    margin: 0 0 var(--golb-space-l);
}

.golb-post__footer {
    padding-top: var(--golb-space);
    border-top: 1px solid var(--golb-border);
}

.golb-post__footer .golb-terms:last-child {
    margin-bottom: 0;
}

/* Related posts ------------------------------------------------------------ */

.golb-related {
    margin-top: var(--golb-space-l);
    padding-top: var(--golb-space-l);
    border-top: 1px solid var(--golb-border);
}

.golb-related__title {
    margin: 0 0 var(--golb-space);
    font-size: 1.25em;
}

.golb-related .golb-post__title {
    font-size: 1.125em;
}
