/* ── Tokens ───────────────────────────────────────────────────────────── */
:root {
    --bg:           #2D395A;
    --bg-card:      #253050;
    --bg-field-alt: #263354;
    --off-white:    #F6F5EE;
    --light-brown:  #DDD6C4;
    --mid-brown:    #A09279;
    --orange:       #F1582C;
    --divider:      rgba(160, 146, 121, 0.25);
    --font-heading: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    --font-body:    Georgia, 'Times New Roman', Times, serif;
}

/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--light-brown);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────────────────── */
#app {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

/* ── Artefact card ────────────────────────────────────────────────────── */
.artefact-card {
    display: flex;
    flex-direction: column;
}

/* ── Title + room ─────────────────────────────────────────────────────── */
.artefact-title {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--off-white);
    padding: 1.4rem 1.2rem 0.3rem;
    line-height: 1.25;
}

.artefact-room {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 1.2rem 1.1rem;
}

/* ── Image ────────────────────────────────────────────────────────────── */
.artefact-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

@media (min-width: 768px) {
    .artefact-image {
        max-width: 640px;
    }
}

/* ── Short description ────────────────────────────────────────────────── */
.artefact-description {
    padding: 1rem 1.2rem;
    color: var(--light-brown);
    font-size: 1.05rem;
    border-bottom: 1px solid var(--divider);
}

/* ── Video ────────────────────────────────────────────────────────────── */
.artefact-video {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--divider);
}

.video-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mid-brown);
    margin-bottom: 0.5rem;
}

.artefact-video video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

@media (min-width: 768px) {
    .artefact-video video {
        max-width: 640px;
    }
}

/* ── Fields section ───────────────────────────────────────────────────── */
.artefact-fields {
    display: flex;
    flex-direction: column;
}

/* ── text and link rows ───────────────────────────────────────────────── */
.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.2rem;
    border-bottom: 1px solid var(--divider);
}

.field-row:nth-child(even) {
    background-color: var(--bg-field-alt);
}

.field-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--mid-brown);
    flex-shrink: 0;
}

.field-value {
    color: var(--off-white);
    text-align: right;
    font-size: 1rem;
}

.field-link {
    color: var(--orange);
    text-align: right;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(241, 88, 44, 0.4);
}

.field-link:hover {
    border-bottom-color: var(--orange);
}

/* ── longtext ─────────────────────────────────────────────────────────── */
.field-longtext {
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--divider);
    border-left: 2px solid var(--mid-brown);
}

.field-longtext .field-label {
    margin-bottom: 0;
}

.field-longtext .field-value {
    color: var(--light-brown);
    text-align: left;
    font-size: 1rem;
    line-height: 1.65;
}

/* ── list ─────────────────────────────────────────────────────────────── */
.field-list {
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--divider);
}

.field-list .field-label {
    margin-bottom: 0;
}

.field-list ul {
    list-style: none;
    padding: 0;
}

.field-list li {
    color: var(--off-white);
    padding: 0.2rem 0 0.2rem 1rem;
    font-size: 1rem;
    position: relative;
}

.field-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--orange);
}

/* ── highlight (fun fact) ─────────────────────────────────────────────── */
.field-highlight {
    margin: 1rem 1.2rem;
    padding: 0.9rem 1rem 0.9rem 1.2rem;
    background-color: var(--bg-card);
    border-left: 3px solid var(--orange);
    border-radius: 0 4px 4px 0;
}

.field-highlight .field-label {
    margin-bottom: 0;
    color: var(--orange);
}

.field-highlight .field-value {
    color: var(--light-brown);
    text-align: left;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.65;
}

/* ── Welcome & error states ───────────────────────────────────────────── */
.welcome-message,
.error-message {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--mid-brown);
    font-family: var(--font-heading);
    font-size: 1rem;
}

.error-message {
    color: var(--orange);
}

/* ── Utility ──────────────────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── TTS buttons ──────────────────────────────────────────────────────── */

/* .field-label-col: wraps the label and TTS button as a vertical stack for
   text, link, and default field rows. The button sits beneath the label on
   the left; the value/link floats to the right via the parent flex row. */
.field-label-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    flex-shrink: 0;
}

/* .field-label-row: wraps the label and TTS button on the same horizontal
   line for longtext, list, and highlight fields. space-between pushes the
   button to the trailing (right) end; content below flows at full width. */
.field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.35rem;
}

.tts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    /* Size and shape */
    width: 2rem;
    height: 2rem;
    border-radius: 50%;

    /* Colours — existing tokens only */
    background-color: var(--orange);
    color: var(--off-white);

    /* Strip default browser button chrome */
    border: none;
    cursor: pointer;

    /* Icon glyph size */
    font-size: 0.75rem;
    font-family: var(--font-body);
    line-height: 1;
}

.tts-btn:focus {
    outline: 2px solid var(--off-white);
}

/* Active / speaking state */
.tts-btn--active {
    opacity: 0.75;
    outline: 2px solid var(--off-white);
}