/* ==========================================================================
   Joinery Page — Joint grid, cards, hover animation, anchor nav
   ========================================================================== */

/* Anchor Navigation
   -------------------------------------------------------------------------- */
.joinery-anchor-nav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--section-gap);
}

.joinery-anchor-nav a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.joinery-anchor-nav a:hover {
    color: var(--accent-warm);
    border-color: var(--accent-warm);
}

/* Joint Grid
   -------------------------------------------------------------------------- */
.joint-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Joint Card
   -------------------------------------------------------------------------- */
.joint-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color var(--transition-normal);
}

.joint-card:hover {
    border-color: var(--accent-warm);
}

.joint-card__diagram {
    aspect-ratio: 1;
    background: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem;
}

.joint-card__diagram svg {
    width: 100%;
    height: 100%;
}

/* Hover animation — parts separate */
.joint-card__diagram .joint-part--a,
.joint-card__diagram .joint-part--b {
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.joint-card:hover .joint-part--a {
    transform: translate(var(--sep-x, -10px), var(--sep-y, -8px));
}

.joint-card:hover .joint-part--b {
    transform: translate(calc(var(--sep-x, -10px) * -1), calc(var(--sep-y, -8px) * -1));
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .joint-card__diagram .joint-part--a,
    .joint-card__diagram .joint-part--b {
        transition: none;
    }
    .joint-card:hover .joint-part--a,
    .joint-card:hover .joint-part--b {
        transform: none;
    }
}

.joint-card__info {
    padding: 1.25rem 1.5rem 1.5rem;
}

.joint-card__header {
    margin-bottom: 0.75rem;
}

.joint-card__name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin: 0;
}

.joint-card__japanese {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--accent-warm);
    display: block;
    margin-top: 0.25rem;
}

.joint-card__description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.joint-card__materials {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

.joint-card__label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-warm);
}

/* Tradition Section Headers
   -------------------------------------------------------------------------- */
.tradition-header {
    margin-bottom: 2rem;
}

.tradition-header__title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 0.03em;
    margin: 0 0 0.5rem;
}

.tradition-header__subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 640px;
}

/* Philosophy + Materials prose sections
   -------------------------------------------------------------------------- */
.joinery-prose {
    max-width: 720px;
    margin: 0 auto;
}

.joinery-prose h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.joinery-prose p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

/* Featured Section
   -------------------------------------------------------------------------- */
.featured-joint {
    max-width: 800px;
    margin: 0 auto;
}

.featured-joint__label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-warm);
    margin-bottom: 0.5rem;
}

.featured-joint__title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.featured-joint__description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 640px;
}

.featured-joint__svg {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.featured-joint__svg svg {
    width: 100%;
    max-height: 600px;
}

/* Origin Badge (not used in current design but available)
   -------------------------------------------------------------------------- */
.origin-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2em 0.6em;
    border-radius: 2px;
    border: 1px solid;
}

.origin-badge--danish {
    color: var(--text-secondary);
    border-color: var(--border);
}

.origin-badge--japanese {
    color: var(--accent-warm);
    border-color: var(--accent-warm);
    opacity: 0.7;
}

/* Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .joint-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .joinery-anchor-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 1rem 0;
        -webkit-overflow-scrolling: touch;
    }

    .joinery-anchor-nav a {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .tradition-header__title,
    .joinery-prose h2,
    .featured-joint__title {
        font-size: 1.5rem;
    }
}
