/* ICKF Public Styles */

/* Site navigation */
.ickf-site-nav {
    max-width: 1000px;
    margin: 0 auto 24px;
    padding: 0 0 16px;
    border-bottom: 2px solid #e0e0e0;
}

.ickf-site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.ickf-site-nav li {
    margin: 0;
}

.ickf-site-nav a {
    display: block;
    padding: 8px 18px;
    text-decoration: none;
    color: #555;
    font-size: 0.95em;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.ickf-site-nav a:hover {
    background: #f0f7fc;
    color: #0073aa;
}

.ickf-site-nav .ickf-nav-active a {
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

/* About page */
.ickf-about-page {
    max-width: 800px;
    margin: 0 auto;
}

.ickf-about-section {
    margin-bottom: 28px;
}

.ickf-about-section h2 {
    margin-bottom: 8px;
}

.ickf-about-section p {
    line-height: 1.7;
    color: #444;
}

.ickf-about-section ul {
    margin: 8px 0 8px 24px;
    color: #444;
    line-height: 1.7;
}

/* 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-historical {
    background: #e2e3e5;
    color: #383d41;
}

.ickf-card-historical {
    opacity: 0.7;
}

/* 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;
}

.ickf-suggest-update {
    margin-top: 16px;
}

.ickf-btn-suggest-update {
    display: inline-block;
    padding: 10px 24px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 600;
    transition: background 0.15s;
}

.ickf-btn-suggest-update:hover {
    background: #005a87;
    color: #fff;
}

/* 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-kobujutsu,
.ickf-card-location,
.ickf-card-heads,
.ickf-card-dojos {
    margin: 4px 0;
    font-size: 0.9em;
    color: #666;
}

.ickf-card-label {
    font-weight: 600;
    color: #333;
}

/* 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;
}

/* History Project footer */
.ickf-history-project {
    margin-top: 40px;
    padding: 20px 24px;
    border-top: 2px solid #e0e0e0;
    background: #f9f9f9;
    border-radius: 0 0 6px 6px;
}

.ickf-history-project h3 {
    margin: 0 0 8px;
    font-size: 1.1em;
    color: #333;
}

.ickf-history-project p {
    margin: 8px 0;
    font-size: 0.9em;
    color: #555;
    line-height: 1.6;
}

.ickf-history-project a {
    color: #0073aa;
    text-decoration: underline;
}

.ickf-history-project a:hover {
    color: #005a87;
}

.ickf-history-scope {
    font-size: 0.85em !important;
    color: #777 !important;
}

/* About page CTA */
.ickf-about-cta {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.ickf-btn-submit {
    display: inline-block;
    padding: 12px 28px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.15s;
}

.ickf-btn-submit:hover {
    background: #005a87;
    color: #fff;
}

@media (max-width: 600px) {
    .ickf-site-nav ul {
        flex-direction: column;
        gap: 2px;
    }

    .ickf-site-nav a {
        padding: 8px 14px;
        font-size: 0.9em;
    }

    .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;
    }
}
