/* =========================================================================
   Saudi Exchange Announcements — front-end styling
   Mirrors the Tadawul "Issuers & Financial Advisor Announcements" pages.
   ========================================================================= */

.sa-arch-wrap,
.sa-single-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    color: #22303f;
    font-size: 15px;
    line-height: 1.6;
}

/* ---- Breadcrumb ---------------------------------------------------------- */
.sa-breadcrumb {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 22px;
}
.sa-breadcrumb a { color: #334155; text-decoration: none; }
.sa-breadcrumb a:hover { text-decoration: underline; }
.sa-breadcrumb .sep { margin: 0 8px; color: #94a3b8; }
.sa-breadcrumb .current { color: #0f172a; font-weight: 600; }

/* ---- Headings with the teal underline ----------------------------------- */
.sa-arch-title,
.sa-single-title {
    font-size: 30px;
    line-height: 1.25;
    font-weight: 400;
    color: #33475b;
    margin: 0 0 14px;
    padding-bottom: 12px;
    position: relative;
}
.sa-arch-title::after,
.sa-single-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 88px;
    height: 3px;
    background: #17b890;
}
.sa-single-title { font-size: 24px; }
.sa-arch-subtitle {
    color: #475569;
    font-size: 14px;
    margin: 0 0 26px;
}

/* ---- Symbol badge / ticker / change chips ------------------------------- */
.sa-badge {
    display: inline-block;
    background: #cdddf0;
    color: #33517c;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 3px;
    letter-spacing: .3px;
}
.sa-ticker { color: #33475b; font-weight: 600; font-size: 13px; }
.sa-change { font-size: 13px; font-weight: 600; }
.sa-change.sa-down { color: #e0362c; }
.sa-change.sa-up   { color: #159a5b; }
.sa-change.sa-flat { color: #64748b; }
.sa-hijri, .sa-greg { color: #5a6b7b; font-size: 13px; }

/* =========================================================================
   ARCHIVE / SHORTCODE LISTING
   ========================================================================= */

/* ---- Search + period bar ------------------------------------------------ */
.sa-searchbar {
    background: #f4f6f8;
    border: 1px solid #e6eaef;
    padding: 20px 22px;
    margin-bottom: 26px;
    display: flex;
    align-items: flex-end;
    gap: 40px;
    flex-wrap: wrap;
}
.sa-search-field label,
.sa-period > label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}
.sa-search-field input[type="text"] {
    width: 240px;
    max-width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #fff;
    font-size: 14px;
}
.sa-period-btns { display: flex; gap: 20px; align-items: center; }
.sa-period-btns a {
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}
.sa-period-btns a:hover { color: #1d4ed8; }
.sa-period-btns a.active {
    color: #1d4ed8;
    font-weight: 600;
    border-bottom-color: #1d4ed8;
}
.sa-reset {
    margin-left: auto;
    align-self: center;
    color: #1d4ed8;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid #1d4ed8;
    border-radius: 3px;
    padding: 8px 16px;
}
.sa-reset:hover { background: #1d4ed8; color: #fff; }

/* ---- Body: sidebar + results -------------------------------------------- */
.sa-arch-body {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.sa-arch-sidebar {
    flex: 0 0 260px;
    background: #f7f8fa;
    border: 1px solid #e6eaef;
    padding: 22px 20px;
}
.sa-arch-sidebar h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #33475b;
}
.sa-arch-sidebar hr {
    border: 0;
    border-top: 1px solid #dfe5ec;
    margin: 14px 0 18px;
}
.sa-symbol-locked {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.sa-timefilter label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}
.sa-timefilter input[type="date"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #fff;
    font-size: 13px;
    margin-bottom: 10px;
    box-sizing: border-box;
}
.sa-side-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}
.sa-apply {
    background: #1d4ed8;
    color: #fff;
    border: 0;
    border-radius: 3px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}
.sa-apply:hover { background: #1743b0; }
.sa-arch-sidebar .sa-reset {
    margin: 0;
    border: 1px solid #1d4ed8;
    padding: 7px 14px;
}

.sa-arch-results { flex: 1 1 auto; min-width: 0; }
.sa-results-count {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

/* ---- List rows ---------------------------------------------------------- */
.sa-list { }
.sa-row {
    padding: 20px 0 16px;
    border-bottom: 1px solid #e2e8f0;
}
.sa-row-ticker {
    font-size: 12px;
    font-weight: 600;
    color: #33475b;
    margin-bottom: 6px;
}
.sa-row-title {
    display: block;
    color: #2563b8;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 14px;
}
.sa-row-title:hover { text-decoration: underline; }
.sa-row-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.sa-row-left { display: flex; align-items: center; gap: 12px; }
.sa-row-right { display: flex; align-items: center; gap: 26px; white-space: nowrap; }

/* ---- Pagination --------------------------------------------------------- */
.sa-pagination {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    gap: 4px;
    background: #f4f6f8;
    padding: 10px;
    border-radius: 4px;
}
.sa-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    text-decoration: none;
    color: #334155;
    border-radius: 4px;
    font-size: 14px;
}
.sa-pagination .page-numbers:hover { background: #e2e8f0; }
.sa-pagination .page-numbers.current {
    background: #17b890;
    color: #fff;
}
.sa-pagination .page-numbers.dots { background: none; }

.sa-empty { color: #64748b; font-style: italic; padding: 20px 0; }

/* =========================================================================
   SINGLE ANNOUNCEMENT
   ========================================================================= */
.sa-single-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 26px;
}

/* ---- Element List / Explanation table ----------------------------------- */
.sa-single-content { margin-bottom: 28px; }
.sa-single-content table {
    width: 100% !important;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
    margin: 0 0 18px;
}
.sa-single-content col:first-child { width: 24%; }
.sa-single-content thead th {
    background: #dbe7f4;
    color: #1f3a5f;
    text-align: left;
    padding: 12px 14px;
    font-weight: 700;
    border: 1px solid #c6d5e6;
    font-size: 14px;
}
.sa-single-content tbody td {
    border: 1px solid #e1e7ee;
    padding: 12px 14px;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: break-word;
}
.sa-single-content tbody td:first-child {
    background: #f4f7fb;
    font-weight: 600;
    color: #33475b;
    width: 24%;
}
.sa-single-content tbody td p { margin: 0 0 10px; }
.sa-single-content tbody td p:last-child { margin-bottom: 0; }
.sa-single-content a { color: #2563b8; }

/* Inline attachment link (in the "Attached Documents" row) */
.sa-single-content a.sa-attachment,
a.sa-attachment {
    display: inline-block;
    margin: 3px 10px 3px 0;
    padding: 6px 12px 6px 30px;
    background: #eef4fb url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c0392b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><polyline points='14 2 14 8 20 8'/></svg>") no-repeat 10px center;
    border: 1px solid #cfe0f0;
    border-radius: 4px;
    color: #2563b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.sa-single-content a.sa-attachment:hover,
a.sa-attachment:hover { background-color: #e2edf9; text-decoration: none; }

/* ---- Disclaimer --------------------------------------------------------- */
.sa-disclaimer {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.7;
    margin: 24px 0;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

/* ---- Share -------------------------------------------------------------- */
.sa-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 34px;
}
.sa-share span { color: #33475b; font-size: 14px; }
.sa-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #33475b;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
}
.sa-share a:hover { background: #1d4ed8; }

/* ---- Previous announcements --------------------------------------------- */
.sa-prev {
    border-top: 1px solid #e2e8f0;
    padding-top: 26px;
}
.sa-prev-title {
    font-size: 20px;
    font-weight: 500;
    color: #33475b;
    margin: 0 0 20px;
    padding-bottom: 10px;
    position: relative;
}
.sa-prev-title::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 60px; height: 3px;
    background: #17b890;
}
.sa-prev-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.sa-prev-card {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s;
}
.sa-prev-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.sa-prev-card-title {
    color: #2563b8;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 12px;
}
.sa-prev-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.sa-prev-card-dates { color: #5a6b7b; font-size: 12px; display: flex; gap: 12px; }
.sa-prev-all {
    display: inline-block;
    margin-top: 18px;
    color: #2563b8;
    text-decoration: none;
    font-size: 14px;
}
.sa-prev-all:hover { text-decoration: underline; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 860px) {
    .sa-arch-body { flex-direction: column; }
    .sa-arch-sidebar { flex-basis: auto; width: 100%; box-sizing: border-box; }
    .sa-searchbar { gap: 20px; }
    .sa-reset { margin-left: 0; }
    .sa-prev-cards { grid-template-columns: 1fr; }
    .sa-row-meta { align-items: flex-start; }
    .sa-row-right { gap: 14px; }
}
