/* ============================================================
   ATR Kashering Guide — Frontend Styles
   Follows AskTheRav.com design system
   ============================================================ */

.atr-kg {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Header */
.atr-kg-header {
    text-align: center;
    margin-bottom: 28px;
}
.atr-kg-title {
    font-size: 26px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px;
}
.atr-kg-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Top reference bar — side by side above search */
.atr-kg-top-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.atr-kg-top-section .atr-kg-expand-toggle {
    font-size: 13px;
    padding: 10px 16px;
}
.atr-kg-top-section .atr-kg-expand-body {
    font-size: 13px;
    padding: 16px 20px;
}

/* Search */
.atr-kg-search-wrap {
    margin-bottom: 24px;
}
.atr-kg-search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}
.atr-kg-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #999;
    pointer-events: none;
}
.atr-kg-search-input {
    width: 100%;
    padding: 14px 44px 14px 44px;
    font-size: 15px;
    border: 2px solid #e2e5ea;
    border-radius: 10px;
    background: #fff;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}
.atr-kg-search-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.15), 0 1px 3px rgba(0,0,0,0.06);
}
.atr-kg-search-input::placeholder {
    color: #999;
}
.atr-kg-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.atr-kg-clear-btn:hover {
    color: #333;
}

/* Results area */
.atr-kg-results {
    margin-bottom: 28px;
}

/* Category header */
.atr-kg-cat-header {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin: 20px 0 8px;
    padding: 0 4px;
}
.atr-kg-cat-header:first-child {
    margin-top: 0;
}

/* Item cards */
.atr-kg-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 20px 28px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.atr-kg-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.atr-kg-card.expanded {
    border-left: 3px solid #0073aa;
}

/* Card header row */
.atr-kg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.atr-kg-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}
.atr-kg-method-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Method badge colors */
.atr-kg-method-badge.m-1 { background: #E8F5EE; color: #2D8659; }
.atr-kg-method-badge.m-2 { background: #FEF9C3; color: #854d0e; }
.atr-kg-method-badge.m-3 { background: #fef9c3; color: #a16207; }
.atr-kg-method-badge.m-4 { background: #e0f2fe; color: #0369a1; }
.atr-kg-method-badge.m-5 { background: #e0f2fe; color: #0073aa; }
.atr-kg-method-badge.m-6 { background: #fee2e2; color: #991b1b; }
.atr-kg-method-badge.m-special { background: #f5f7fa; color: #666; border: 1px solid #e2e5ea; }

.atr-kg-method-num {
    background: currentColor;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}
/* Invert the number circle for each method */
.m-1 .atr-kg-method-num { background: #2D8659; }
.m-2 .atr-kg-method-num { background: #854d0e; }
.m-3 .atr-kg-method-num { background: #a16207; }
.m-4 .atr-kg-method-num { background: #0369a1; }
.m-5 .atr-kg-method-num { background: #0073aa; }
.m-6 .atr-kg-method-num { background: #991b1b; }

/* Qualifier */
.atr-kg-qualifier {
    font-size: 14px;
    color: #666;
    margin: 6px 0 0;
}

/* Expanded detail */
.atr-kg-detail {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e5ea;
}
.atr-kg-card.expanded .atr-kg-detail {
    display: block;
}

/* Method detail inside card */
.atr-kg-method-detail {
    background: #f5f7fa;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 12px;
}
.atr-kg-method-detail-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}
.atr-kg-method-detail p {
    font-size: 13px;
    color: #666;
    margin: 0;
}
.atr-kg-hagala-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    cursor: pointer;
}
.atr-kg-hagala-link:hover {
    text-decoration: underline;
}

/* Notes inside card */
.atr-kg-notes {
    list-style: none;
    padding: 0;
    margin: 0;
}
.atr-kg-notes li {
    position: relative;
    padding: 8px 0 8px 20px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    unicode-bidi: plaintext;
    text-align: start;
}
.atr-kg-notes li:last-child {
    border-bottom: none;
}
.atr-kg-notes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0073aa;
    opacity: 0.4;
}

/* No results message */
.atr-kg-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}
.atr-kg-no-results strong {
    color: #666;
}

/* Browse all prompt */
.atr-kg-browse-prompt {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 14px;
}
.atr-kg-browse-link {
    color: #0073aa;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}
.atr-kg-browse-link:hover {
    text-decoration: underline;
}

/* Expandable sections */
.atr-kg-sections {
    margin-top: 12px;
}
.atr-kg-expand-section {
    margin-bottom: 8px;
}
.atr-kg-expand-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.atr-kg-expand-toggle:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.atr-kg-expand-toggle.active {
    border-radius: 10px 10px 0 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.atr-kg-chevron {
    width: 20px;
    height: 20px;
    color: #999;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.atr-kg-expand-toggle.active .atr-kg-chevron {
    transform: rotate(180deg);
}
.atr-kg-expand-body {
    background: #fff;
    padding: 20px 28px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    font-size: 14px;
    color: #666;
    line-height: 1.7;
}
.atr-kg-expand-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 20px 0 8px;
}
.atr-kg-expand-body h3:first-child {
    margin-top: 0;
}
.atr-kg-expand-body p {
    margin: 0 0 10px;
}
.atr-kg-expand-body ul {
    padding-left: 20px;
    margin: 0 0 10px;
}
.atr-kg-expand-body li {
    margin-bottom: 8px;
}

/* Methods overview rows */
.atr-kg-method-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #e2e5ea;
}
.atr-kg-method-row:last-child {
    border-bottom: none;
}
.atr-kg-method-row .atr-kg-method-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0073aa;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.atr-kg-method-row strong {
    color: #333;
    display: block;
    margin-bottom: 2px;
    unicode-bidi: plaintext;
    text-align: start;
}
.atr-kg-method-row p {
    margin: 0;
    font-size: 13px;
}

/* Footer */
.atr-kg-footer {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    font-size: 13px;
    color: #999;
}
.atr-kg-footer a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}
.atr-kg-footer a:hover {
    text-decoration: underline;
}

/* Highlight search match */
.atr-kg-highlight {
    background: #fef08a;
    border-radius: 2px;
    padding: 0;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .atr-kg {
        padding: 0 12px;
    }
    .atr-kg-top-bar {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .atr-kg-title {
        font-size: 22px;
    }
    .atr-kg-card {
        padding: 18px 20px;
        border-radius: 8px;
    }
    .atr-kg-card-header {
        flex-direction: column;
        gap: 8px;
    }
    .atr-kg-item-name {
        font-size: 15px;
    }
    .atr-kg-search-input {
        font-size: 16px; /* prevent iOS zoom */
        padding: 12px 40px 12px 40px;
    }
    .atr-kg-expand-body {
        padding: 16px 20px;
    }
    .atr-kg-card:hover {
        transform: none; /* no hover on mobile */
    }
    .atr-kg-expand-toggle:hover {
        transform: none;
    }
}
