/*
 * Biigtigong English Dictionary — Public Styles
 * Clean, modern design for the dictionary search interface.
 */

/* =========================================================
   Wrapper
   ========================================================= */

.bd-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #222;
    line-height: 1.6;
}

/* =========================================================
   Search type toggle
   ========================================================= */

.bd-search-type-wrap {
    display: inline-flex;
    border: 2px solid #d6a240;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.bd-search-type-btn {
    padding: 7px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    background: #fff;
    color: #a97420;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    letter-spacing: 0.03em;
}

.bd-search-type-btn + .bd-search-type-btn {
    border-left: 2px solid #d6a240;
}

.bd-search-type-btn--active {
    background: #C8922A;
    color: #fff;
}

.bd-search-type-btn:hover:not(.bd-search-type-btn--active) {
    background: #fdf4e3;
}

/* =========================================================
   Search form
   ========================================================= */

.bd-search-form {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    margin: 24px 0 28px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.bd-search-input {
    flex: 1 1 auto;
    padding: 14px 18px;
    font-size: 1.05rem;
    border: 2px solid #d6a240;
    border-right: none;
    border-radius: 6px 0 0 6px;
    outline: none;
    background: #fff;
    color: #222;
    transition: border-color 0.2s;
    min-width: 0;
}

.bd-search-input:focus {
    border-color: #C8922A;
    background: #fffdf7;
}

.bd-search-input::placeholder {
    color: #aaa;
}

.bd-search-btn {
    flex: 0 0 auto;
    padding: 14px 28px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background-color: #C8922A;
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.bd-search-btn:hover,
.bd-search-btn:focus {
    background-color: #a97420;
    outline: none;
}

.bd-search-btn:active {
    transform: scale(0.98);
}

/* =========================================================
   Loading indicator
   ========================================================= */

.bd-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
    color: #888;
    font-size: 0.95rem;
}

.bd-loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e0c98a;
    border-top-color: #C8922A;
    border-radius: 50%;
    animation: bd-spin 0.8s linear infinite;
}

@keyframes bd-spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   Results sections
   ========================================================= */

.bd-results-section {
    margin-top: 28px;
}

.bd-section-header {
    font-size: 1rem;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 32px 0 12px;
}

/* =========================================================
   Keyword sections  (lev1 grouping)
   ========================================================= */

.bd-keyword-section {
    margin-bottom: 32px;
}

.bd-keyword-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #3a2c0a;
    border-bottom: 2px solid #C8922A;
    padding-bottom: 6px;
    margin: 0 0 16px;
}

/* =========================================================
   Refiner sub-groups  (lev2 grouping)
   ========================================================= */

.bd-refiner-group {
    margin-bottom: 16px;
    padding-left: 16px;
    border-left: 3px solid #e8d5a8;
}

.bd-refiner-header {
    font-size: 1rem;
    font-weight: 600;
    color: #5a3e10;
    margin: 0 0 8px;
}

/* =========================================================
   Lev3 sub-groups  (lev3 grouping within a refiner)
   ========================================================= */

.bd-lev3-group {
    margin-bottom: 12px;
    padding-left: 16px;
}

.bd-lev3-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #7a5a20;
    font-style: italic;
    margin: 4px 0 4px;
}

/* =========================================================
   Entry list items
   ========================================================= */

.bd-entry-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.bd-entry-item {
    padding: 5px 0;
    border-bottom: 1px solid #f0e8d4;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.bd-entry-item:last-child {
    border-bottom: none;
}

.bd-entry-word {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c1a00;
    text-decoration: none;
    transition: color 0.2s;
}

.bd-entry-word:hover,
.bd-entry-word:focus {
    color: #C8922A;
    text-decoration: underline;
}

.bd-pos-badge {
    display: inline-block;
    color: #5a3e10;
    font-size: 0.88rem;
    font-style: italic;
    vertical-align: baseline;
}

.bd-entry-gloss {
    color: #555;
    font-size: 0.93rem;
}

/* =========================================================
   No results
   ========================================================= */

.bd-no-results {
    color: #888;
    font-style: italic;
    padding: 20px 0;
    font-size: 0.97rem;
}

/* =========================================================
   Back button
   ========================================================= */

.bd-back-link {
    margin-bottom: 20px;
}

.bd-back-btn {
    display: inline-block;
    color: #C8922A;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 0;
    transition: color 0.2s;
}

.bd-back-btn:hover {
    color: #a97420;
    text-decoration: underline;
}

/* =========================================================
   Entry detail header
   ========================================================= */

.bd-detail-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8d5a8;
}

.bd-detail-word {
    font-size: 2.2rem;
    font-weight: 800;
    color: #2c1a00;
    margin: 0 0 6px;
    line-height: 1.2;
}

.bd-pos-badge--large {
    font-size: 0.82rem;
    padding: 4px 12px;
}

.bd-pos-desc {
    color: #666;
    font-size: 0.9rem;
    margin: 8px 0 0;
}

/* =========================================================
   Entry detail sections
   ========================================================= */

.bd-detail-gloss {
    margin-bottom: 14px;
    font-size: 1.4rem;
    line-height: 1.6;
}

.bd-detail-meta {
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
}

.bd-detail-noun-chart {
    margin-bottom: 14px;
    font-size: 0.92rem;
    color: #444;
}

/* =========================================================
   Inflection tables
   ========================================================= */

.bd-inflections {
    margin-top: 28px;
}

.bd-inflections-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #3a2c0a;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8d5a8;
}

.bd-inflection-section {
    background: #fdfaf5;
    border: 1px solid #e5d9c4;
    border-radius: 6px;
    padding: 16px 18px 12px;
    margin-bottom: 20px;
}

.bd-inflection-title {
    font-size: 1rem;
    font-weight: 700;
    color: #5a3e10;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #ead9b0;
}

.bd-forms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.bd-forms-table thead th {
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    font-weight: 600;
    padding: 6px 10px;
    border-bottom: 1px solid #e0d0b0;
    background: transparent;
}

.bd-forms-table tbody tr:nth-child(even) {
    background: rgba(200, 146, 42, 0.04);
}

.bd-forms-table tbody tr:hover {
    background: rgba(200, 146, 42, 0.09);
}

.bd-form-label {
    text-align: left;
    font-weight: 600;
    color: #5a4a2a;
    background: rgba(240, 230, 210, 0.35);
    padding: 7px 10px;
    width: 36%;
    vertical-align: top;
    font-size: 0.88rem;
}

.bd-form-cell {
    padding: 7px 10px;
    vertical-align: top;
}

.bd-form-primary {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1rem;
    color: #1a1200;
}

.bd-form-empty {
    color: #ccc;
}

.bd-variant {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 0.85rem;
    color: #888;
    margin-left: 8px;
}

.bd-variant::before {
    content: "(";
}

.bd-variant::after {
    content: ")";
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 600px) {
    .bd-search-form {
        flex-direction: column;
        border-radius: 6px;
        overflow: visible;
        box-shadow: none;
    }

    .bd-search-input {
        border: 2px solid #d6a240;
        border-radius: 6px;
        margin-bottom: 8px;
    }

    .bd-search-btn {
        border-radius: 6px;
        width: 100%;
        padding: 13px 20px;
    }

    .bd-detail-word {
        font-size: 1.7rem;
    }

    .bd-form-label {
        width: 44%;
    }

    .bd-forms-table {
        font-size: 0.85rem;
    }

    .bd-entry-word {
        font-size: 1.2em;
    }
}
