/**
 * Kutri Events - Frontend CSS
 *
 * Käyttää Astra-teeman CSS-muuttujia mahdollisimman paljon.
 * Tavoite: < 3KB minifioituna.
 *
 * @package KutriEvents
 */

/* === BASE === */

.ke-section-title {
    font-size: 1.25em;
    margin-bottom: 1em;
    font-weight: 600;
}

.ke-section-description {
    color: var(--ast-global-color-3, #666);
    margin-bottom: 1em;
}

/* === BUTTONS === */

.ke-btn {
    display: inline-block;
    padding: 0.75em 1.5em;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 1em;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
}

.ke-btn-primary {
    background-color: var(--ast-global-color-0, #0274be);
    color: #fff;
}

.ke-btn-primary:hover {
    background-color: var(--ast-global-color-1, #3a3a3a);
    color: #fff;
}

.ke-btn-secondary {
    background-color: var(--ast-global-color-5, #f5f5f5);
    color: var(--ast-global-color-2, #3a3a3a);
}

.ke-btn-secondary:hover {
    background-color: var(--ast-global-color-4, #e5e5e5);
}

.ke-btn-outline {
    background-color: transparent;
    border: 1px solid var(--ast-global-color-0, #0274be);
    color: var(--ast-global-color-0, #0274be);
}

.ke-btn-outline:hover {
    background-color: var(--ast-global-color-0, #0274be);
    color: #fff;
}

.ke-btn-small {
    padding: 0.5em 1em;
    font-size: 0.875em;
}

.ke-btn-zoom {
    font-size: 1.1em;
}

/* === ZOOM SECTION === */

.ke-zoom-section {
    margin: 1.5em 0;
    padding: 1.5em;
    background: var(--ast-global-color-5, #f9f9f9);
    border-radius: 8px;
}

.ke-zoom-loading {
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: var(--ast-global-color-3, #666);
}

.ke-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--ast-global-color-4, #ddd);
    border-top-color: var(--ast-global-color-0, #0274be);
    border-radius: 50%;
    animation: ke-spin 0.8s linear infinite;
}

@keyframes ke-spin {
    to { transform: rotate(360deg); }
}

.ke-zoom-allowed {
    text-align: center;
}

.ke-zoom-denied {
    text-align: center;
}

.ke-zoom-message {
    margin-bottom: 1em;
    color: var(--ast-global-color-3, #666);
}

/* === CALENDAR === */

.ke-calendar-section {
    margin: 1.5em 0;
}

.ke-calendar-inline {
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid var(--ast-global-color-4, #eee);
}

.ke-calendar-title {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 0.75em;
    color: var(--ast-global-color-3, #666);
}

.ke-calendar-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    justify-content: center;
}

.ke-calendar-buttons--inline {
    margin-top: 1em;
}

/* === DATETIME === */

.ke-datetime {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    font-size: 1.1em;
    margin: 1em 0;
}

.ke-date,
.ke-time {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.ke-icon {
    font-size: 1.2em;
}

/* === QUESTION FORM === */

.ke-question-form-section {
    margin: 2em 0;
    padding: 1.5em;
    background: var(--ast-global-color-5, #f9f9f9);
    border-radius: 8px;
}

.ke-question-form {
    max-width: 500px;
}

.ke-form-field {
    margin-bottom: 1em;
}

.ke-form-field label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
}

.ke-input,
.ke-textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid var(--ast-global-color-4, #ddd);
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
}

.ke-input:focus,
.ke-textarea:focus {
    outline: none;
    border-color: var(--ast-global-color-0, #0274be);
}

.ke-textarea {
    resize: vertical;
    min-height: 100px;
}

.ke-form-submit {
    margin-top: 1em;
}

.ke-form-message {
    margin-top: 1em;
    padding: 0.75em 1em;
    border-radius: 4px;
}

.ke-form-message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ke-form-message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* === EVENT CARD === */

.ke-event-card {
    display: flex;
    gap: 1em;
    padding: 1em;
    margin-bottom: 1em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ke-event-card__image {
    flex: 0 0 150px;
}

.ke-event-card__image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.ke-event-card__content {
    flex: 1;
}

.ke-event-card__title {
    margin: 0 0 0.5em;
    font-size: 1.1em;
}

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

.ke-event-card__title a:hover {
    color: var(--ast-global-color-0, #0274be);
}

.ke-event-card__date {
    color: var(--ast-global-color-3, #666);
    font-size: 0.9em;
    margin-bottom: 0.5em;
}

.ke-event-card__excerpt {
    color: var(--ast-global-color-3, #666);
    font-size: 0.9em;
    margin-bottom: 0.5em;
}

.ke-event-card__link {
    font-size: 0.9em;
    color: var(--ast-global-color-0, #0274be);
    text-decoration: none;
}

.ke-event-card__link:hover {
    text-decoration: underline;
}

/* Compact variant */
.ke-event-card--compact {
    padding: 0.75em;
}

.ke-event-card--compact .ke-event-card__title {
    font-size: 1em;
}

/* === ERROR === */

.ke-error {
    color: #721c24;
    background: #f8d7da;
    padding: 0.75em 1em;
    border-radius: 4px;
}

/* === RESPONSIVE === */

@media (max-width: 600px) {
    .ke-event-card {
        flex-direction: column;
    }

    .ke-event-card__image {
        flex: none;
    }

    .ke-calendar-buttons-row {
        flex-direction: column;
    }

    .ke-calendar-buttons-row .ke-btn {
        width: 100%;
    }
}
