/*
 * Site-wide finish pass (3 Dec 2026), market/language routes only (body.hf-global-portal).
 * Maps the brief's spacing system onto the existing tokens (--hf27-*); no second design system.
 */

/* ---------- 1. Content-to-footer transition: one owner per gap ----------
 * Measured cause (staging, 1440 px): the theme's .cs-site-content margin-bottom (11rem = 176 px at
 * >= 992 px, 6rem/4rem below) stacked on each page's final section margin (72-112 px), giving
 * 248-321 px desktop / 104-145 px mobile gaps. The content wrapper now owns one bottom padding;
 * final sections add no trailing margin; the footer keeps its own 48 px internal top padding. */
.hf-global-portal .cs-site-content {
    margin-bottom: 0;
    padding-bottom: 64px;
}

.hf-global-portal .hf-global > :last-child,
.hf-global-portal .hf-global > :last-child > :last-child,
.hf-global-portal .hf-jr-article > :last-child,
.hf-global-portal :is(.hf-jr-related, .hf-related-guides, .hf27-enquiry, .hf-jr-about__closing, .hf-about__closing):last-child {
    margin-bottom: 0;
}

.hf-global-portal .hf-jr-archive {
    padding-bottom: 0;
}

/* Catalogue/product pages already used 32 + 32 px; keep their total at 64 px. */
.hf-global-portal.hf-global-portal-compact .cs-site-content {
    padding-bottom: 32px;
}

@media (max-width: 767.98px) {
    .hf-global-portal .cs-site-content { padding-bottom: 40px; }
    .hf-global-portal.hf-global-portal-compact .cs-site-content { padding-bottom: 20px; }
}

/* ---------- 2. Shared type and rhythm ---------- */
.hf-global-portal :is(.hf-about, .hf-in-home-section, .hf-solar-pd) p {
    max-width: 68ch;
}

:is(:lang(hi), :lang(zh-Hans), :lang(zh-hans)) :is(h1, h2, h3, .hf27-eyebrow, .cs-button) {
    letter-spacing: normal;
    word-spacing: normal;
}

:lang(hi) {
    font-family: var(--cs-font-base-family, "Plus Jakarta Sans"), "Nirmala UI", "Noto Sans Devanagari", "Mangal", sans-serif;
}

:lang(hi) :is(p, li) {
    line-height: 1.7;
}

/* ---------- 3. About: editorial company story ---------- */
.hf-about {
    display: grid;
    gap: 0;
}

.hf-about__lead {
    max-width: 62rem;
    padding: 8px 0 64px;
}

.hf-about__lead h1 {
    margin: 0 0 20px;
    font-size: clamp(2.125rem, 5vw, 4rem);
    line-height: 1.04;
}

.hf-about__intro {
    margin: 0;
    color: var(--hf27-muted);
    font-size: clamp(1rem, 1.3vw, 1.125rem);
    line-height: 1.6;
}

.hf-about__factory {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    padding: 64px 0;
    border-top: 1px solid var(--hf27-border);
}

.hf-about__factory-media {
    margin: 0;
    overflow: hidden;
    border-radius: var(--hf27-radius);
    background: #181b20;
}

.hf-about__factory-media--light {
    background: #ecebe8;
}

.hf-about__factory-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
}

.hf-about__figure {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 12px;
    color: var(--hf27-accent);
    line-height: 1;
}

.hf-about__number {
    font-size: clamp(4.5rem, 9vw, 7.5rem);
    font-weight: 300;
    letter-spacing: -.04em;
}

.hf-about__unit {
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.hf-about__factory-copy h2,
.hf-about__portfolio h2,
.hf-about__closing h2 {
    margin: 0 0 16px;
    font-size: clamp(1.625rem, 2.8vw, 2.5rem);
    line-height: 1.1;
}

.hf-about__factory-copy p,
.hf-about__portfolio-copy p,
.hf-about__closing p {
    margin: 0;
    color: var(--hf27-muted);
    line-height: 1.6;
}

.hf-about__strengths {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--hf27-border);
    border-bottom: 1px solid var(--hf27-border);
}

.hf-about__strength {
    padding: 32px 32px 36px 0;
}

.hf-about__strength + .hf-about__strength {
    padding-left: 32px;
    border-left: 1px solid var(--hf27-border);
}

.hf-about__strength h3 {
    margin: 0 0 12px;
    font-size: 1.125rem;
    line-height: 1.3;
}

.hf-about__strength p {
    margin: 0;
    color: var(--hf27-muted);
    font-size: .9375rem;
    line-height: 1.6;
}

.hf-about__portfolio {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: start;
    padding: 64px 0;
}

.hf-about__portfolio-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hf-about__portfolio-list a {
    display: grid;
    gap: 10px;
    color: var(--hf27-text);
    font-weight: 600;
    font-size: .9375rem;
    text-decoration: none;
}

.hf-about__portfolio-list a:is(:hover, :focus-visible) span:last-child {
    text-decoration: underline;
    text-decoration-color: var(--hf27-accent);
}

.hf-about__thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--hf27-radius);
    background: #ecebe8;
}

.hf-about__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hf-about__closing {
    padding: 56px 0 0;
    border-top: 1px solid var(--hf27-border);
}

.hf-about__actions,
.hf-solar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    margin-top: 28px;
}

@media (max-width: 991.98px) {
    .hf-about__factory,
    .hf-about__portfolio {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767.98px) {
    .hf-about__br { display: none; }
    .hf-about__lead { padding-bottom: 40px; }
    .hf-about__factory, .hf-about__portfolio { padding: 40px 0; }
    .hf-about__strengths { grid-template-columns: minmax(0, 1fr); }
    .hf-about__strength,
    .hf-about__strength + .hf-about__strength {
        padding: 24px 0;
        border-left: 0;
    }
    .hf-about__strength + .hf-about__strength { border-top: 1px solid var(--hf27-border); }
    .hf-about__portfolio-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hf-about__closing { padding-top: 40px; }
}

/* ---------- 4. India homepage ---------- */
.hf-in-hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    margin-bottom: 40px;
}

.hf-in-hero h1 {
    margin: 0 0 18px;
    font-size: clamp(2.125rem, 4.4vw, 3.75rem);
    line-height: 1.04;
}

.hf-in-hero__body {
    margin: 0 0 28px;
    color: var(--hf27-muted);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.hf-in-hero__media {
    display: block;
    overflow: hidden;
    border-radius: var(--hf27-radius);
}

.hf-in-hero__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1439 / 816;
    object-fit: cover;
}

.hf-in-entrances {
    margin-bottom: 72px;
}

.hf-in-entrances__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hf-in-entry a {
    display: grid;
    gap: 14px;
    color: var(--hf27-text);
    text-decoration: none;
}

.hf-in-entry__media {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--hf27-radius);
    background: #181b20;
}

.hf-in-entry__media--light {
    background: #ecebe8;
}

.hf-in-entry__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .3s ease;
}

.hf-in-entry a:is(:hover, :focus-visible) img {
    transform: scale(1.03);
}

.hf-in-entry__label {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

.hf-in-entry__label::after {
    content: " \2192";
    color: var(--hf27-accent);
}

@media (prefers-reduced-motion: reduce) {
    .hf-in-entry__media img { transition: none; }
    .hf-in-entry a:is(:hover, :focus-visible) img { transform: none; }
}

.hf-in-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 24px;
}

.hf-in-section-head h2,
.hf-in-nashorn h2,
.hf-in-company h2 {
    margin: 0;
    font-size: clamp(1.625rem, 2.8vw, 2.5rem);
    line-height: 1.1;
}

.hf-in-retail,
.hf-in-nashorn,
.hf-in-company,
.hf-in-wood {
    margin-bottom: 72px;
}

.hf-in-retail__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hf-in-retail__item a {
    display: grid;
    gap: 10px;
    color: var(--hf27-text);
    text-decoration: none;
}

.hf-in-retail__media {
    display: block;
    overflow: hidden;
    border-radius: var(--hf27-radius);
    background: #ecebe8;
}

.hf-in-retail__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}

.hf-in-retail__name {
    font-weight: 600;
    line-height: 1.35;
}

.hf-in-retail__price {
    color: var(--hf27-muted);
}

.hf-in-nashorn {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    padding: 40px;
    border: 1px solid var(--hf27-border);
    border-radius: var(--hf27-radius);
    background: #181b20;
}

.hf-in-nashorn__copy p:not(.hf27-eyebrow) {
    margin: 16px 0 0;
    color: var(--hf27-muted);
    line-height: 1.6;
}

.hf-in-nashorn__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hf-in-nashorn__links a {
    display: grid;
    gap: 12px;
    justify-items: start;
    text-decoration: none;
}

.hf-in-nashorn__links img {
    width: 100%;
    height: auto;
    max-width: 260px;
    border-radius: var(--hf27-radius);
}

.hf-in-company {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
    padding: 48px 0;
    border-top: 1px solid var(--hf27-border);
    border-bottom: 1px solid var(--hf27-border);
}

.hf-in-company__figure {
    margin: 0;
    color: var(--hf27-accent);
    white-space: nowrap;
}

.hf-in-company p:not(.hf-in-company__figure) {
    margin: 14px 0 18px;
    color: var(--hf27-muted);
    line-height: 1.6;
}

@media (max-width: 991.98px) {
    .hf-in-hero { grid-template-columns: minmax(0, 1fr); }
    .hf-in-hero__media { order: -1; }
    .hf-in-retail__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hf-in-nashorn { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767.98px) {
    .hf-in-hero__media img { aspect-ratio: 1; }
    .hf-in-entrances { margin-bottom: 44px; }
    .hf-in-entrances__list { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .hf-in-retail, .hf-in-nashorn, .hf-in-company, .hf-in-wood { margin-bottom: 44px; }
    .hf-in-nashorn { padding: 24px 20px; }
    .hf-in-company { grid-template-columns: minmax(0, 1fr); padding: 32px 0; }
}

/* ---------- 5. Solar feature (homepage) ----------
 * Desktop: the supplied 2:1 graphite composition with live copy in its quiet left area; the feature
 * grows with its content (no fixed height). Below 992 px: the transparent cutout above stacked copy. */
.hf-solar-feature {
    position: relative;
    display: grid;
    margin-bottom: 72px;
    overflow: hidden;
    border-radius: var(--hf27-radius);
    background: #101214;
}

.hf-solar-feature__media img {
    display: block;
    width: 100%;
    height: auto;
}

.hf-solar-feature__copy {
    padding: 28px 20px 32px;
}

.hf-solar-feature h2 {
    margin: 0 0 16px;
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    line-height: 1.08;
}

.hf-solar-feature__copy > p:not(.hf27-eyebrow):not(.hf-solar-compliance) {
    margin: 0;
    color: var(--hf27-muted);
    line-height: 1.6;
}

@media (min-width: 992px) {
    .hf-solar-feature {
        grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
        min-height: clamp(460px, 50vw, 620px);
    }
    .hf-solar-feature__media {
        position: absolute;
        inset: 0;
    }
    .hf-solar-feature__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: right center;
    }
    .hf-solar-feature__copy {
        position: relative;
        grid-column: 1;
        align-self: center;
        padding: 48px 0 48px clamp(32px, 4vw, 56px);
    }
}

.hf-solar-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin: 28px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--hf27-border);
    list-style: none;
}

.hf-solar-specs li {
    display: grid;
    gap: 4px;
    min-width: 6.5rem;
}

.hf-solar-specs__value {
    color: var(--hf27-text);
    font-size: clamp(1.75rem, 2.6vw, 2.25rem);
    font-weight: 600;
    line-height: 1;
}

.hf-solar-specs__unit {
    font-size: .55em;
    font-weight: 600;
}

.hf-solar-specs__label {
    color: var(--hf27-muted);
    font-size: .875rem;
}

.hf-solar-compliance {
    margin: 18px 0 0;
    color: var(--hf27-muted);
    font-size: .875rem;
}

/* ---------- 6. Solar product page ---------- */
.hf-solar-pd__top {
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    margin-bottom: 64px;
}

.hf-solar-pd__gallery {
    margin: 0;
    overflow: hidden;
    border-radius: var(--hf27-radius);
    background: #ecebe8;
}

.hf-solar-pd__gallery img {
    display: block;
    width: 100%;
    height: auto;
}

.hf-solar-pd__title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 3.6vw, 3rem);
    line-height: 1.06;
}

.hf-solar-pd__subtitle {
    margin: 0 0 16px;
    color: var(--hf27-text);
    font-weight: 600;
}

.hf-solar-pd__short {
    margin: 0;
    color: var(--hf27-muted);
    line-height: 1.6;
}

.hf-solar-pd__overview,
.hf-solar-pd__specs {
    max-width: 62rem;
    padding: 48px 0;
    border-top: 1px solid var(--hf27-border);
}

.hf-solar-pd__overview h2,
.hf-solar-pd__specs h2,
.hf-solar-enquiry h2 {
    margin: 0 0 16px;
    font-size: clamp(1.5rem, 2.4vw, 2.125rem);
    line-height: 1.12;
}

.hf-solar-pd__overview p,
.hf-solar-enquiry__intro p {
    margin: 0;
    color: var(--hf27-muted);
    line-height: 1.6;
}

.hf-solar-table {
    width: 100%;
    max-width: 40rem;
    border-collapse: collapse;
}

.hf-solar-table :is(th, td) {
    padding: 12px 0;
    border-bottom: 1px solid var(--hf27-border);
    text-align: left;
    vertical-align: top;
}

.hf-solar-table th {
    width: 55%;
    color: var(--hf27-muted);
    font-weight: 500;
}

.hf-solar-enquiry {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: clamp(28px, 5vw, 64px);
    padding: 48px 0 0;
    border-top: 1px solid var(--hf27-border);
    scroll-margin-top: 120px;
}

.hf-solar-pd__specs {
    scroll-margin-top: 120px;
}

.hf-solar-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.hf-solar-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    font-size: .875rem;
}

.hf-solar-form__wide {
    grid-column: 1 / -1;
}

.hf-solar-form__hint {
    margin: -6px 0 0;
    color: var(--hf27-muted);
    font-size: .8125rem;
}

.hf-optional {
    color: var(--hf27-muted);
    font-weight: 400;
}

.hf-solar-enquiry__status {
    align-self: start;
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--hf27-border);
    border-left: 3px solid var(--hf27-accent);
    border-radius: var(--hf27-radius);
    background: #181b20;
}

.hf-solar-enquiry__status--error {
    grid-column: 2;
    border-left-color: #e07a6a;
}

.hf-solar-enquiry__ref {
    display: block;
    margin-top: 6px;
    color: var(--hf27-muted);
    font-size: .8125rem;
}

@media (max-width: 991.98px) {
    .hf-solar-pd__top,
    .hf-solar-enquiry {
        grid-template-columns: minmax(0, 1fr);
    }
    .hf-solar-enquiry__status--error { grid-column: auto; }
}

@media (max-width: 767.98px) {
    .hf-solar-feature { margin-bottom: 44px; }
    .hf-solar-pd__top { margin-bottom: 40px; }
    .hf-solar-pd__overview, .hf-solar-pd__specs { padding: 36px 0; }
    .hf-solar-enquiry { padding-top: 36px; }
    .hf-solar-form { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 7. Footer legal row ---------- */
.hf-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hf-footer__legal a {
    color: var(--hf27-muted);
    font-size: .8125rem;
}

.hf-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
}

/* ---------- 8. Word spacing: the theme's negative heading tracking collapses spaces at small sizes ---------- */
.hf-global-portal :is(.hf-about, .hf-solar-pd, .hf-solar-feature, .hf-solar-enquiry, .hf-in-hero, .hf-in-entrances, .hf-in-retail, .hf-in-nashorn, .hf-in-company, .hf-in-wood) :is(h1, h2) {
    word-spacing: normal;
}

.hf-global-portal :is(.hf-about, .hf-solar-pd, .hf-solar-feature, .hf-solar-enquiry, .hf-in-entrances, .hf-in-retail, .hf-in-nashorn) :is(h3, th, td, label, .hf-solar-specs__label, .hf-in-entry__label, .hf-in-retail__name, .hf-about__portfolio-list a) {
    letter-spacing: 0;
    word-spacing: normal;
}

.hf-global-portal .hf-solar-table,
.hf-global-portal .hf-solar-table :is(th, td) {
    border: 0;
}

.hf-global-portal .hf-solar-table :is(th, td) {
    border-bottom: 1px solid var(--hf27-border);
}

/* ---------- 9. Footer internal top padding: 48 px desktop (unchanged), 32 px on phones ---------- */
@media (max-width: 767.98px) {
    .hf-global-portal .hf-footer {
        padding-top: 32px;
    }
}

/* ---------- 10. Devanagari headings need more leading than the Latin display setting ---------- */
.hf-global-portal :lang(hi) :is(h1, h2, h3),
.hf-global-portal :is(h1, h2, h3):lang(hi) {
    line-height: 1.25;
}
