/* Long-text pages (EN + IT): the returns policy now, the legal pages of Phase 6 later (privacy, cookies, terms, delivery
   rules). One shared frame (partials text-open and text-close): headings, paragraphs, lists, tables that scroll inside
   their own box, a notice box and the optional "last reviewed" line. Reads the tokens of css/style.css :root (D-04).
   The custom Bootstrap build has no table classes, so .table-responsive is defined here. */

.text-page { max-width: 72ch; overflow-wrap: break-word; }

/* Headings: the page header holds the h1; h2 is a section (green underline that hugs the words), h3 a sub-section */
.text-page h2,
.text-page h3 {
    color: var(--dark);
    width: fit-content;
    max-width: 100%;
    margin-top: var(--space-7);
    margin-bottom: var(--space-4);
}
.text-page h2 {
    font-size: var(--fs-h3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--primary);
}
.text-page h3 {
    font-size: clamp(1.125rem, 1.05rem + .4vw, 1.25rem);
    margin-top: var(--space-6);
}
.text-page > :first-child { margin-top: 0; }

/* Body text */
.text-page p,
.text-page li { line-height: 1.75; }
.text-page p { margin-bottom: var(--space-4); }
.text-page ul,
.text-page ol { margin-bottom: var(--space-5); padding-left: 1.5rem; }
.text-page li { margin-bottom: var(--space-2); }
.text-page li > ul,
.text-page li > ol { margin-top: var(--space-2); margin-bottom: 0; }
.text-page a { overflow-wrap: anywhere; }

.text-page-lead {
    font-size: var(--fs-lead);
    font-weight: 600;
    color: var(--dark);
    margin-bottom: var(--space-5);
}

/* Table: the box scrolls sideways on a phone, the page never does; the first row is the light header row */
.text-page .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-5) 0;
    border: var(--card-border);
    border-radius: var(--radius-lg);
    background: #fff;
}
.text-page .table-responsive:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.text-page table {
    width: 100%;
    min-width: 34rem;
    margin: 0;
    border-collapse: collapse;
    font-size: var(--fs-small);
}
.text-page th,
.text-page td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid rgba(15, 66, 41, .1);
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
    overflow-wrap: break-word;
}
.text-page thead th,
.text-page tr:first-child th {
    background: var(--light);
    color: var(--dark);
    font-weight: 600;
}
.text-page tr:last-child th,
.text-page tr:last-child td { border-bottom: 0; }

/* Notice box: the card recipe with a green edge */
.text-page-note {
    background: #fff;
    border: var(--card-border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-6) 0 0;
    font-size: .95rem;
}
.text-page-note > :last-child { margin-bottom: 0; }

/* "Last reviewed" line: printed only when the page route has a review date */
.text-page-reviewed {
    margin: var(--space-6) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid rgba(15, 66, 41, .12);
    font-size: var(--fs-small);
    color: var(--secondary);
}
