/* ============================================
   SECTIONS - Feature, About, Gallery, CTA, Footer
   ============================================ */

/* --- Features / Services Section --- */
.sw-features {
    position: relative;
}

.sw-features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gutter);
}

.sw-feature-card {
    display: block;
    padding: var(--space-6) 0;
    border-top: 2px solid var(--color-border);
    text-decoration: none;
    transition: border-color 0.2s;
}

.sw-feature-card:hover {
    border-top-color: var(--color-primary);
}

.sw-feature-card h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
    color: var(--gray-900);
    transition: color 0.2s;
}

.sw-feature-card:hover h3 {
    color: var(--color-primary);
}

.sw-feature-card p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin: 0;
}

/* --- About / Split Section --- */
.sw-split {
    display: grid;
    grid-template-columns: 1fr 2.2fr;
    gap: var(--space-16);
    align-items: center;
}

.sw-split__content {
    max-width: 520px;
}

.sw-split__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-primary);
    margin-bottom: var(--space-5);
}

.sw-split__content h2 {
    margin-bottom: var(--space-6);
}

.sw-split__content p {
    color: var(--color-text-muted);
    font-size: var(--text-lg);
    line-height: 1.75;
}

.sw-split__image {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.sw-split__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.sw-split__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 101, 189, 0.1) 0%, transparent 60%);
}

/* Floating stat card */
.sw-split__stat {
    position: absolute;
    bottom: var(--space-6);
    left: var(--space-6);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.sw-split__stat-number {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.sw-split__stat-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gray-600);
    line-height: 1.3;
}

/* --- Gallery Grid --- */
.sw-gallery {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
}

.sw-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: var(--space-3);
}

.sw-gallery__item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}

.sw-gallery__item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
}

.sw-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.sw-gallery__item:hover img {
    transform: scale(1.08);
}

.sw-gallery__item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.sw-gallery__item:hover::after {
    opacity: 1;
}

.sw-gallery__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-5);
    z-index: 2;
    color: var(--white);
    font-size: var(--text-sm);
    font-weight: 500;
    transform: translateY(10px);
    opacity: 0;
    transition: all var(--duration-normal) var(--ease-out);
}

.sw-gallery__item:hover .sw-gallery__caption {
    transform: translateY(0);
    opacity: 1;
}

/* --- CTA Section --- */
.sw-cta {
    position: relative;
    background: var(--color-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-20) var(--space-10);
    text-align: center;
    overflow: hidden;
}

.sw-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(0, 77, 143, 0.3) 0%, transparent 50%);
}

.sw-cta__content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.sw-cta h2 {
    color: var(--white);
    font-size: var(--text-4xl);
    margin-bottom: var(--space-5);
}

.sw-cta p {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-lg);
    margin: 0 auto var(--space-8);
}

.sw-cta__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* --- Stats Row --- */
.sw-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gutter);
}

.sw-stat {
    text-align: center;
    padding: var(--space-8) var(--space-4);
}

.sw-stat__number {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: var(--space-3);
}

.sw-stat__label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: 500;
}

/* --- Activities List --- */
.sw-activities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    list-style: none;
    padding: 0;
}

.sw-activities li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
    margin: 0;
}

.sw-activities li:hover {
    border-color: var(--blue-200);
    background: var(--blue-50);
}

.sw-activities li svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.sw-activities li span {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-700);
    line-height: 1.5;
}

/* --- Footer --- */
.sw-footer {
    background: var(--gray-800);
    color: var(--gray-400);
    padding: var(--space-20) 0 var(--space-8);
}

.sw-footer__top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-12);
    padding-bottom: var(--space-12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: var(--space-8);
}

.sw-footer__brand p {
    font-size: var(--text-base);
    line-height: 1.8;
    max-width: 340px;
}

.sw-footer__brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.sw-footer__brand-logo img {
    height: 120px;
    width: 120px;
}

.sw-footer__brand-logo span {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--white);
}

.sw-footer h4 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-5);
}

.sw-footer__links {
    list-style: none;
    padding: 0;
}

.sw-footer__links li {
    margin-bottom: var(--space-3);
    font-size: var(--text-base);
    color: var(--gray-400);
}

.sw-footer__links a {
    color: var(--gray-400);
    font-size: var(--text-base);
    text-decoration: none;
    transition: all var(--duration-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.sw-footer__links a:hover {
    color: var(--white);
    transform: translateX(4px);
}

.sw-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.sw-footer__social {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sw-footer__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--gray-400);
    transition: all var(--duration-fast);
}

.sw-footer__social a:hover {
    background: var(--color-primary);
    color: var(--white);
    transform: translateY(-2px);
}

.sw-footer__social a svg {
    width: 16px;
    height: 16px;
}

.sw-footer__links-inline {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.sw-footer__links-inline a {
    color: var(--gray-400);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: color var(--duration-fast);
}

.sw-footer__links-inline a:hover {
    color: var(--white);
}

/* --- Post Content Styling --- */
.sw-post-content {
    padding: calc(var(--section-padding) + 2rem) 0 var(--section-padding);
    background: var(--blue-50);
}

.sw-page-title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-10);
    padding-bottom: var(--space-6);
    border-bottom: 2px solid var(--color-border);
}

.sw-post-content .post-content h2 {
    margin-top: var(--space-12);
    margin-bottom: var(--space-5);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.sw-post-content .post-content h2:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.sw-post-content .wp-caption {
    margin: var(--space-8) 0;
}

.sw-post-content .wp-caption-text {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: var(--space-3);
}

/* hr styling */
.sw-post-content hr {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: var(--space-12) 0;
}

/* Back to top - hide evolve's */
#backtotop {
    display: none !important;
}

/* Custom back to top */
.sw-back-to-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: all var(--duration-normal) var(--ease-out);
    border: none;
    box-shadow: 0 4px 16px rgba(0, 101, 189, 0.3);
}

.sw-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sw-back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 101, 189, 0.4);
}

.sw-back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   JAHRESPROGRAMM - TablePress #1 rendered as event cards
   ============================================ */

.tablepress-table-name {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-8) !important;
    border-top: none !important;
    padding-top: 0 !important;
    font-size: var(--text-2xl);
    color: var(--gray-900);
}

#tablepress-1.tablepress {
    display: block;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    background: transparent;
    border: none;
}

/* Hide table header/footer - we are not a table anymore */
#tablepress-1 thead,
#tablepress-1 tfoot {
    display: none;
}

#tablepress-1 tbody {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

#tablepress-1 tbody > tr {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    column-gap: var(--space-6);
    margin: 0;
    padding: var(--space-6) var(--space-8);
    background: var(--white);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);
}

#tablepress-1 tbody > tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--blue-200);
}

/* Kill any tablepress cell chrome */
#tablepress-1 tbody > tr > td {
    display: block;
    padding: 0;
    background: transparent !important;
    border: none;
    color: var(--color-text);
    line-height: 1.6;
}

/* Neutralize stale TablePress custom column widths (e.g. cached .column-3 { width: 720px }) */
#tablepress-1 tbody td.column-1,
#tablepress-1 tbody td.column-2,
#tablepress-1 tbody td.column-3,
#tablepress-1 tbody td.column-4 {
    width: auto !important;
    min-width: 0 !important;
}

/* Date rail */
#tablepress-1 tbody td.column-1 {
    grid-column: 1;
    grid-row: 1 / span 3;
    min-width: 150px;
    padding-right: var(--space-6);
    border-right: 1px solid var(--color-border);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.3;
    color: var(--blue-700);
    white-space: pre-line;
}

/* Activity / title */
#tablepress-1 tbody td.column-3 {
    grid-column: 2;
    grid-row: 1;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

/* Meta: time + location */
#tablepress-1 tbody td.column-2,
#tablepress-1 tbody td.column-4 {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

#tablepress-1 tbody td.column-2 { grid-row: 2; }
#tablepress-1 tbody td.column-4 { grid-row: 3; }

#tablepress-1 tbody td.column-1:empty,
#tablepress-1 tbody td.column-3:empty,
#tablepress-1 tbody td.column-2:empty,
#tablepress-1 tbody td.column-4:empty {
    display: none;
}

/* Icons for the meta lines */
#tablepress-1 tbody td.column-2:not(:empty)::before {
    content: '';
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E") no-repeat center / contain;
}

#tablepress-1 tbody td.column-4:not(:empty)::before {
    content: '';
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Hide fully-empty trailing rows (e.g. the TablePress footer spacer) */
#tablepress-1 tbody > tr:has(td.column-1:empty):has(td.column-2:empty):has(td.column-3:empty):has(td.column-4:empty) {
    display: none;
}

/* Hide DataTables "1 bis 5 von 5 Einträgen" info line */
#tablepress-1_wrapper .dt-layout-cell:has(.dt-info),
#tablepress-1_wrapper .dt-layout-cell:has(.dataTables_info) {
    display: none !important;
}

@media (max-width: 640px) {
    #tablepress-1 tbody > tr {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        row-gap: var(--space-3);
        padding: var(--space-5) var(--space-6);
    }

    #tablepress-1 tbody td.column-1,
    #tablepress-1 tbody td.column-2,
    #tablepress-1 tbody td.column-3,
    #tablepress-1 tbody td.column-4 {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    #tablepress-1 tbody td.column-1 { grid-row: 1 !important; }
    #tablepress-1 tbody td.column-3 { grid-row: 2 !important; }
    #tablepress-1 tbody td.column-2 { grid-row: 3 !important; }
    #tablepress-1 tbody td.column-4 { grid-row: 4 !important; }

    /* Date becomes a full-width header strip with calendar icon */
    #tablepress-1 tbody td.column-1 {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: var(--space-2);
        white-space: nowrap;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: 0 0 var(--space-3);
        margin-bottom: var(--space-1);
        font-size: var(--text-base);
    }

    #tablepress-1 tbody td.column-1::before {
        content: '';
        width: 15px;
        height: 15px;
        flex-shrink: 0;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23004d8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") no-repeat center / contain;
    }

    #tablepress-1 tbody td.column-3 {
        margin-bottom: var(--space-2);
    }
}

/* ============================================
   POST GRID PLUGIN OVERRIDES
   ============================================ */

[id^="post-grid-"] {
    padding: 0 !important;
    background: transparent !important;
    margin-top: var(--space-8);
}

[id^="post-grid-"] .grid-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-8);
    text-align: left !important;
}

[id^="post-grid-"] .item {
    background: var(--white) !important;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    width: auto !important;
    display: block !important;
    margin: 0 !important;
    vertical-align: top !important;
    height: auto !important;
    padding: 0 !important;
}

[id^="post-grid-"] .item:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

[id^="post-grid-"] .layer-wrapper {
    display: flex;
    flex-direction: column;
}

[id^="post-grid-"] .element-media img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

[id^="post-grid-"] .element-media {
    overflow: hidden;
}

[id^="post-grid-"] .item > .layer-wrapper > div:last-child {
    padding: var(--space-5) var(--space-6) var(--space-6);
}

/* Title */
.layout-3311 .element_1681901136026,
[id^="post-grid-"] .title {
    color: var(--gray-900) !important;
    font-size: var(--text-lg) !important;
    font-family: var(--font-display) !important;
    font-weight: 600 !important;
    margin-bottom: var(--space-2) !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.layout-3311 .element_1681901136026 a,
[id^="post-grid-"] .title a {
    color: var(--gray-900) !important;
    font-size: var(--text-lg) !important;
    text-decoration: none !important;
    padding: 0 !important;
}

.layout-3311 .element_1681901136026 a:hover,
[id^="post-grid-"] .title a:hover {
    color: var(--color-primary) !important;
}

/* Excerpt */
.layout-3311 .element_1681901139508,
[id^="post-grid-"] .excerpt {
    color: var(--color-text-muted) !important;
    font-size: var(--text-sm) !important;
    font-family: var(--font-body) !important;
    margin: 0 0 var(--space-3) 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
}

/* Read more */
.layout-3311 .element_1681901151298,
[id^="post-grid-"] .read_more {
    color: var(--color-primary) !important;
    font-size: var(--text-sm) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center;
    gap: 0.35em;
    padding: 0 !important;
}

.layout-3311 .element_1681901151298::after,
[id^="post-grid-"] .read_more::after {
    content: '\2192';
}

.layout-3311 .element_1681901151298:hover,
[id^="post-grid-"] .read_more:hover {
    color: var(--blue-700) !important;
}

/* Pagination */
[id^="post-grid-"] .pagination {
    display: none !important;
}
