:root {
    --bg:        #0d0b07;
    --bg2:       #131009;
    --bg3:       #1a1608;
    --gold:      #c9a84c;
    --gold-dim:  #a07830;
    --gold-pale: #e8c97a;
    --text:      #e8dfc8;
    --muted:     #8a7d60;
    --line:      rgba(201,168,76,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    min-height: 100vh;
}

/* HEADER */
header {
    border-bottom: 1px solid var(--line);
    padding: 28px 0 0;
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 32px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    font-family: 'Scheherazade New', serif;
    font-size: 1.5rem;
    color: var(--gold-pale);
    text-decoration: none;
}

.site-brand span {
    color: var(--gold-dim);
    font-size: 0.8rem;
    display: block;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-weight: 300;
}

.gold-line {
    height: 2px;
    background: linear-gradient(90deg, var(--gold) 0%, transparent 70%);
}

/* PAGE HERO */
.page-hero {
    max-width: 1000px;
    margin: 0 auto;
    padding: 44px 32px 28px;
}

.page-hero h1 {
    font-family: 'Scheherazade New', serif;
    font-size: 2.2rem;
    color: var(--gold-pale);
    margin-bottom: 6px;
}

.page-hero .subtitle { font-size: 14px; color: var(--muted); }
.page-hero .subtitle strong { color: var(--gold); }

/* CONTROLS */
.controls-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 32px 32px;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    background: var(--bg2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 16px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--gold-dim); }
.search-input::placeholder { color: var(--muted); }

.filter-select {
    background: var(--bg2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 16px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    min-width: 180px;
}

.filter-select:focus { border-color: var(--gold-dim); }

.btn-search {
    background: var(--gold-dim);
    color: #0d0b07;
    border: none;
    padding: 10px 24px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search:hover { background: var(--gold); }

.btn-reset {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 10px 16px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: border-color 0.2s, color 0.2s;
}

.btn-reset:hover { border-color: var(--gold-dim); color: var(--gold); }

/* GRID */
.articles-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 32px 80px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

/* CARD */
.card {
    background: var(--bg2);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background 0.2s;
    overflow: hidden;
}

.card:hover { background: var(--bg3); }

/* THUMBNAIL */
.card-thumb {
    display: block;
    margin: -28px -24px 4px;
    overflow: hidden;
    flex-shrink: 0;
    line-height: 0;
}

.card-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.card:hover .card-thumb img { transform: scale(1.04); }

/* CATEGORIES */
.card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cat-tag {
    font-size: 11px;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    padding: 2px 10px;
    text-decoration: none;
    transition: background 0.15s;
}

.cat-tag:hover { background: rgba(201,168,76,0.1); }

/* TITLE */
.card-title {
    font-family: 'Scheherazade New', serif;
    font-size: 1.2rem;
    color: var(--gold-pale);
    line-height: 1.5;
    text-decoration: none;
    display: block;
}

.card-title:hover { color: var(--gold); }

/* EXCERPT */
.card-excerpt {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.7;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* FOOTER */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    gap: 8px;
    flex-wrap: wrap;
}

.card-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-meta .author { color: var(--gold-dim); font-weight: 600; }

.card-link {
    font-size: 12px;
    color: var(--gold);
    text-decoration: none;
    border: 1px solid var(--gold-dim);
    padding: 5px 14px;
    transition: background 0.15s;
    white-space: nowrap;
}

.card-link:hover { background: rgba(201,168,76,0.1); }

/* EMPTY STATE */
.empty {
    padding: 64px 32px;
    text-align: center;
    color: var(--muted);
    grid-column: 1/-1;
    font-size: 1rem;
}

/* PAGE FOOTER */
footer {
    border-top: 1px solid var(--line);
    padding: 28px 32px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

footer a { color: var(--gold-dim); text-decoration: none; }

/* RESPONSIVE */
@media (max-width: 640px) {
    .header-inner,
    .page-hero,
    .controls-wrap,
    .articles-wrap { padding-inline: 16px; }
    .page-hero h1  { font-size: 1.6rem; }
    .articles-grid { grid-template-columns: 1fr; }
}
