/**
 * Whitesand Beauty: site-wide components
 *  1. Tactile liquid-glass button (DESIGN.md Â§6.1, Constitution VI Â§5: .box.start-btn with
 *     .text, .btn-icon and .circle-overlay), magnetic on fine pointers (Â§4.2, hero-cover.js).
 *  2. Footer: Nocturne Charcoal surface (DESIGN.md Â§4.6) on the Brand Book hairline grid.
 *
 * Shared by the theme (functions.php) and the preview server. Monochrome only.
 * Selectors carry an element/extra class so they outrank the legacy .box/.start-btn rules.
 */

/* ================================================================ 1. Tactile button */

button.ws-tactile.box.start-btn,
a.ws-tactile.box.start-btn {
    --ws-t-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --h: 52px;
    position: relative;
    z-index: 1;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: auto;
    height: var(--h);
    padding-block: 0;
    padding-inline: 24px 7px;
    overflow: hidden;
    border: 0;
    border-radius: 9999px;
    /* Pearl glass: eggshell body with a cool falloff */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(239, 245, 246, 0.9) 100%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    color: #1E1E1E;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    /* Specular rims (DESIGN.md Â§6.1) over a soft contact shadow */
    box-shadow:
        inset 2px -2px 1px -1px rgba(255, 255, 255, 0.9),
        inset 6px -6px 1px -6px rgba(255, 255, 255, 0.55),
        inset 0 0 2px rgba(0, 0, 0, 0.35),
        0 1px 0 rgba(255, 255, 255, 0.06),
        0 14px 34px -10px rgba(0, 0, 0, 0.6);
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
    transition:
        transform 0.6s var(--ws-t-ease),
        box-shadow 0.6s var(--ws-t-ease);
    -webkit-tap-highlight-color: transparent;
}

/* Refractive sheen (45Â° specular gradient, 7px gaussian) */
button.ws-tactile.box.start-btn::after,
a.ws-tactile.box.start-btn::after {
    content: "";
    position: absolute;
    inset: 2px 30% 45% 3px;
    z-index: 3;
    border-radius: inherit;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 70%);
    filter: blur(7px);
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.6s var(--ws-t-ease);
}

/* Liquid fill: a charcoal pool spreads from the icon lens on hover */
button.ws-tactile .circle-overlay,
a.ws-tactile .circle-overlay {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: #1E1E1E;
    clip-path: circle(0px at var(--ws-pool-x, calc(100% - 26px)) 50%);
    transition: clip-path 0.7s var(--ws-t-ease);
    pointer-events: none;
}
[dir="rtl"] button.ws-tactile .circle-overlay,
[dir="rtl"] a.ws-tactile .circle-overlay { --ws-pool-x: 26px; }

button.ws-tactile.start-btn .text,
a.ws-tactile.start-btn .text {
    position: relative;
    z-index: 4;
    color: #1E1E1E;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: color 0.45s ease 0.05s;
}

button.ws-tactile.start-btn .btn-icon,
a.ws-tactile.start-btn .btn-icon {
    position: relative;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: calc(var(--h) - 14px);
    height: calc(var(--h) - 14px);
    border: 0;
    border-radius: 9999px;
    background: #1E1E1E;
    color: #F9FEFF;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.6s var(--ws-t-ease), background-color 0.45s ease, color 0.45s ease;
}
button.ws-tactile .btn-icon svg,
a.ws-tactile .btn-icon svg { width: 16px; height: 16px; }

@media (hover: hover) {
    button.ws-tactile.box.start-btn:hover,
    a.ws-tactile.box.start-btn:hover {
        transform: translate3d(var(--mx, 0px), calc(var(--my, 0px) - 3px), 0);
        box-shadow:
            inset 2px -2px 1px -1px rgba(255, 255, 255, 0.35),
            inset 6px -6px 1px -6px rgba(255, 255, 255, 0.2),
            inset 0 0 2px rgba(0, 0, 0, 0.6),
            0 1px 0 rgba(255, 255, 255, 0.06),
            0 20px 40px -12px rgba(0, 0, 0, 0.7);
    }
    button.ws-tactile:hover .circle-overlay,
    a.ws-tactile:hover .circle-overlay { clip-path: circle(140% at var(--ws-pool-x, calc(100% - 26px)) 50%); }
    button.ws-tactile.start-btn:hover .text,
    a.ws-tactile.start-btn:hover .text { color: #F9FEFF; }
    button.ws-tactile.start-btn:hover .btn-icon,
    a.ws-tactile.start-btn:hover .btn-icon { transform: scale(1.1); background: #F9FEFF; color: #1E1E1E; }
    button.ws-tactile.box.start-btn:hover::after,
    a.ws-tactile.box.start-btn:hover::after { opacity: 0.18; }
}

button.ws-tactile.box.start-btn:active,
a.ws-tactile.box.start-btn:active {
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(0.94);
    transition-duration: 0.2s;
}

button.ws-tactile.box.start-btn:focus-visible,
a.ws-tactile.box.start-btn:focus-visible {
    outline: 1px solid #F9FEFF;
    outline-offset: 4px;
}

@media (max-width: 640px) {
    button.ws-tactile.box.start-btn,
    a.ws-tactile.box.start-btn { --h: 48px; justify-content: center; padding-inline: 20px 6px; }
    button.ws-tactile.start-btn .text { flex: 1; text-align: center; }
}

/* ================================================================ 2. Footer */

.ws-footer {
    --f-ink: #F9FEFF;
    --f-soft: rgba(249, 254, 255, 0.58);
    --f-line: rgba(255, 255, 255, 0.1);
    --f-ease: cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    margin-top: clamp(80px, 10vw, 128px);
    background: #1E1E1E;
    color: var(--f-ink);
}
html.dark .ws-footer {
    background: #161616;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ws-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(64px, 8vw, 112px) clamp(20px, 5vw, 64px) 28px;
}

/* Lead: brand line + actions */
.ws-footer__lead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px 40px;
    padding-bottom: clamp(48px, 6vw, 72px);
}

.ws-footer__title {
    /* Grows beside the actions, but never narrower than the desktop two-line measure:
       below that the actions drop under the title instead of running into it */
    flex: 1 1 0;
    min-width: min(100%, 9em);
    margin: 0;
    max-width: 10.5em; /* the desktop two-line shape, also when the actions sit below */
    text-wrap: balance;
    font-size: clamp(2rem, 1.1rem + 3.2vw, 3.75rem);
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--f-ink);
}
.ws-footer__title:lang(fa) { letter-spacing: 0; line-height: 1.4; max-width: 22ch; }

.ws-footer__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 10px;
}
.ws-footer__actions > * { flex: 0 0 auto; }

.ws-footer__lens-row { display: flex; gap: 8px; }

.ws-footer__lens {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    color: var(--f-ink);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, transform 0.5s var(--f-ease);
}
.ws-footer__lens svg { width: 18px; height: 18px; }
.ws-footer__lens:hover { background: var(--f-ink); color: #1E1E1E; box-shadow: none; transform: translateY(-2px); }
.ws-footer__lens:focus-visible { outline: 1px solid var(--f-ink); outline-offset: 3px; }

/* Ruled columns: the rules separate real content, no ornaments */
.ws-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr);
    border-top: 1px solid var(--f-line);
    border-bottom: 1px solid var(--f-line);
}

.ws-footer__cell {
    padding: 28px 28px 36px;
    border-inline-start: 1px solid var(--f-line);
}
.ws-footer__cell:first-child { border-inline-start: 0; padding-inline-start: 0; }

.ws-footer__label {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 400;
    color: var(--f-soft);
}

.ws-footer__text {
    margin: 0;
    max-width: 34ch;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.85;
    color: var(--f-ink);
}

.ws-footer__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 24px;
    margin: 18px 0 0;
}

.ws-footer__link {
    color: var(--f-ink);
    text-decoration: none;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.6s var(--f-ease), color 0.3s ease;
}
[dir="rtl"] .ws-footer__link { background-position: 100% 100%; }
.ws-footer__link:hover,
.ws-footer__link:focus-visible { background-size: 100% 1px; outline: none; }
.ws-footer__link--soft { color: var(--f-soft); font-size: 14px; }
.ws-footer__link--soft:hover { color: var(--f-ink); }

.ws-footer__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.ws-footer__hours { display: grid; gap: 12px; max-width: 320px; margin: 0; }
.ws-footer__hours div { display: flex; justify-content: space-between; gap: 16px; }
.ws-footer__hours dt { font-size: 15px; font-weight: 300; color: var(--f-ink); }
.ws-footer__hours dd {
    margin: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--f-soft);
    direction: ltr;
    white-space: nowrap;
}
.ws-footer__hours dd:lang(fa) { direction: rtl; }

.ws-footer__ltr { direction: ltr; unicode-bidi: isolate; }

/* Signature: the master lockup, set large */
.ws-footer__signature {
    display: block;
    padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 5vw, 64px);
    color: var(--f-ink);
    text-decoration: none;
}
.ws-footer__signature svg {
    display: block;
    width: 100%;
    max-width: 1040px;
    height: auto;
    margin-inline: auto;
    opacity: 0.92;
}
.ws-footer__signature:focus-visible { outline: 1px solid var(--f-ink); outline-offset: 8px; }

/* The closing signature settles into place as the page ends */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .ws-footer__signature svg {
            animation: ws-footer-rise linear both;
            animation-timeline: view();
            /* Completes once fully entered: it sits at the page end, so later ranges never finish */
            animation-range: entry 0% entry 100%;
        }
    }
}
@keyframes ws-footer-rise {
    from { opacity: 0; transform: translateY(40px) scale(0.98); }
    to { opacity: 0.92; transform: none; }
}

/* Legal */
.ws-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 32px;
    padding-top: 24px;
    border-top: 1px solid var(--f-line);
    font-size: 13px;
    color: var(--f-soft);
}
.ws-footer__legal p { margin: 0; }
.ws-footer__legal nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.ws-footer__legal a { color: var(--f-soft); text-decoration: none; transition: color 0.3s ease; }
.ws-footer__legal a:hover { color: var(--f-ink); }

@media (max-width: 900px) {
    .ws-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ws-footer__cell:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--f-line); }
    .ws-footer__cell:nth-child(2) { border-inline-start: 0; padding-inline-start: 0; }
}

@media (max-width: 640px) {
    .ws-footer__grid { grid-template-columns: 1fr; }
    .ws-footer__cell,
    .ws-footer__cell:nth-child(2) { border-inline-start: 0; padding-inline: 0; border-top: 1px solid var(--f-line); }
    .ws-footer__cell:first-child { border-top: 0; border-bottom: 0; }
    /* Clear the bottom sanctuary dock (56px + 16px offset) at the end of the page */
    .ws-footer__legal { flex-direction: column; align-items: flex-start; padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    .ws-footer *,
    button.ws-tactile,
    button.ws-tactile * { transition: none !important; }
}

/* ================================================================ 3. Logo intro */
/* template-parts/components/logo-intro.php + playLogoIntro() in main.js. The brand vectors are stacked
   like the vertical lockup; each is revealed by a feathered mask driven by --p (0 hidden, 1 shown), so
   without JS everything is simply visible. */

.ws-intro {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: #121212;
    color: #F9FEFF;
    overflow: hidden;
}
html.ws-intro-pending .ws-intro,
.ws-intro.is-playing { display: flex; }

.ws-intro__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 24px;
}

.ws-intro__figure {
    position: relative;
    height: clamp(150px, 27vh, 250px);
    aspect-ratio: 39 / 100;
}
.ws-intro__figure svg,
.ws-intro__fa svg,
.ws-intro__en svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}
.ws-intro__fill,
.ws-intro__lines {
    position: absolute;
    inset: 0;
}
.ws-intro__fill svg,
.ws-intro__lines svg { height: 100%; }
.ws-intro__lines path {
    fill: none;
    stroke: currentColor;
    stroke-width: 0.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ws-intro__fa {
    width: clamp(200px, 58vw, 300px);
    margin-top: clamp(22px, 3.4vh, 34px);
    color: #F9FEFF;
}
.ws-intro__en {
    width: clamp(120px, 34vw, 172px);
    margin-top: clamp(14px, 2.2vh, 20px);
}

.ws-intro__tagline {
    margin: clamp(22px, 3.4vh, 32px) 0 0;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.8;
    color: rgba(249, 254, 255, 0.62);
}

/* Feathered reveal masks: the visible edge travels in the direction the mark is written */
.ws-intro__wipe {
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
.ws-intro__wipe--down {
    -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 55%);
    mask-image: linear-gradient(to bottom, #000 45%, transparent 55%);
    -webkit-mask-size: 100% 300%;
    mask-size: 100% 300%;
    -webkit-mask-position: 0 calc((1 - var(--p, 1)) * 100%);
    mask-position: 0 calc((1 - var(--p, 1)) * 100%);
}
.ws-intro__wipe--rtl {
    -webkit-mask-image: linear-gradient(to left, #000 45%, transparent 55%);
    mask-image: linear-gradient(to left, #000 45%, transparent 55%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-position: calc(var(--p, 1) * 100%) 0;
    mask-position: calc(var(--p, 1) * 100%) 0;
}
.ws-intro__wipe--ltr {
    -webkit-mask-image: linear-gradient(to right, #000 45%, transparent 55%);
    mask-image: linear-gradient(to right, #000 45%, transparent 55%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-position: calc((1 - var(--p, 1)) * 100%) 0;
    mask-position: calc((1 - var(--p, 1)) * 100%) 0;
}

.ws-intro__skip {
    position: absolute;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    inset-inline-end: 28px;
    padding: 10px 6px;
    border: 0;
    background: none;
    color: rgba(249, 254, 255, 0.58);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.3s ease;
}
.ws-intro__skip:hover { color: #F9FEFF; }
.ws-intro__skip:focus-visible { outline: 1px solid #F9FEFF; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .ws-intro { display: none !important; }
}

/* ================================================================ 4. Native select menus */
/* The open list is drawn by the OS, so options do not inherit the field's light-on-dark text.
   Give them explicit colours: light list in light mode, dark list in dark mode. Options that
   carry their own dark background class (booking drawer) keep it with light text. */
select option { background-color: #F9FEFF; color: #1E1E1E; }
select option[class],
html.dark select option { background-color: #1E1E1E; color: #F9FEFF; }

/* ================================================================ 5. Shared UI (inner pages and landing sections) */
/* Tokens for anything inside .ws-page (inner pages) or .ws-ui (landing sections). */
.ws-page,
.ws-ui {
    --p-ink: #1E1E1E;
    --p-soft: #717171;
    --p-line: #E0E0E0;
    --p-surface: rgba(30, 30, 30, 0.035);
    --p-bg: #F9FEFF;
    --p-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --p-gutter: clamp(20px, 5vw, 64px);
}
html.dark .ws-page,
html.dark .ws-ui {
    --p-ink: #F9FEFF;
    --p-soft: rgba(249, 254, 255, 0.62);
    --p-line: rgba(255, 255, 255, 0.1);
    --p-surface: rgba(255, 255, 255, 0.04);
    --p-bg: #121212;
}

.ws-h2 {
    margin: 0;
    font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.5rem);
    font-weight: 300;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.ws-h2:lang(fa) { letter-spacing: 0; line-height: 1.5; }

.ws-muted { color: var(--p-soft); }
.ws-gap { margin-top: clamp(80px, 10vw, 144px); }

/* Buttons and links */
.ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 26px;
    border: 1px solid var(--p-ink);
    border-radius: 9999px;
    background: var(--p-ink);
    color: var(--p-bg);
    font: inherit;
    font-size: 15px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease, background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.ws-btn:hover { opacity: 0.86; }
.ws-btn:active { transform: translateY(1px); }
.ws-btn:focus-visible { outline: 1px solid var(--p-ink); outline-offset: 3px; }
.ws-btn[disabled] { opacity: 0.5; cursor: progress; }
.ws-btn--ghost { background: transparent; color: var(--p-ink); }
.ws-btn--ghost:hover { opacity: 1; background: var(--p-ink); color: var(--p-bg); }

.ws-link {
    color: var(--p-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.3em;
    text-decoration-color: var(--p-line);
    transition: text-decoration-color 0.3s ease;
}
.ws-link:hover { text-decoration-color: currentColor; }
.ws-link:focus-visible { outline: 1px solid var(--p-ink); outline-offset: 3px; border-radius: 2px; }
.ws-link--icon { display: inline-flex; align-items: center; gap: 6px; }
.ws-link--icon .ws-ico { width: 16px; height: 16px; }

/* Photo frame */
.ws-frame {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: 28px;
    background: #121212;
}
.ws-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Visually hidden text for screen readers (WordPress core class) */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Icons: line set (ws_icon / navIcon) and brand marks */
.ws-ico { display: inline-flex; flex: none; width: 18px; height: 18px; }
.ws-ico svg { width: 100%; height: 100%; display: block; }
[dir="rtl"] .ws-ico--flip svg { transform: scaleX(-1); }
.ws-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Brand clinical badge (icon_clinical_N.svg): charcoal disc, white ring in dark mode (DESIGN 6.12) */
.ws-badge { flex: none; display: block; width: 52px; height: 52px; border-radius: 50%; }
.ws-badge svg { display: block; width: 100%; height: 100%; }
html.dark .ws-badge { box-shadow: 0 0 0 1px rgba(249, 254, 255, 0.45); }

/* Outlined woman mark used as a large watermark (brand book slides 05 and 19) */
.ws-watermark { position: absolute; pointer-events: none; color: var(--p-line); }
.ws-watermark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ws-watermark path { fill: none; stroke: currentColor; stroke-width: 1px; vector-effect: non-scaling-stroke; }

/* Form panel */
.ws-form-panel {
    padding: clamp(28px, 4vw, 56px);
    border-radius: 28px;
    background: var(--p-surface);
}
.ws-form-panel > p { margin: 12px 0 0; max-width: 48ch; color: var(--p-soft); line-height: 1.9; }

.ws-form { display: grid; gap: 22px; margin-top: clamp(28px, 3vw, 40px); }
.ws-form__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.ws-field { display: grid; gap: 8px; }
.ws-field label { font-size: 14px; color: var(--p-soft); }
.ws-field label span { color: var(--p-ink); }
.ws-field input,
.ws-field select,
.ws-field textarea {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border: 1px solid var(--p-line);
    border-radius: 14px;
    background: var(--p-bg);
    color: var(--p-ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.6;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
html.dark .ws-field input,
html.dark .ws-field select,
html.dark .ws-field textarea { background: rgba(255, 255, 255, 0.03); color-scheme: dark; }
.ws-field textarea { min-height: 140px; resize: vertical; }
.ws-field input::placeholder,
.ws-field textarea::placeholder { color: var(--p-soft); opacity: 0.7; }
.ws-field input:focus,
.ws-field select:focus,
.ws-field textarea:focus {
    outline: none;
    border-color: var(--p-ink);
    box-shadow: 0 0 0 3px var(--p-surface);
}
.ws-field [aria-invalid="true"] { border-color: var(--p-ink); border-width: 1.5px; }
.ws-field__error { margin: 0; font-size: 13px; font-weight: 500; color: var(--p-ink); }
.ws-field__error:empty { display: none; }

.ws-form__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    margin-top: 6px;
}
.ws-form__legal { margin: 0; max-width: 40ch; font-size: 13px; line-height: 1.8; color: var(--p-soft); }

/* Feedback written by setupAjaxForm() in main.js */
.ws-form .form-feedback { margin: 0; font-size: 15px; line-height: 1.8; }
.ws-form .form-feedback.hidden { display: none; }
.ws-form .form-feedback.is-success,
.ws-form .form-feedback.is-error {
    display: block;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--p-line);
}
.ws-form .form-feedback.is-error { border-color: var(--p-ink); }

/* Numbers that must read left to right inside Persian text (phones, hours) */
.ws-num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; direction: ltr; }

/* Brand pattern cover (brand book slide 20) for a missing photo: articles, physicians */
.ws-frame--pattern { background: #1E1E1E; }
.ws-frame--pattern::before {
    content: "";
    position: absolute;
    inset: -10%;
    background: rgba(249, 254, 255, 0.3);
    -webkit-mask: url("../vectors/whitesand_pattern_tile.svg") 0 0 / 112px 210px repeat;
    mask: url("../vectors/whitesand_pattern_tile.svg") 0 0 / 112px 210px repeat;
    transition: transform 0.9s var(--p-ease);
}

@media (max-width: 640px) {
    .ws-form__pair { grid-template-columns: minmax(0, 1fr); }
    .ws-form__foot .ws-btn { width: 100%; }
}

/* Footer: call-back request link beside the booking button (consultation, not booking) */
.ws-footer__consult {
    padding: 10px 4px;
    border: 0;
    background: none;
    color: rgba(249, 254, 255, 0.78);
    font: inherit;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 0.3em;
    text-decoration-thickness: 1px;
    cursor: pointer;
    transition: color 0.25s ease;
}
.ws-footer__consult:hover { color: #F9FEFF; }
.ws-footer__consult:focus-visible { outline: 1px solid #F9FEFF; outline-offset: 3px; border-radius: 2px; }

/* ================================================================ 6. Language runs */

/* Text marked with its own language (the language switch, the cover eyebrow, a Persian article on
   the English site) uses that language's face: Persian in Roshan Al, English in Sora. */
[lang="fa"] { font-family: "Roshan Al", Farhang, Vazirmatn, system-ui, sans-serif; }
[lang="en"] { font-family: 'Sora', system-ui, -apple-system, sans-serif; }

/* ================================================================ 7. Reading text */

/* Running paragraphs are justified, their last line kept to the start edge. Persian everywhere, at
   every width: Persian books are set this way, and the spare width goes between words (measured: no
   gap grows by more than about half an em). English only in long-form text, whose lines hold 60 or more
   characters (articles, the privacy policy, the About story), from 640px and with hyphenation: in the
   shorter leads and blurbs a single long word can leave a gap of nearly an em, so they stay ragged.
   Headings, captions, one-line card text and form text stay start-aligned. */
:is(.ws-prose > p, .ws-story__body p, .ws-values p, .ws-page-head__lead, .ws-team__head p, .ws-team-home__head p, .ws-book__lead, .ws-philosophy__pillar p, .ws-protocol__body p, .ws-form-panel > p):lang(fa) {
    text-align: justify;
    text-align-last: start;
}
@media (min-width: 640px) {
    :is(.ws-prose > p, .ws-story__body p):lang(en) {
        text-align: justify;
        text-align-last: start;
        hyphens: auto;
    }
}
