/* Tevam Home — phone-first styles. No external fonts or scripts. */
:root {
  --ink: #1d2a24;
  --muted: #5b6b63;
  --bg: #f7f5f0;
  --card: #ffffff;
  --brand: #1f5f45;
  --brand-dark: #164633;
  --accent: #c8862a;
  --line: #dcd7cc;
  --error: #a3261b;
  --ok: #1f6b3a;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
a { color: var(--brand); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.35rem; margin: 28px 0 12px; }
img { max-width: 100%; height: auto; }

.site-header { background: var(--brand); color: #fff; position: relative; }
/* Phone menu: a ☰ button that drops the links down, full width. Computers show the links in a row instead. */
.menu summary {
  list-style: none; cursor: pointer; color: #fff; font-weight: 600; padding: 8px 12px; min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 8px; display: flex; align-items: center;
}
.menu summary::-webkit-details-marker { display: none; }
.menu-links {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: var(--brand-dark);
  display: flex; flex-direction: column; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
.menu-links a { color: #fff; text-decoration: none; padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, 0.15); font-size: 1.05rem; }
.menu-links a:active, .menu-links a:hover { background: var(--brand); }
.nav.nav-wide { display: none; }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.brand { color: #fff; font-weight: 700; font-size: 1.25rem; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
/* Tevam's THR logo sits on a white round badge so it reads on the blue bar. */
.brand-logo { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; background: #fff; padding: 2px; }
.brand-legal { font-size: 0.8rem; opacity: 0.9; }
.header-row > div:first-child { flex: 1 1 12rem; min-width: 0; }
.menu { flex: 0 0 auto; }
.nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.nav a, .nav .link-button { color: #fff; text-decoration: none; font-size: 0.95rem; }
.nav a:hover { text-decoration: underline; }

.site-footer { border-top: 1px solid var(--line); background: #efece4; color: var(--muted); font-size: 0.9rem; padding: 18px 0; }
.site-footer p { margin: 4px 0; }

.hero { background: var(--card); border-radius: var(--radius); padding: 28px 20px; border: 1px solid var(--line); }
.hero h1 { font-size: 2.2rem; color: var(--brand-dark); }
.hero .steps { font-weight: 600; color: var(--muted); }
.hero .fine { font-size: 0.85rem; color: var(--muted); }

.button, button.button {
  display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: var(--radius);
  padding: 12px 20px; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px;
}
.button:hover { background: var(--brand-dark); }
.button.secondary { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.button.danger { background: #b42318; color: #fff; border: 2px solid #b42318; }
.button[disabled] { background: #b9c2bd; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; line-height: 1.5; cursor: pointer; }
form.inline { display: inline-flex; align-items: center; margin: 0; }
.keep-lines { white-space: pre-line; }
/* Long words or links wrap inside text, but tables keep whole words and scroll sideways in their box. */
main h1, main h2, main p, main li, main dd, main label, main legend { overflow-wrap: anywhere; }
table.list th, table.list td { white-space: nowrap; }
.field-label { font-weight: 600; margin: 0 0 6px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); font-weight: 600; }
.tile:hover { border-color: var(--brand); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.field { margin: 0 0 16px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 0.9rem; margin: 2px 0 6px; }
fieldset.field { border: 0; padding: 0; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #b8b1a3; border-radius: 8px; background: #fff; min-height: 44px;
}
textarea { min-height: 110px; }
.choice { display: flex; align-items: center; gap: 8px; margin: 6px 0; min-height: 32px; }
.choice input { width: 20px; height: 20px; }
.error { color: var(--error); font-weight: 600; font-size: 0.95rem; margin: 4px 0; }
.alert { border-left: 4px solid var(--error); background: #fbecea; padding: 12px 14px; border-radius: 6px; margin: 12px 0; }
.notice { border-left: 4px solid var(--brand); background: #e9f2ed; padding: 12px 14px; border-radius: 6px; margin: 12px 0; }

.price { font-size: 1.6rem; font-weight: 700; color: var(--brand-dark); margin: 0; }
.muted { color: var(--muted); }

.tracker { list-style: none; padding: 0; margin: 12px 0; }
.tracker li { padding: 10px 12px 10px 36px; position: relative; border-left: 3px solid var(--line); margin-left: 10px; color: var(--muted); }
.tracker li::before { content: ""; position: absolute; left: -9px; top: 14px; width: 15px; height: 15px; border-radius: 50%; background: var(--line); }
.tracker li.done { color: var(--ink); }
.tracker li.done::before { background: var(--brand); }
.tracker li.current { color: var(--ink); font-weight: 700; }
.tracker li.current::before { background: var(--accent); box-shadow: 0 0 0 4px #f3dfc0; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos a { min-width: 0; }
.photos a.photo-file { overflow-wrap: anywhere; word-break: break-word; }
.file-list li { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.photos img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

table.list { width: 100%; border-collapse: collapse; background: var(--card); }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 0.95rem; vertical-align: top; }
.table-scroll { overflow-x: auto; }
.badge { display: inline-block; background: #eef3f0; color: var(--brand-dark); border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; white-space: nowrap; }
dl.details { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 6px 12px; margin: 0; }
dl.details dt { font-weight: 600; color: var(--muted); }
dl.details dd { margin: 0; }

@media (min-width: 720px) {
  .nav.nav-wide { display: flex; }
  .menu { display: none; }
  h1 { font-size: 2.3rem; }
  .hero { padding: 44px 40px; }
  .hero h1 { font-size: 3rem; }
}

/* Phase 2: settings and quote tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list td.wrap-cell { white-space: normal; min-width: 180px; }
.money-input { width: 7.5em; max-width: 100%; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin: 6px 0; }
.link-button.underline { text-decoration: underline; color: var(--brand); }
h3 { font-size: 1.1rem; margin: 20px 0 8px; }
details.add-item { margin-top: 16px; }
details.add-item summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 6px 0; }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
fieldset.line { margin: 12px 0; }
fieldset.line legend { font-weight: 600; padding: 0 4px; }
.line-numbers { display: flex; flex-wrap: wrap; gap: 0 16px; }
ul.terms { padding-left: 20px; color: var(--muted); font-size: 0.95rem; }
.small { font-size: 0.85rem; }

/* Tables that turn into stacked cards on phones (each cell shows its column name). */
@media (max-width: 599px) {
  table.stack thead { position: absolute; left: -9999px; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 6px 10px; background: var(--card); }
  table.stack td { white-space: normal; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; }
  table.stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); flex: 0 0 auto; }
  table.stack td.wrap-cell { min-width: 0; text-align: right; }
  table.stack td.wrap-cell { flex-wrap: wrap; }
  table.stack td.wrap-cell .error { text-align: left; flex-basis: 100%; }
}
.nowrap { white-space: nowrap; }

/* Phase 3: money summary (labels wrap, amounts stay on one line and line up on the right) */
table.list.summary th { white-space: normal; font-weight: 600; }
table.list.summary td { text-align: right; white-space: nowrap; }

/* Phase 3: contract and payment tables become cards on tablets too (they have more columns). */
@media (max-width: 899px) {
  table.stack-wide thead { position: absolute; left: -9999px; }
  table.stack-wide, table.stack-wide tbody, table.stack-wide tr, table.stack-wide td { display: block; width: 100%; }
  table.stack-wide tr { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 6px 10px; background: var(--card); }
  table.stack-wide td { white-space: normal; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; }
  table.stack-wide td::before { content: attr(data-label); font-weight: 600; color: var(--muted); flex: 0 0 auto; }
  table.stack-wide td.wrap-cell { min-width: 0; text-align: right; flex-wrap: wrap; }
}

/* File pickers never stick out of their box on small phones. */
input[type="file"] { max-width: 100%; }

/* Long words (like a pasted link) wrap inside a table text cell instead of stretching the table (TH-042). */
table.list td.wrap-cell .cell-text { display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }

/* Phase 4: time picker */
.time-picker fieldset { margin: 0 0 12px; }
.time-picker legend { font-weight: 700; padding: 0 4px; }
.time-picker .times { display: flex; flex-wrap: wrap; gap: 8px; }
.time-picker .times .button { min-width: 7rem; }

.bookings { list-style: none; padding: 0; margin: 0 0 16px; }
.bookings h3 { margin-top: 0; overflow-wrap: anywhere; }
.bookings .muted { overflow-wrap: anywhere; }

.call-day { margin: 8px 0; }
.call-day-name { font-weight: 700; margin: 0 0 4px; }
.time-choice { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }

/* Our Work (Phase 5) */
.work-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.work-admin-item { margin: 0; }
.work-admin-item img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; display: block; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.filter { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--card); }
.filter[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.work-item { margin: 0; }
.work-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: right bottom; border-radius: var(--radius); display: block; }
.work-item figcaption { font-weight: 600; margin-top: 6px; }
.work-view { border: 0; padding: 12px; max-width: min(96vw, 1100px); background: #111; color: #fff; border-radius: var(--radius); }
.work-view::backdrop { background: rgba(0, 0, 0, 0.8); }
.work-view img { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; }
.work-view-label { text-align: center; margin: 8px 0; }
.work-view-nav { display: flex; justify-content: center; gap: 12px; }
.work-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer; }
@media (max-width: 480px) { .work-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.slider { margin: 18px 0; }
.slider-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); scrollbar-width: none; }
.slider-strip::-webkit-scrollbar { display: none; }
.slider-strip img { flex: 0 0 100%; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: right bottom; scroll-snap-align: start; display: block; }
.slider-more { text-align: right; margin: 6px 0 0; }
.slider-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.slider-bar .button { padding: 4px 12px; min-width: 44px; }
.slider-bar .slider-more { margin-left: auto; }
