/* ==========================================================================
   Heritage Minerals: Lordship and the legal pages (the ceremony pages).

   Lordship  Gold, as regalia. The page keeps its heraldic night palette
             (ink, parchment, antique gold, claret seal); the minerals add
             gilding to the italic lines, the seam under the title, a gold
             bar with a diamond glint for "Break the seal", an assay
             hallmark in the hero, and a gilt edge on the address card.
             No new claims: only what the page already states.
   Legal     Platinum, the metal of permanence (as Legal elsewhere on the
             site). Each policy reads as an assayed certificate: a
             platinum rule down the clauses with an ingot stamped at each,
             a quartz chip for the dates (quartz keeps time), platinum
             contact boxes and a platinum hallmark.

   Layers on lordship.css / pages.css and minerals.css. Linked on
   lordship.html, legal.html, privacy-policy.html and cookies.html by
   scripts/update_minerals.py, which also writes the hallmarks.
   ========================================================================== */

/* ==========================================================================
   LORDSHIP
   ========================================================================== */

/* Italic lines in the headings are gilded */
.ld-h2 em {
    background-image: linear-gradient(115deg, #C8963F 0%, #F7E3B0 22%, #D9B26A 42%, #FFF3D1 55%, #B98A3A 72%, #F1D6A0 100%);
    background-size: 220% 100%; background-position: var(--mn-sheen) 50%;
    -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
    animation: mn-sheen 11s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
    padding-right: 0.08em;
}

/* The rule under "of Hougun Manor" becomes the seam: gold at its heart */
.ld-hero__rule {
    width: 180px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, #B7A9D6 14%, #D9B26A 32% 68%, #C3C8CE 78%, #2FB57F 88%, transparent);
    box-shadow: 0 0 12px rgba(217, 178, 106, 0.45);
}
/* Eyebrow lines: a short seam */
.ld-eyebrow::before { height: 2px; border-radius: 2px; background: linear-gradient(90deg, #B7A9D6, #D9B26A 30% 70%, #2FB57F); }

/* "Break the seal": a gold bar with a diamond glint crossing it */
.ld-btn:not(.ld-btn--ghost) {
    position: relative; isolation: isolate; overflow: hidden;
    background: linear-gradient(115deg, #B98A3A 0%, #F1D6A0 28%, #D9B26A 52%, #F7E3B0 76%, #C8963F 100%);
}
.ld-btn:not(.ld-btn--ghost)::after {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 60%; z-index: -1; pointer-events: none;
    background: linear-gradient(105deg, transparent 15%, rgba(255, 231, 243, 0.35) 45%, rgba(255, 255, 255, 0.8) 50%, rgba(168, 233, 255, 0.35) 55%, transparent 80%);
    transform: skewX(-18deg) translateX(-170%);
}
.ld-btn:not(.ld-btn--ghost):hover::after, .ld-btn:not(.ld-btn--ghost):focus-visible::after { transform: skewX(-18deg) translateX(330%); transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1); }
.ld-btn--ghost:hover { border-color: transparent; background: linear-gradient(var(--ld-ink), var(--ld-ink)) padding-box, var(--mn-lustre-gold) border-box; }

/* Hero facts: each preceded by a gold grain */
.ld-hero__facts li { display: inline-flex; align-items: center; gap: 0.45rem; }
.ld-hero__facts li::before {
    content: ""; width: 7px; height: 7px; flex: none; background: var(--mn-lustre-gold);
    border-radius: 46% 54% 42% 58% / 55% 45% 55% 45%; box-shadow: 0 0 6px rgba(217, 178, 106, 0.6);
}

/* Assay hallmark in the hero's lower right (wide screens) */
.mn-hallmark--regalia {
    position: absolute; z-index: 1; right: max(2rem, calc((100% - 1180px) / 2 + 1rem)); bottom: 3.5rem;
    width: clamp(110px, 9vw, 140px); --hm-rim-stroke: rgba(217, 178, 106, 0.65); --hm-text: #F1D6A0;
    animation: mn-hm-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both;
}
@media (max-width: 1099px) { .mn-hallmark--regalia { display: none; } }

/* The address card: a gilt edge inside the parchment */
.ld-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1.5px;
    background: linear-gradient(135deg, #F7E3B0, #B98A3A 30%, #F1D6A0 55%, #8A6420 80%, #F7E3B0);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* ==========================================================================
   LEGAL: the assayed certificate
   ========================================================================== */
.mn-gild--platinum-ink { --mn-text-lustre: var(--mn-ink-platinum); }
[data-theme="dark"] .mn-gild--platinum-ink { --mn-text-lustre: var(--mn-glow-platinum); }

.page-header:has(.mn-hallmark--legal) { position: relative; overflow: clip; }
.mn-hallmark--legal {
    position: absolute; z-index: 1; top: 50%; translate: 0 -40%; right: max(2rem, calc((100% - 1280px) / 2 + 3rem));
    width: clamp(112px, 10vw, 150px); --hm-rim-stroke: rgba(195, 200, 206, 0.7); --hm-dash: rgba(229, 228, 226, 0.35); --hm-text: #E5E4E2;
    animation: mn-hm-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}
@media (max-width: 1099px) { .mn-hallmark--legal { display: none; } }

/* Dates are kept by quartz */
.legal-effective {
    display: inline-flex; align-items: flex-start; gap: 0.6rem; padding: 0.55rem 0.95rem; border-radius: 12px; line-height: 1.6;
    color: var(--mn-quartz-ink); background: linear-gradient(115deg, rgba(255, 255, 255, 0.75), rgba(237, 232, 245, 0.6));
    box-shadow: inset 0 0 0 1px rgba(167, 155, 191, 0.45);
}
.legal-effective::before {
    content: ""; width: 0.55em; height: 0.9em; margin-top: 0.3em; flex: none; background: var(--mn-lustre-quartz);
    clip-path: polygon(50% 0, 100% 30%, 100% 100%, 0 100%, 0 30%); box-shadow: inset 0 0 0 1px rgba(94, 83, 121, 0.5);
}
[data-theme="dark"] .legal-effective { color: #CFC6E0; background: rgba(167, 155, 191, 0.12); box-shadow: inset 0 0 0 1px rgba(167, 155, 191, 0.3); }

/* A platinum rule down the clauses, an ingot stamped at each */
.legal-body { position: relative; padding-left: clamp(1.4rem, 3vw, 2.2rem); }
.legal-body::before {
    content: ""; position: absolute; left: 0; top: 0.5rem; bottom: 0.5rem; width: 2px; border-radius: 2px;
    background: linear-gradient(180deg, transparent, #B9BEC4 4%, #FFFFFF 20%, #8D9298 45%, #E5E4E2 70%, #9AA0A7 92%, transparent);
}
.legal-section h2 { position: relative; }
.legal-section h2::before {
    content: ""; position: absolute; top: 0.38em; left: calc(-1 * clamp(1.4rem, 3vw, 2.2rem) - 6px); width: 14px; height: 9px;
    background: var(--mn-lustre-platinum); clip-path: polygon(16% 0, 84% 0, 100% 100%, 0 100%);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}
.legal-body a { text-decoration-color: color-mix(in srgb, #8D9298 80%, transparent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.legal-body a:hover { text-decoration-color: var(--mn-gold); }
.legal-body li::marker { color: #8D9298; }

/* Contact boxes: a brushed-platinum edge */
.legal-contact-box {
    border: 1px solid transparent;
    background: linear-gradient(var(--color-background-alt), var(--color-background-alt)) padding-box, var(--mn-lustre-platinum) border-box;
}

/* ==========================================================================
   Motion, forced colours, print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .ld-h2 em, .mn-hallmark--regalia, .mn-hallmark--legal { animation: none !important; }
    .ld-btn:not(.ld-btn--ghost):hover::after { transition: none; }
}
@media (forced-colors: active) {
    .ld-h2 em { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
    .mn-hallmark--regalia, .mn-hallmark--legal, .legal-section h2::before, .legal-body::before, .ld-card::after { display: none; }
}
@media print {
    .mn-hallmark--regalia, .mn-hallmark--legal, .legal-body::before, .legal-section h2::before { display: none !important; }
    .legal-body { padding-left: 0; }
    .ld-h2 em { background: none; color: #000; -webkit-text-fill-color: #000; }
}
