/* ================================================
   SELF-TRADE GUIDE (/services/self-trade-guide)
   The DIY pages' teal background, with the 8 parts drawn like the
   guide's slides: paper panels, square edges, monospace type
   ================================================ */

/* Parts clear the fixed navbar when linked to */
.stg-part {
    scroll-margin-top: 80px;
}

/* Header */
.stg-hero {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 20px 36px;
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.stg-hero h1 {
    color: white;
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 18px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.stg-hero .gold-rule {
    margin: 0 auto 24px;
}

.stg-hero p {
    font-size: 1.15rem;
    line-height: 1.7;
    opacity: 0.95;
    margin: 0;
}

.stg-hero p a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

/* Jump links to the parts */
.stg-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.stg-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    background: rgba(11, 60, 73, 0.35);
    color: white;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.stg-nav a span {
    color: #f5af3c;
}

.stg-nav a:hover {
    background: #0b3c49;
    border-color: #0b3c49;
    color: white;
    text-decoration: none;
}

.stg-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px 80px;
    position: relative;
    z-index: 1;
}

/* A part of the guide, drawn like one of its slides */
.stg-part {
    background: #f6f4f0;
    border-top: 8px solid #0b3c49;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 40px;
    margin-bottom: 28px;
    color: #1d2b30;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.92rem;
}

.stg-part h4,
.stg-part h5 {
    font-family: inherit;
}

.stg-part-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 22px;
    margin-bottom: 30px;
    border-bottom: 2px solid #1f7a72;
}

.stg-part-num {
    flex-shrink: 0;
    background: #1f7a72;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 4px 10px;
    margin-top: 5px;
}

.stg-part-title {
    color: #0b3c49;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.15;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.stg-part-lead {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.stg-part a {
    color: #1f7a72;
    text-decoration: underline;
    font-weight: 700;
}

.stg-part a:hover {
    color: #0b3c49;
}

.stg-part strong {
    color: #0d1f24;
    font-weight: 800;
}

/* Small uppercase label */
.stg-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #1f7a72;
    margin-bottom: 10px;
}

.stg-kicker--gold {
    color: #b5832a;
}

/* Two-column layouts */
.stg-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
}

/* Columns may shrink below their content, so the table scrolls in its own box */
.stg-split > * {
    min-width: 0;
}

.stg-split--shot-narrow {
    grid-template-columns: 1fr 2fr;
}

.stg-split--book {
    grid-template-columns: 5fr 3fr;
}

.stg-split--table {
    grid-template-columns: 2fr 1fr;
}

.stg-stack > * + * {
    margin-top: 22px;
}

/* A screenshot from the portal; opens full size in a new tab */
.stg-shot {
    display: block;
    border: 2px solid #0b3c49;
    background: white;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.stg-shot:hover {
    box-shadow: 0 6px 18px rgba(11, 60, 73, 0.2);
}

.stg-shot img {
    display: block;
    max-width: 100%;
    height: auto;
}

.stg-shot:not(.stg-shot--full) img {
    width: 100%;
}

/* A wide screenshot across the part, at most its own size (the img's width
   attribute), which it keeps while it loads */
.stg-shot--full {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* The Live SREC Pricing box keeps its own frame, with the markers past its
   edge on a clear background */
.stg-shot--pricing {
    max-width: 314px;
    border: 0;
    background: none;
    overflow: visible;
}

.stg-shot--pricing:hover {
    box-shadow: none;
}

/* Numbered notes matching the gold markers in a screenshot */
.stg-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stg-legend li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stg-legend li + li {
    margin-top: 18px;
}

.stg-marker {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #b5832a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.05rem;
    font-weight: 800;
}

.stg-legend h5 {
    color: #0b3c49;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 2px 0 5px;
}

.stg-legend p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Legend notes in two columns, numbered down each column */
.stg-legend--cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: column;
    gap: 18px 36px;
}

.stg-legend--cols li + li {
    margin-top: 0;
}

.stg-legend--rows2 {
    grid-template-rows: repeat(2, auto);
}

.stg-legend--rows3 {
    grid-template-rows: repeat(3, auto);
}

.stg-legend--rows4 {
    grid-template-rows: repeat(4, auto);
}

/* Legend notes in boxes across, under a screenshot */
.stg-legend--grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.stg-legend--grid li + li {
    margin-top: 0;
}

.stg-legend--grid li {
    background: white;
    border: 2px solid #1f7a72;
    padding: 14px;
}

/* Callout boxes */
.stg-note {
    background: white;
    border: 2px solid #1f7a72;
    padding: 18px 20px;
}

.stg-note p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.stg-note--gold {
    background: #fbf8f2;
    border-color: #b5832a;
}

.stg-notes {
    display: grid;
    gap: 18px;
}

.stg-notes--3 {
    grid-template-columns: repeat(3, 1fr);
}

.stg-notes--2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 01 - Two ways to sell */
.stg-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

.stg-option {
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid #1f7a72;
}

.stg-option--order {
    border-color: #b5832a;
}

.stg-option-head {
    background: #1f7a72;
    padding: 18px 22px;
}

.stg-option--order .stg-option-head {
    background: #b5832a;
}

.stg-option-head .stg-kicker {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 4px;
}

.stg-option-head h5 {
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}

.stg-option-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 6px 22px 22px;
}

.stg-facts {
    display: grid;
    grid-template-columns: 100px 1fr;
    margin: 0 0 22px;
}

.stg-facts dt,
.stg-facts dd {
    padding: 13px 0;
    border-bottom: 1px solid #e3ded4;
    margin: 0;
}

.stg-facts dt {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #1f7a72;
    padding-top: 15px;
}

.stg-option--order .stg-facts dt {
    color: #b5832a;
}

.stg-facts dd {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* The flow sits at the bottom of each option */
.stg-flow-wrap {
    margin-top: auto;
}

.stg-flow {
    list-style: none;
    counter-reset: stg-flow;
    padding: 0;
    margin: 0;
}

.stg-flow li {
    counter-increment: stg-flow;
    position: relative;
    border: 1px solid #1f7a72;
    background: #fbfaf7;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0d1f24;
}

.stg-flow li::before {
    content: "0" counter(stg-flow);
    color: #1f7a72;
    margin-right: 10px;
}

.stg-flow li + li {
    margin-top: 22px;
}

.stg-flow li + li::after {
    content: "\2193";
    position: absolute;
    top: -21px;
    left: 50%;
    transform: translateX(-50%);
    color: #1f7a72;
    font-weight: 800;
    line-height: 20px;
}

.stg-option--order .stg-flow li {
    border-color: #b5832a;
}

.stg-option--order .stg-flow li::before,
.stg-option--order .stg-flow li + li::after {
    color: #b5832a;
}

/* The rule, under the options */
.stg-rule {
    margin-top: 14px;
    background: #0b3c49;
    padding: 20px 24px;
    color: white;
    font-size: 0.95rem;
    line-height: 1.7;
}

.stg-rule strong {
    color: #f5af3c;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-right: 8px;
}

/* 02 - Sample order book */
.stg-book {
    background: white;
    border: 2px solid #0b3c49;
}

.stg-book-row {
    display: grid;
    grid-template-columns: 96px 130px 70px 1fr;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
    border-left: 6px solid transparent;
}

.stg-book-row + .stg-book-row {
    border-top: 1px dashed #c9c3b8;
}

.stg-book-row--mine {
    background: #fbf1df;
    border-left-color: #b5832a;
}

.stg-book-row--bid {
    background: #e3efed;
    border-left-color: #1f7a72;
}

.stg-book-row--spread {
    grid-template-columns: 96px 1fr;
    padding-top: 12px;
    padding-bottom: 12px;
}

.stg-book-side {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #0d1f24;
}

.stg-book-row--spread .stg-book-side {
    color: #1f7a72;
}

.stg-book-price {
    color: #0b3c49;
    font-size: 1.55rem;
    font-weight: 800;
}

.stg-book-size {
    font-size: 0.85rem;
}

.stg-book-what {
    font-size: 0.85rem;
    line-height: 1.55;
}

/* 07 - What executes where */
.stg-table-wrap {
    overflow-x: auto;
    border: 2px solid #0b3c49;
}

.stg-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.stg-table th {
    background: #0b3c49;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 16px 18px;
    text-align: left;
}

.stg-table td {
    padding: 16px 18px;
    border-top: 1px solid #e3ded4;
    font-size: 0.9rem;
    vertical-align: top;
}

.stg-table td:first-child {
    color: #0d1f24;
    font-size: 1.1rem;
    font-weight: 800;
    white-space: nowrap;
}

.stg-table td:last-child {
    border-left: 5px solid #1f7a72;
    color: #1f7a72;
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
}

.stg-table td.stg-exec--stop {
    border-left-color: #b03a2e;
    color: #b03a2e;
}

.stg-table td.stg-exec--order {
    border-left-color: #b5832a;
    color: #b5832a;
}

.stg-footnote {
    color: white;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    text-align: center;
    opacity: 0.8;
    margin: 10px 0 0;
}

/* Responsive */
@media (max-width: 992px) {
    .stg-split,
    .stg-split--shot-narrow,
    .stg-split--book,
    .stg-split--table,
    .stg-options {
        grid-template-columns: 1fr;
    }

    .stg-shot--pricing {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .stg-hero {
        padding: 100px 16px 24px;
    }

    .stg-hero h1 {
        font-size: 1.9rem;
    }

    .stg-hero p {
        font-size: 1rem;
    }

    .stg-wrap {
        padding: 0 12px 60px;
    }

    .stg-part {
        padding: 24px 14px;
        margin-bottom: 20px;
    }

    .stg-part-head {
        flex-direction: column;
        gap: 10px;
    }

    .stg-part-num {
        font-size: 0.9rem;
        margin-top: 0;
    }

    .stg-part-title {
        font-size: 1.35rem;
        letter-spacing: 0.06em;
    }

    .stg-legend--grid,
    .stg-legend--cols,
    .stg-notes--3,
    .stg-notes--2 {
        grid-template-columns: 1fr;
    }

    .stg-legend--cols {
        grid-auto-flow: row;
        grid-template-rows: none;
    }

    .stg-option-head h5 {
        font-size: 1.25rem;
    }

    .stg-facts {
        grid-template-columns: 80px 1fr;
    }

    .stg-book-row {
        grid-template-columns: 76px 1fr auto;
        padding: 12px 14px;
    }

    .stg-book-what {
        grid-column: 1 / -1;
    }

    .stg-book-row--spread {
        grid-template-columns: 76px 1fr;
    }

    .stg-book-price {
        font-size: 1.25rem;
    }

    .stg-table th,
    .stg-table td {
        padding: 10px 7px;
    }

    .stg-table th {
        font-size: 0.62rem;
        letter-spacing: 0.05em;
    }

    .stg-table td {
        font-size: 0.8rem;
    }

    .stg-table td:first-child,
    .stg-table td:last-child {
        white-space: normal;
        font-size: 0.88rem;
    }
}
