/*
 Theme Name:   Ignite Child
 Theme URI:
 Description:  Child theme for Ignite — Knowledge Base templates and styling.
               Functionality (CPT, taxonomy) is handled by the Knowledge Base plugin.
 Author:       Marco
 Template:     ignite
 Version:      2.0.0
 Text Domain:  ignite-child
*/

/* ═══════════════════════════════════════════════════
   KB STARTPAGE — Category Grid
   ═══════════════════════════════════════════════════ */

.kb-category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1.5rem 0;
}

.kb-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 180px;
    min-height: 160px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.kb-category-card:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.kb-category-card .kb-cat-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.kb-category-card .kb-cat-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.35rem;
}

.kb-category-card .kb-cat-count {
    font-size: 0.8rem;
    color: #888;
}

/* ═══════════════════════════════════════════════════
   KB CATEGORY PAGE — Article Grid
   ═══════════════════════════════════════════════════ */

.kb-back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
}

.kb-back-link:hover {
    color: #333;
    text-decoration: underline;
}

.kb-back-link::before {
    content: "← ";
}

.kb-category-description {
    margin-bottom: 1.5rem;
    color: #555;
    font-size: 0.95rem;
}

/* ── Grid: CSS Grid layout, most resistant to theme overrides ── */
.kb-articles-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 160px) !important;
    gap: 20px !important;
    margin: 1.5rem 0 !important;
    /* establish a fresh block formatting context */
    overflow: visible !important;
}

/* Cards sit in their own grid cell — no float or flex needed */
.kb-article-card {
    width: 160px !important;
    max-width: 160px !important;
    min-width: 160px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    /* reset anything the theme may inject */
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Inner link fills the card */
.kb-article-card a {
    display: block !important;
    width: 100% !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: opacity 0.2s ease;
}

.kb-article-card a:hover {
    opacity: 0.8 !important;
    text-decoration: none !important;
    color: inherit !important;
}

/* Thumbnail wrapper — hard 150×150 square */
.kb-article-card .kb-thumb-wrap {
    display: block !important;
    width: 150px !important;
    height: 150px !important;
    margin: 0 auto 0.5rem auto !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #f0f0f0 !important;
    /* isolate from theme image rules */
    position: relative !important;
}

/* Strip WordPress alignment class effects from the img */
.kb-article-card .kb-thumb-wrap img {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    float: none !important;
    width: 150px !important;
    height: 150px !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

.kb-article-card .kb-no-image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 150px !important;
    height: 150px !important;
    font-size: 2.5rem !important;
}

/* Title below the image */
.kb-article-card .kb-article-title {
    display: block !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin-top: 0.5rem !important;
    width: 100% !important;
}

/* ═══════════════════════════════════════════════════
   LEGACY — Japanese Lessons (page-lessons.php)
   ═══════════════════════════════════════════════════ */

.lessons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.lesson-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 160px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.lesson-card:hover {
    opacity: 0.75;
}

.lesson-card img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 0.5rem;
}

.lesson-card .lesson-no-image {
    width: 150px;
    height: 150px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.lesson-card .lesson-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}


/* ═══════════════════════════════════════════════════
   CARMENONE — Full-viewport iframe template
   ═══════════════════════════════════════════════════ */

/* Hide breadcrumbs, sidebar and footer */
.page-template-page-carmenone .breadcrumbs,
.page-template-page-carmenone .sidebar-primary-container,
.page-template-page-carmenone .site-footer {
    display: none !important;
}

/* Mirror the parent full-width template — same 7.407% side margins */
@media all and (min-width: 56.25em) {
    .page-template-page-carmenone .main {
        float: none !important;
        width: 85.186% !important;
        margin-left: 7.407% !important;
    }
}

/* iframe fills the available width and viewport height minus header */
.carmenone-wrap {
    width: 100%;
    height: calc(100vh - 76px);
    overflow: hidden;
    display: block;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.carmenone-wrap iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
}

/* Prevent outer page scroll — CarmenOne manages its own scrolling internally */
body.page-template-page-carmenone {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Increase top spacing between nav and iframe */
.page-template-page-carmenone .main {
    padding-top: 3em !important;
}


/* ═══════════════════════════════════════════════════
   Addition to Ignite Stylesheet for My Calendar
   ═══════════════════════════════════════════════════ */
   
button.mc-navigation-button,
a.mc-navigation-button {
    border: none !important;
    border-radius: 6px !important;
    outline: none !important;
    cursor: pointer;
}