/* ICKF Public Styles */

/* Single pages */
.ickf-single {
    max-width: 800px;
    margin: 0 auto;
}

.ickf-instructor-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.ickf-instructor-photo img {
    border-radius: 4px;
    max-width: 200px;
    height: auto;
}

.ickf-instructor-name {
    margin: 0 0 16px;
}

/* Key info alongside photo */
.ickf-instructor-keyinfo {
    flex: 1;
}

.ickf-keyinfo-list {
    margin: 0;
}

.ickf-keyinfo-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.ickf-keyinfo-item dt {
    width: 280px;
    flex-shrink: 0;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
}

.ickf-keyinfo-item dd {
    margin: 0;
}

/* All Instructors section */
.ickf-instructor-all-instructors ul {
    list-style: none;
    padding: 0;
}

.ickf-instructor-all-instructors li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ickf-original-badge {
    display: inline-block;
    font-size: 0.75em;
    padding: 1px 8px;
    border-radius: 10px;
    background: #e8f0fe;
    color: #1a56db;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 6px;
}

.ickf-rank-year,
.ickf-approx {
    color: #888;
    font-style: italic;
}

/* Status badge */
.ickf-status-badge {
    display: inline-block;
    font-size: 0.75em;
    padding: 2px 10px;
    border-radius: 12px;
    vertical-align: middle;
    font-weight: 600;
    text-transform: uppercase;
}

.ickf-status-active {
    background: #d4edda;
    color: #155724;
}

.ickf-status-closed {
    background: #f8d7da;
    color: #721c24;
}

/* Tenure badges (Current / Historical) */
.ickf-tenure-badge {
    display: inline-block;
    font-size: 0.75em;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
}

.ickf-tenure-current {
    background: #d4edda;
    color: #155724;
}

.ickf-tenure-historical {
    background: #e2e3e5;
    color: #383d41;
}

.ickf-tenure-years {
    color: #888;
    font-size: 0.9em;
    font-style: italic;
    margin-left: 4px;
}

/* Instructor/Dojo lists */
.ickf-dojo-instructors ul,
.ickf-instructor-dojos ul {
    list-style: none;
    padding: 0;
}

.ickf-dojo-instructors li,
.ickf-instructor-dojos li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ickf-position,
.ickf-title,
.ickf-instructor-details {
    color: #888;
    font-size: 0.9em;
}

.ickf-last-updated {
    margin-top: 32px;
    font-size: 0.85em;
    color: #999;
    font-style: italic;
}

.ickf-edit-link {
    margin-top: 16px;
}

.ickf-edit-link a {
    display: inline-block;
    padding: 6px 16px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
}

.ickf-edit-link a:hover {
    background: #005a87;
}

/* Archive pages */
.ickf-archive {
    max-width: 1000px;
    margin: 0 auto;
}

.ickf-filter-form {
    margin-bottom: 24px;
    padding: 16px;
    background: #f7f7f7;
    border-radius: 4px;
}

.ickf-filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.ickf-filter-row label {
    font-weight: 600;
}

.ickf-filter-row select,
.ickf-filter-row input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ickf-filter-btn {
    padding: 6px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.ickf-filter-btn:hover {
    background: #005a87;
}

/* Card grids */
.ickf-instructor-grid,
.ickf-dojo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ickf-instructor-card,
.ickf-dojo-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    background: #fff;
}

.ickf-card-photo {
    margin-bottom: 12px;
}

.ickf-card-photo img {
    border-radius: 4px;
    width: 100%;
    height: auto;
}

.ickf-card-name {
    margin: 0 0 6px;
    font-size: 1.1em;
}

.ickf-card-name a {
    text-decoration: none;
    color: #333;
}

.ickf-card-name a:hover {
    color: #0073aa;
}

.ickf-card-title,
.ickf-card-rank,
.ickf-card-location,
.ickf-card-heads {
    margin: 4px 0;
    font-size: 0.9em;
    color: #666;
}

/* Lineage Tree */
.ickf-lineage-tree {
    margin-bottom: 24px;
}

.ickf-lineage-tree h2 {
    margin-bottom: 16px;
}

.ickf-lineage-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow-x: auto;
}

/* Node styling */
.ickf-lineage-node {
    display: inline-block;
    padding: 6px 16px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    white-space: nowrap;
    transition: border-color 0.2s, background-color 0.2s;
}

a.ickf-lineage-node:hover {
    border-color: #0073aa;
    background: #f0f7fc;
    color: #0073aa;
}

.ickf-lineage-current {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

/* Focal point */
.ickf-lineage-focal {
    margin: 16px 0;
    text-align: center;
}

/* Ancestor levels — stacked rows, oldest at top */
.ickf-lineage-ancestors {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Each level is a centered row of nodes */
.ickf-lineage-level {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    padding-top: 20px;
}

/* First level has no connector above it */
.ickf-lineage-level:first-child {
    padding-top: 0;
}

/* Vertical connector line between levels */
.ickf-lineage-level + .ickf-lineage-level::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: #ccc;
}

/* Connector from last ancestor level down to focal */
.ickf-lineage-ancestors::after {
    content: '';
    display: block;
    width: 2px;
    height: 20px;
    background: #ccc;
    margin: 0 auto;
}

/* Students — nested tree */
.ickf-lineage-students {
    width: 100%;
}

.ickf-lineage-students::before {
    content: '';
    display: block;
    width: 2px;
    height: 20px;
    background: #ccc;
    margin: 0 auto;
}

.ickf-lineage-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ickf-lineage-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.ickf-lineage-item > .ickf-lineage-node {
    position: relative;
    margin: 4px 0;
}

/* Nested student levels */
.ickf-lineage-list .ickf-lineage-list {
    margin-top: 0;
    padding-top: 20px;
    position: relative;
}

.ickf-lineage-list .ickf-lineage-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: #ccc;
}

/* Horizontal branching when multiple students */
.ickf-lineage-list:has(> .ickf-lineage-item:nth-child(2)) {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.ickf-lineage-list:has(> .ickf-lineage-item:nth-child(2)) > .ickf-lineage-item::before {
    content: '';
    display: block;
    width: 2px;
    height: 10px;
    background: #ccc;
}

@media (max-width: 600px) {
    .ickf-instructor-header {
        flex-direction: column;
    }

    .ickf-instructor-photo img {
        max-width: 160px;
    }

    .ickf-keyinfo-item {
        flex-direction: column;
        gap: 2px;
    }

    .ickf-keyinfo-item dt {
        width: auto;
    }

    .ickf-lineage-level {
        gap: 12px;
    }

    .ickf-lineage-list:has(> .ickf-lineage-item:nth-child(2)) {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .ickf-lineage-node {
        font-size: 0.85em;
        padding: 4px 12px;
    }
}
