/* ============================================================
   ChiroCode — Practice microsite (/{slug})

   S195. Loaded only by _PublicLayout, but every class is cc-ms-
   prefixed anyway: stylesheets in this app have collided before
   and a prefix costs nothing.
   ============================================================ */

.cc-ms {
    background: var(--cc-surface-base);
}

/* === HERO === */

.cc-ms-hero {
    position: relative;
    padding: var(--cc-space-16) var(--cc-space-6);
    text-align: center;
    background: var(--cc-surface-subtle);
    border-bottom: 1px solid var(--cc-border);
    overflow: hidden;
}

.cc-ms-hero-inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--cc-space-4);
}

/* With a portrait, the hero becomes two columns and the text stops being centred — a centred
   column next to a photo reads as a mistake. */
.cc-ms-hero-inner--portrait {
    flex-direction: row;
    align-items: center;
    gap: var(--cc-space-8);
    text-align: left;
}

.cc-ms-hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--cc-space-4);
}

.cc-ms-hero-inner--portrait .cc-ms-hero-text {
    align-items: flex-start;
}

.cc-ms-hero-inner--portrait .cc-ms-hero-actions {
    justify-content: flex-start;
}

.cc-ms-hero-inner--portrait .cc-ms-tagline {
    max-width: none;
}

/* S196: a forced square. object-fit: cover with a fixed width AND height means any photo the
   practice uploads is cropped to fit rather than distorting the page — portrait, landscape or
   an odd phone ratio all land the same. object-position sits slightly high because faces do. */
.cc-ms-portrait {
    flex: 0 0 200px;
    width: 200px;
    height: 200px;
    object-fit: cover;
    object-position: center 35%;
    border-radius: var(--cc-card-radius);
    background: var(--cc-surface-subtle);
    box-shadow: var(--cc-shadow-sm);
}

.cc-ms-logo {
    height: 52px;
    max-width: 200px;
    width: auto;
    object-fit: contain;
    object-position: left center;
}

.cc-ms-hero-inner:not(.cc-ms-hero-inner--portrait) .cc-ms-logo {
    object-position: center;
}

.cc-ms-name {
    font-family: var(--cc-font-heading);
    font-size: 2.75rem;
    line-height: 1.1;
    font-weight: var(--cc-weight-bold);
    color: var(--cc-text-primary);
    margin: 0;
}

.cc-ms-tagline {
    font-size: 1.125rem;
    color: var(--cc-text-secondary);
    margin: 0;
    max-width: 46ch;
}

.cc-ms-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--cc-space-3);
    margin-top: var(--cc-space-2);
}

/* === BODY === */

.cc-ms-body {
    max-width: 760px;
    margin: 0 auto;
    padding: var(--cc-space-12) var(--cc-space-6) var(--cc-space-16);
    display: flex;
    flex-direction: column;
    gap: var(--cc-space-12);
}

.cc-ms-h2 {
    font-family: var(--cc-font-heading);
    font-size: 1.5rem;
    font-weight: var(--cc-weight-bold);
    color: var(--cc-text-primary);
    margin: 0 0 var(--cc-space-4);
}

.cc-ms-para {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--cc-text-secondary);
    margin: 0 0 var(--cc-space-4);
}

.cc-ms-para:last-child {
    margin-bottom: 0;
}

/* === SERVICES === */

.cc-ms-services {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--cc-space-3) var(--cc-space-6);
}

.cc-ms-services li {
    display: flex;
    align-items: flex-start;
    gap: var(--cc-space-2);
    font-size: 0.9375rem;
    color: var(--cc-text-primary);
}

.cc-ms-services svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 2px;
    color: var(--cc-accent);
}

/* === CONTACT + MAP === */

.cc-ms-contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--cc-space-6);
    align-items: start;
}

.cc-ms-contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--cc-space-4);
}

.cc-ms-contact-row {
    display: flex;
    align-items: flex-start;
    gap: var(--cc-space-3);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--cc-text-secondary);
}

.cc-ms-contact-row svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 3px;
    color: var(--cc-accent);
}

.cc-ms-contact-row a {
    color: var(--cc-accent-text);
    text-decoration: none;
}

.cc-ms-contact-row a:hover {
    text-decoration: underline;
}

.cc-ms-map {
    display: flex;
    flex-direction: column;
    gap: var(--cc-space-2);
}

.cc-ms-map iframe {
    width: 100%;
    height: 240px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-card-radius);
    display: block;
}

.cc-ms-map-link {
    display: inline-flex;
    align-items: center;
    gap: var(--cc-space-2);
    font-size: var(--cc-text-sm);
    color: var(--cc-accent-text);
    text-decoration: none;
}

.cc-ms-map-link svg {
    width: 14px;
    height: 14px;
}

.cc-ms-map-link:hover {
    text-decoration: underline;
}

/* === CLOSING CTA === */

.cc-ms-cta {
    background: var(--cc-slate-900);
    border-radius: var(--cc-card-radius);
    padding: var(--cc-space-10) var(--cc-space-6);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--cc-space-3);
}

.cc-ms-cta-title {
    font-family: var(--cc-font-heading);
    font-size: 1.5rem;
    font-weight: var(--cc-weight-bold);
    color: var(--cc-white);
    margin: 0;
}

.cc-ms-cta-dek {
    color: var(--cc-slate-400);
    margin: 0 0 var(--cc-space-2);
    font-size: 0.9375rem;
}

/* === MOBILE === */

@media (max-width: 768px) {
    .cc-ms-hero {
        padding: var(--cc-space-12) var(--cc-space-5);
    }

    /* The portrait stacks above the name and everything re-centres. Two narrow columns on a
       phone would leave the practice name breaking after every second word. */
    .cc-ms-hero-inner--portrait {
        flex-direction: column;
        text-align: center;
        gap: var(--cc-space-5);
    }

    .cc-ms-hero-inner--portrait .cc-ms-hero-text {
        align-items: center;
    }

    .cc-ms-hero-inner--portrait .cc-ms-hero-actions {
        justify-content: center;
    }

    .cc-ms-hero-inner--portrait .cc-ms-logo {
        object-position: center;
    }

    .cc-ms-portrait {
        flex: 0 0 auto;
        width: 160px;
        height: 160px;
    }

    .cc-ms-name {
        font-size: 2rem;
    }

    .cc-ms-tagline {
        font-size: 1rem;
    }

    .cc-ms-body {
        padding: var(--cc-space-10) var(--cc-space-5) var(--cc-space-12);
        gap: var(--cc-space-10);
    }

    .cc-ms-services,
    .cc-ms-contact {
        grid-template-columns: 1fr;
    }

    /* The map goes above the address on a phone: the visitor is usually deciding whether the
       practice is near them, and that is a picture question before it is a text one. */
    .cc-ms-contact-details {
        order: 2;
    }

    .cc-ms-map {
        order: 1;
    }
}

/* === ADMIN: the editor's image slots (Settings/PublicPage) === */

.cc-ms-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--cc-space-6);
    margin: var(--cc-space-4) 0;
}

.cc-ms-admin-slot {
    display: flex;
    flex-direction: column;
    gap: var(--cc-space-3);
    align-items: flex-start;
}

.cc-ms-admin-slot-title {
    font-size: var(--cc-text-lg);
    font-weight: var(--cc-weight-semibold);
    color: var(--cc-text-primary);
    margin: 0;
}

/* Same square and the same crop rule as the live page, at the same object-position, so the
   preview is the answer to "what will this look like" rather than an approximation of it. */
.cc-ms-admin-preview {
    width: 160px;
    height: 160px;
    object-fit: cover;
    object-position: center 35%;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-card-radius);
    background: var(--cc-surface-subtle);
}

/* A logo is usually transparent and rarely square, so it is contained on white rather than
   cropped to fill the way a photo is. */
.cc-ms-admin-preview--logo {
    object-fit: contain;
    object-position: center;
    background: var(--cc-white);
    padding: var(--cc-space-3);
}

.cc-ms-admin-empty {
    width: 160px;
    height: 160px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--cc-border-strong);
    border-radius: var(--cc-card-radius);
    background: var(--cc-surface-subtle);
    color: var(--cc-text-secondary);
    font-size: var(--cc-text-sm);
}

.cc-ms-admin-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cc-space-2);
    width: 100%;
}

@media (max-width: 768px) {
    .cc-ms-admin-grid {
        grid-template-columns: 1fr;
    }
}

/* === S198: "save as my practice" === */

.cc-ms-home-offer,
.cc-ms-home-set {
    display: flex;
    align-items: center;
    gap: var(--cc-space-4);
    flex-wrap: wrap;
    padding: var(--cc-space-4) var(--cc-space-5);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-card-radius);
    background: var(--cc-surface-subtle);
}

/* Saved state gets the accent tint - a quiet confirmation, not a celebration. */
.cc-ms-home-set {
    background: var(--cc-accent-tint);
    border-color: var(--cc-border-brand);
}

.cc-ms-home-set svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--cc-accent);
}

.cc-ms-home-copy {
    flex: 1 1 16rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.cc-ms-home-copy strong {
    color: var(--cc-text-primary);
    font-weight: var(--cc-weight-semibold);
}

.cc-ms-home-copy span {
    color: var(--cc-text-secondary);
}

.cc-ms-home-note {
    margin: var(--cc-space-2) 0 0;
    font-size: var(--cc-text-sm);
    color: var(--cc-text-secondary);
}

@media (max-width: 768px) {
    .cc-ms-home-offer,
    .cc-ms-home-set {
        align-items: flex-start;
    }
}

/* ============================================================
   S199: the public shell, the directory list, the day picker
   ============================================================ */

/* Sticky footer. Every patient-facing page is short, so a footer that stops halfway down the
   window with white space beneath it was the normal case rather than the exception. */
.cc-public-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cc-public-main {
    flex: 1 0 auto;
}

.cc-public-body > .cc-marketing-footer {
    flex-shrink: 0;
}

/* === /find: the directory list === */

.cc-find-list {
    list-style: none;
    margin: var(--cc-space-5) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--cc-space-3);
}

.cc-find-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cc-space-5);
    flex-wrap: wrap;
    padding: var(--cc-space-5);
    background: var(--cc-surface-base);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-card-radius);
    transition: border-color var(--cc-transition-fast), box-shadow var(--cc-transition-fast);
}

.cc-find-item:hover {
    border-color: var(--cc-border-strong);
    box-shadow: var(--cc-shadow-sm);
}

.cc-find-item-main {
    flex: 1 1 18rem;
    display: flex;
    flex-direction: column;
    gap: var(--cc-space-2);
    align-items: flex-start;
}

.cc-find-name {
    font-family: var(--cc-font-heading);
    font-size: 1.125rem;
    font-weight: var(--cc-weight-semibold);
    margin: 0;
    line-height: 1.3;
}

.cc-find-name a {
    color: var(--cc-text-primary);
    text-decoration: none;
}

.cc-find-name a:hover {
    color: var(--cc-accent-text);
}

.cc-find-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cc-space-2) var(--cc-space-5);
    font-size: 0.9375rem;
    color: var(--cc-text-secondary);
}

.cc-find-meta span {
    display: inline-flex;
    align-items: center;
    gap: var(--cc-space-2);
}

.cc-find-meta svg {
    width: 15px;
    height: 15px;
    color: var(--cc-text-secondary);
    opacity: 0.75;
}

.cc-find-meta a {
    color: var(--cc-accent-text);
    text-decoration: none;
}

.cc-find-meta a:hover {
    text-decoration: underline;
}

.cc-find-actions {
    display: flex;
    gap: var(--cc-space-2);
    flex-wrap: wrap;
}

/* Booking-page styles (cc-bk-*) live in marketing.css beside the rest of the cc-bk- block.
   S199: they were briefly duplicated here and won only by load order — the same shape of trap
   that hid the S197 nav bug for a session. One rule, one file. */

@media (max-width: 768px) {
    .cc-find-item {
        align-items: flex-start;
    }

    .cc-find-actions {
        width: 100%;
    }

    .cc-find-actions .cc-btn {
        flex: 1 1 0;
        justify-content: center;
    }
}