/**
 * Penny Profits public website styles.
 *
 * Purpose: Faithfully restore the original blue, red and white PHP site design.
 * Related test: tests/validate_site.php.
 */

@font-face {
    font-family: "Allerta";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/allerta-regular.woff2") format("woff2");
}

:root {
    color-scheme: light dark;
    --pp-blue: #007ac9;
    --pp-blue-dark: #005b96;
    --pp-red: #b71234;
    --pp-black: #1f1d1e;
    --pp-white: #ffffff;
    --pp-paper: #ffffff;
    --pp-soft: #f6f7f8;
    --pp-text: #181818;
    --pp-muted: #555555;
    --pp-line: #d9d9d9;
    --pp-shadow: -0.625rem 0 0.8rem -0.45rem rgba(0, 0, 0, 0.5), 0.625rem 0 0.8rem -0.45rem rgba(0, 0, 0, 0.5);
    --page-width: min(73.125rem, calc(100% - 2rem));
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--pp-paper);
    color: var(--pp-text);
    font-family: "Allerta", Arial, sans-serif;
    line-height: 1.55;
}

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

a {
    color: var(--pp-blue-dark);
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

a:hover {
    color: var(--pp-red);
}

a:focus-visible,
button:focus-visible {
    outline: 0.2rem solid #f2ab00;
    outline-offset: 0.2rem;
}

button {
    font: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.25;
}

.page-width {
    width: var(--page-width);
    margin-inline: auto;
}

.shell {
    width: var(--page-width);
    margin-inline: auto;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    z-index: 200;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.7rem 1rem;
    transform: translateY(-160%);
    background: var(--pp-black);
    color: var(--pp-white);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: relative;
    z-index: 10;
    border-bottom: 5px inset var(--pp-blue);
    background: var(--pp-white);
    color: #111111;
}

.site-header__main {
    display: grid;
    grid-template-columns: minmax(12rem, 1.3fr) minmax(8rem, 0.7fr) minmax(8rem, 0.7fr) minmax(13rem, 1fr);
    align-items: center;
    gap: 1rem;
    min-height: 7.5rem;
    padding-block: 0.65rem;
}

.brand {
    display: block;
    max-width: 15rem;
}

.status-box {
    min-height: 4.75rem;
    padding: 0.45rem 0.75rem;
    border: 5px ridge var(--pp-blue);
    border-radius: 0 1.6rem 0 1.6rem;
    text-align: center;
}

.status-box strong,
.status-box span {
    display: block;
}

.status-box strong {
    font-size: 1.05rem;
}

.status-box span {
    margin-top: 0.25rem;
    color: #555555;
    font-size: 0.8rem;
}

.header-contact {
    text-align: right;
}

.header-contact__phone {
    color: #111111;
    font-size: clamp(1.1rem, 2vw, 1.65rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
}

.header-contact__phone::before {
    margin-right: 0.45rem;
    content: "☎";
}

.social-links--header {
    justify-content: flex-end;
    margin-top: 0.55rem;
}

.social-links--header a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--pp-blue);
    color: var(--pp-white);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.site-navigation {
    border-top: 1px solid #e4e4e4;
}

.site-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-block: 0;
    padding: 0;
    list-style: none;
}

.site-navigation a {
    display: block;
    padding: 0.55rem 1rem;
    color: #111111;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.site-navigation a:hover,
.site-navigation a[aria-current="page"] {
    background: var(--pp-blue);
    color: var(--pp-white);
}

.home-carousel {
    position: relative;
    overflow: hidden;
    min-height: clamp(11rem, 35vw, 25.625rem);
    border-bottom: 5px inset var(--pp-blue);
    background: #000000;
}

.home-carousel__slides {
    width: min(73.125rem, 100%);
    margin-inline: auto;
}

.home-carousel__slide {
    margin: 0;
}

.home-carousel__slide img {
    width: 100%;
    aspect-ratio: 1170 / 410;
    object-fit: cover;
}

.carousel-button {
    position: absolute;
    top: 50%;
    width: 3.25rem;
    height: 3.25rem;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.58);
    color: #ffffff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.carousel-button--previous {
    left: max(0.75rem, calc((100% - 73.125rem) / 2 + 0.75rem));
}

.carousel-button--next {
    right: max(0.75rem, calc((100% - 73.125rem) / 2 + 0.75rem));
}

.carousel-dots {
    position: absolute;
    right: 0;
    bottom: 0.7rem;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.carousel-dots span {
    width: 0.72rem;
    height: 0.72rem;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.carousel-dots .is-active {
    background: #ffffff;
}

.main-home-body {
    padding-inline: 0.65rem;
}

.headlines {
    display: grid;
    min-height: 7rem;
    align-items: center;
    overflow: hidden;
    padding-block: 1.5rem;
    text-align: center;
}

.headlines section {
    grid-area: 1 / 1;
}

.headlines h1,
.headlines h2 {
    margin: 0;
    font-size: clamp(1.15rem, 2.3vw, 1.8rem);
    font-weight: 400;
}

.headlines strong {
    color: var(--pp-red);
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.feature-card,
.contact-card {
    position: relative;
    min-height: 14rem;
    padding: 1.4rem;
    border: 2px solid var(--pp-blue);
    border-radius: 0.25rem;
    background: var(--pp-paper);
    box-shadow: var(--pp-shadow);
    text-align: center;
}

.feature-card__icon {
    float: right;
    margin-left: 0.75rem;
    color: var(--pp-blue);
    font-size: 3.2rem;
    line-height: 1;
}

.feature-card h2 {
    font-size: 1.65rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    padding: 0.65rem 1rem;
    border: 2px solid transparent;
    border-radius: 0.25rem;
    font-weight: 700;
    text-decoration: none;
}

.button--red {
    border-color: var(--pp-red);
    background: var(--pp-red);
    color: #ffffff;
}

.button--red:hover {
    border-color: var(--pp-blue);
    background: var(--pp-blue);
    color: #ffffff;
}

.button--outline {
    border-color: currentColor;
    background: transparent;
    color: inherit;
}

.button--disabled {
    border-color: #777777;
    background: #777777;
    color: #ffffff;
    cursor: not-allowed;
}

.statistics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    max-width: 45rem;
    margin: 4rem auto;
    text-align: center;
}

.statistics strong,
.statistics span {
    display: block;
}

.statistics strong {
    color: var(--pp-blue);
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 1;
}

.statistics span {
    margin-top: 0.7rem;
    font-size: 1.15rem;
}

.find-us {
    padding-block: 1rem 4rem;
    text-align: center;
}

.find-us > h2,
.address-card h2 {
    font-size: 2rem;
}

.map-panel {
    position: relative;
    min-height: 20rem;
    overflow: hidden;
    border: 2px solid var(--pp-blue);
    border-radius: 0.25rem;
    isolation: isolate;
    background:
        linear-gradient(45deg, rgba(0, 122, 201, 0.08) 25%, transparent 25%) 0 0 / 3rem 3rem,
        linear-gradient(-45deg, rgba(0, 122, 201, 0.08) 25%, transparent 25%) 0 0 / 3rem 3rem,
        var(--pp-soft);
    box-shadow: var(--pp-shadow);
}

.map-panel__fallback {
    position: absolute;
    z-index: 1000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background:
        linear-gradient(45deg, rgba(0, 122, 201, 0.08) 25%, transparent 25%) 0 0 / 3rem 3rem,
        linear-gradient(-45deg, rgba(0, 122, 201, 0.08) 25%, transparent 25%) 0 0 / 3rem 3rem,
        var(--pp-soft);
    color: var(--pp-text);
    text-decoration: none;
}

.map-panel__fallback:focus-visible {
    outline: 3px solid var(--pp-red);
    outline-offset: -5px;
}

.map-panel__pin {
    color: var(--pp-red);
    font-size: 4rem;
}

.address-card {
    padding-top: 2rem;
}

.address-card p {
    font-size: clamp(1.25rem, 3vw, 2rem);
}

.services {
    padding-block: 2rem 6rem;
}

.services__heading {
    text-align: center;
}

.services__heading > p {
    margin-bottom: 0.35rem;
    color: var(--pp-red);
    font-weight: 700;
}

.services-wheel {
    position: relative;
    width: min(31.25rem, 90vw);
    height: min(31.25rem, 90vw);
    margin: 3rem auto;
    border: 2px dotted var(--pp-red);
    border-radius: 50%;
}

.services-wheel__buttons button {
    position: absolute;
    display: grid;
    width: 5rem;
    height: 5rem;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 2px solid var(--pp-red);
    border-radius: 1.25rem;
    background: var(--pp-white);
    color: var(--pp-blue);
    cursor: pointer;
    font-size: 1.55rem;
    font-weight: 700;
}

.services-wheel__buttons button:hover,
.services-wheel__buttons button.is-active {
    background: linear-gradient(90deg, var(--pp-red), #da004c);
    color: #ffffff;
}

.services-wheel__buttons button:nth-child(1) { left: 50%; top: 0; }
.services-wheel__buttons button:nth-child(2) { left: 93%; top: 25%; }
.services-wheel__buttons button:nth-child(3) { left: 93%; top: 75%; }
.services-wheel__buttons button:nth-child(4) { left: 50%; top: 100%; }
.services-wheel__buttons button:nth-child(5) { left: 7%; top: 75%; }
.services-wheel__buttons button:nth-child(6) { left: 7%; top: 25%; }

.services-wheel__content {
    position: absolute;
    inset: 22%;
    display: grid;
    place-items: center;
    text-align: center;
}

.services-wheel__content article {
    grid-area: 1 / 1;
}

.services-wheel__content h3 {
    margin-bottom: 0.55rem;
    color: var(--pp-red);
    font-size: 1.55rem;
}

.page-hero {
    padding-block: clamp(3rem, 7vw, 6rem);
    text-align: center;
}

.page-hero .eyebrow,
.section-heading .eyebrow,
.contact-card .eyebrow,
.callout .eyebrow {
    color: var(--pp-blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-hero h1 {
    margin-bottom: 1rem;
    color: var(--pp-blue);
    font-size: clamp(2rem, 5vw, 3.25rem);
}

.page-hero h1 span {
    color: var(--pp-red);
}

.page-hero__lead {
    max-width: 48rem;
    margin-inline: auto;
    color: var(--pp-muted);
    font-size: 1.1rem;
}

.prose-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 0.5fr);
    gap: 3rem;
    padding-bottom: 5rem;
}

.prose {
    max-width: 52rem;
}

.prose h2:not(:first-child) {
    margin-top: 2.5rem;
}

.prose p,
.prose li {
    color: var(--pp-muted);
}

.prose--policy {
    padding-bottom: 6rem;
}

.fact-panel {
    align-self: start;
    padding: 2rem;
    border: 2px solid var(--pp-blue);
    border-radius: 0.25rem;
    box-shadow: var(--pp-shadow);
    text-align: center;
}

.fact-panel__value {
    margin-bottom: 0;
    color: var(--pp-blue);
    font-size: 2.75rem;
}

.fact-panel hr {
    margin-block: 1.5rem;
    border: 0;
    border-top: 1px solid var(--pp-line);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-bottom: 5rem;
}

.contact-card--wide {
    grid-column: 1 / -1;
}

.contact-card h2 {
    overflow-wrap: anywhere;
}

.section {
    padding-block: 3rem 5rem;
}

.section-heading {
    text-align: center;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social-links a {
    font-weight: 700;
}

.callout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 2rem;
    margin-bottom: 6rem;
    padding: 2.5rem;
    border: 2px solid var(--pp-blue);
    box-shadow: var(--pp-shadow);
}

.site-footer {
    padding-top: 3rem;
    background: var(--pp-paper);
}

.footer-brand {
    text-align: center;
}

.footer-brand img {
    width: 15.625rem;
    margin-inline: auto;
}

.footer-brand p {
    font-size: 1.15rem;
}

.footer-brand span {
    color: var(--pp-red);
}

.footer-bar {
    padding-block: 1rem;
    background: var(--pp-blue);
    color: #ffffff;
}

.footer-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-bar p {
    margin: 0;
    font-size: 0.85rem;
}

.footer-bar nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1rem;
}

.footer-bar a,
.footer-button {
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
}

.footer-button {
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.consent-panel {
    position: fixed;
    z-index: 150;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem;
    max-width: 75rem;
    margin-inline: auto;
    padding: 1.25rem;
    border: 3px solid var(--pp-blue);
    border-radius: 0.25rem;
    background: var(--pp-white);
    color: #111111;
    box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.35);
}

.consent-panel h2 {
    margin-bottom: 0.35rem;
    font-size: 1.25rem;
}

.consent-panel p {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.consent-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --pp-paper: #171717;
        --pp-soft: #242424;
        --pp-text: #f4f4f4;
        --pp-muted: #c4c4c4;
        --pp-line: #444444;
    }

    .site-header,
    .services-wheel__buttons button,
    .consent-panel {
        background: #fefefe;
        color: #111111;
    }

    .feature-card,
    .contact-card {
        background: #202020;
    }
}

@media (max-width: 56rem) {
    .site-header__main {
        grid-template-columns: 1fr 1fr;
    }

    .brand {
        max-width: 14rem;
    }

    .header-contact {
        text-align: left;
    }

    .social-links--header {
        justify-content: flex-start;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }

    .prose-layout,
    .callout {
        grid-template-columns: 1fr;
    }

    .consent-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 40rem) {
    :root {
        --page-width: min(100% - 1rem, 73.125rem);
    }

    .site-header__main {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .brand,
    .header-contact {
        grid-column: 1 / -1;
    }

    .brand {
        margin-inline: auto;
    }

    .header-contact,
    .social-links--header {
        justify-content: center;
        text-align: center;
    }

    .status-box {
        min-height: 4rem;
        border-width: 3px;
    }

    .site-navigation ul {
        justify-content: center;
    }

    .site-navigation a {
        padding-inline: 0.65rem;
        font-size: 0.78rem;
    }

    .home-carousel {
        min-height: 0;
    }

    .carousel-button {
        width: 2.5rem;
        height: 2.5rem;
    }

    .headlines {
        min-height: 8rem;
    }

    .statistics,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-card--wide {
        grid-column: auto;
    }

    .services-wheel {
        height: auto;
        border: 0;
        border-radius: 0;
    }

    .services-wheel__buttons {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .services-wheel__buttons button {
        position: static;
        width: 100%;
        height: 3.5rem;
        transform: none;
    }

    .services-wheel__content {
        position: static;
        min-height: 12rem;
        margin-top: 1.5rem;
        padding: 1.5rem;
        border: 2px dotted var(--pp-red);
    }

    .footer-bar__inner {
        display: block;
        text-align: center;
    }

    .footer-bar nav {
        justify-content: center;
        margin-top: 0.8rem;
    }

    .consent-panel {
        right: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
    }

    .consent-panel__actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
