/**
 * Signposts Block Frontend Styles
 */

/* Signposts Container */
.zonkey-signposts {
    margin-bottom: 2rem;
}

/* Signpost Card */
.signpost-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: all var(--transition-speed, 0.3s) ease;
    height: 100%;
}

/* Layout Variations */
.signpost-card.signpost-layout-vertical {
    flex-direction: column;
}

.signpost-card.signpost-layout-horizontal {
    flex-direction: row;
    align-items: stretch;
}

.signpost-layout-horizontal .signpost-card-media {
    flex: 0 0 120px;
    width: 120px;
    padding-bottom: 0;
    min-height: 120px;
    /* Left corners for horizontal layout (overrides vertical top corners) */
    border-top-left-radius: var(--block-border-radius, 0);
    border-bottom-left-radius: var(--block-border-radius, 0);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.signpost-layout-horizontal .signpost-card-image,
.signpost-layout-horizontal .signpost-card-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.signpost-layout-horizontal .signpost-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.25rem;
}

.signpost-layout-horizontal .signpost-card-title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.signpost-layout-horizontal .signpost-card-subtitle {
    font-size: 0.875rem;
    color: inherit;
    opacity: 0.7;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.signpost-layout-horizontal .signpost-card-content {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.signpost-layout-horizontal .signpost-card-footer {
    margin-top: 0.5rem;
    justify-content: flex-start;
}

/* Keep buttons left-aligned in horizontal layout */
.signpost-layout-horizontal .signpost-card-footer .btn-has-icon {
    justify-content: flex-start;
}

.signpost-layout-horizontal .signpost-card-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.signpost-card.rounded {
    border-radius: 8px;
}

.signpost-card.has-shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.signpost-card.has-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.08);
}

.signpost-card.is-clickable {
    cursor: pointer;
    position: relative;
}

/* Card Media (Image or Icon) */
.signpost-card-media {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background-color: #f3f4f6;
}

.signpost-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.signpost-card-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary, #2563eb), var(--color-secondary, #7c3aed));
}

.signpost-card-icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: white;
}

/* Card Body */
.signpost-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.signpost-card-title {
    font-family: var(--font-heading, 'Poppins', sans-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    color: inherit;
}

.signpost-card-subtitle {
    font-size: 0.938rem;
    font-weight: 500;
    color: inherit;
    opacity: 0.7;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.signpost-card-content {
    font-size: 0.938rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    color: inherit;
    opacity: 0.9;
}

.signpost-card-content p {
    margin: 0 0 0.75rem 0;
}

.signpost-card-content p:last-child {
    margin-bottom: 0;
}

/* Card Footer / Buttons */
.signpost-card-footer {
    margin-top: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Button styles are handled by buttons.css (awd-btn classes) */

/* Clickable Card Overlay */
.signpost-card-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-indent: -9999px;
    overflow: hidden;
}

.signpost-card-overlay-link:focus {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: -2px;
}

/* Ensure card content is above overlay link */
.is-clickable .signpost-card-body {
    position: relative;
    z-index: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .signpost-card-title {
        font-size: 1.125rem;
    }

    .signpost-card-body {
        padding: 1.25rem;
    }

    .signpost-card-content {
        font-size: 0.875rem;
    }

    .signpost-card-icon .dashicons {
        font-size: 48px;
        width: 48px;
        height: 48px;
    }

}

/* Mobile: Convert horizontal cards to vertical layout */
@media (max-width: 600px) {
    .signpost-card.signpost-layout-horizontal {
        flex-direction: column;
    }

    .signpost-layout-horizontal .signpost-card-media {
        flex: none;
        width: 100%;
        padding-bottom: 56.25%; /* Restore 16:9 aspect ratio */
        min-height: auto;
        /* Reset to top corners for vertical layout on mobile */
        border-top-left-radius: var(--block-border-radius, 0);
        border-top-right-radius: var(--block-border-radius, 0);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .signpost-layout-horizontal .signpost-card-body {
        padding: 1.25rem;
    }

    .signpost-layout-horizontal .signpost-card-title {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }

    .signpost-layout-horizontal .signpost-card-subtitle {
        margin-bottom: 0.75rem;
    }

    .signpost-layout-horizontal .signpost-card-content {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    .signpost-layout-horizontal .signpost-card-footer {
        margin-top: auto;
    }
}

@media (max-width: 480px) {
    .signpost-card-title {
        font-size: 1rem;
    }

    .signpost-card-body {
        padding: 1rem;
    }

    .signpost-card-link.awd-btn {
        width: 100%;
        text-align: center;
    }
}

/* Disable animations if requested */
.disable-animations .signpost-card {
    transition: none !important;
}

.disable-animations .signpost-card.has-hover:hover {
    transform: none;
}
