/* =============================================================
   GRANNY RECIPE DISPLAY — Full Stylesheet v2.0
   Brand: Gold #FDB439 | Dark #1F2933 | Brown #8B5A2B
   ============================================================= */

/* ── Title Card ──────────────────────────────────────────────── */
.granny-recipe-title-card {
    width: 90%;
    max-width: none;
    margin: 0 auto 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e8e0d8;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
    text-align: center;
}
.granny-recipe-title-card .granny-title {
    font-size: 36px;
    margin: 0 0 8px;
    font-weight: 700;
    color: #1F2933;
}

/* ── Average rating in title card ────────────────────────────── */
.grd-avg-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 12px;
}
.grd-avg-rating__score {
    font-size: 18px;
    font-weight: 700;
    color: #1F2933;
}
.grd-avg-rating__count {
    font-size: 13px;
    color: #7B8794;
}

/* ── Meta ────────────────────────────────────────────────────── */
.granny-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    font-size: 16px;
    color: #403732;
    margin-top: 12px;
}
.granny-meta span { display: inline-block; }

/* ── Action buttons row ──────────────────────────────────────── */
.grd-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8e0d8;
}

.grd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all 0.15s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
}
.grd-btn--edit     { background: #FDB439; color: #1F2933; border-color: #FDB439; }
.grd-btn--edit:hover { background: #E47B02; border-color: #E47B02; color: #fff; }
.grd-btn--delete   { background: #fff; color: #C62828; border-color: #C62828; }
.grd-btn--delete:hover { background: #C62828; color: #fff; }
.grd-btn--copy     { background: #1F2933; color: #FDB439; border-color: #1F2933; }
.grd-btn--copy:hover { background: #3E4C59; border-color: #3E4C59; }
.grd-btn--primary  { background: #FDB439; color: #1F2933; border-color: #FDB439; }
.grd-btn--primary:hover { background: #E47B02; border-color: #E47B02; color: #fff; }
.grd-btn--login    { background: #FDB439; color: #1F2933; border-color: #FDB439; }
.grd-btn--register { background: #fff; color: #1F2933; border-color: #1F2933; }
.grd-btn:disabled  { opacity: 0.5; cursor: not-allowed; }

/* ── Login prompt ────────────────────────────────────────────── */
.grd-login-prompt {
    font-size: 14px;
    color: #52606D;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.grd-login-prompt--reviews {
    padding: 16px;
    background: #F9F9FB;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* ── Notices ─────────────────────────────────────────────────── */
.grd-notice {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    margin: 16px auto;
    max-width: 700px;
    line-height: 1.5;
}
.grd-notice--warn  { background: #FFF8E1; color: #E65100; border-left: 4px solid #FDB439; }
.grd-notice--error { background: #FFEBEE; color: #B71C1C; border-left: 4px solid #C62828; }
.grd-notice-inline { color: #7B8794; font-size: 14px; font-style: italic; margin: 8px 0; }

/* ── Cards (ingredients / directions) ───────────────────────── */
.granny-card {
    max-width: 900px;
    margin: 10px auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e8e0d8;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}
.granny-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: #444;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}
.granny-card h2:after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 60px; height: 3px;
    background: #8b5a2b;
    border-radius: 2px;
}

/* ── Story card ──────────────────────────────────────────────── */
.granny-card.granny-recipe-story {
    width: 90%;
    max-width: none;
    margin: 20px auto;
    border-radius: 18px;
    padding: 30px;
    background: #fffaf5;
    border-left: 4px solid #8b5a2b;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
    font-style: italic;
    color: #403732;
    line-height: 1.7;
}

/* ── Ingredients ─────────────────────────────────────────────── */
.granny-recipe-ingredients p,
.granny-recipe-ingredients li { font-size: 16px; line-height: 1.65; margin: 6px 0; }
.granny-recipe-ingredients ul { list-style: none; padding-left: 0; }
.granny-recipe-ingredients li { padding-left: 24px; position: relative; }
.granny-recipe-ingredients li:before {
    content: "•"; color: #8b5a2b;
    position: absolute; left: 0;
    font-size: 1.4em; line-height: 1;
}

/* ── Directions ──────────────────────────────────────────────── */
.granny-recipe-directions p { font-size: 16px; line-height: 1.7; margin: 6px 0; }

/* ── Variations (saved by the Recipe Scanner) ───────────────── */
.granny-recipe-variations .grd-variation { padding: 12px 0; border-top: 1px solid #f0e8de; }
.granny-recipe-variations .grd-variation:first-of-type { border-top: none; padding-top: 4px; }
.granny-recipe-variations .grd-variation__name { font-size: 18px; font-weight: 700; color: #1F2933; margin: 0 0 4px; }
.granny-recipe-variations .grd-variation__text { font-size: 16px; line-height: 1.7; margin: 0; }

/* ── Stars ───────────────────────────────────────────────────── */
.grd-stars { display: inline-flex; gap: 2px; }
.grd-star  { font-size: 20px; line-height: 1; }
.grd-star--full  { color: #FDB439; }
.grd-star--half  { color: #FDB439; opacity: 0.6; }
.grd-star--empty { color: #E8E0D8; }

/* ── Reviews card ────────────────────────────────────────────── */
.grd-reviews-card {
    max-width: 900px;
    margin: 20px auto;
}

/* ── Rating summary ──────────────────────────────────────────── */
.grd-rating-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e0d8;
}
.grd-rating-summary__score {
    font-size: 48px;
    font-weight: 700;
    color: #1F2933;
    line-height: 1;
    font-family: Georgia, serif;
}
.grd-rating-summary__stars .grd-star { font-size: 28px; }
.grd-rating-summary__count { font-size: 13px; color: #7B8794; margin-top: 4px; }

/* ── Star picker (interactive) ───────────────────────────────── */
.grd-review-form { margin-bottom: 32px; }
.grd-review-form h3 { font-size: 18px; color: #1F2933; margin: 0 0 12px; }

.grd-star-picker {
    display: flex;
    align-items: center;
    gap: 4px;
}
.grd-star-pick {
    background: none;
    border: none;
    font-size: 36px;
    cursor: pointer;
    color: #E8E0D8;
    padding: 0;
    line-height: 1;
    transition: color 0.1s, transform 0.1s;
}
.grd-star-pick:hover,
.grd-star-pick.selected { color: #FDB439; transform: scale(1.15); }
.grd-star-pick__label {
    font-size: 13px;
    color: #7B8794;
    margin-left: 10px;
    font-style: italic;
}

/* ── Review form actions ─────────────────────────────────────── */
.grd-review-form__actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* ── Individual review ───────────────────────────────────────── */
.grd-reviews-list { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

.grd-review {
    background: #F9F9FB;
    border: 1px solid #e8e0d8;
    border-radius: 12px;
    padding: 18px 20px;
}
.grd-review__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.grd-review__author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.grd-review__avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1F2933, #3E4C59);
    color: #FDB439;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.grd-review__author strong { display: block; font-size: 14px; color: #1F2933; }
.grd-review__date { font-size: 12px; color: #7B8794; }
.grd-review__stars .grd-star { font-size: 16px; }
.grd-review__body { font-size: 15px; color: #3E4C59; line-height: 1.65; margin-top: 6px; }
.grd-review__mine-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    background: #FDB439;
    color: #1F2933;
    padding: 2px 10px;
    border-radius: 50px;
    font-weight: 600;
}
.grd-no-reviews { color: #7B8794; font-style: italic; font-size: 14px; margin-top: 16px; }

/* ── Toast ───────────────────────────────────────────────────── */
.grd-toast {
    position: fixed;
    bottom: 28px; right: 28px;
    background: #1F2933;
    color: #fff;
    padding: 12px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    border-left: 4px solid #FDB439;
    display: none;
}
.grd-toast--error   { border-left-color: #C62828; }
.grd-toast--success { border-left-color: #2E7D32; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .granny-recipe-title-card,
    .granny-card.granny-recipe-story { padding: 20px; }
    .granny-title { font-size: 28px; }
    .granny-meta  { gap: 12px; font-size: 14px; }
    .granny-card  { padding: 16px; border-radius: 12px; }
    .granny-card h2 { font-size: 20px; }
    .grd-actions  { flex-direction: column; align-items: stretch; }
    .grd-btn      { justify-content: center; }
    .grd-rating-summary { flex-direction: column; text-align: center; }
    .grd-review__header { flex-direction: column; align-items: flex-start; }
}

/* =============================================================
   FAVORITES — Button, Cards, Page  (added v2.1.0)
   ============================================================= */

/* ── Favorite toggle button ──────────────────────────────────── */
.grd-fav-btn {
    background: #fff;
    color: #1F2933;
    border: 2px solid #e8e0d8;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.grd-fav-btn:hover {
    border-color: #e0536a;
    color: #c0304a;
    background: #fff5f7;
}
.grd-fav-btn--active {
    background: #fff0f3;
    border-color: #e0536a;
    color: #c0304a;
}
.grd-fav-btn--active:hover { background: #ffe0e7; }
.grd-fav-btn--small { padding: 6px 12px; font-size: 13px; }
.grd-fav-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── My Favorites page ───────────────────────────────────────── */
.grd-favorites-wrap { max-width: 1100px; margin: 0 auto; padding: 10px 0 40px; }
.grd-favorites-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.grd-favorites-title { font-size: 28px; font-weight: 700; color: #1F2933; margin: 0; }
.grd-favorites-count { background: #FDB439; color: #1F2933; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 50px; }

/* ── Empty state ─────────────────────────────────────────────── */
.grd-fav-empty { text-align: center; padding: 60px 20px; background: #fff; border-radius: 16px; border: 1px solid #e8e0d8; }
.grd-fav-empty__icon { font-size: 52px; margin-bottom: 16px; }
.grd-fav-empty h3 { font-size: 22px; color: #1F2933; margin: 0 0 10px; }
.grd-fav-empty p { color: #7B8794; margin: 0 0 24px; }

/* ── Favorites grid ──────────────────────────────────────────── */
.grd-fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* ── Favorite recipe card ────────────────────────────────────── */
.grd-fav-card { background: #fff; border: 1px solid #e8e0d8; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 8px; position: relative; transition: box-shadow 0.15s; }
.grd-fav-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.09); }
.grd-fav-card__heart { position: absolute; top: 14px; right: 14px; }
.grd-fav-card__title { font-size: 17px; font-weight: 700; color: #1F2933; text-decoration: none; line-height: 1.3; padding-right: 60px; }
.grd-fav-card__title:hover { color: #E47B02; }
.grd-fav-card__author { font-size: 13px; color: #7B8794; }
.grd-fav-card__meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: #52606D; margin-top: 4px; }
.grd-fav-card__meta span { background: #F3F4F7; border-radius: 6px; padding: 3px 8px; }
.grd-fav-private-badge { background: #fff3e0 !important; color: #E47B02 !important; }
.grd-fav-card__rating { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.grd-fav-review-count { color: #7B8794; font-size: 12px; }
.grd-fav-card__link { margin-top: auto; align-self: flex-start; font-size: 13px; padding: 8px 18px; }

/* ── Pagination ──────────────────────────────────────────────── */
.grd-fav-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 36px; }
.grd-fav-page-btn { background: #FDB439; color: #1F2933; padding: 10px 22px; border-radius: 50px; font-weight: 600; font-size: 14px; text-decoration: none; transition: background 0.15s; }
.grd-fav-page-btn:hover { background: #E47B02; color: #fff; }
.grd-fav-page-info { color: #52606D; font-size: 14px; }

@media (max-width: 600px) {
    .grd-fav-grid { grid-template-columns: 1fr; }
    .grd-favorites-title { font-size: 22px; }
}
