/* article.css - chess-article specific styles that complement the
   NACCL output.css (Tailwind). Targets the markup the article pages
   (Default, View, Curate, Generate, Admin) already use. */

/* --- top-level chrome ---------------------------------------------- */

h1, h2, h3, h4 {
    color: #2d3142;
    font-family: "Wix Madefor Display", sans-serif;
}

/* Page-title pattern used by Default/Curate/Admin/etc. The output.css
   does not ship a generic h1 size so we set it here. */
.wrap > h1, main > h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 18px 0 14px;
}
main > h1 + .meta,
main > h1 + p.meta {
    margin-top: -6px;
    margin-bottom: 18px;
    color: #5d6675;
}

/* Single-article view hero (View.aspx). pnlArticle is the ASP:Panel that
   wraps the article body; ASP.NET renders it as a <div>. ASP.NET prepends
   the ContentPlaceHolder id to nested control ids (e.g. MainContent_pnlArticle)
   so `#pnlArticle` would miss it - we use the [id$=pnlArticle] suffix-match
   selector instead so the rule sticks in both the master-page render path
   and a flat render. */
[id$=pnlArticle] .meta {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5d82a8;
}
[id$=pnlArticle] h1 {
    font-size: 56px;
    line-height: 1.1;
    font-weight: 900;
    color: #1c2434;
    margin: 0 0 24px;
    letter-spacing: -0.02em;
}
@media (max-width: 640px) {
    [id$=pnlArticle] h1 { font-size: 34px; }
}

/* --- News page header + pager ------------------------------------- */

.news-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    /* Top margin pushes the "NACCL News" headline below the curved gradient
       header. Site.master gives <main> a flat top on the index page so the
       breathing room has to live here. */
    margin: 64px 0 6px;
}
.news-head h1 { margin: 0; font-size: 32px; font-weight: 800; }
.news-count { color: #5d6675; font-size: 13px; margin: 0; }

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 28px 0 12px;
    flex-wrap: wrap;
}
.pager-link {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d0d4dc;
    border-radius: 4px;
    color: #2d3142;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.pager-link:hover { background: #2d3142; color: #fff; border-color: #2d3142; }
.pager-link.disabled {
    background: #f4f6fa;
    color: #b0b6c2;
    border-color: #e2e6ec;
    cursor: not-allowed;
}
.pager-status { color: #5d6675; font-size: 13px; font-weight: 500; }

/* --- search bar on Default.aspx ------------------------------------ */

.searchbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    /* Larger bottom margin so the first article card has clear visual
       separation from the search button - reader feedback. */
    margin: 0 0 36px;
}
.searchbar input[type="text"] {
    flex: 1;
    min-width: 220px;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

/* --- buttons ------------------------------------------------------- */

.btn,
button.btn,
input[type="submit"].btn {
    display: inline-block;
    background: #2d3142;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}
.btn:hover { background: #1d2030; color: #fff; }

.btn-link {
    color: #5d82a8;
    font-size: 13px;
    text-decoration: underline;
}

/* --- article card grid on Default.aspx ----------------------------- */

.card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 18px 22px;
    margin: 0 0 14px;
}
.card h2 {
    font-size: 18px;
    margin: 0 0 6px;
}
.card h2 a {
    color: #2d3142;
    text-decoration: none;
}
.card h2 a:hover { text-decoration: underline; }
.card .meta {
    color: #5d6675;
    font-size: 12px;
    margin: 0 0 8px;
}
.card p {
    color: #4a4a4a;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.empty {
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #777;
}

/* --- single-article view (View.aspx) ------------------------------- */

.article-body {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 28px 32px;
    font-size: 16px;
    line-height: 1.7;
    color: #2a2e3a;
}
.article-body h1,
.article-body h2,
.article-body h3 { margin-top: 24px; margin-bottom: 12px; }
.article-body h1 { font-size: 24px; }
.article-body h2 { font-size: 20px; }
.article-body h3 { font-size: 17px; }
.article-body p { margin: 0 0 14px; }
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}
.article-body a { color: #1a4ea0; }
.article-body blockquote {
    border-left: 4px solid #5d82a8;
    background: #f4f7fb;
    padding: 12px 16px;
    margin: 12px 0;
    color: #444;
}
.article-body pre {
    background: #f4f4f4;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
    font-size: 13px;
}
.article-body code {
    background: #f4f4f4;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
    font-size: 0.92em;
}

/* --- form fields on Generate / Edit pages -------------------------- */

.field { margin: 0 0 14px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2d3142;
    margin: 0 0 4px;
}
.field input[type="text"],
.field input[type="password"],
.field textarea,
.field select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}
.field textarea { min-height: 120px; resize: vertical; }
.wide { width: 100%; }

.actions { margin: 18px 0 0; }
.msg { color: #b3261e; font-size: 13px; margin-top: 10px; }

/* --- admin manage list (Admin/Default.aspx) ------------------------ */

table.admin-list {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}
table.admin-list th,
table.admin-list td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
table.admin-list th {
    background: #f4f6fa;
    font-weight: 600;
    color: #2d3142;
}
table.admin-list tr:last-child td { border-bottom: none; }

/* Manage page table (uses class="grid" in the existing markup). */
table.grid {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    margin: 14px 0;
}
table.grid th,
table.grid td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    vertical-align: middle;
}
table.grid th {
    background: #f4f6fa;
    font-weight: 600;
    color: #2d3142;
}
table.grid tr:last-child td { border-bottom: none; }
table.grid a { color: #1a4ea0; text-decoration: none; margin-right: 8px; }
table.grid a:hover { text-decoration: underline; }
table.grid .rowactions { white-space: nowrap; }
table.grid .danger { color: #b3261e; }
