/* Coffee detail page — extends the mcs-ui system. */

.cd-head {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  margin-top: 8px;
}
.cd-photo {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--mcs-r-md, 14px);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--mcs-line, #E6DCCC);
}
.cd-photo img { width: 100%; height: 100%; object-fit: cover; }
.cd-photo-ph {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 72px; color: var(--mcs-line, #E6DCCC);
  font-family: "Lato-Bold", sans-serif;
}

.cd-title { font-size: clamp(24px, 3vw, 34px); margin: 0 0 8px; }
.cd-title span { font-weight: 400; color: var(--mcs-muted, #8A7059); }
.cd-title span a { color: var(--mcs-muted, #8A7059); }
.cd-title span a:hover { color: var(--mcs-accent, #C05A2A); }
.cd-sca { font-size: 13px; color: var(--mcs-muted, #8A7059); margin: 0 0 16px; }
.cd-info > .mcs-ui-morelink { margin: 2px 0 14px; }
.cd-attribution { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; margin: -4px 0 12px; }
.cd-attribution-verified { color: #00893F; }
.cd-attribution-community { color: var(--mcs-muted, #8A7059); }
.cd-specs { margin: 0 0 14px; font-size: 14px; }
.cd-specs dt { color: var(--mcs-accent, #C05A2A); font-weight: 700; letter-spacing: .04em; }
.cd-notes { font-size: 15px; font-style: italic; color: var(--mcs-body, #5C4638); margin: 0 0 16px; max-width: 52ch; }
.cd-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

.cd-settings { max-width: 720px; }
.cd-grinder { max-width: 260px; margin-bottom: 24px; }

.cd-set {
  border: 1px solid var(--mcs-line, #E6DCCC);
  border-radius: var(--mcs-r-md, 14px);
  overflow: hidden;
  background: var(--mcs-card, #FFFDFA);
  margin-bottom: 16px;
}
.cd-set-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--mcs-muted, #8A7059);
}
.cd-set-head img { height: 14px; width: auto; }
.cd-set-head b { font-weight: 700; }
.cd-set-head--roaster { background: var(--mcs-dark, #4A2822); }
.cd-set-head--mine { background: var(--mcs-accent, #C05A2A); }
.cd-set-head .cd-set-grinder {
  margin-left: auto; font-weight: 400; font-size: 12px; opacity: .8;
}
.cd-set-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cd-set-table th {
  text-align: center; padding: 8px 6px;
  font-size: 11px; letter-spacing: .06em; color: var(--mcs-muted, #8A7059);
  background: var(--mcs-chip, #EFE6D8); font-weight: 700;
}
.cd-set-table th:first-child, .cd-set-table td:first-child { text-align: left; padding-left: 16px; }
.cd-set-table td { text-align: center; padding: 9px 6px; border-top: 1px solid var(--mcs-line, #E6DCCC); }
.cd-set-note { margin: 0; padding: 10px 16px 14px; font-size: 13px; color: var(--mcs-body, #5C4638); }

/* setting gallery photos (G-8) */
.cd-set-gallery {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 2px 16px 14px;
}
.cd-set-shot {
  flex: 0 0 auto;
  width: 72px; height: 72px; object-fit: cover;
  border-radius: var(--mcs-r-sm, 10px);
  border: 1px solid var(--mcs-line, #E6DCCC); background: #fff;
  cursor: zoom-in;
}

/* ---- My Settings — Explore-style card grid ---- */
.ms-grid {
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  /* align-items left at the grid default (stretch) on purpose: cards used to
     size to their own content (a heavily-logged setting towering over a
     sparse one); .ms-brews/.ms-card-gallery below now cap that variable
     content instead, so every card in a row is the same standard size. */
}
.ms-card .mcs-ui-card-media .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: "Lato-Bold", sans-serif; font-size: 40px; color: var(--mcs-muted, #8A7059);
  background: var(--mcs-chip, #EFE6D8);
}
.ms-card .mcs-ui-badge-mine .ms-badge-private {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .4px;
  padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.16);
}
.ms-card .mcs-ui-card-title a { color: inherit; text-decoration: none; }
.ms-card:hover .mcs-ui-card-title a { color: var(--mcs-accent, #C05A2A); }

/* capped to 3 rows + a "+N more" line in the template (_card_my_setting.html)
   and to a matching min-height here, so a setting with many grind methods
   logged can't make its card taller than one with just one or two. */
.ms-brews { list-style: none; margin: 12px 0 0; padding: 0; min-height: 96px; max-height: 96px; overflow: hidden; }
.ms-brews li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
  padding: 6px 0; border-top: 1px solid var(--mcs-line, #E6DCCC); font-size: 12.5px;
}
.ms-brews li:first-child { border-top: 0; padding-top: 2px; }
.ms-brew-name { font-family: "Lato-Bold", sans-serif; color: var(--mcs-ink, #2E1B14); }
.ms-brew-vals { color: var(--mcs-body, #5C4638); }
.ms-brews-empty { color: var(--mcs-muted, #8A7059); font-style: italic; }
.ms-brews-more { color: var(--mcs-accent, #C05A2A); font-weight: 700; border-top: 0 !important; padding-top: 4px !important; }

/* always rendered (see the template) and forced to one row regardless of
   photo count, so an 8-photo setting isn't taller than a photo-less one —
   .cd-set-gallery itself still wraps freely on the full coffee-detail page. */
.ms-card-gallery { padding: 12px 0 0; flex-wrap: nowrap; overflow: hidden; height: 76px; }
.ms-card-gallery .cd-set-shot { width: 52px; height: 52px; }

.ms-card-foot {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); align-items: stretch; gap: 8px;
  margin-top: auto; padding-top: 14px;
}
.ms-card-foot form { margin: 0; display: flex; }
/* the keys are the smallest size and share the card's width in matched pairs: the way to add a setting on
   its own first row, Edit and Make public under it, and Delete last (alone on its row when it would be odd;
   next to Edit when there is no Make public). A card too narrow for two keys side by side (two cards across on a
   phone) stacks them, all the same width. */
.ms-card-foot .mcs-ui-morelink { --pk-k: .75; flex: 1 1 auto; width: 100%; box-sizing: border-box;
  justify-content: center; min-height: 30px; padding: 0 8px; font-size: 12px; }
.ms-card-foot .ms-foot-add { order: -1; grid-column: 1 / -1; }
.ms-card-foot > :last-child:nth-child(even), .ms-card-foot > :only-child { grid-column: 1 / -1; }

@media (max-width: 575px) {
  .ms-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.cd-set-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 2px 16px 14px; }
.cd-set-actions form { margin: 0; }

.cd-recipe + .cd-recipe { margin-top: 14px; }
.cd-recipe-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cd-recipe-head h3 { margin: 0 0 8px; }

/* --- roaster profile --- */
.rc-head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
  margin: 8px 0 4px;
}
.rc-logo {
  width: 120px; height: 120px;
  border: 1px solid var(--mcs-line, #E6DCCC);
  border-radius: var(--mcs-r-sm, 10px);
  overflow: hidden; background: #fff;
}
.rc-logo img { width: 100%; height: 100%; object-fit: cover; }
.rc-logo-ph {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 44px; color: var(--mcs-line, #E6DCCC);
  font-family: "Lato-Bold", sans-serif;
}
.rc-name { font-size: clamp(22px, 2.6vw, 30px); margin: 0 0 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-addr { font-style: normal; font-size: 13px; line-height: 1.6; color: var(--mcs-muted, #8A7059); margin: 0 0 10px; }
.rc-contact { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; margin: 0; }
.rc-contact a { color: var(--mcs-body, #5C4638); }
.rc-contact a:hover { color: var(--mcs-accent, #C05A2A); }
.rc-contact .fa { margin-right: 6px; opacity: .7; }
.rc-social { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; }
.rc-social a {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--mcs-dark, #4A2822);
}
.rc-social img { width: 17px; height: 17px; filter: brightness(0) invert(1); }
.rc-desc { font-size: 15px; line-height: 1.7; color: var(--mcs-body, #5C4638); margin: 18px 0 0; max-width: 62ch; }

@media (max-width: 767px) {
  .rc-head { grid-template-columns: 1fr; gap: 16px; }
  .rc-social { order: 3; }
}

@media (max-width: 767px) {
  .cd-head { grid-template-columns: 1fr; gap: 22px; }
  .cd-photo { max-width: 320px; }
}

/* ---- My Settings: the search bar, the grid / list switch and the list view ------------------- */
.ms-sr {   /* a label for screen readers only */
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ms-filters { margin-bottom: 30px; }
.ms-bar { justify-content: flex-start; }
.ms-search { flex: 1 1 260px; min-width: 200px; }
.ms-viewbar { margin: 0 0 0 auto; }
.ms-viewbar .mcs-ui-seg { padding: 8px 18px; }
.ms-tag {
  display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px;
  background: var(--mcs-chip, #EFE6D8); color: var(--mcs-muted, #8A7059);
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; vertical-align: 2px;
}
.ms-muted { color: var(--mcs-muted, #8A7059); font-style: italic; }
.ms-nowrap { white-space: nowrap; }

.ms-table {
  width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden;
  background: var(--mcs-card, #FFFDFA); border: 1px solid var(--mcs-line, #E6DCCC);
  border-radius: var(--mcs-r-md, 14px); font-size: 14px; color: var(--mcs-body, #5C4638);
}
.ms-table th, .ms-table td { padding: 12px 14px; text-align: left; vertical-align: top; }
.ms-table tbody tr + tr > * { border-top: 1px solid var(--mcs-line, #E6DCCC); }
.ms-table thead th {
  background: var(--mcs-chip, #EFE6D8); color: var(--mcs-muted, #8A7059);
  font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; font-weight: 700;
}
.ms-table tbody th { font-weight: normal; font-family: var(--mcs-display, "Lato-Bold", sans-serif); font-size: 15.5px; }
.ms-table tbody th a { color: var(--mcs-ink, #2E1B14); text-decoration: none; }
.ms-table tbody th a:hover { color: var(--mcs-accent, #C05A2A); }
.ms-table small { display: block; margin-top: 2px; color: var(--mcs-muted, #8A7059); font: 12.5px var(--mcs-sans, "Lato-Regular", sans-serif); }
.ms-brew { display: block; }
.ms-brew b { font-family: "Lato-Bold", sans-serif; color: var(--mcs-ink, #2E1B14); font-weight: normal; }
/* the keys sit on one line when the table has room, and wrap onto a second when it does not (a tablet) */
.ms-actions form { display: inline-block; margin: 0; vertical-align: middle; }
.ms-actions > * { margin: 3px 8px 3px 0; vertical-align: middle; }
.ms-table + .ms-table, .ms-grid + .mcs-ui-sechead, .ms-table + .mcs-ui-sechead { margin-top: 34px; }

/* on a phone each row becomes a small card of labelled lines, so nothing needs sideways scrolling */
@media (max-width: 760px) {
  .ms-viewbar { margin-left: 0; }
  .ms-table, .ms-table tbody, .ms-table tr, .ms-table th, .ms-table td { display: block; }
  .ms-table thead { display: none; }
  .ms-table tbody tr { padding: 12px 14px; }
  .ms-table tbody tr + tr { border-top: 1px solid var(--mcs-line, #E6DCCC); }
  .ms-table th, .ms-table td { padding: 3px 0; }
  .ms-table tbody tr + tr > * { border-top: 0; }
  .ms-table td[data-label]::before {
    content: attr(data-label); display: inline-block; min-width: 92px; margin-right: 8px;
    color: var(--mcs-muted, #8A7059); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  }
  .ms-table td.ms-actions { padding-top: 8px; white-space: normal; }
}

/* the recipe written on a brew row: a key as wide as the table, its text under it */
.cd-set-table .cd-set-recipe-row td { text-align: left; padding: 0 16px 12px; border-top: 0; }
.cd-set-recipe .se-recipe-toggle { width: 100%; box-sizing: border-box; justify-content: center;
  --pk-fg: var(--mcs-accent, #C05A2A); padding: 6px 14px; min-height: 36px;
  font-family: inherit; font-size: 13px; font-weight: 700; }
.cd-set-recipe-body[hidden] { display: none; }
.cd-set-recipe p { margin: 10px 2px 0; white-space: pre-line; font-size: 13px; color: var(--mcs-body, #5C4638); }
.cd-set-recipe .cd-set-gallery { padding: 10px 0 0; }
