/* Textile page only. Font and background come from style.css. */

/* ---------- Top bar: left | centre | right ---------- */
.tx-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    padding: 20px;
}

.tx-nav a { text-decoration: none; color: inherit; letter-spacing: 0.05em; }
.tx-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.tx-logo { justify-self: start; }
.tx-cta  { justify-self: end; }

/* overrides the full-width space-between ul in style.css */
.tx-nav .tx-links {
    width: auto;
    justify-content: center;
    gap: 28px;
}

/* ---------- Hero: label | two photos | label ---------- */
.tx-main { padding: 0 20px 80px; }

.tx-hero {
    display: grid;
    grid-template-columns: 1fr minmax(0, 60%) 1fr;
    align-items: center;
    min-height: calc(100vh - 140px);
    padding-bottom: 60px; /* keeps photos clear of the caption at the bottom */
}

.tx-label {
    margin: 0;
    padding: 0 16px;
    text-align: center;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: 0.05em;
    line-height: 1.5;
}

.tx-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 18px;
}

.tx-images img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: #E8E5E0;
}

/* second photo sits slightly lower, like loose prints */
.tx-images img:nth-child(2) { margin-top: 14px; }

/* ---------- Case study: asymmetrical 12-column grid ---------- */
.tx-study {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 90px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 0 40px;
}

/* text blocks */
.tx-text {
    font-size: 14px;
    letter-spacing: 0.03em;
    line-height: 1.75;
    max-width: 62ch;
}
.tx-text h2,
.tx-text h3 {
    margin: 0 0 14px;
    font-weight: normal;
    letter-spacing: 0.05em;
    line-height: 1.4;
}
.tx-text h2 { font-size: 20px; }
.tx-text h3 { font-size: 16px; }
.tx-text p  { margin: 0 0 1em; }
.tx-text ul { margin: 0; padding-left: 1.2em; }
.tx-text li { margin-bottom: 0.6em; }

/* portfolio pages, shown like loose prints */
.tx-page { margin: 0; }
.tx-page img {
    display: block;
    width: 100%;
    height: auto;
    background: #E8E5E0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.tx-page figcaption {
    margin-top: 10px;
    font-size: 12px;
    letter-spacing: 0.05em;
}

/* placement: each row staggers columns and vertical offset */
.tx-intro     { grid-column: 1 / 6; }
.p-a          { grid-column: 7 / 11; margin-top: 40px; }

.p-b          { grid-column: 2 / 6; }
.tx-research  { grid-column: 8 / 12; align-self: end; }

.p-c          { grid-column: 1 / 5; }
.tx-concepts  { grid-column: 6 / 11; margin-top: 60px; }

.p-d          { grid-column: 2 / 6; }
.p-e          { grid-column: 8 / 12; margin-top: 120px; }

.tx-final     { grid-column: 1 / 6; align-self: end; }
.p-f          { grid-column: 8 / 12; }

.tx-materials { grid-column: 1 / 5; }
.p-g          { grid-column: 6 / 9;  margin-top: 70px; }
.p-h          { grid-column: 10 / 13; }

.tx-making    { grid-column: 1 / 5; }
.p-i          { grid-column: 7 / 11; margin-top: 50px; }

.p-j          { grid-column: 2 / 6; }
.p-k          { grid-column: 8 / 12; margin-top: 90px; }

.tx-testing   { grid-column: 1 / 7; }
.p-l          { grid-column: 8 / 12; }

.tx-outcome   { grid-column: 4 / 10; }

/* ---------- Bottom centre, always visible ---------- */
.tx-caption {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 18px;
    margin: 0;
    text-align: center;
    font-size: 14px;
    letter-spacing: 0.05em;
    pointer-events: none;
}
.tx-caption a { color: inherit; text-decoration: none; pointer-events: auto; }
.tx-caption a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Tablet / phone ---------- */
@media all and (max-width: 900px) {
    .tx-hero {
        grid-template-columns: 1fr;
        row-gap: 20px;
        min-height: 0;
        padding: 24px 0 40px;
    }
    .tx-label { padding: 0; }
    .tx-caption { position: static; padding: 0 0 32px; pointer-events: auto; }

    /* single column; pages keep a slight left/right stagger */
    .tx-study { grid-template-columns: 1fr; row-gap: 48px; padding-top: 24px; }
    .tx-study > * { grid-column: 1 / -1; margin-top: 0; align-self: start; }
    .tx-page:nth-of-type(odd)  { width: 82%; }
    .tx-page:nth-of-type(even) { width: 82%; margin-left: auto; }
}

@media all and (max-width: 600px) {
    .tx-nav { grid-template-columns: 1fr auto; row-gap: 16px; }
    .tx-nav .tx-links { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}

@media all and (max-width: 520px) {
    .tx-images { grid-template-columns: 1fr; }
    .tx-images img:nth-child(2) { margin-top: 0; }
    .tx-page:nth-of-type(odd),
    .tx-page:nth-of-type(even) { width: 100%; }
}