/* ============================================================
   ARSIP DIGITAL – Public Styles
   ============================================================ */

/* ── Reset / Base ──────────────────────────────────────────── */
.ad-wrap, .ad-wrap * { box-sizing: border-box; }
.ad-wrap {
    --ad-primary:    #1B5E20;   /* overridden inline by PHP */
    --ad-primary-dk: #144a18;
    --ad-border:     #E0E0E0;
    --ad-bg:         #F7F8FA;
    --ad-white:      #ffffff;
    --ad-text:       #1A1A2E;
    --ad-muted:      #6B7280;
    --ad-radius:     8px;
    --ad-shadow:     0 2px 8px rgba(0,0,0,.08);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--ad-text);
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* ── Hero / Header ─────────────────────────────────────────── */
.ad-hero {
    background: var(--ad-primary);
    border-radius: var(--ad-radius);
    padding: 36px 36px 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.ad-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.06) 0%, transparent 60%);
    pointer-events: none;
}
.ad-hero__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}
.ad-hero__logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,.15);
}
.ad-hero__title {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
    line-height: 1.2;
}
.ad-hero__sub {
    margin: 0;
    color: rgba(255,255,255,.8);
    font-size: .95rem;
}

/* ── Category Tabs ─────────────────────────────────────────── */
.ad-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.ad-tab {
    padding: 8px 18px;
    border: 1px solid var(--ad-border);
    border-radius: 30px;
    background: var(--ad-white);
    color: var(--ad-muted);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}
.ad-tab:hover {
    border-color: var(--tab-color, var(--ad-primary));
    color: var(--tab-color, var(--ad-primary));
}
.ad-tab--active {
    background: var(--ad-primary);
    border-color: var(--ad-primary);
    color: #fff;
}

/* ── Toolbar ───────────────────────────────────────────────── */
.ad-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--ad-white);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: var(--ad-shadow);
}
.ad-search-box {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--ad-border);
    border-radius: 6px;
    padding: 0 12px;
    background: var(--ad-bg);
    transition: border-color .18s;
}
.ad-search-box:focus-within {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(27,94,32,.10);
}
.ad-search-icon {
    color: var(--ad-muted);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}
.ad-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 0;
    font-size: .9rem;
    color: var(--ad-text);
    outline: none;
}
.ad-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.ad-select {
    border: 1px solid var(--ad-border);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: .875rem;
    color: var(--ad-text);
    background: var(--ad-white);
    cursor: pointer;
    outline: none;
    min-width: 160px;
}
.ad-select:focus { border-color: var(--ad-primary); }

/* ── Results Bar ───────────────────────────────────────────── */
.ad-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.ad-results-count {
    font-size: .875rem;
    color: var(--ad-muted);
}
.ad-results-count strong { color: var(--ad-text); }

/* ── Document Grid ─────────────────────────────────────────── */
.ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    min-height: 100px;
}
.ad-grid--loading { opacity: .5; pointer-events: none; }

/* ── Document Card ─────────────────────────────────────────── */
.ad-card {
    background: var(--ad-white);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--ad-shadow);
    transition: box-shadow .2s, transform .2s;
}
.ad-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transform: translateY(-3px);
}
.ad-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-top: 4px solid #ccc;
    background: #FAFAFA;
}
.ad-card__cat {
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
}
.ad-card__ext {
    font-size: .7rem;
    font-weight: 700;
    font-family: monospace;
    padding: 2px 7px;
    border-radius: 4px;
    color: #fff;
}
.ad-card__ext--pdf  { background: #C62828; }
.ad-card__ext--docx,
.ad-card__ext--doc  { background: #1565C0; }
.ad-card__ext--xlsx,
.ad-card__ext--xls  { background: #2E7D32; }
.ad-card__ext--pptx,
.ad-card__ext--ppt  { background: #E65100; }

.ad-card__body {
    padding: 14px 16px;
    flex: 1;
}
.ad-card__title {
    font-size: .97rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 12px;
    color: var(--ad-text);
}

.ad-card__meta {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ad-card__meta-row {
    display: flex;
    font-size: .78rem;
    line-height: 1.4;
    gap: 6px;
}
.ad-card__meta-row--full { flex-direction: column; gap: 2px; }
.ad-card__meta-row dt {
    color: var(--ad-muted);
    flex-shrink: 0;
    min-width: 90px;
    font-weight: 500;
}
.ad-card__meta-row dt::after { content: ':'; }
.ad-card__meta-row dd {
    margin: 0;
    color: var(--ad-text);
    font-weight: 400;
}

.ad-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--ad-border);
    margin-top: auto;
}
.ad-card__date {
    font-size: .75rem;
    color: var(--ad-muted);
}
.ad-card__dl {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--ad-primary);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 5px;
    text-decoration: none;
    transition: background .18s;
}
.ad-card__dl:hover { background: var(--ad-primary-dk); color: #fff; }
.ad-card__dl--link { background: #1565C0; }
.ad-card__dl--link:hover { background: #0D47A1; }
.ad-card__no-file {
    font-size: .75rem;
    color: #bbb;
}

/* ── Empty & Loading States ────────────────────────────────── */
.ad-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--ad-muted);
    background: var(--ad-white);
    border: 1px dashed var(--ad-border);
    border-radius: var(--ad-radius);
}

/* ── Load More ─────────────────────────────────────────────── */
.ad-loadmore-wrap {
    text-align: center;
    margin-top: 28px;
}
.ad-btn-loadmore {
    background: transparent;
    border: 2px solid var(--ad-primary);
    color: var(--ad-primary);
    padding: 11px 32px;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
}
.ad-btn-loadmore:hover {
    background: var(--ad-primary);
    color: #fff;
}
.ad-btn-loadmore:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Credit Footer ────────────────────────────────────────── */
.ad-credit {
    text-align: center;
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px solid var(--ad-border);
    font-size: .78rem;
    color: var(--ad-muted);
}
.ad-credit a {
    color: var(--ad-primary);
    text-decoration: none;
    font-weight: 600;
}
.ad-credit a:hover { text-decoration: underline; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ad-hero { padding: 24px 20px; }
    .ad-hero__title { font-size: 1.3rem; }
    .ad-hero__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .ad-toolbar { flex-direction: column; align-items: stretch; }
    .ad-search-box { min-width: 0; }
    .ad-filters { width: 100%; }
    .ad-select { flex: 1; min-width: 0; }
    .ad-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .ad-tabs { gap: 6px; }
    .ad-tab { font-size: .8rem; padding: 6px 14px; }
}
