/* =============================================================
   GRANNY'S RECIPE SEARCH — Stylesheet v2.0
   Brand: Gold #FDB439 | Dark #1F2933 | Brown #8B5A2B
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@700&display=swap');

:root {
  --gsr-gold:    #FDB439;
  --gsr-gold-dk: #E47B02;
  --gsr-brown:   #8B5A2B;
  --gsr-dark:    #1F2933;
  --gsr-dark-2:  #3E4C59;
  --gsr-mid:     #52606D;
  --gsr-muted:   #7B8794;
  --gsr-light:   #F3F4F7;
  --gsr-cream:   #FFFAF5;
  --gsr-white:   #FFFFFF;
  --gsr-border:  #E8E0D8;
  --gsr-radius:  10px;
  --gsr-shadow:  0 2px 12px rgba(0,0,0,0.07);
}

/* ── Wrapper ─────────────────────────────────────────────────── */
.gsr-search-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  background: var(--gsr-white);
  border: 1px solid var(--gsr-border);
  border-radius: 14px;
  box-shadow: var(--gsr-shadow);
}

/* ── Mode bar (radio buttons) ────────────────────────────────── */
.gsr-mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gsr-gold);
}
.gsr-mode-bar__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--gsr-mid);
  white-space: nowrap;
}
.gsr-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  border: 2px solid var(--gsr-border);
  background: var(--gsr-white);
  color: var(--gsr-mid);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.gsr-mode-btn input[type="radio"] { display: none; }
.gsr-mode-btn.active,
.gsr-mode-btn:has(input:checked) {
  background: var(--gsr-gold);
  border-color: var(--gsr-gold);
  color: var(--gsr-dark);
}
.gsr-mode-btn:hover:not(.active) {
  border-color: var(--gsr-gold);
  color: var(--gsr-dark);
}

/* ── Search form ─────────────────────────────────────────────── */
.gsr-search-form { margin-bottom: 0; }

.gsr-form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.gsr-form-row--controls { align-items: flex-end; }

.gsr-field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
}
.gsr-field--narrow { flex: 0 0 160px; min-width: 160px; }
.gsr-field--checkbox { flex: 0 0 auto; min-width: auto; justify-content: flex-end; padding-bottom: 4px; }
.gsr-field--submit { flex: 0 0 auto; min-width: auto; }

.gsr-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gsr-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.gsr-search-form input[type="text"],
.gsr-search-form select {
  padding: 10px 13px;
  border: 2px solid var(--gsr-border);
  border-radius: var(--gsr-radius);
  font-size: 14px;
  color: var(--gsr-dark);
  background: var(--gsr-white);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.gsr-search-form input[type="text"]:focus,
.gsr-search-form select:focus {
  border-color: var(--gsr-gold);
  box-shadow: 0 0 0 3px rgba(253,180,57,0.2);
  outline: none;
}
/* Visible dropdown arrow so users know selects are expandable */
.gsr-search-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237B8794' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Checkbox label */
.gsr-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gsr-dark-2);
  cursor: pointer;
  padding: 10px 0;
}
.gsr-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gsr-gold);
  cursor: pointer;
  flex-shrink: 0;
}

/* Search button */
.gsr-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--gsr-gold);
  color: var(--gsr-dark);
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.gsr-search-btn:hover { background: var(--gsr-gold-dk); color: #fff; }

/* ── Divider ─────────────────────────────────────────────────── */
.gsr-divider {
  border: none;
  border-top: 2px solid var(--gsr-border);
  margin: 20px 0;
}

/* ── Results header ──────────────────────────────────────────── */
.gsr-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.gsr-results-count {
  font-size: 16px;
  color: var(--gsr-dark);
}
.gsr-results-page {
  font-size: 13px;
  color: var(--gsr-muted);
}

/* ── Recipe cards ────────────────────────────────────────────── */
.gsr-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.gsr-recipe-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--gsr-white);
  border: 1px solid var(--gsr-border);
  border-radius: var(--gsr-radius);
  padding: 16px 20px;
  box-shadow: var(--gsr-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gsr-recipe-card:hover {
  border-color: var(--gsr-gold);
  box-shadow: 0 4px 16px rgba(253,180,57,0.15);
}

.gsr-recipe-card__main { flex: 1; min-width: 0; }

.gsr-recipe-card__title {
  display: block;
  font-size: 21px;
  font-weight: 700;
  font-family: 'Josefin Sans', sans-serif;
  color: var(--gsr-dark);
  text-decoration: none;
  margin-bottom: 3px;
  line-height: 1.3;
}
.gsr-recipe-card__title:hover { color: var(--gsr-brown); }

.gsr-recipe-card__author {
  font-size: 13px;
  color: var(--gsr-muted);
  margin-bottom: 8px;
}

.gsr-recipe-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.gsr-meta-item {
  font-size: 12px;
  color: var(--gsr-mid);
  background: var(--gsr-light);
  padding: 3px 9px;
  border-radius: 50px;
  white-space: nowrap;
}
.gsr-story-badge {
  background: var(--gsr-cream);
  color: var(--gsr-brown);
  border: 1px solid var(--gsr-border);
}

/* ── Stars ───────────────────────────────────────────────────── */
.gsr-recipe-card__rating { display: flex; align-items: center; gap: 4px; }
.gsr-stars { display: inline-flex; gap: 1px; }
.gsr-star { font-size: 16px; line-height: 1; }
.gsr-star--full  { color: var(--gsr-gold); }
.gsr-star--half  { color: var(--gsr-gold); opacity: 0.6; }
.gsr-star--empty { color: var(--gsr-border); }
.gsr-review-count { font-size: 12px; color: var(--gsr-muted); }
.gsr-no-rating { font-size: 12px; color: var(--gsr-muted); font-style: italic; }

/* ── View button on card ─────────────────────────────────────── */
.gsr-view-btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--gsr-gold);
  color: var(--gsr-dark);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 300;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.gsr-view-btn:hover { background: var(--gsr-gold-dk); color: #fff; }

/* ── No results / no friends ─────────────────────────────────── */
.gsr-no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--gsr-muted);
}
.gsr-no-results__icon { font-size: 48px; display: block; margin-bottom: 12px; }
.gsr-no-results p { font-size: 16px; margin: 0; }

.gsr-no-friends {
  text-align: center;
  padding: 56px 24px;
  background: var(--gsr-cream);
  border-radius: var(--gsr-radius);
  border: 1px solid var(--gsr-border);
}
.gsr-no-friends__icon { font-size: 56px; display: block; margin-bottom: 16px; }
.gsr-no-friends h3 { font-size: 20px; color: var(--gsr-dark); margin: 0 0 10px; font-family: Georgia, serif; }
.gsr-no-friends p  { font-size: 15px; color: var(--gsr-mid); margin: 0 0 24px; }

.gsr-find-friends-btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--gsr-gold);
  color: var(--gsr-dark);
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}
.gsr-find-friends-btn:hover { background: var(--gsr-gold-dk); color: #fff; }

/* ── Pagination ──────────────────────────────────────────────── */
.gsr-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--gsr-border);
}
.gsr-page-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--gsr-light);
  color: var(--gsr-dark-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  border: 1px solid var(--gsr-border);
}
.gsr-page-btn:hover { background: var(--gsr-gold); border-color: var(--gsr-gold); color: var(--gsr-dark); }
.gsr-page-btn--active { background: var(--gsr-gold); border-color: var(--gsr-gold); color: var(--gsr-dark); }
.gsr-page-btn--disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.gsr-page-ellipsis { color: var(--gsr-muted); padding: 0 4px; font-size: 14px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  .gsr-search-wrapper { padding: 16px; }
  .gsr-form-row { flex-direction: column; }
  .gsr-field, .gsr-field--narrow { min-width: 100%; }
  .gsr-mode-bar { justify-content: center; }
  .gsr-recipe-card { flex-direction: column; align-items: flex-start; }
  .gsr-recipe-card__action { width: 100%; }
  .gsr-view-btn { display: block; text-align: center; }
  .gsr-results-header { flex-direction: column; }
}

/* ── Friend cookbook banner ──────────────────────────────────── */
.gsr-friend-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--gsr-cream);
  border: 1px solid var(--gsr-border);
  border-left: 4px solid var(--gsr-gold);
  border-radius: var(--gsr-radius);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.gsr-friend-banner__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gsr-dark);
  font-family: 'Josefin Sans', sans-serif;
}
.gsr-back-link {
  font-size: 13px;
  color: var(--gsr-muted);
  text-decoration: none;
  white-space: nowrap;
}
.gsr-back-link:hover { color: var(--gsr-gold-dk); }
/* =============================================================
   FAVORITES MODE — Attribution badge  (added v2.1.0)
   ============================================================= */

.gsr-fav-attribution {
    font-size: 12px;
    color: #c0304a;
    font-weight: 600;
    margin-top: 6px;
    padding: 4px 10px;
    background: #fff0f3;
    border-radius: 20px;
    display: inline-block;
}
