/* ==========================================================================
   Totally Locally – Who We Are
   Front-end styles. Deliberately theme-agnostic and lightly opinionated so
   it sits comfortably on the existing site; override freely in your theme.
   ========================================================================== */

.tlw-notice { padding: 1rem 1.25rem; border-radius: 8px; margin: 0 0 1.5rem; }
.tlw-notice--ok  { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.tlw-notice--err { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6cb; }

/* ---- Form -------------------------------------------------------------- */
.tlw-form { max-width: 720px; }
/* Sections are separated by a divider line, not a box, so every field
   (including the name/business questions above) shares the same full width. */
.tlw-form .tlw-group {
    border: 0;
    min-inline-size: 0; /* stop fieldset imposing a min width */
    width: 100%;
    padding: 1.75rem 0 0;
    margin: 1.75rem 0 0;
    border-top: 1px solid #e2e2e2;
}
.tlw-form legend {
    font-weight: 700;
    padding: 0;
    margin: 0 0 1.1rem;
    font-size: 1.5rem;
    line-height: 1.2;
}
.tlw-field { margin: 0 0 1.1rem; }
.tlw-field label { display: block; font-weight: 400; font-size: 1.05rem; margin: 0 0 .35rem; }
.tlw-field input[type="text"],
.tlw-field input[type="url"],
.tlw-field input[type="email"],
.tlw-field input[type="file"],
.tlw-field textarea {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    box-sizing: border-box;
}
.tlw-field textarea { resize: vertical; }
.tlw-req { color: #c62828; }
.tlw-help { font-size: .85rem; color: #666; margin: .35rem 0 0; }
.tlw-submit {
    background: #3E4E68;
    color: #fff;
    border: 0;
    padding: .85rem 1.6rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.tlw-submit:hover { background: #2C3A4F; }

/* Honeypot – visually hidden but present for bots. */
.tlw-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px; overflow: hidden;
}
/* Fallback text field only matters when the JS autocomplete finds nothing;
   keep it subtle. */
.tlw-bizfield-fallback { margin-top: .5rem; }

/* ---- Business autocomplete -------------------------------------------- */
.tlw-bizfield { position: relative; }
.tlw-bizfield-results {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    position: absolute;
    z-index: 40;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    max-height: 260px;
    overflow-y: auto;
}
.tlw-bizfield-result {
    padding: .55rem .75rem;
    cursor: pointer;
}
.tlw-bizfield-result:hover { background: #f2f7f4; }

/* ---- Archive grid ------------------------------------------------------ */
.tlw-archive { max-width: 1160px; margin: 0 auto; padding: 1rem; }
.tlw-archive-header { text-align: center; margin: 0 0 2rem; }
.tlw-archive-title { color: #3E4E68; }
.tlw-archive-intro { color: #555; max-width: 40rem; margin: .5rem auto 0; }

.tlw-grid {
    display: grid;
    gap: 1.5rem 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.tlw-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.tlw-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 780px) { .tlw-grid--cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tlw-grid--cols-3 { grid-template-columns: 1fr; } }
.tlw-grid--cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tlw-grid--cols-5 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tlw-grid--cols-6 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.tlw-card { display: block; text-decoration: none; color: inherit; }
.tlw-card:hover .tlw-card-name { text-decoration: underline; }
.tlw-card-img {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 10px;
    background: #f0efec;
}
.tlw-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.tlw-card:hover .tlw-card-img img { transform: scale(1.04); }
.tlw-card-placeholder,
.tlw-person-card-placeholder {
    display: block; width: 100%; height: 100%;
    background: linear-gradient(135deg, #e9e7e2, #d9d6cf);
}
.tlw-card .tlw-card-name {
    display: block;
    font-weight: 700;
    margin: .7rem 0 0;
    line-height: 1.25;
    color: #3E4E68;
}
.tlw-card-business { display: block; color: #3E4E68; font-size: .92rem; margin: .1rem 0 0; }
.tlw-empty { text-align: center; color: #777; padding: 2rem 0; }

/* ---- Single person ----------------------------------------------------- */
/* Content width for the contained sections (questions + business card). */
:root { --tlw-measure: 900px; }
.tlw-single { max-width: none; margin: 0; padding: 0; }

/* Full-width hero: square image left, name + facts + quick-fire right */
.tlw-single-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    min-height: 480px;
}
.tlw-single-hero-img { line-height: 0; overflow: hidden; }
.tlw-single-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 1 / 1;
}
.tlw-single-hero-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.75rem, 4vw, 3.5rem);
}
/* Contain and centre the hero text */
.tlw-single-hero-inner { max-width: 700px; margin: 0 auto; width: 100%; }
.tlw-single-name {
    margin: 0;
    line-height: 1.05;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    color: #3E4E68;
}
/* Plain piped meta line, aligned to the text, with space beneath */
.tlw-single-facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 .7rem;
    margin: .9rem 0 0;
    padding: 0;
    color: #555;
    font-size: 1rem;
}
.tlw-single-facts li + li::before { content: "|"; margin-right: .7rem; color: #bbb; }
.tlw-single-facts a { color: #3E4E68; text-decoration: none; font-weight: 600; }
.tlw-single-facts a:hover { text-decoration: underline; }
/* Space between the trading line and the business/first question.
   Scoped to .tlw-single-hero-inner so a later `.tlw-answers { margin: 0 }`
   can't flatten this margin. */
.tlw-single-hero-inner .tlw-hero-block { margin-top: 3rem; }

/* Contained body */
.tlw-single-main { max-width: var(--tlw-measure); margin: 0 auto; padding: 4.5rem 1.25rem 1rem; }
.tlw-single-bio {
    margin: 0 0 2.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #2b2b2b;
}

/* Answers */
.tlw-answer-group { margin: 0 0 2.75rem; }
.tlw-answer-group:last-child { margin-bottom: 0; }
.tlw-answer-group-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3E4E68;
    margin: 0 0 1.5rem;
    padding: 0 0 .5rem;
    border-bottom: 1px solid #dfe2e8;
}
.tlw-answers { margin: 0; }
.tlw-answer { margin: 0 0 1.6rem; }
.tlw-answer:last-child { margin-bottom: 0; }
.tlw-answer-q {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a1a1a;
    margin: 0 0 .35rem;
}
.tlw-answer-a { margin: 0; color: #333; line-height: 1.7; font-size: 1.1rem; }
/* Links inside answers match the surrounding answer text exactly */
.tlw-answer-a a { color: inherit; font-weight: inherit; text-decoration: none; }
.tlw-answer-a a:hover { text-decoration: underline; }

/* Contact links row */
.tlw-links-row {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin: 0;
    padding: 0;
}
.tlw-links-row a {
    display: inline-block;
    border: 1px solid #3E4E68;
    color: #3E4E68;
    text-decoration: none;
    padding: .5rem 1.1rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 600;
    transition: background .2s ease, color .2s ease;
}
.tlw-links-row a:hover { background: #3E4E68; color: #fff; }

/* ---- Cross-link blocks (both directions) ------------------------------ */
.tlw-crosslink {
    max-width: var(--tlw-measure);
    margin: 3rem auto 3.5rem;
    padding: 2.5rem 1.25rem 0;
    border-top: 1px solid #e2e2e2;
}
.tlw-crosslink-title { font-size: 1.5rem; font-weight: 700; color: #3E4E68; margin: 0 0 1.25rem; }

/* Contained half-image business card on a person page — white card */
.tlw-bizcard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: box-shadow .25s ease;
}
.tlw-bizcard:hover { box-shadow: 0 10px 26px rgba(0,0,0,.12); }
.tlw-bizcard-img { line-height: 0; }
.tlw-bizcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4 / 3; }
.tlw-bizcard-placeholder { display: block; width: 100%; height: 100%; min-height: 200px; background: linear-gradient(135deg, #e9e7e2, #d9d6cf); }
.tlw-bizcard-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.75rem;
}
.tlw-bizcard-name { display: block; font-weight: 700; font-size: 1.4rem; color: #1a1a1a; line-height: 1.2; }
.tlw-bizcard-desc { display: block; color: #555; margin: .6rem 0 1rem; line-height: 1.55; }
.tlw-bizcard-cta { color: #3E4E68; font-weight: 700; }

/* People on a business page — sideways white cards (image left, info right) */
.tlw-people-strip { display: flex; flex-direction: column; gap: 1.25rem; }
.tlw-personrow {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: box-shadow .25s ease;
}
.tlw-personrow:hover { box-shadow: 0 10px 26px rgba(0,0,0,.12); }
.tlw-personrow-img { line-height: 0; }
.tlw-personrow-img img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 1 / 1; }
.tlw-personrow-placeholder { display: block; width: 100%; height: 100%; min-height: 180px; background: linear-gradient(135deg, #e9e7e2, #d9d6cf); }
.tlw-personrow-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 1.75rem;
}
.tlw-personrow-name { display: block; font-weight: 700; font-size: 1.4rem; color: #3E4E68; line-height: 1.2; }
.tlw-personrow-meta { display: block; color: #555; margin: .5rem 0 .9rem; line-height: 1.5; }
.tlw-personrow-cta { color: #3E4E68; font-weight: 700; }

@media (max-width: 520px) {
    .tlw-personrow { grid-template-columns: 1fr; }
    .tlw-personrow-img img { aspect-ratio: 16 / 9; }
}

@media (max-width: 720px) {
    /* Stack the hero: square image on top, text below */
    .tlw-single-hero { grid-template-columns: 1fr; min-height: 0; }
    .tlw-single-hero-body { padding: 1.75rem 1.25rem; }
    /* Stack the business card: image on top, body below */
    .tlw-bizcard { grid-template-columns: 1fr; }
    .tlw-bizcard-img img { aspect-ratio: 16 / 9; }
}
