/* Shared layout for the Solar Roof notice + vendor pages: */
/* tesla.php, luma-solar-roof.php, voltaic-solar-roof.php */
/* Orange text/border accents use #C24E00 (documented 4.6:1+ on white, see main-style.css DESIGN-2) */
/* rather than the raw --accent-color, which fails AA contrast on a white background. */

.sr-page {
    background-color: #ffffff;
    color: var(--para-color);
}

.sr-page .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero */
.sr-hero {
    background-color: #f6f6f6;
    padding: 3.5em 0 3em 0;
}

.sr-eyebrow {
    display: inline-block;
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #C24E00;
    margin-bottom: 0.75em;
}

.sr-hero h1 {
    font-size: var(--fs-3xl);
    font-weight: 600;
    color: var(--para-color);
    margin: 0 0 0.5em 0;
}

.sr-hero .sr-intro {
    font-size: var(--fs-lg);
    font-weight: 400;
    color: var(--para-color);
    line-height: 1.6;
    max-width: 42em;
    margin-top: 0;
}

.sr-hero-media {
    margin-top: 2em;
}

.sr-hero-media img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
}

/* Specification strip: dark band, definition list of stat/label pairs */
.sr-spec-strip {
    background-color: #171717;
}

.sr-spec-strip dl {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5em;
    margin: 0;
    padding: 2.25em 20px;
}

.sr-stat {
    flex: 1 1 180px;
    text-align: center;
}

.sr-stat dt {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
}

.sr-stat dd {
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0.4em 0 0 0;
}

/* Body sections */
.sr-section {
    padding: 3.5em 0;
}

.sr-section-alt {
    background-color: #f6f6f6;
}

.sr-section h2 {
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #C24E00;
    margin: 0 0 0.5em 0;
}

.sr-section h3 {
    font-size: var(--fs-2xl);
    font-weight: 600;
    color: var(--para-color);
    margin: 0 0 0.5em 0;
}

.sr-section p {
    font-size: var(--fs-md);
    font-weight: 400;
    color: var(--para-color);
    line-height: 1.6;
    max-width: 60em;
}

.sr-section-media {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5em;
    margin-top: 2em;
}

.sr-section-media img {
    width: 100%;
    border-radius: 4px;
}

/* Single-image variant: one image at a readable width instead of the two-up grid */
.sr-section-media-single {
    grid-template-columns: 1fr;
    max-width: 40em;
}

.sr-caveat {
    font-size: var(--fs-md);
    font-style: italic;
    color: var(--text-color);
}

/* Specification table */
.sr-spec-table-wrap {
    padding: 3.5em 0;
}

.sr-spec-table {
    width: 100%;
    max-width: none;
    border-collapse: collapse;
    border: 1px solid #C24E00;
}

.sr-spec-table caption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-spec-table th,
.sr-spec-table td {
    text-align: left;
    padding: 0.9em 1.2em;
    font-size: var(--fs-md);
    font-weight: 400;
    color: var(--para-color);
    border-bottom: 1px solid #dcdcdc;
}

.sr-spec-table th[scope="row"] {
    font-weight: 600;
    width: 40%;
    background-color: #f6f6f6;
}

.sr-spec-table tr:last-child th,
.sr-spec-table tr:last-child td {
    border-bottom: 0;
}

/* Closing strip / CTA */
.sr-closing {
    background-color: #171717;
    padding: 3em 0;
    text-align: center;
}

.sr-closing h2 {
    font-size: var(--fs-2xl);
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.75em 0;
}

.sr-closing p {
    font-size: var(--fs-md);
    color: #dedede;
    margin: 0 0 1.5em 0;
}

.sr-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    justify-content: center;
}

a.sr-btn {
    display: inline-block;
    padding: 0.9em 1.8em;
    background-color: #C24E00;
    color: #ffffff;
    font-size: var(--fs-md);
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}

a.sr-btn:hover {
    background-color: #a54300;
}

a.sr-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

a.sr-btn-outline {
    background-color: transparent;
    border: 2px solid #ffffff;
}

a.sr-btn-outline:hover {
    background-color: #ffffff;
    color: #171717;
}

.sr-section a,
.sr-hero a {
    color: #C24E00;
    font-weight: 600;
}

.sr-section a:focus-visible,
.sr-hero a:focus-visible {
    outline: 2px solid #C24E00;
    outline-offset: 2px;
}

/* ---- Site review fixes (fix/site-review) ---- */

.sr-page h1,
.sr-page h2,
.sr-page h3 {
    line-height: 1.2;
    text-wrap: balance;
}

/* A section title with no large headline after it is the headline itself */
.sr-section h2:not(:has(+ h3)) {
    font-size: var(--fs-2xl);
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--para-color);
    margin: 0 0 0.5em 0;
}

.sr-section-media-content h3,
.sr-section-media-content h2:not(:has(+ h3)) {
    font-size: var(--fs-xl);
}

.sr-section-media-content h2 ~ h3 {
    font-size: var(--fs-lg);
    margin-top: 1.5em;
}

.sr-section-media-content > :first-child {
    margin-top: 0;
}

.sr-section li {
    font-size: var(--fs-md);
    line-height: 1.6;
    color: var(--para-color);
}

/* Eyebrow labels on grey bands: same orange family, AA on #f6f6f6 */
.sr-hero .sr-eyebrow,
.sr-section-alt h2 {
    color: #B84A00;
}

.sr-spec-table-wrap h2 {
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #C24E00;
    margin: 0 0 1em 0;
}

/* Buttons: white label must beat the generic section link colour */
.sr-page a.sr-btn,
.sr-page a.sr-btn:visited,
.sr-page a.sr-btn:hover {
    color: #ffffff;
    font-size: var(--fs-base);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
    max-width: 100%;
}

.sr-page a.sr-btn-outline:hover {
    color: #171717;
}

.sr-section a.sr-btn {
    margin: 1.25em 0.75em 0 0;
}

.btn-block {
    margin-top: 1.5em;
}

/* Image + text rows */
.sr-section-media {
    align-items: center;
    gap: 2.5em;
    margin-top: 2.5em;
}

.sr-section-media > * {
    min-width: 0;
}

.sr-section-media > img {
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
}

.sr-section-media-reverse > .sr-section-media-content,
.sr-section-media-text-right > .sr-section-media-content {
    order: 2;
}

.sr-section-media-text-left > .sr-section-media-content {
    order: -1;
}

.sr-section-media-single {
    max-width: none;
}

.sr-section-media-single > img {
    aspect-ratio: 16 / 9;
}

/* Feature / spec cards */
.sr-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5em;
    margin-top: 1.5em;
}

.sr-info-card {
    background-color: #f6f6f6;
    border-top: 3px solid #C24E00;
    border-radius: 4px;
    padding: 1.5em 1.75em;
}

.sr-section-alt .sr-info-card {
    background-color: #ffffff;
}

.sr-section .sr-info-card h3 {
    font-size: var(--fs-md);
    margin: 0 0 0.75em 0;
}

.sr-info-card ul {
    margin: 0;
    padding-left: 1.2em;
}

.sr-section .sr-info-card li {
    font-size: 1.0625rem;
    line-height: 1.5;
    margin-bottom: 0.4em;
}

/* Highlight stat inside a text section */
.sr-section p.feature-stat {
    font-size: var(--fs-2xl);
    font-weight: 700;
    line-height: 1.1;
    color: #C24E00;
    margin-top: 1em;
}

.sr-section-alt p.feature-stat {
    color: #B84A00;
}

.feature-stat span {
    display: block;
    font-size: var(--fs-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--para-color);
    margin-top: 0.4em;
}

/* Diagrams that open full size */
.sr-section .diagram-link {
    display: block;
    max-width: 900px;
    margin: 1.5em auto 0 auto;
    text-decoration: none;
}

.diagram-link img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.diagram-hint {
    display: none;
}

.sr-section .diagram-link-narrow {
    max-width: 640px;
}

/* Image link cards (hub pages) */
.sr-link-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5em;
    margin-top: 2em;
}

.sr-section a.sr-link-card {
    display: block;
    background-color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    color: var(--para-color);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.sr-section:not(.sr-section-alt) a.sr-link-card {
    background-color: #f6f6f6;
}

.sr-link-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.sr-link-card span {
    display: block;
    padding: 0.9em 1.1em 1em 1.1em;
    font-size: var(--fs-md);
    font-weight: 600;
    border-top: 3px solid #C24E00;
}

.sr-section a.sr-link-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    transform: translateY(-2px);
}

.sr-section a.sr-link-card:hover span {
    color: #C24E00;
}

.sr-closing p:last-child {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .sr-hero h1 {
        font-size: 2.25rem;
    }

    .sr-hero .sr-intro {
        font-size: var(--fs-md);
    }

    .sr-section h3,
    .sr-section h2:not(:has(+ h3)),
    .sr-closing h2 {
        font-size: 1.75rem;
    }

    .sr-section-media-content h3,
    .sr-section-media-content h2:not(:has(+ h3)) {
        font-size: 1.5rem;
    }

    .sr-section-media-content h2 ~ h3 {
        font-size: 1.25rem;
    }

    .sr-section p,
    .sr-section li,
    .sr-closing p {
        font-size: 1.0625rem;
    }

    .sr-section p.feature-stat {
        font-size: var(--fs-xl);
    }

    .sr-section-media {
        grid-template-columns: 1fr;
        gap: 1.25em;
    }

    .sr-section-media > img {
        order: -2;
    }

    .sr-section-media + .sr-section-media {
        border-top: 1px solid #dcdcdc;
        padding-top: 2em;
    }

    .sr-section a.sr-btn,
    .sr-cta-row a.sr-btn {
        display: block;
        text-align: center;
        margin-right: 0;
    }

    .sr-cta-row {
        flex-direction: column;
    }

    .sr-spec-strip dl {
        justify-content: center;
    }

    .sr-stat {
        flex: 1 1 calc(50% - 1em);
        min-width: 0;
    }

    .sr-stat dt {
        font-size: var(--fs-lg);
        line-height: 1.15;
        overflow-wrap: normal;
    }

    .sr-spec-table,
    .sr-spec-table tbody,
    .sr-spec-table tr,
    .sr-spec-table th,
    .sr-spec-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .sr-spec-table th[scope="row"] {
        width: 100%;
        border-bottom: 0;
        padding: 0.75em 0.9em 0.25em 0.9em;
    }

    .sr-spec-table td {
        padding: 0.25em 0.9em 0.75em 0.9em;
        font-size: var(--fs-base);
    }

    .diagram-hint {
        display: block;
        text-align: center;
        font-size: var(--fs-sm);
        margin-top: 0.5em;
    }
}

/* ==== Round-2 review fixes ==== */

/* Tall text beside a photo: keep the photo at the top and in view instead of floating mid-row */
@media (min-width: 768px) {
    .sr-section-media {
        align-items: start;
    }

    .sr-section-media > img {
        position: sticky;
        top: 1.5em;
    }
}

/* A sub-heading after body text needs breathing room */
.sr-section p + h3,
.sr-section ul + h3,
.sr-section-media-content p + h3,
.sr-section-media-content ul + h3 {
    margin-top: 1.5em;
}

/* Card lists start at the same height even when one title wraps */
.sr-section .sr-info-card h3 {
    min-height: 2.4em;
}

/* No single-word last lines */
.sr-page p {
    text-wrap: pretty;
}

/* ==== Components for pages migrated from the older templates ==== */

/* Lists inside sections */
.sr-section ul {
    padding-left: 1.25em;
}

.sr-section li::marker {
    color: #C24E00;
}

/* Badge band: row of badge/logo images on black */
.sr-badge-band {
    background-color: #171717;
}

.sr-badge-band .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    gap: 2em;
    padding-top: 2.5em;
    padding-bottom: 2.5em;
}

.sr-badge-band img {
    width: 150px;
    height: auto;
    object-fit: contain;
}

/* Image cards: image + heading + text, 3 across */
.sr-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5em;
    margin-top: 2em;
}

.sr-card {
    background-color: #f6f6f6;
    border-radius: 4px;
    overflow: hidden;
}

.sr-section-alt .sr-card {
    background-color: #ffffff;
}

.sr-card > img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.sr-card-body {
    padding: 1.25em 1.5em 1.5em 1.5em;
    border-top: 3px solid #C24E00;
}

.sr-section .sr-card h3 {
    font-size: var(--fs-md);
    margin: 0 0 0.5em 0;
}

.sr-section .sr-card p {
    font-size: 1.0625rem;
    margin: 0;
}

/* Accent band: dark-orange background, white text (AA) */
.sr-band-accent {
    background-color: #C24E00;
    color: #ffffff;
    padding: 3em 0;
}

.sr-band-accent h2,
.sr-band-accent h3,
.sr-band-accent p,
.sr-band-accent li {
    color: #ffffff;
}

.sr-band-accent h2 {
    font-size: var(--fs-xl);
    font-weight: 600;
    margin: 0 0 0.5em 0;
}

.sr-band-accent p {
    font-size: var(--fs-md);
    line-height: 1.6;
    max-width: 60em;
}

.sr-band-accent a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
}

.sr-band-accent a.sr-btn {
    background-color: #ffffff;
    color: #171717;
    text-decoration: none;
}

.sr-band-accent a.sr-btn:hover {
    background-color: #f0f0f0;
    color: #171717;
}

/* Icon link tiles: three process steps on a dark band */
.sr-icon-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2em;
    text-align: center;
}

.sr-icon-tiles a {
    display: block;
    color: #ffffff;
    text-decoration: none;
}

.sr-icon-tiles img {
    display: block;
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin: 0 auto 1em auto;
}

.sr-icon-tiles .sr-tile-label {
    display: block;
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
}

.sr-icon-tiles .sr-tile-caption {
    display: block;
    margin-top: 0.4em;
    font-size: 1.0625rem;
    color: #dedede;
}

.sr-icon-tiles a:hover .sr-tile-label {
    color: #ff8a3d;
}

/* Gallery grid */
.sr-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75em;
    margin-top: 2em;
}

.sr-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
}

/* Infographic: one large image, centred, readable width */
.sr-infographic {
    display: block;
    max-width: 900px;
    margin: 2em auto 0 auto;
}

.sr-infographic img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Article layout */
.sr-article {
    max-width: 760px;
    margin: 0 auto;
}

.sr-article > img,
.sr-article .sr-article-media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
    margin: 0 0 2em 0;
}

.sr-section .sr-article h2:not(:has(+ h3)),
.sr-section .sr-article h2 {
    font-size: var(--fs-xl);
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--para-color);
    margin: 1.75em 0 0.5em 0;
}

.sr-section .sr-article h3 {
    font-size: var(--fs-lg);
    margin: 1.5em 0 0.4em 0;
}

.sr-section .sr-article h4 {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--para-color);
    margin: 1.25em 0 0.3em 0;
}

.sr-section .sr-article p,
.sr-section .sr-article li {
    font-size: 1.125rem;
    line-height: 1.7;
}

.sr-section .sr-article li {
    margin-bottom: 0.5em;
}

/* Data tables (warranties etc.) */
.sr-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.sr-table caption {
    caption-side: top;
    text-align: left;
    font-size: 1rem;
    font-weight: 400;
    color: #555555;
    padding-bottom: 0.5em;
}

.sr-table th,
.sr-table td {
    text-align: left;
    padding: 0.8em 1em;
    font-size: 1rem;
    color: var(--para-color);
    border-bottom: 1px solid #dcdcdc;
    vertical-align: top;
}

.sr-table thead th {
    font-weight: 600;
    background-color: #f6f6f6;
    border-bottom: 2px solid #C24E00;
}

@media (max-width: 767px) {
    .sr-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .sr-badge-band img {
        width: 120px;
    }

    .sr-icon-tiles img {
        width: 110px;
        height: 110px;
    }

    .sr-section .sr-article h2 {
        font-size: 1.5rem;
    }

    .sr-section .sr-article h3 {
        font-size: 1.25rem;
    }

    .sr-section .sr-article p,
    .sr-section .sr-article li {
        font-size: 1.0625rem;
    }

    /* Tables stack: each row becomes a block, cells labelled via data-label */
    .sr-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .sr-table,
    .sr-table tbody,
    .sr-table tr,
    .sr-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .sr-table tr {
        border-bottom: 2px solid #dcdcdc;
        padding: 0.5em 0;
    }

    .sr-table td {
        border-bottom: 0;
        padding: 0.3em 0.25em;
    }

    .sr-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: var(--fs-sm);
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #C24E00;
    }
}
