/* =============================================================================
   Tripinvest ES — tekst na stronach listingu /pl/nieruchomosci/{typ}[/{miasto}].
   Treść z panelu (/admin/listing-texts/); markup: includes/listing-text-section.php
   oraz wstęp w nagłówku pl/nieruchomosci.php. Jedzie na tokenach warstwy `ti-*`
   (/assets/home-editorial.css). Przy zmianach podbij ?v= w <link>.
   ============================================================================= */

/* ——— Wstęp (BLUF) w ciemnym nagłówku listingu ——— */
.lt-intro { max-width: 100ch; color: rgba(255, 255, 255, .72); font-size: clamp(1rem, .95rem + .25vw, 1.125rem); line-height: 1.72; overflow-wrap: anywhere; }
.lt-intro p { margin: 0 0 1rem; }
.lt-intro > :last-child { margin-bottom: 0; }
.lt-intro strong { color: #fff; font-weight: 600; }
.lt-intro a { color: var(--ti-gold); text-decoration: none; border-bottom: 1px solid rgba(247, 173, 12, .45); }
.lt-intro a:hover { border-bottom-color: var(--ti-gold); }

/* ——— Sekcja pod kafelkami: spis treści z lewej, tekst z prawej ——— */
.lt-sec { border-top: 1px solid var(--ti-line); }
.lt-layout { display: grid; grid-template-columns: minmax(0, 17.5rem) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 6.5rem); align-items: start; }
.lt-layout--single { grid-template-columns: minmax(0, 1fr); }
.lt-main { max-width: 70ch; min-width: 0; }

.lt-aside { position: sticky; top: 7rem; min-width: 0; }
.lt-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: lt-toc; border-top: 1px solid var(--ti-line); }
.lt-toc li { counter-increment: lt-toc; border-bottom: 1px solid var(--ti-line); }
.lt-toc a {
    display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: baseline;
    padding: .9rem 0; font-size: .875rem; line-height: 1.5; color: var(--ti-ink-2);
    text-decoration: none; transition: color .3s var(--ti-ease);
}
.lt-toc a::before {
    content: counter(lt-toc, decimal-leading-zero);
    font-size: .6875rem; letter-spacing: .12em; color: var(--ti-brass); font-variant-numeric: tabular-nums;
}
.lt-toc a:hover { color: var(--ti-ink); }

/* ——— Treść redakcyjna (ten sam rytm co podstrony miast) ——— */
.lt-prose { color: var(--ti-ink-2); font-size: 1.0625rem; line-height: 1.85; overflow-wrap: anywhere; }
.lt-prose > :first-child { margin-top: 0; }
.lt-prose > :last-child { margin-bottom: 0; }
.lt-prose p { margin: 0 0 1.25rem; }
.lt-prose h2, .lt-h2 {
    font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.05rem); font-weight: 300; line-height: 1.22;
    letter-spacing: -.02em; color: var(--ti-ink);
    margin: clamp(3rem, 5vw, 4.25rem) 0 1.15rem; scroll-margin-top: 7rem;
}
.lt-prose h3 {
    font-size: 1.25rem; font-weight: 500; line-height: 1.3; letter-spacing: -.015em;
    color: var(--ti-ink); margin: 2.25rem 0 .85rem;
}
.lt-prose h4 { font-size: 1.0625rem; font-weight: 600; color: var(--ti-ink); margin: 1.75rem 0 .6rem; }
/* Nagłówek wklejony z Worda bywa cały pogrubiony — grubość ustala arkusz, nie wklejka. */
.lt-prose h2 strong, .lt-prose h3 strong, .lt-prose h4 strong { font-weight: inherit; color: inherit; }
.lt-prose a { color: var(--ti-brass); text-decoration: none; border-bottom: 1px solid rgba(184, 148, 46, .4); }
.lt-prose a:hover { border-bottom-color: var(--ti-brass); }
.lt-prose strong { color: var(--ti-ink); font-weight: 600; }
.lt-prose ul, .lt-prose ol { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.lt-prose li { position: relative; padding-left: 1.35rem; margin-bottom: .55rem; }
.lt-prose li:last-child { margin-bottom: 0; }
.lt-prose ul li::before {
    content: ""; position: absolute; left: 0; top: .78em;
    width: .45rem; height: 1px; background: var(--ti-gold);
}
.lt-prose ol { counter-reset: lt-ol; }
.lt-prose ol li { counter-increment: lt-ol; }
.lt-prose ol li::before {
    content: counter(lt-ol) "."; position: absolute; left: 0; top: 0;
    color: var(--ti-brass); font-size: .8125rem; font-variant-numeric: tabular-nums;
}
.lt-prose blockquote { margin: 1.75rem 0; padding: .15rem 0 .15rem 1.35rem; border-left: 1px solid var(--ti-gold); color: var(--ti-ink); }
.lt-prose figure { margin: 1.75rem 0; overflow-x: auto; }
.lt-prose img { max-width: 100%; height: auto; }
.lt-prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; background: #fff; }
.lt-prose th, .lt-prose td { padding: .75rem 1rem; border: 1px solid var(--ti-line); text-align: left; vertical-align: top; }
.lt-prose th { font-weight: 600; color: var(--ti-ink); }

/* ——— Wiersze z linkami (kilka akapitów-linków pod rząd, patrz listingLinkRows()) ——— */
.lt-prose .lt-links { margin: 0 0 1.25rem; border-top: 1px solid var(--ti-line); }
.lt-prose .lt-links li { padding: 0; margin: 0; border-bottom: 1px solid var(--ti-line); }
.lt-prose .lt-links li::before { content: none; }
.lt-prose .lt-links a {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .9rem 0; border-bottom: 0; color: var(--ti-ink-2);
    font-size: .9375rem; line-height: 1.45; transition: color .3s var(--ti-ease);
}
.lt-prose .lt-links a:hover { color: var(--ti-ink); }
.lt-prose .lt-links span { min-width: 0; }
.lt-prose .lt-links .ti-ico { color: var(--ti-brass); flex-shrink: 0; transition: transform .3s var(--ti-ease); }
.lt-prose .lt-links a:hover .ti-ico { transform: translateX(3px); }

/* ——— FAQ ——— */
.lt-faq { border-top: 1px solid var(--ti-line); }
.lt-faq details { border-bottom: 1px solid var(--ti-line); }
.lt-faq summary {
    cursor: pointer; list-style: none; display: flex; align-items: baseline; justify-content: space-between;
    gap: 1.5rem; padding: 1.35rem 0; font-size: 1.0625rem; font-weight: 500; color: var(--ti-ink); line-height: 1.5;
}
.lt-faq summary::-webkit-details-marker { display: none; }
.lt-faq summary .ti-ico {
    color: var(--ti-brass); flex-shrink: 0; align-self: center;
    transform: rotate(90deg); transition: transform .3s var(--ti-ease);
}
.lt-faq details[open] summary .ti-ico { transform: rotate(-90deg); }
.lt-faq__answer { padding: 0 0 1.6rem; }

.lt-outro { margin-top: clamp(2.5rem, 4vw, 3.5rem); padding-top: clamp(1.75rem, 3vw, 2.25rem); border-top: 1px solid var(--ti-line); }
.lt-faq + .lt-outro { border-top: 0; padding-top: 0; }

@media (max-width: 900px) {
    .lt-layout { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
    .lt-aside { position: static; }
    .lt-main { max-width: none; }
}

/* ——— Telefon: ciaśniejszy skład, a każda sekcja zaczyna się od linii i numeru ze spisu treści ——— */
@media (max-width: 640px) {
    .lt-intro { font-size: .9375rem; line-height: 1.65; }

    .lt-sec { padding: 3.25rem 0 3.5rem; }
    .lt-layout { gap: 2.25rem; }

    .lt-aside .ti-eyebrow { margin-bottom: 1rem; }
    .lt-toc a { grid-template-columns: 1.75rem minmax(0, 1fr); padding: .7rem 0; line-height: 1.4; }

    .lt-prose { font-size: 1rem; line-height: 1.72; }
    .lt-prose p { margin-bottom: 1.05rem; }
    .lt-prose h2, .lt-h2 {
        font-size: 1.4rem; line-height: 1.25;
        margin: 2.5rem 0 .9rem; padding-top: 1.5rem; border-top: 1px solid var(--ti-line);
    }
    .lt-prose h3 { font-size: 1.125rem; margin: 1.75rem 0 .65rem; }

    /* Numer taki sam jak w spisie treści nad tekstem — po stuknięciu w „03" ląduje się przy „03". */
    .lt-layout:not(.lt-layout--single) .lt-main { counter-reset: lt-sec; }
    .lt-layout:not(.lt-layout--single) .lt-main > .lt-prose:first-child > h2,
    .lt-layout:not(.lt-layout--single) .lt-h2 { counter-increment: lt-sec; }
    .lt-layout:not(.lt-layout--single) .lt-main > .lt-prose:first-child > h2::before,
    .lt-layout:not(.lt-layout--single) .lt-h2::before {
        content: counter(lt-sec, decimal-leading-zero); display: block; margin-bottom: .55rem;
        font-size: .6875rem; font-weight: 600; letter-spacing: .12em; line-height: 1;
        color: var(--ti-brass); font-variant-numeric: tabular-nums;
    }
    /* Pierwsza sekcja stoi tuż pod spisem treści — druga linia byłaby zbędna. */
    .lt-main > .lt-prose:first-child > h2:first-child,
    .lt-main > .lt-h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

    .lt-faq { border-top: 0; }
    .lt-faq summary { padding: 1.1rem 0; font-size: 1rem; line-height: 1.45; gap: 1rem; }
    .lt-faq details:first-child summary { padding-top: .35rem; }
    .lt-faq__answer { padding-bottom: 1.3rem; }

    .lt-outro { margin-top: 2.25rem; padding-top: 0; border-top: 0; }
    .lt-prose .lt-links a { padding: .95rem 0; font-size: .875rem; }
}
