/* Monk Directory Styles - Updated Layout Matching Reference */
.mnk {
    --band: #3b2314;
    --card: #fbf3e0;
    --ink: #3b2314;
    --mut: #7a5a45;
    --gold: #d4a838;
    --goldD: #a67c1f;
    --peach: #edc4b3;
    --ph: #f2d9cb;
    --danger: #8f1d1d;
    background: transparent;
    color: var(--ink);
    line-height: 1.6;
    max-width: 1080px;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: inherit;
}
.mnk * { box-sizing: border-box; }
.mnk [hidden], .mnk-lb[hidden] { display: none !important; }

.mnk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    background: var(--peach);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 14px;
    align-items: center;
}
.mnk-bar input {
    border: 1px solid var(--goldD);
    background: var(--card);
    color: var(--ink);
    border-radius: 8px;
    padding: 10px 14px;
    min-height: 44px;
    font: inherit;
    width: auto;
    min-width: 0;
    flex: 1 1 220px;
}
.mnk-bar .mnk-add {
    width: auto;
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .mnk-bar .mnk-add { flex: 1 1 100%; }
}

.mnk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.mnk-card {
    background: var(--card);
    border: 2px solid var(--gold);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(59, 35, 20, 0.08);
}

.mnk-pic {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--ph);
    display: grid;
    place-items: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--goldD);
    cursor: zoom-in;
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 0;
    width: 100%;
    overflow: hidden;
    margin-bottom: 14px;
}
.mnk-noimg { cursor: default; }
.mnk-pic img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mnk-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: var(--band);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 999px;
    padding: 0 10px;
    font-size: .8rem;
    line-height: 1.7;
    font-weight: 600;
}

.mnk-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.mnk-body h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    line-height: 1.35;
    color: var(--band);
    text-align: center;
    font-weight: 700;
}
.mnk-info-list {
    font-size: 0.95rem;
    color: var(--ink);
    margin-bottom: 16px;
    display: grid;
    gap: 4px;
}
.mnk-info-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(166, 124, 31, 0.2);
    padding-bottom: 3px;
}
.mnk-info-label {
    font-weight: 600;
    color: var(--mut);
}
.mnk-info-val {
    color: var(--ink);
    text-align: right;
}

.mnk-more, .mnk-btn {
    border: 1px solid var(--goldD);
    background: var(--gold);
    color: var(--band);
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    min-height: 42px;
    font: inherit;
    font-weight: 700;
    width: 100%;
    text-align: center;
    transition: background 0.2s;
    text-decoration: none;
    display: block;
}
.mnk-more:hover, .mnk-btn:hover {
    background: var(--goldD);
    color: #fff;
}

.mnk-acts {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.mnk-acts .mnk-btn {
    flex: 1;
    background: var(--card);
}
.mnk-pri {
    background: var(--gold);
    color: var(--band);
}
.mnk-del {
    background: var(--card);
    color: var(--danger);
    border-color: var(--danger);
}

.mnk-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--mut);
    background: var(--card);
    border: 1px dashed var(--goldD);
    border-radius: 12px;
}

/* Lightbox & Modal */
.mnk-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(30,12,6,.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 10px;
}
.mnk-lb img {
    max-width: min(960px, 94vw);
    max-height: 56vh;
    object-fit: contain;
    border: 2px solid var(--gold);
    border-radius: 8px;
}
.mnk-cap { color: var(--gold); text-align: center; }
.mnk-lbbar { display: flex; gap: 8px; }
.mnk-desc {
    max-width: min(720px, 94vw);
    max-height: 24vh;
    overflow: auto;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--goldD);
    border-radius: 8px;
    padding: 10px 14px;
    white-space: pre-wrap;
    line-height: 1.7;
}

.mnk-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(30,12,6,.7);
    display: flex;
    justify-content: center;
    padding: 16px;
    overflow: auto;
    box-sizing: border-box;
}
.mnk-modal[hidden] { display: none !important; }
.mnk-form {
    background: var(--card);
    color: var(--ink);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 20px;
    width: min(520px, 100%);
    display: grid;
    gap: 12px;
    margin: auto;
    align-content: start;
}
.mnk-form h3 { margin: 0; font-size: 1.25rem; color: var(--band); }
.mnk-form label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.mnk-form input, .mnk-form textarea {
    border: 1px solid var(--goldD);
    background: #fffaf0;
    color: var(--ink);
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    width: 100%;
}
.mnk-th { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.mnk-th:empty { display: none; }
.mnk-th div { position: relative; aspect-ratio: 1; border: 1px solid var(--gold); border-radius: 8px; overflow: hidden; }
.mnk-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mnk-th button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold); background: var(--band); color: var(--gold); cursor: pointer; }
.mnk-err { margin: 0; color: var(--danger); font-weight: 600; }
.mnk-err:empty { display: none; }
.mnk-fa { display: flex; justify-content: flex-end; gap: 8px; }
.mnk-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.mnk-bar .mnk-login { color: var(--band); font-weight: 600; align-self: center; text-decoration: underline; }
