/**
 * YAML Cards Extension CSS
 *
 * Styles for the yaml-card custom fence extension.
 * This file should be included in your mkdocs.yml extra_css section.
 */

:root {
    --easing-snappy: cubic-bezier(.6, 0, .4, 1);
    --easing-smooth: cubic-bezier(.6, 0, .4, 1);
    --transition-snappy: .1s var(--easing-snappy);
    --transition-smooth: .4s var(--easing-snappy);
}

/* Grid container for cards */
.yaml-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 1rem 0;
}

/* Responsive: stack cards on smaller screens */
@media screen and (max-width: 76.1875em) {
    .yaml-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Base card styling */
.yaml-card {
    position: relative;
    border: var(--card-border, 1px solid #ccc);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    height: 100%;
    transition: border-color var(--transition-snappy);
}

/* Stretched link for clickable cards */
.card-stretched-link {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

/* Hover state */
.yaml-card:hover {
    border-color: var(--md-accent-fg-color);
}

/* Card header section */
.card-header {
    padding: 0.5em 1em;
    padding-top: 0;
    display: flex;
    flex-direction: column;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.5em 0;
    border-bottom: var(--card-border);
    transition: border-bottom-color var(--transition-snappy);
}

/* Activate on card hover */
.yaml-card:hover .card-title {
    border-bottom-color: var(--md-accent-fg-color);
}

/* Wrapper for dual-mode icons to prevent flex gap changes */
.card-title-icon-wrapper {
    position: relative;
    flex-shrink: 0;
    display: inline-block;
    width: 24px;
    height: 24px;
}

.card-title-icon-wrapper .card-title-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-title-icon {
    flex-shrink: 0;
    margin: 0;
    width: 24px;
}

/* Light mode: show light icon, hide dark icon */
[data-md-color-scheme="default"] .card-title-icon-light {
    display: block;
}

[data-md-color-scheme="default"] .card-title-icon-dark {
    display: none;
}

/* Dark mode: hide light icon, show dark icon */
[data-md-color-scheme="slate"] .card-title-icon-light {
    display: none;
}

[data-md-color-scheme="slate"] .card-title-icon-dark {
    display: block;
}

.card-title-text {
    font-weight: bold;
    font-size: 12pt;
    line-height: normal;
}

/* Card body section */
.card-body {
    flex: 1;
    padding: 1em;
    display: flex;
    flex-direction: column;
}

.card-body > p:first-child {
    margin-top: 0;
}

.card-body > p:last-child {
    margin-bottom: 0;
}

/* Card footer section */
.card-footer {
    margin-top: 0.6em;
    padding: 1em 1.1em;
    height: 3.5em;
    display: flex;
    flex-direction: column;
    font-size: 0.7rem;
    font-family: 'Suisse Intl Mono',monospace;
    text-transform: uppercase;
    background: #0B0B0B0F;
    justify-content: center;
    align-items: flex-end;
}

[data-md-color-scheme="slate"] .card-footer {
    background: #25252560;
}

.card-footer > p {
    margin: 0;
}

/* Footer links need higher z-index to be clickable over stretched link */
.card-footer a {
    position: relative;
    z-index: 2;
    padding: 0 3px;
    background-color: transparent;
    color: var(--md-default-fg-color);
    transition: color var(--transition-snappy), background-color var(--transition-snappy);
}

.yaml-card:hover .card-footer a {
    background-color: var(--md-accent-fg-color);
}

[data-md-color-scheme="default"] .yaml-card:hover .card-footer a {
    color: var(--md-default-bg-color);
}

[data-md-color-scheme="slate"] .yaml-card:hover .card-footer a,
[data-md-color-scheme="slate"] .card-footer a:focus,
[data-md-color-scheme="slate"] .card-footer a:hover {
    color: var(--md-default-fg-color);
}

/* Horizontal alignment */
.align-h-left {
    text-align: left;
}

.align-h-center {
    text-align: center;
}

.align-h-right {
    text-align: right;
}

/* Vertical alignment */
.align-v-top {
    justify-content: flex-start;
}

.align-v-middle {
    justify-content: center;
}

.align-v-bottom {
    justify-content: flex-end;
}

/* Error message styling */
.yaml-card-error {
    background-color: #ff000020;
    border: 1px solid #ff0000;
    padding: 1rem;
    border-radius: 4px;
    color: #ff0000;
    font-family: 'Suisse Intl Mono',monospace;
}
