/* Phil's Landscaping — shared styles for the website, Office app, and guide */

/* ============================================================
   COLORS — change these to restyle the website and the app.
   This block starts at line 8 in styles.css.
   ============================================================ */
:root {
  --green: #1c3f2e;         /* main dark green (header, buttons) */
  --green-mid: #2d6a4f;     /* mid green (links, accents) */
  --leaf: #7fb392;          /* light leaf green */
  --cream: #f4efe4;         /* page background */
  --paper: #fffdf8;         /* cards and panels */
  --ink: #1a1f16;           /* main text */
  --muted: #5c6558;         /* secondary text */
  --line: #d9d1c3;          /* borders */
  --gold: #c7a24a;          /* highlights and paid status */
  --warn: #8a3b16;          /* storage warning, alerts */
  --warn-bg: #f8eadf;
  --ok: #1e6b3a;
  --shadow: 0 8px 28px rgba(28, 63, 46, 0.12);
  --radius: 16px;
  --tabbar-h: 64px;
  --header-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-mid); }
button, input, select, textarea { font: inherit; }
h1, h2, h3, .brand-name { font-family: var(--serif); font-weight: 650; letter-spacing: -0.02em; }

.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus { left: 8px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 100; }

/* ---------- Public site header / footer ---------- */
.site-header, .site-footer {
  background: var(--green);
  color: #f3f7f3;
}
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}
.brand {
  display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none;
}
.brand img, .brand-mark { width: 36px; height: 36px; border-radius: 8px; }
.brand-name { font-size: 1.05rem; }
.nav-toggle {
  display: inline-flex; background: transparent; border: 0; color: #fff;
  padding: 8px 10px; font-size: 0.95rem; cursor: pointer;
}
.site-nav { display: none; }
.site-nav.open, .site-header.nav-open .site-nav {
  display: flex; flex-direction: column; position: absolute;
  left: 0; right: 0; top: 100%; background: var(--green);
  padding: 8px 16px 16px; gap: 4px;
}
.site-nav a {
  color: #fff; text-decoration: none; padding: 10px 8px; border-radius: 8px;
}
.site-nav a:hover, .site-nav a:focus { background: rgba(255,255,255,0.12); }
.site-footer { padding: 28px 16px 36px; text-align: center; font-size: 0.95rem; }
.site-footer a { color: #e8c872; }
.site-footer .fine { color: #cfe8d4; font-size: 0.85rem; margin-top: 8px; }

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .site-header { padding: 12px 32px; }
  .site-nav { display: flex; position: static; flex-direction: row; gap: 8px; padding: 0; }
}

/* ---------- Hero ---------- */
/* HERO PHOTO: to use your own picture, put it at images/hero.jpg
   (this rule is around the .hero-photo block below). */
.hero {
  position: relative;
  background:
    linear-gradient(180deg, rgba(28,63,46,0.28), rgba(28,63,46,0.72)),
    radial-gradient(1200px 420px at 70% 10%, #7fb392 0%, transparent 55%),
    linear-gradient(160deg, #2d6a4f 0%, #1c3f2e 55%, #163226 100%);
  color: #fff;
  min-height: 72vh;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  z-index: 0;
}
.hero-inner {
  position: relative; z-index: 1;
  padding: 48px 20px 40px;
  max-width: 720px;
}
.hero h1 { font-size: clamp(2rem, 7vw, 3.4rem); margin: 0 0 10px; line-height: 1.1; }
.hero p { margin: 0 0 22px; font-size: 1.15rem; color: #eef5ee; max-width: 36rem; }
.hero-art {
  position: absolute; right: -20px; bottom: 0; width: 55%; max-width: 420px;
  opacity: 0.35; pointer-events: none;
}

/* ---------- Layout ---------- */
.wrap { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
section.block { padding: 48px 0; }
.block h2 { font-size: 1.8rem; margin: 0 0 8px; color: var(--green); }
.lead { color: var(--muted); margin: 0 0 24px; }

.cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards.three { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 6px; font-size: 1.2rem; }
.price { color: var(--green-mid); font-weight: 650; margin: 8px 0 0; }
.muted { color: var(--muted); }
.fine { font-size: 0.85rem; color: var(--muted); }

/* ---------- Buttons / forms ---------- */
.btn, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 0; cursor: pointer;
  text-decoration: none; font-weight: 650;
  background: var(--green); color: #fff;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn.gold { background: var(--gold); color: #1a1f16; }
.btn.warn { background: var(--warn); }
.btn.small { min-height: 38px; padding: 6px 12px; font-weight: 600; font-size: 0.92rem; }
.btn-row, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

label.field, .field {
  display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.92rem;
}
.field input, .field select, .field textarea, input.ctrl, select.ctrl, textarea.ctrl {
  font-weight: 400; width: 100%; min-height: 44px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 16px; /* keeps iPhone from zooming */
}
textarea.ctrl, .field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }

/* ---------- Office app shell ---------- */
.app-body {
  background: #efe9db;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  padding-top: env(safe-area-inset-top, 0px);
  min-height: 100dvh;
  scroll-padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
}
html { scroll-padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px); }
.app-header {
  position: sticky; top: 0; z-index: 30;
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 12px;
  background: var(--green); color: #fff;
}
.app-header h1 { font-size: 1.1rem; margin: 0; font-family: var(--serif); }
.app-header a, .app-header button.link {
  color: #fff; background: none; border: 0; text-decoration: none;
  min-height: 44px; padding: 0 8px; cursor: pointer;
}
#view { width: min(720px, 100%); margin: 0 auto; padding: 14px 14px calc(24px + var(--tabbar-h)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fffdf8; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  height: calc(var(--tabbar-h) + var(--safe-bottom));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--muted); font-size: 0.7rem; font-weight: 650;
  min-height: var(--tabbar-h);
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--green); }

.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 4px 0 14px; }
.page-title h2 { margin: 0; font-size: 1.55rem; color: var(--green); }
.seg {
  display: flex; background: #e7e0d2; border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 12px;
}
.seg button {
  flex: 1; border: 0; background: transparent; min-height: 40px; border-radius: 10px;
  font-weight: 650; color: var(--muted); cursor: pointer;
}
.seg button.on { background: var(--paper); color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; text-decoration: none; color: inherit;
  box-shadow: 0 2px 10px rgba(28,63,46,0.06);
}
.list-item h3 { margin: 0 0 4px; font-size: 1.05rem; }
.list-item .meta { color: var(--muted); font-size: 0.9rem; }
.status {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #e7e0d2; color: var(--ink);
}
.status.quoted { background: #e8e4f4; color: #3d3560; }
.status.scheduled { background: #dceaf8; color: #1d3d5c; }
.status.inprogress { background: #f7e4c4; color: #6a3e08; }
.status.done { background: #dcecde; color: #1c4a2a; }
.status.invoiced { background: #f8e0d2; color: #7a2e12; }
.status.paid { background: #e8c872; color: #1a1f16; }

.banner, .storage-banner {
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid #e4c8b0;
  padding: 10px 14px; font-size: 0.92rem;
}
.storage-banner a { color: var(--warn); font-weight: 700; }
.empty {
  background: var(--paper); border: 1px dashed var(--line);
  border-radius: 14px; padding: 28px 16px; text-align: center; color: var(--muted);
}
.kpi {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px;
}
.kpi .card { padding: 14px; }
.kpi .num { font-size: 1.45rem; font-weight: 750; color: var(--green); margin: 0; }
.kpi .lbl { margin: 0; font-size: 0.8rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-head h3 { margin: 0; font-size: 1.1rem; }
.cal-grid, .week-grid { display: grid; gap: 4px; }
.cal-grid { grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day {
  min-height: 52px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; font-size: 0.75rem; text-align: left;
  color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 2px;
}
.cal-day.out { opacity: 0.4; }
.cal-day.today { outline: 2px solid var(--green-mid); }
.cal-day .n { font-weight: 700; }
.cal-dot { display: block; background: var(--green); color: #fff; border-radius: 6px; padding: 1px 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.week-grid { grid-template-columns: 1fr; }
.week-day { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.week-day h3 { margin: 0 0 8px; font-size: 1rem; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.photo-slot {
  position: relative; background: #e7e0d2; border-radius: 12px; overflow: hidden;
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .remove {
  position: absolute; top: 4px; right: 4px; min-height: 32px; width: 32px; padding: 0;
  border-radius: 999px; background: rgba(0,0,0,0.6); color: #fff; border: 0; cursor: pointer;
}
.add-photo { width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; font-weight: 650; color: var(--green); }

/* Quote print */
.quote-sheet { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.quote-sheet table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.quote-sheet th, .quote-sheet td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.quote-sheet th:last-child, .quote-sheet td:last-child, .right { text-align: right; }
.totals { margin-left: auto; width: min(240px, 100%); }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-weight: 750; font-size: 1.1rem; border-top: 2px solid var(--green); margin-top: 6px; padding-top: 8px; }

/* Guide */
.guide-body { background: var(--cream); }
.guide-wrap { width: min(740px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 64px; }
.guide-wrap h1 { color: var(--green); font-size: 2rem; margin: 0 0 8px; }
.guide-wrap h2 { color: var(--green); font-size: 1.35rem; margin: 32px 0 8px; }
.guide-wrap ol.steps, .guide-wrap ul { padding-left: 1.2rem; }
.guide-wrap li { margin: 0 0 8px; }
.guide-wrap .toc a { display: block; padding: 6px 0; }
.file-ref {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #efe6d3; padding: 1px 6px; border-radius: 6px; font-size: 0.9em;
}

@media print {
  .site-header, .site-footer, .tabbar, .app-header, .no-print, .nav-toggle, .storage-banner { display: none !important; }
  body, .app-body, .guide-body { background: #fff; padding: 0; }
  #view { width: 100%; padding: 0; }
  .quote-sheet, .card, .list-item { box-shadow: none; border-color: #ccc; }
  .guide-wrap { width: 100%; padding: 0; }
  a[href]::after { content: none !important; }
}

@media (max-width: 420px) {
  .cal-day { min-height: 46px; padding: 2px; font-size: 0.68rem; }
}
