/* ===========================================================================
   content-pages.css

   Presentation for the static content pages (FAQs, Fee Structure). Loaded only
   by the pages that ask for it, via ViewData["PageCss"] in _Layout.cshtml, so
   it costs nothing on the rest of the site.

   Nothing here changes copy, figures or information architecture - it restyles
   the existing markup using the palette the site already uses:

     #493276  brand purple   (.text-color-Bdark / .bg-color-Bdark)
     #3d2963  deep purple    (.footerHighlighter)
     #EAE4F4  purple tint    (already used on .basket-pro-details accordions)
     #E6552C  accent orange  (Schedule - I heading)
     10px     corner radius  (.border-6)

   Note on borders: accessibility-fixes.css deliberately forces component
   borders to #767676 for WCAG 1.4.11 non-text contrast. Nothing here tries to
   override that - separation between cards comes from spacing, background and
   shadow instead of a lighter border.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   Shared page furniture
   --------------------------------------------------------------------------- */

/* Caps the measure so long answers and fee notes stay readable instead of
   running the full width of a desktop monitor. */
.content-page {
    max-width: 1000px;
    margin-inline: auto;
}

/* Section heading with a short brand rule under it. The <h3> elements it
   styles carry exactly the text that used to sit in a bold <p>. */
.content-page .section-heading {
    font-size: 1rem;
    color: #493276;
    margin-bottom: 0;
}

.content-page .section-heading::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 8px;
    background: #E6552C;
    border-radius: 2px;
}

/* ---------------------------------------------------------------------------
   FAQs - accordion
   Restyled through Bootstrap's own --bs-accordion-* custom properties rather
   than by overriding its rules, so the component keeps all of its behaviour and
   there is no specificity fight. Bootstrap's default open state is blue
   (#0c63e4), which is off-brand on this site.
   --------------------------------------------------------------------------- */
.faq-accordion {
    --bs-accordion-bg: #ffffff;
    --bs-accordion-border-radius: 10px;
    --bs-accordion-inner-border-radius: 10px;
    --bs-accordion-btn-color: #493276;
    --bs-accordion-btn-padding-y: 1rem;
    --bs-accordion-btn-padding-x: 1.25rem;
    --bs-accordion-active-color: #493276;
    --bs-accordion-active-bg: #EAE4F4;
    --bs-accordion-body-padding-y: 1rem;
    --bs-accordion-body-padding-x: 1.25rem;
    /* A focus ring in the brand colour, wide enough to be unmistakable. */
    --bs-accordion-btn-focus-border-color: #493276;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(73, 50, 118, 0.35);
    /* Chevrons recoloured to the brand purple (Bootstrap ships near-black and,
       when open, its blue). */
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23493276'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23493276'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Separate cards rather than one flush stack, so each question reads as its own
   item and the open one is easy to locate. */
.faq-accordion .accordion-item {
    margin-bottom: 0.75rem;
    border-radius: 10px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(73, 50, 118, 0.08);
}

.faq-accordion .accordion-item:last-child {
    margin-bottom: 0;
}

.faq-accordion .accordion-button {
    font-weight: 600;
    line-height: 1.5;
    /* The site-wide .accordion-button rule sets padding-right: 30px, which is
       not enough room for the chevron at this padding. */
    padding-right: 3rem;
}

/* Bootstrap removes the border radius on a collapsed button inside a rounded
   item only for the flush variant; these are separate cards, so keep it. */
.faq-accordion .accordion-button:not(.collapsed) {
    box-shadow: none;
}

.faq-accordion .accordion-button:hover {
    background-color: #f6f3fb;
}

.faq-accordion .accordion-button:not(.collapsed):hover {
    background-color: #e3dbf1;
}

.faq-accordion .accordion-body {
    color: #333333;
    line-height: 1.75;
}

.faq-accordion .accordion-body p {
    margin-bottom: 0.75rem;
}

.faq-accordion .accordion-body p:last-child {
    margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Fee Structure - tables
   These replace a block of bare element selectors (`table { }`, `thead th { }`)
   that were defined inline in the view and applied to any table on the page.
   The markup stays a real <table>: it is tabular data, and turning the rows
   into blocks for small screens would strip the row/column relationships that
   screen readers rely on. It wraps comfortably at 40/60, so no horizontal
   scrolling appears at phone widths.
   --------------------------------------------------------------------------- */
.fee-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(73, 50, 118, 0.08);
    border: 1px solid #767676;
}

.fee-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.fee-table thead th {
    background-color: #493276;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    padding: 0.875rem 1rem;
    border: 0;
}

/* The first cell of each row is a <th scope="row">, so the body cell rules have
   to cover both element types. */
.fee-table tbody th,
.fee-table td {
    padding: 0.875rem 1rem;
    vertical-align: top;
    line-height: 1.7;
    border: 0;
    border-bottom: 1px solid #767676;
}

.fee-table tbody tr:last-child th,
.fee-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Zebra striping to help the eye track across a wide row. */
.fee-table tbody tr:nth-child(even) {
    background-color: #faf9fc;
}

/* The "Head" column labels the row, so it is emphasised the way a row header is.
   40/60 keeps the proportions the inline styles set. */
.fee-table tbody th[scope="row"] {
    width: 40%;
    font-weight: 600;
    color: #493276;
    text-align: left;
}

.fee-table td:last-child {
    width: 60%;
}

/* The fee amounts read as figures rather than prose. */
.fee-table .fee-amount {
    font-weight: 600;
    color: #333333;
    white-space: nowrap;
}

/* Sub-points inside the Software Maintenance Charges cell. These replace runs
   of <br><br>, which produced spacing but no structure. */
.fee-table .fee-detail {
    margin-bottom: 0.75rem;
}

.fee-table .fee-detail:last-child {
    margin-bottom: 0;
}

.fee-table .fee-detail-label {
    color: #493276;
}

.fee-table .fee-detail-note {
    display: block;
    font-size: 0.875rem;
    color: #5a5a5a;
}

/* Closing note, lifted out of body copy into a flagged callout. */
.fee-note {
    border: 1px solid #767676;
    border-left: 4px solid #E6552C;
    border-radius: 10px;
    background-color: #fdf6f3;
    padding: 0.875rem 1rem;
}

.fee-note p {
    color: #333333;
}

@media (max-width: 575.98px) {
    .fee-table thead th,
    .fee-table tbody th,
    .fee-table td {
        padding: 0.75rem;
    }

    .faq-accordion {
        --bs-accordion-btn-padding-x: 1rem;
        --bs-accordion-body-padding-x: 1rem;
    }
}
