/* Category Archive – Chips, Content, FAQ */

/* ─── Two-row filter bar ─── */
.ks-chips-section {
    margin-left: calc(-1 * var(--wp--style--root--padding-left, 20px));
    margin-right: calc(-1 * var(--wp--style--root--padding-right, 20px));
    padding-left: var(--wp--style--root--padding-left, 20px);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ks-chips-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ks-chips-label {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    opacity: .4;
    flex-shrink: 0;
    width: 54px;
    text-align: right;
    line-height: 1;
}

/* Scrollable chip row */
.ks-chips-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    padding-bottom: 4px;
    -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
    mask-image: linear-gradient(to right, black 88%, transparent 100%);
}
.ks-chips-scroll::-webkit-scrollbar { display: none; }

.ks-chips {
    display: inline-flex;
    gap: 8px;
    flex-wrap: nowrap;
    padding-right: 40px;
}

/* ─── Base chip ─── */
.ks-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    transition: opacity .15s, transform .15s;
    cursor: pointer;
    box-shadow: var(--wp--custom--shadow-card-small);
}
.ks-chip:hover { opacity: .82; }
.ks-chip:active { transform: scale(0.95); }

/* ─── SVG icons via ::before ─── */
.ks-chip--time::before,
.ks-chip--age::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

/* Clock icon */
.ks-chip--time::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Ccircle cx='6' cy='6' r='5' stroke='%23F0F0F0' stroke-width='1.3'/%3E%3Cpath d='M6 3.5V6l1.5 1.5' stroke='%23F0F0F0' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Person icon */
.ks-chip--age::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Ccircle cx='6' cy='3.5' r='2' stroke='%23F0F0F0' stroke-width='1.3'/%3E%3Cpath d='M2 11c0-2.21 1.79-4 4-4s4 1.79 4 4' stroke='%23F0F0F0' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Zeit-Chips – golden */
.ks-chip--time {
    background-color: var(--wp--preset--color--accent-1);
    color: var(--wp--preset--color--contrast);
}
.ks-chip--time:hover { color: var(--wp--preset--color--contrast); }

/* Alters-Chips – lila */
.ks-chip--age {
    background-color: var(--wp--preset--color--accent-2);
    color: var(--wp--preset--color--contrast);
}
.ks-chip--age:hover { color: var(--wp--preset--color--contrast); }

/* Themen-Chips – teal */
.ks-chip--topic {
    background-color: var(--wp--preset--color--accent-3);
    color: var(--wp--preset--color--contrast);
}
.ks-chip--topic:hover { opacity: .85; color: var(--wp--preset--color--contrast); }

/* Active chip – contrast outline ring */
.ks-chip--active {
    outline: 2px solid var(--wp--preset--color--accent-1);
    outline-offset: 2px;
}

/* ─── Section headings ─── */
.ks-section-heading {
    font-size: 1.125rem;
    font-weight: 700;
    opacity: .55;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .75rem !important;
}

/* ─── Content block ─── */
.ks-term-content { font-size: 1rem; line-height: 1.7; }
.ks-term-content-block p { margin-bottom: 1rem; }
.ks-term-content-block p:last-child { margin-bottom: 0; }

/* ─── FAQ ─── */
.ks-faq__heading { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }
.ks-faq__item { border-top: 1px solid var(--wp--preset--color--accent-5, var(--wp--preset--color--accent-5)); padding: 1.25rem 0; }
.ks-faq__item:last-child { border-bottom: 1px solid var(--wp--preset--color--accent-5, var(--wp--preset--color--accent-5)); }
.ks-faq__q { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
.ks-faq__a { font-size: .9375rem; line-height: 1.6; color: var(--wp--preset--color--contrast, var(--wp--preset--color--contrast)); opacity: .75; margin: 0; }


/* ─── Story card badges (reading time + age) ─── */
/* content is injected by wp_head (ks-story-badges) using post-{id} selectors */

/* Base styles – ::after = time (right), ::before = age (left) */
.gspbgrid_item::after,
.gspbgrid_item::before {
    position: absolute;
    bottom: 10px;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .02em;
    color: var(--wp--preset--color--contrast);
    z-index: 4;
    pointer-events: none;
}

.gspbgrid_item::after {
    right: 10px;
    background-color: var(--wp--custom--badge-overlay-bg);
    border: 1px solid var(--wp--preset--color--accent-5);
}

.gspbgrid_item::before {
    left: 10px;
    background-color: var(--wp--custom--badge-overlay-bg);
    border: 1px solid var(--wp--preset--color--accent-5);
}

/* ═══════════════════════════════════════════════════════════════
   STORY COUNT
═══════════════════════════════════════════════════════════════ */

.ks-story-count {
    font-size: .875rem;
    color: var(--wp--preset--color--contrast);
    opacity: .5;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ks-story-count__num {
    font-weight: 700;
    opacity: 1;
    font-size: 1.0625rem;
    color: var(--wp--preset--color--contrast);
}

/* ═══════════════════════════════════════════════════════════════
   RELATED TERMS
═══════════════════════════════════════════════════════════════ */

.ks-related-terms {
    margin-top: 3rem;
}

.ks-related-terms__section {
    margin-bottom: 1.75rem;
}

.ks-related-terms__label {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .4;
    color: var(--wp--preset--color--contrast);
    margin: 0 0 .75rem;
}

.ks-related-terms__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 540px) {
    .ks-related-terms__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 800px) {
    .ks-related-terms__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Tile base ── */
.ks-related-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none !important;
    color: var(--wp--preset--color--contrast);
    border: 1px solid var(--wp--custom--overlay--white-8);
    transition: transform .15s, box-shadow .15s;
    position: relative;
    overflow: hidden;
}
.ks-related-tile::before {
    /* reset the story-badge ::before — only applies within gspbgrid_item */
    content: none !important;
    display: none !important;
}
.ks-related-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--wp--custom--shadow-overlay);
    color: var(--wp--preset--color--contrast);
}

/* Time tiles – amber/golden */
.ks-related-tile--time {
    background: linear-gradient(135deg, var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-1));
}
.ks-related-tile--time::after {
    /* reset story badge ::after */
    content: none !important;
    display: none !important;
}

/* Age tiles – purple */
.ks-related-tile--age {
    background: linear-gradient(135deg, var(--wp--preset--color--accent-2), var(--wp--preset--color--accent-2));
}
.ks-related-tile--age::after {
    content: none !important;
    display: none !important;
}

.ks-related-tile__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ks-related-tile__name {
    font-size: .9375rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ks-related-tile__sub {
    font-size: .75rem;
    opacity: .65;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════
   ARCHIVE CTA
═══════════════════════════════════════════════════════════════ */

.ks-archive-cta {
    margin-top: 3rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--wp--custom--mint-dark) 0%, var(--wp--preset--color--accent-2) 50%, var(--wp--custom--mint-dark) 100%);
    border: 1px solid var(--wp--custom--overlay--white-8);
    overflow: hidden;
}

.ks-archive-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 24px;
}

.ks-archive-cta__text {
    flex: 1;
    min-width: 0;
}

.ks-archive-cta__teaser {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .5;
    color: var(--wp--preset--color--contrast);
    margin: 0 0 .5rem;
}

.ks-archive-cta__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--wp--preset--color--contrast);
    margin: 0 0 .375rem;
    line-height: 1.25;
}

.ks-archive-cta__count {
    font-size: .8125rem;
    color: var(--wp--preset--color--contrast);
    opacity: .5;
    margin: 0 0 1.25rem;
}

.ks-archive-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--wp--preset--color--contrast);
    color: var(--wp--custom--mint-dark);
    font-size: .875rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 100px;
    text-decoration: none !important;
    transition: opacity .15s;
}
.ks-archive-cta__btn:hover { opacity: .88; color: var(--wp--custom--mint-dark); }

/* Preview thumbnails */
.ks-archive-cta__previews {
    display: flex;
    gap: -8px;
    flex-shrink: 0;
}

.ks-archive-cta__preview {
    width: 52px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--wp--custom--overlay--white-15);
    margin-left: -10px;
    flex-shrink: 0;
}
.ks-archive-cta__preview:first-child { margin-left: 0; }

.ks-archive-cta__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ks-archive-cta__preview--placeholder {
    opacity: .6;
}

@media (max-width: 480px) {
    .ks-archive-cta__previews { display: none; }
    .ks-archive-cta__inner { padding: 22px 18px; }
}

/* ─── Seasonal chip – warm amber glow ─── */
.ks-chip--seasonal {
    background: linear-gradient(135deg, var(--wp--preset--color--accent-1), var(--wp--custom--primary-hover));
    color: var(--wp--custom--text-on-primary);
    box-shadow: 0 2px 12px var(--wp--custom--primary-soft);
}
.ks-chip--seasonal:hover {
    color: var(--wp--custom--text-on-primary);
    box-shadow: 0 4px 16px var(--wp--custom--primary-border-soft);
    opacity: 1;
    transform: translateY(-1px);
}

/* Separator between existing chip bar and topic chips */
.ks-topic-chips-section {
    margin-top: -1rem;
}

/* ═══════════════════════════════════════════════════════════════
   DISCOVERY SWIPER  [ks_discovery_swiper]
═══════════════════════════════════════════════════════════════ */

.ks-discovery-swiper {
    margin-left: calc(-1 * var(--wp--style--root--padding-left, 20px));
    margin-right: calc(-1 * var(--wp--style--root--padding-right, 20px));
    padding-left: var(--wp--style--root--padding-left, 20px);
    margin-bottom: 2.5rem;
    margin-top: 2rem;
}

.ks-discovery-swiper__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--wp--preset--color--contrast);
    opacity: .55;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 .875rem !important;
    padding-right: var(--wp--style--root--padding-right, 20px);
}

.ks-discovery-swiper__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
}
.ks-discovery-swiper__scroll::-webkit-scrollbar { display: none; }

.ks-discovery-swiper__track {
    display: inline-flex;
    gap: 12px;
    padding-right: 40px;
}

/* ── Book-cover card ── */
.ks-discovery-card__link {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    text-decoration: none !important;
}
.ks-discovery-card {
    flex-shrink: 0;
    width: 130px;
    height: 195px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: block;
    text-decoration: none !important;
    transition: transform .2s, box-shadow .2s;
    box-shadow: var(--wp--custom--shadow-card-medium);
}
.ks-discovery-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--wp--custom--shadow-card-large);
}

/* Card uses CSS background-image – no <img> needed */
.ks-discovery-card {
    background-size: cover;
    background-position: center;
}
.ks-discovery-card--placeholder {
    background: linear-gradient(135deg, var(--wp--custom--mint-dark), var(--wp--preset--color--accent-2)) !important;
}

.ks-discovery-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--wp--custom--overlay--dark-60) 32%, transparent 68%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    gap: 5px;
}

.ks-discovery-card__title {
    font-size: .75rem;
    font-weight: 700;
    color: var(--wp--preset--color--contrast);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.ks-discovery-card__badge {
    display: inline-block;
    font-size: .625rem;
    font-weight: 700;
    color: var(--wp--preset--color--contrast);
    background-color: var(--wp--custom--overlay--mint-chip-bg);
    border: 1px solid var(--wp--custom--overlay--white-15);
    border-radius: 100px;
    padding: 2px 7px;
    align-self: flex-start;
    line-height: 1.4;
}

@media (min-width: 540px) {
    .ks-discovery-card { width: 150px; height: 225px; }
}
@media (min-width: 800px) {
    .ks-discovery-card { width: 170px; height: 255px; }
}

/* ═══════════════════════════════════════════════════════════════
   ARCHIVE BYLINE  — Kuratorin + "Stand"
═══════════════════════════════════════════════════════════════ */

.ks-archive-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0 0 1.25rem;
    font-size: .8125rem;
    color: var(--wp--preset--color--accent-4);
    line-height: 1.45;
}
.ks-archive-byline__curator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--wp--preset--color--accent-4);
}
.ks-archive-byline__curator strong {
    color: var(--wp--preset--color--contrast);
    font-weight: 700;
}
.ks-archive-byline__avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--wp--preset--color--accent-5);
}
.ks-archive-byline__date {
    color: var(--wp--preset--color--accent-4);
    opacity: .85;
    position: relative;
    padding-left: 14px;
}
.ks-archive-byline__date::before {
    content: "·";
    position: absolute;
    left: 0;
    color: var(--wp--preset--color--accent-4);
    opacity: .6;
}
@media (max-width: 560px) {
    .ks-archive-byline__date { padding-left: 0; }
    .ks-archive-byline__date::before { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   CHIP LABEL  — Override (verhindert "LESEZEIT"-Umbruch)
═══════════════════════════════════════════════════════════════ */

.ks-chips-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--wp--preset--color--accent-4);
    opacity: 1;
    flex-shrink: 0;
    width: auto;
    text-align: left;
    white-space: nowrap;
    padding-right: 4px;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════
   TOPIC TERMS  — "Themen entdecken" als horizontaler Swiper
   Pattern: Ausflug-Filter-Row (overflow-x auto, scrollbar hidden,
   Mask fade, scroll-snap proximity).
═══════════════════════════════════════════════════════════════ */

.ks-topic-terms {
    margin: 0 0 2rem;
    margin-left: calc(-1 * var(--wp--style--root--padding-left, 20px));
    margin-right: calc(-1 * var(--wp--style--root--padding-right, 20px));
    padding-left: var(--wp--style--root--padding-left, 20px);
}
.ks-topic-terms__label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--wp--preset--color--accent-4);
    margin: 0 0 .75rem;
}
.ks-topic-terms__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    padding-right: 40px;
    -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
    mask-image: linear-gradient(to right, black 88%, transparent 100%);
}
.ks-topic-terms__track::-webkit-scrollbar { display: none; }

.ks-topic-tile {
    flex: 0 0 auto;
    width: 180px;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--wp--preset--color--accent-3);
    border: 1px solid var(--wp--preset--color--accent-5);
    border-radius: 14px;
    text-decoration: none !important;
    color: var(--wp--preset--color--contrast);
    transition: border-color .15s, transform .15s, background-color .15s;
    min-height: 58px;
}
.ks-topic-tile:hover {
    border-color: var(--wp--preset--color--accent-1);
    transform: translateY(-1px);
}
.ks-topic-tile__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    background: rgba(255, 181, 71, .12);
    border: 1px solid rgba(255, 181, 71, .22);
    border-radius: 999px;
}
.ks-topic-tile__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.ks-topic-tile__name {
    font-size: .875rem;
    font-weight: 700;
    color: var(--wp--preset--color--contrast);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ks-topic-tile__count {
    font-size: .75rem;
    font-weight: 500;
    color: var(--wp--preset--color--accent-4);
    line-height: 1.2;
}

@media (min-width: 600px) {
    .ks-topic-tile { width: 200px; }
}

/* ═══════════════════════════════════════════════════════════════
   CHIP CONTRAST FIX  — dunkle Textfarbe auf Orange/Mint
   DESIGN.md: Orange-Chip → #121821, Mint-Chip → #0a1f18
═══════════════════════════════════════════════════════════════ */

.ks-chip--time {
    color: var(--wp--custom--text-on-primary);
}
.ks-chip--time:hover { color: var(--wp--custom--text-on-primary); }
.ks-chip--time::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Ccircle cx='6' cy='6' r='5' stroke='%23121821' stroke-width='1.4'/%3E%3Cpath d='M6 3.5V6l1.5 1.5' stroke='%23121821' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ks-chip--age {
    color: var(--wp--custom--mint-dark);
}
.ks-chip--age:hover { color: var(--wp--custom--mint-dark); }
.ks-chip--age::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Ccircle cx='6' cy='3.5' r='2' stroke='%230a1f18' stroke-width='1.4'/%3E%3Cpath d='M2 11c0-2.21 1.79-4 4-4s4 1.79 4 4' stroke='%230a1f18' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}
