/*
Theme Name: DOPPELCHREIS
Template: twentytwentyfour
Author: Hayloft-IT GmbH
Author URI: https://www.hayloft-it.ch
Version: 0.0.1
Requires at least: 6.8.1
Requires PHP: 8.1
Text Domain: doppelchreis
*/

:root {
    --color-text: var(--wp--preset--color--contrast);
    --color-text-muted: var(--wp--preset--color--contrast-2);
    --color-border: #e0e0e0;
    --color-bg: var(--wp--preset--color--base);
    --color-bg-alt: #f5f5f5;
    --color-accent: var(--wp--preset--color--accent);
    --color-secondary: var(--wp--preset--color--custom-secondary);
    --color-success: #155724;
    --color-success-bg: #d4edda;
    --color-error: #721c24;
    --color-error-bg: #f8d7da;
    --transition-fast: 0.2s ease;
}

/* Focus states - visually hidden but accessible for keyboard */
a:focus {
    outline: none;
}

a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Typography */
h1, h2, h3, h4, h5, h6,
.wp-block-heading {
    font-weight: 600 !important;
}

/* Layout */
.wp-site-blocks {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wp-site-blocks > * { width: 100%; }
.wp-site-blocks > main { flex: 1; }

.wp-block-group.is-layout-flex {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.wp-block-group.is-vertical.is-layout-flex { flex-direction: column; }
header .wp-block-group.is-layout-flex { align-items: end; }

footer .wp-block-group.is-layout-flex,
.wp-block-template-part.site-footer .wp-block-group.is-layout-flex {
    align-items: revert;
    gap: revert;
}

.is-justify-content-between { justify-content: space-between; }

/* Navigation */
header .wp-block-navigation a,
.wp-block-template-part.site-header .wp-block-navigation a {
    position: relative;
    text-decoration: none;
}

header .wp-block-navigation a::after,
.wp-block-template-part.site-header .wp-block-navigation a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

header .wp-block-navigation a:hover::after,
header .wp-block-navigation a:focus::after,
.wp-block-template-part.site-header .wp-block-navigation a:hover::after,
.wp-block-template-part.site-header .wp-block-navigation a:focus::after {
    opacity: 1;
}

header .wp-block-navigation a:hover,
header .wp-block-navigation a:focus,
.wp-block-template-part.site-header .wp-block-navigation a:hover,
.wp-block-template-part.site-header .wp-block-navigation a:focus {
    text-decoration: none;
}

.wp-block-navigation .current-menu-item > a,
.wp-block-navigation .current_page_item > a,
.wp-block-navigation .current-menu-ancestor > a,
.wp-block-navigation .current-menu-parent > a {
    font-weight: 600;
    position: relative;
}

.wp-block-navigation .current-menu-item > a::after,
.wp-block-navigation .current_page_item > a::after,
.wp-block-navigation .current-menu-ancestor > a::after,
.wp-block-navigation .current-menu-parent > a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 1px;
    opacity: 1;
}

.wp-block-navigation .current-menu-item > a::after,
.wp-block-navigation .current_page_item > a::after {
    background: currentColor;
}

.wp-block-navigation .current-menu-ancestor > a::after,
.wp-block-navigation .current-menu-parent > a::after {
    background: var(--wp--preset--color--custom-secondary, currentColor);
}

.single-events .wp-block-navigation .current-menu-ancestor > a,
.single-events .wp-block-navigation .current-menu-parent > a {
    color: var(--wp--preset--color--custom-secondary);
}

.viewing-member-details .wp-block-navigation a[href$="/mitglieder/"],
.viewing-member-details .wp-block-navigation a[href$="/mitglieder"] {
    font-weight: 600;
    position: relative;
}

.viewing-member-details .wp-block-navigation a[href$="/mitglieder/"]::after,
.viewing-member-details .wp-block-navigation a[href$="/mitglieder"]::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    opacity: 1;
}

/* Footer */
footer,
footer *,
.wp-block-template-part.site-footer,
.wp-block-template-part.site-footer * {
    font-size: 18px !important;
}

footer .wp-block-navigation a:hover,
footer .wp-block-navigation a:focus,
.wp-block-template-part.site-footer .wp-block-navigation a:hover,
.wp-block-template-part.site-footer .wp-block-navigation a:focus {
    text-decoration: underline;
}

footer .wp-block-navigation .current-menu-item > a,
footer .wp-block-navigation .current_page_item > a,
.wp-block-template-part.site-footer .wp-block-navigation .current-menu-item > a,
.wp-block-template-part.site-footer .wp-block-navigation .current_page_item > a {
    font-weight: inherit;
}

footer .wp-block-navigation .current-menu-item > a::after,
footer .wp-block-navigation .current_page_item > a::after,
.wp-block-template-part.site-footer .wp-block-navigation .current-menu-item > a::after,
.wp-block-template-part.site-footer .wp-block-navigation .current_page_item > a::after {
    display: none;
}

.footer-menu .wp-block-navigation__container {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    align-items: center;
}

.footer-menu .wp-block-navigation-item {
    padding: 0 0.35em;
    display: flex;
    align-items: center;
}

.footer-menu .wp-block-navigation-item:first-child { padding-left: 0; }
.footer-menu .wp-block-navigation-item:last-child { padding-right: 0; }

.footer-menu .wp-block-navigation-item:not(:last-child)::after {
    content: '';
    display: block;
    width: 2px;
    height: 1em;
    background-color: currentColor;
    margin-left: 0.75em;
}

/* Buttons */
.wp-block-button__link,
.wp-element-button {
    transition: opacity var(--transition-fast);
    border-radius: 10px;
    text-transform: none;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus,
.wp-element-button:hover,
.wp-element-button:focus {
    opacity: 0.8;
}

.wp-block-button.btn-link .wp-block-button__link,
.wp-block-button.btn-link > a {
    background: none;
    padding: 0;
    color: var(--wp--preset--color--custom-secondary);
    text-decoration: none;
    letter-spacing: 0 !important;
    transition: opacity var(--transition-fast);
}

.wp-block-button.btn-link .wp-block-button__link:hover,
.wp-block-button.btn-link .wp-block-button__link:focus,
.wp-block-button.btn-link > a:hover,
.wp-block-button.btn-link > a:focus {
    background: none;
    opacity: 0.7;
}

.wp-block-buttons.is-content-justification-left,
.wp-block-buttons.is-content-justification-center,
.wp-block-buttons.is-content-justification-right {
    display: flex;
    flex-wrap: wrap;
}

.wp-block-buttons.is-content-justification-left { justify-content: flex-start; }
.wp-block-buttons.is-content-justification-center { justify-content: center; }
.wp-block-buttons.is-content-justification-right { justify-content: flex-end; }

.flex-icon-button {
    gap: 1em;
    display: inline-flex;
    align-items: center;
}

.wp-block-button__link-icon {
    width: 1.8em;
    height: 1.8em;
}

/* Events */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.events-list-empty { color: var(--color-text-muted); }

.event-item {
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border-radius: 10px;
    transition: background-color var(--transition-fast);
}

.event-item:hover { background: #f0f0f0; }

.event-item__date {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.event-item__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.event-item__title a {
    color: inherit;
    text-decoration: none;
}

.event-item__title a:hover { text-decoration: underline; }

.event-item__excerpt {
    color: var(--color-text-muted);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.events-list--past .event-item {
    background: transparent;
    border: 1px solid var(--color-border);
}

.events-list--past .event-item:hover { background: var(--color-bg-alt); }

.past-events-heading {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.events-back-link {
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.events-back-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    transition: color var(--transition-fast), gap var(--transition-fast);
}

.events-back-link a:hover {
    color: #111;
    gap: 0.75rem;
}

.events-back-link svg { flex-shrink: 0; }

/* Event RSVP */
.event-item .event_status,
.event-rsvp-wrapper .event_status {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.event-item .event_antwort,
.event-rsvp-wrapper .event_antwort {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
}

.event-item .event_ja,
.event-rsvp-wrapper .event_ja {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.event-item .event_ja::before,
.event-rsvp-wrapper .event_ja::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
}

.event-item .event_nein,
.event-rsvp-wrapper .event_nein {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.event-item .event_nein::before,
.event-rsvp-wrapper .event_nein::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-error);
    border-radius: 50%;
}

.event-item .antwort_change,
.event-rsvp-wrapper .antwort_change {
    color: var(--color-text-muted);
    cursor: pointer;
    margin-left: 0.75rem;
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}

.event-item .antwort_change:hover,
.event-rsvp-wrapper .antwort_change:hover {
    color: #111;
    text-decoration: underline;
}

.event-item .event_status .wp-block-buttons,
.event-rsvp-wrapper .event_status .wp-block-buttons {
    display: none;
    margin-top: 0.75rem;
    gap: 0.5rem;
}

.event-item .event_status.btns_show .wp-block-buttons,
.event-rsvp-wrapper .event_status.btns_show .wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
}

.event-item .event_status .wp-block-button__link,
.event-rsvp-wrapper .event_status .wp-block-button__link {
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
}

.event-rsvp-wrapper { margin: 1.5rem 0; }

/* Event Invitations */
.mne-event-invitations {
    max-width: 800px;
    margin: 0 auto;
}

.event-invitation {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.event-invitation h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.event-invitation h3 a {
    color: inherit;
    text-decoration: none;
}

.event-invitation h3 a:hover { text-decoration: underline; }

.event-invitation .event-date {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.event-invitation .event_status { margin-top: 1rem; }

.event-invitation .event_antwort {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.event-invitation .event_ja {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.event-invitation .event_nein {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.event-invitation .antwort_change {
    color: var(--color-text-muted);
    cursor: pointer;
    margin-left: 0.5rem;
}

.event-invitation .antwort_change:hover { text-decoration: underline; }

.event-invitation .event_status .wp-block-buttons { display: none; }
.event-invitation .event_status.btns_show .wp-block-buttons { display: flex; }

/* Members */
.mne-members-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.mne-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.mne-member-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--color-bg-alt);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.mne-member-card:hover { border-color: #111; }

.mne-member-avatar {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.mne-member-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.mne-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #cfcabe;
    color: #111;
    font-size: 1.5rem;
    font-weight: 500;
}

.mne-member-info {
    flex: 1;
    min-width: 0;
}

.mne-member-name {
    font-weight: 600;
    font-size: 18px;
}

.mne-member-company {
    font-size: 18px;
    color: var(--color-text);
}

/* Member Details */
.mne-member-details {
    max-width: 800px;
    margin: 0 auto;
}

.mne-member-details__card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.mne-member-details__avatar img,
.mne-member-details__avatar .avatar {
    max-width: 186px;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-bg-alt);
}

.mne-member-details__name { margin: 0 0 0.25rem 0; }

.mne-member-details__company {
    font-weight: 600;
    color: var(--color-text);
    font-size: 18px;
    line-height: 24px;
    margin-bottom: 1rem;
}

.mne-member-details__contact {
    background: var(--color-bg-alt);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.mne-member-details__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mne-member-details__links li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 18px;
    line-height: 24px;
}

.mne-member-details__links li a:hover { text-decoration: underline; }

.mne-member-details__links li a svg {
    flex-shrink: 0;
    width: 19px;
    height: 19px;
    color: var(--wp--preset--color--custom-secondary);
}

.mne-member-details__links li a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mne-member-details__bio {
    margin-top: 1.5rem;
    font-size: 18px;
    line-height: 24px;
    color: var(--color-text);
}

.mne-member-details__back {
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.mne-member-details__back a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    transition: color var(--transition-fast), gap var(--transition-fast);
}

.mne-member-details__back a:hover {
    color: #111;
    gap: 0.75rem;
}

.mne-member-details__back svg { flex-shrink: 0; }

/* Account Edit */
.mne-account-edit {
    max-width: 800px;
    margin: 0 auto;
}

.mne-account-edit h1 { margin-bottom: 1.5rem; }

.mne-account-edit .acf-fields {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.mne-account-edit .acf-fields::after {
    content: "";
    display: table;
    clear: both;
}

.mne-account-edit .acf-field {
    padding: 1rem 0;
    border-top: 1px solid #f0f0f0;
    width: 100%;
    box-sizing: border-box;
}

.mne-account-edit .acf-field:first-child,
.mne-account-edit .acf-field:nth-child(2) {
    border-top: none;
    padding-top: 0;
}

.mne-account-edit .acf-field[data-width="50"] {
    width: calc(50% - 0.5rem) !important;
    border-top: none;
    float: left;
}

.mne-account-edit .acf-field[data-width="50"]:first-child { margin-right: 1rem; }
.mne-account-edit .acf-field[data-width]+.acf-field[data-width] { border-left: none; }

.mne-account-edit .acf-label label {
    font-weight: 500;
    color: #111;
    margin-bottom: 0.5rem;
    display: block;
}

.mne-account-edit .acf-input input[type="text"],
.mne-account-edit .acf-input input[type="email"],
.mne-account-edit .acf-input input[type="url"],
.mne-account-edit .acf-input textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.33rem;
    font-size: 1rem;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.mne-account-edit .acf-input input[type="text"]:focus,
.mne-account-edit .acf-input input[type="email"]:focus,
.mne-account-edit .acf-input input[type="url"]:focus,
.mne-account-edit .acf-input textarea:focus {
    outline: none;
    border-color: #111;
}

.mne-account-edit .acf-image-uploader {
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.mne-account-edit .acf-image-uploader .has-value { border-style: solid; }

.mne-account-edit .mne-success-notice {
    padding: 1rem 1.25rem;
    background: var(--color-success-bg);
    border-radius: 8px;
    color: var(--color-success);
    margin-bottom: 1.5rem;
}

.mne-account-edit .wp-block-button input[type="submit"] {
    cursor: pointer;
    border: none;
}

/* Responsive */
@media (max-width: 600px) {
    .mne-account-edit .acf-field[data-width="50"] { width: 100%; }

    .mne-account-edit .acf-field:nth-child(2) {
        border-top: 1px solid #f0f0f0;
        padding-top: 1rem;
    }

    .mne-member-details__card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .mne-member-details__avatar {
        display: flex;
        justify-content: center;
    }

    .mne-member-details__links { grid-template-columns: 1fr; }
    .mne-member-details__links li a { justify-content: center; }
}
