/* The woodwork shop and its workshop admin. Shares the site palette from style.css. */

.shop-main {
    display: block;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- catalogue ---------- */

.shop-hero {
    padding: clamp(40px, 7vw, 86px) clamp(24px, 6vw, 78px) clamp(24px, 4vw, 46px);
    border-bottom: 1px solid var(--line);
}

.shop-hero h1 {
    margin: 6px 0 18px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.08;
}

.shop-hero-lead {
    max-width: 62ch;
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--muted);
}

.shop-hero-note {
    max-width: 62ch;
    margin: 0;
    font-size: 15px;
    color: var(--muted);
}

.crumb {
    padding: 22px clamp(24px, 6vw, 78px) 0;
    font-size: 14px;
    font-weight: 700;
}

.crumb a {
    color: var(--warm-dark);
    text-decoration: none;
}

.piece-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(20px, 3vw, 34px);
    padding: clamp(30px, 5vw, 58px) clamp(24px, 6vw, 78px);
}

.piece-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.piece-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(23, 33, 45, 0.1);
}

.piece-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.piece-card-photo {
    position: relative;
    /* Square rather than wide. A tile has to hold an upright picture as well
       as a wide photograph of a table, and every tile has to be the same
       shape or the grid stops lining up. A square is the shape that treats
       both fairly: the table loses a little at the sides, the painting gains
       most of the tile it was previously floating in. */
    aspect-ratio: 1 / 1;
    background: var(--soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.piece-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.piece-card-nophoto {
    color: var(--muted);
    font-size: 14px;
}

.piece-card-taken .piece-card-photo img {
    filter: grayscale(0.75);
    opacity: 0.75;
}

.piece-flag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
}

.piece-flag.sold { background: var(--night); }
.piece-flag.held { background: var(--warm); }

.piece-card-body {
    padding: 18px 20px 22px;
}

.piece-card-body h2 {
    margin: 0 0 6px;
    font-size: 19px;
}

.piece-card-summary {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
}

.piece-card-price {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    font-weight: 900;
    color: var(--warm-dark);
}

.piece-card-price span {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.shop-empty,
.order-done {
    max-width: 640px;
    margin: clamp(50px, 10vw, 110px) auto;
    padding: 0 24px;
    text-align: center;
}

.shop-empty p,
.order-done p {
    color: var(--muted);
}

.order-done-reference {
    font-size: 18px;
    color: var(--ink) !important;
}

.order-done-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 26px;
}

.shop-explainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(20px, 3vw, 40px);
    padding: clamp(34px, 5vw, 64px) clamp(24px, 6vw, 78px);
    border-top: 1px solid var(--line);
    background: var(--soft);
}

.shop-explainer h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.shop-explainer p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

/* ---------- one piece ---------- */

.piece-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 56px);
    padding: clamp(24px, 4vw, 44px) clamp(24px, 6vw, 78px);
}

/* On the piece's own page nothing is cropped, whatever it is. The photograph
   keeps its own shape - upright for most pictures, wide for most furniture -
   and is only held back from filling the whole screen on a tall one. */
.piece-main-photo {
    width: 100%;
    max-height: 74vh;
    object-fit: contain;
    border-radius: 10px;
    background: var(--soft);
    display: block;
}

/* The placeholder is a box rather than a photograph, so it needs a shape of
   its own or it collapses to nothing. */
.piece-main-photo.piece-card-nophoto {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tiles in a grid stay the same shape as each other, so a picture is fitted
   inside its tile rather than filled to it and trimmed. */
.piece-card-whole .piece-card-photo {
    background: var(--soft);
}

.piece-card-whole .piece-card-photo img {
    object-fit: contain;
    padding: 10px;
}

.piece-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.piece-thumb {
    width: 78px;
    height: 62px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: none;
    cursor: pointer;
}

.piece-thumb.active { border-color: var(--warm); }

.piece-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.piece-facts h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.12;
}

.piece-summary {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 17px;
}

.piece-price {
    margin: 0 0 18px;
    font-size: 28px;
    font-weight: 900;
    color: var(--warm-dark);
}

.piece-state {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
}

.piece-state.sold { background: var(--soft); color: var(--night); }
.piece-state.held { background: #fbf1e8; color: var(--warm-dark); }

.piece-spec {
    display: grid;
    gap: 0;
    margin: 22px 0;
    border-top: 1px solid var(--line);
}

.piece-spec > div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.piece-spec dt {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.piece-spec dd { margin: 0; }

.piece-description p {
    color: var(--muted);
    line-height: 1.7;
}

/* ---------- asking for a piece ---------- */

.order-panel {
    max-width: 900px;
    margin: 0 auto clamp(50px, 8vw, 100px);
    padding: clamp(26px, 4vw, 44px);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
}

.order-panel h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.order-intro {
    margin: 0 0 22px;
    color: var(--muted);
}

.order-panel-closed {
    text-align: center;
    background: #fff;
}

.order-error {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-left: 4px solid #b4442f;
    border-radius: 4px;
    background: #fbeceb;
    color: #7d2c1e;
    font-weight: 700;
}

.order-block {
    margin: 0 0 26px;
    padding: 0;
    border: 0;
}

.order-block legend {
    padding: 0;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--warm-dark);
}

.zone-choices {
    display: grid;
    gap: 8px;
}

.zone-choice {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.zone-choice:has(input:checked) {
    border-color: var(--warm);
    box-shadow: 0 0 0 1px var(--warm);
}

.zone-name { font-weight: 700; }

.zone-price {
    font-weight: 800;
    color: var(--warm-dark);
    font-size: 14px;
}

.cost-summary {
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
}

.cost-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    font-size: 15px;
}

.cost-summary > div span { color: var(--muted); }

.cost-total {
    margin-top: 6px;
    padding-top: 12px !important;
    border-top: 1px solid var(--line);
    font-size: 18px !important;
}

.cost-total span { color: var(--ink) !important; font-weight: 700; }
.cost-total strong { color: var(--warm-dark); }

.cost-note {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.field-grid label,
.admin-form label {
    display: block;
}

.field-grid label.wide { grid-column: 1 / -1; }

.field-grid label > span,
.admin-form label > span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.field-grid input,
.field-grid select,
.field-grid textarea,
.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
}

.field-grid input:focus,
.field-grid textarea:focus,
.admin-form input:focus,
.admin-form textarea:focus {
    outline: 2px solid var(--warm);
    outline-offset: 1px;
}

.field-grid label.check {
    display: flex;
    align-items: center;
    gap: 10px;
    grid-column: 1 / -1;
}

.field-grid label.check input {
    width: auto;
}

.field-grid label.check span {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

/* ---------- workshop admin ---------- */

.admin-body {
    background: var(--soft);
    min-height: 100vh;
}

.admin-bar {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
    flex-wrap: wrap;
    padding: 14px clamp(18px, 4vw, 46px);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.admin-logo { width: 170px; height: auto; }

.admin-nav {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
}

.admin-nav a,
.admin-bar-actions a {
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--night);
}

.admin-nav a:hover,
.admin-bar-actions a:hover { background: var(--soft); }
.admin-nav a.active { background: var(--night); color: #fff; }

.admin-bar-actions { display: flex; gap: 4px; }
.admin-bar-actions a { color: var(--muted); font-weight: 600; }

.badge {
    display: inline-block;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--warm);
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.admin-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(22px, 3vw, 40px) clamp(18px, 4vw, 40px) 80px;
}

.admin-head { margin-bottom: 22px; }
.admin-head h1 { margin: 4px 0 6px; font-size: clamp(26px, 3vw, 34px); }
.admin-head p { margin: 0; color: var(--muted); }

.crumb-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--warm-dark);
    text-decoration: none;
}

.admin-card {
    margin-bottom: 22px;
    padding: clamp(18px, 3vw, 30px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.admin-card h2 { margin: 0 0 14px; font-size: 19px; }
.admin-card h3 { margin: 24px 0 10px; font-size: 15px; }

.card-lead {
    margin: -6px 0 18px;
    max-width: 76ch;
    color: var(--muted);
    font-size: 15px;
}

.admin-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
}

.admin-columns .admin-card { margin-bottom: 0; }

.admin-form button { margin-top: 16px; }

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.inline-form label { min-width: 150px; }
.inline-form button { margin-top: 0; }

.table-scroll { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    padding: 9px 12px 9px 0;
    border-bottom: 2px solid var(--line);
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
}

.admin-table td {
    padding: 11px 12px 11px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.admin-table a { color: var(--warm-dark); }

.cell-sub {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.cell-photo img {
    width: 56px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.no-photo { font-size: 12px; color: var(--muted); }
.cell-actions { white-space: nowrap; }

.state {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.state-available, .state-paid, .state-shipped { background: #e6f2ea; color: #1f6a41; }
.state-reserved, .state-quoted, .state-confirmed { background: #fbf1e8; color: var(--warm-dark); }
.state-draft, .state-enquiry { background: #e9edf2; color: #38495c; }
.state-sold { background: var(--night); color: #fff; }
.state-archived, .state-cancelled { background: #f0eeec; color: var(--muted); }

.warn-text { color: #9a5a11; font-weight: 700; }
.ok-text { color: #1f6a41; font-weight: 700; }

.mini-button {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    color: var(--night);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.mini-button:hover { border-color: var(--warm); }
.mini-button.danger { color: #9a2f1c; border-color: #e5cdc7; }
.mini-button[disabled] { opacity: 0.35; cursor: default; }

.button.danger {
    border: 1px solid #9a2f1c;
    background: #9a2f1c;
    color: #fff;
}

.admin-empty { color: var(--muted); font-style: italic; }

.admin-notice,
.admin-warning {
    margin: 16px 0 0;
    padding: 14px 18px;
    border-left: 4px solid var(--warm);
    border-radius: 4px;
    background: #fdf6f0;
    font-size: 14px;
}

.admin-warning strong { display: block; margin-bottom: 6px; }
.admin-warning p, .admin-warning ul { margin: 6px 0 0; color: #6d4a2f; }
.admin-warning ul { padding-left: 20px; }

.field-note {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

.weight-readout,
.total-readout {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    background: var(--soft);
}

.weight-readout > div { display: grid; }
.weight-readout span, .total-readout span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 800;
}

.weight-readout strong { font-size: 19px; }
.readout-lead strong { color: var(--warm-dark); }

.total-readout {
    align-items: baseline;
    justify-content: space-between;
}

.total-readout strong { font-size: 24px; color: var(--warm-dark); }

.detail-list > div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.detail-list dt {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.detail-list dd { margin: 0; word-break: break-word; }

.quoted-message {
    padding: 14px 18px;
    border-left: 3px solid var(--line);
    background: var(--soft);
    border-radius: 4px;
    white-space: pre-wrap;
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.chip {
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: var(--night);
}

.chip.active { background: var(--night); color: #fff; border-color: var(--night); }

.photo-manager {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.photo-tile {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--soft);
}

.photo-tile img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.photo-tile figcaption { padding: 8px; }

.cover-flag {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--warm);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.photo-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-actions form { display: flex; gap: 4px; }

.explainer-steps {
    margin: 0;
    padding-left: 22px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.explainer-steps strong { color: var(--ink); }

.danger-card { border-color: #e5cdc7; }
.danger-card p { color: var(--muted); font-size: 14px; }

@media (max-width: 860px) {
    .piece-detail { grid-template-columns: 1fr; }
    .piece-spec > div,
    .detail-list > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- paying for a piece ---------- */

.pay-page {
    max-width: 660px;
    margin: clamp(36px, 7vw, 90px) auto;
    padding: 0 24px clamp(40px, 8vw, 90px);
}

.pay-page h1 {
    margin: 6px 0 20px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.12;
}

.pay-notice {
    margin: 0 0 22px;
    padding: 14px 18px;
    border-left: 4px solid var(--warm);
    border-radius: 4px;
    background: #fdf6f0;
    color: #6d4a2f;
    font-weight: 600;
}

.pay-state {
    margin: 0 0 24px;
    padding: 20px 24px;
    border-radius: 10px;
}

.pay-state h2 { margin: 0 0 8px; font-size: 20px; }
.pay-state p { margin: 0; }

.pay-state.paid { background: #e6f2ea; color: #1c5c39; }
.pay-state.closed { background: var(--soft); color: var(--muted); }
.pay-state.closed h2 { color: var(--ink); }

.pay-summary {
    margin: 0 0 26px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.pay-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 0;
}

.pay-summary > div span { color: var(--muted); }

.pay-total {
    margin-top: 8px;
    padding-top: 14px !important;
    border-top: 1px solid var(--line);
    font-size: 19px;
}

.pay-total span { color: var(--ink) !important; font-weight: 700; }
.pay-total strong { color: var(--warm-dark); }

.pay-form { margin: 0 0 14px; }
.pay-form button { width: 100%; }

.pay-reassure,
.pay-help,
.pay-attempt {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.65;
}

.pay-attempt {
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--soft);
}

.practice-lead {
    padding: 12px 16px;
    border: 1px dashed var(--warm);
    border-radius: 6px;
    color: var(--warm-dark);
}

.practice-choices {
    display: grid;
    gap: 10px;
}

.paid-banner {
    padding: 12px 16px;
    border-radius: 6px;
    background: #e6f2ea;
    color: #1c5c39;
    font-weight: 700;
}

.state-awaiting_payment { background: #fdf1e3; color: #8a5218; }
.state-created, .state-pending { background: #e9edf2; color: #38495c; }
.state-declined, .state-failed, .state-mismatch { background: #fbeceb; color: #7d2c1e; }

/* ---------- kinds of work ---------- */

.category-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 22px;
}

/* ---------- the mail screen ---------- */

.from-note {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--muted);
}

.mail-failed {
    padding: 12px 16px;
    border-radius: 6px;
    background: #fbeceb;
    color: #7d2c1e;
    font-weight: 700;
}

.plain-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

.plain-list strong { color: var(--ink); }

/* ---------- the console overview ---------- */

.tile-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.tile {
    display: block;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(23, 33, 45, 0.09);
    border-color: var(--warm);
}

.tile-figure {
    display: block;
    font-size: 34px;
    font-weight: 900;
    line-height: 1.05;
    color: var(--warm-dark);
}

.tile-label {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tile-note {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.attention-list {
    margin: 0;
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.9;
}

.attention-list a { color: var(--warm-dark); }
