/* =============================================================================
   LS COFFEE — STYLES
   Magazine-inspired: serif headlines, generous whitespace, muted palette.
   ============================================================================= */

:root {
  --bg:        #f6f2ec;   /* warm off-white, "newsprint" */
  --paper:    #fffdf8;   /* slightly lighter for cards */
  --ink:       #1a1a1a;
  --ink-soft:  #4a4a4a;
  --rule:      #d9d2c5;
  --accent:    #8b3a1f;   /* roasted-bean rust */
  --accent-2:  #2f4a3a;   /* deep evergreen */
  --good:      #2f7a3a;
  --mid:       #b08400;
  --warn:      #a83e2a;
  --shadow:    0 1px 0 rgba(0,0,0,0.04);
  --radius:    4px;
  --serif:     'Cormorant Garamond', 'Iowan Old Style', 'Palatino', Georgia, serif;
  --sans:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

header.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 56px 0 28px;
  text-align: center;
}

.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--ink-soft);
}

h1.title {
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  margin: 8px 0 4px;
  letter-spacing: -0.01em;
}

.tagline {
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 540px;
  margin: 6px auto 0;
}

.masthead-nav {
  margin-top: 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
.masthead-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.masthead-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.masthead-nav .dot {
  margin: 0 10px;
  opacity: 0.5;
}

/* ---------- Controls bar ---------- */

.controls {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}

.controls-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  flex: 1 1 240px;
  min-width: 180px;
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 6px 10px;
}
.search input {
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  width: 100%;
  color: var(--ink);
}
.search-icon {
  width: 14px;
  height: 14px;
  color: var(--ink-soft);
  margin-right: 6px;
  flex-shrink: 0;
}

.sort-select, .min-select {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 7px 10px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.tag-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip {
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--ink-soft); }
.chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.result-count {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---------- Map ---------- */

.map-wrap {
  margin: 24px 0 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
#map {
  height: 360px;
  width: 100%;
  background: #e6e0d4;
}
.leaflet-container {
  font-family: var(--sans) !important;
  font-size: 13px !important;
}
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
}
.shop-marker {
  background: var(--accent);
  color: white;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* ---------- Ranked list ---------- */

.list-section {
  padding: 24px 0 80px;
}

.list-heading {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  margin: 24px 0 12px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}

.further-afield-heading {
  margin-top: 56px;
  font-style: italic;
  color: var(--accent-2);
}

.further-afield-blurb {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  margin: -6px 0 12px;
}

.shop {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.shop:last-child { border-bottom: 0; }

.rank {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 44px;
  line-height: 1;
  color: var(--ink);
  text-align: right;
  padding-top: 4px;
}

.shop-body {
  min-width: 0;
}

.shop-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 2px;
}

.shop-meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.shop-meta a { color: var(--ink-soft); border-bottom: 1px dotted var(--ink-soft); }
.shop-meta a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.shop-meta .hood {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--accent-2);
  font-weight: 600;
}
.shop-meta .dot { opacity: 0.5; margin: 0 2px; }

.shop-notes {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  margin: 6px 0 12px;
}

.shop-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.shop-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  background: transparent;
  padding: 2px 0;
}
.shop-tag::before { content: '#'; opacity: 0.5; margin-right: 1px; }

/* ---------- Score block ---------- */

.scores {
  text-align: right;
  min-width: 150px;
}

.overall {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1;
  color: var(--ink);
}
.overall .denom {
  font-size: 16px;
  color: var(--ink-soft);
  font-weight: 400;
}
.overall-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin-top: 4px;
}

.score-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  font-size: 12px;
}
.score-grid .cat {
  color: var(--ink-soft);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.score-grid .val {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.score-grid .val.unrated {
  color: var(--ink-soft);
  font-weight: 400;
}

/* color the overall by score band */
.overall.tier-a { color: var(--good); }
.overall.tier-b { color: var(--accent); }
.overall.tier-c { color: var(--mid); }
.overall.tier-d { color: var(--warn); }

/* ---------- Empty state ---------- */

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
}

/* ---------- Prose sections (About / How I Rank / Support) ---------- */

.prose-section, .support-section {
  padding: 48px 0 24px;
  border-top: 1px solid var(--rule);
}

.section-heading {
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  font-size: 32px;
  margin: 0 0 18px;
  letter-spacing: -0.005em;
}

.prose {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 680px;
  margin: 0 0 12px;
}

.prose.intro { margin-bottom: 28px; }
.prose.disclaimer {
  font-size: 16px;
  color: var(--ink-soft);
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  margin-top: 18px;
}

/* ---------- About: photo + text layout ---------- */

.about-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-rows: auto;
  grid-auto-flow: dense;
  gap: 36px;
  align-items: start;
}

.about-text  { grid-column: 1; grid-row: 1; }
.about-photo { grid-column: 2; grid-row: 1; }

.about-photo {
  margin: 0;
  /* Reserve space so the layout doesn't shift when the image loads. */
  min-height: 1px;
}

.about-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: 0 2px 14px rgba(0,0,0,0.10);
}

/* When the image fails to load (e.g. the file isn't there yet), show a
   subtle placeholder rather than a broken-image icon. */
.about-photo.missing img { display: none; }
.about-photo.missing::before {
  content: 'Add your photo at\Aimages/about.jpeg';
  white-space: pre;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  padding: 16px;
}

.about-text > .prose:first-child { margin-top: 0; }

@media (max-width: 720px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .about-photo {
    max-width: 240px;
    margin: 0 auto;
  }
}
.criterion p strong {
  font-weight: 600;
  color: var(--ink);
  font-style: normal;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px 32px;
  margin-top: 8px;
}
.criterion h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--accent);
}
.criterion p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}

/* ---------- Buy Me a Coffee button ---------- */

.bmc-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #FFDD00;
  color: #0d0c22;
  padding: 12px 22px;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  margin-top: 8px;
}
.bmc-button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
  color: #0d0c22;
}
.bmc-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.bmc-icon { font-size: 18px; line-height: 1; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--rule);
  padding: 24px 0 48px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .shop {
    grid-template-columns: 44px 1fr;
    gap: 14px;
  }
  .scores {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: 58px;
    margin-top: 4px;
  }
  .score-grid {
    grid-template-columns: auto auto;
    justify-content: start;
  }
  .rank { font-size: 32px; }
  .shop-name { font-size: 22px; }
  .shop-notes { font-size: 16px; }
  #map { height: 260px; }
}
