/* ============================================================
   SOMEDAY BOARD (Prompt 4) — a field-guide grid of drives and
   ideas kept for later. Warm paper, deep forest; amber only on
   the saved-bookmark reward.
   ============================================================ */
.sd-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 0 0 16px;
}
.sd-toolbar[hidden] { display: none; }

.sd-sort {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--cream-200);
    border: 1px solid var(--color-border-soft);
}
.sd-sort-btn {
    border: none;
    background: transparent;
    color: var(--brown-700);
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.sd-sort-btn.is-active {
    background: var(--color-surface);
    color: var(--green-ink-800);
    box-shadow: var(--shadow-xs);
}
.sd-sort-btn:focus-visible { outline: none; box-shadow: var(--ring-primary); }

.sd-hint {
    margin: 0;
    font-size: 0.84rem;
    color: var(--color-text-muted);
}
.sd-hint a { color: var(--green-800); font-weight: 700; }

.sd-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
@media (min-width: 900px) {
    .sd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

.sd-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--duration-base) var(--ease-out),
        border-color var(--duration-base) ease,
        transform var(--duration-base) var(--ease-out),
        opacity 0.22s ease;
}
@media (hover: hover) {
    .sd-card:hover { border-color: var(--color-border); box-shadow: var(--shadow-md); transform: translateY(-2px); }
    .sd-card:hover .sd-thumb-img { transform: scale(1.03); }
}
.sd-card.is-removing {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
    pointer-events: none;
}
.sd-card--unavailable .sd-thumb { filter: grayscale(0.6); opacity: 0.72; }
.sd-card--unavailable .sd-title { color: var(--brown-500); }

.sd-thumb {
    position: relative;
    display: block;
    aspect-ratio: 8 / 5;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.sd-thumb:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--green-300); }
div.sd-thumb:not([role="button"]) { cursor: default; }
.sd-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.45s ease, transform 0.6s var(--ease-out);
}
.sd-thumb-img.is-loaded { opacity: 1; }

.sd-kind,
.sd-home,
.sd-gone {
    position: absolute;
    z-index: 1;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-kind {
    top: 10px;
    left: 10px;
    background: rgba(254, 252, 247, 0.94);
    color: var(--green-ink-800);
    box-shadow: var(--shadow-xs);
}
/* "TravelPad Pick" (Prompt 7): editorial amber, replaces the plain kind label for picks. */
.sd-pick {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--sun-100);
    color: var(--sun-600);
    border: 1px solid rgba(242, 168, 84, 0.5);
}
.sd-pick svg { color: var(--sun-500); }
.sd-home {
    bottom: 10px;
    left: 10px;
    background: rgba(26, 52, 37, 0.84);
    color: var(--cream-50);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.76rem;
}
.sd-gone {
    top: 10px;
    right: 10px;
    background: rgba(38, 32, 15, 0.72);
    color: var(--cream-50);
    text-transform: none;
    letter-spacing: 0;
}
.sd-attribution {
    position: absolute;
    right: 8px;
    top: 8px;
    max-width: 55%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
    font-size: 0.62rem;
    color: var(--cream-50);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
    opacity: 0.85;
}
.sd-attribution a { color: inherit; }

.sd-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 12px 10px;
    min-width: 0;
}
.sd-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 620;
    line-height: 1.25;
    color: var(--brown-900);
    overflow-wrap: anywhere;
}
.sd-title a,
.sd-title-btn {
    color: inherit;
    text-decoration: none;
    font: inherit;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
}
.sd-title a:hover,
.sd-title-btn:hover { color: var(--green-800); }
.sd-meta {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}
.sd-foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    margin-top: 6px;
    min-width: 0;
}
.sd-saved-on {
    font-size: 0.74rem;
    color: var(--brown-300);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-copy {
    grid-column: 1 / -1;
    justify-self: start;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--green-ink-800);
    text-decoration: none;
}
.sd-copy:hover { text-decoration: underline; }
/* C2: the card's ⋯ (.tp-icon-btn) sits where the loose bookmark used to. */
.sd-more { grid-column: 2; grid-row: 1; justify-self: end; margin: -6px -8px -6px 0; color: var(--ink-soft); }

/* Skeletons */
.sd-card--skeleton { pointer-events: none; }
.sd-card--skeleton .sd-thumb { aspect-ratio: 8 / 5; }
.sd-skel { display: block; height: 12px; margin: 6px 0; border-radius: 6px; }

/* Idea detail modal */
.sd-idea-modal { max-width: 520px; padding-top: 0; overflow: hidden; }
.sd-idea-modal .modal-close { color: var(--cream-50); background: rgba(26, 52, 37, 0.5); }
.sd-idea-photo {
    position: relative;
    height: 220px;
    margin: 0 -36px 18px;
    background:
        radial-gradient(ellipse 80% 90% at 30% 20%, rgba(140, 199, 161, 0.5), transparent),
        linear-gradient(135deg, var(--green-100), var(--cream-200));
    overflow: hidden;
}
.sd-idea-photo .sd-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sd-idea-eyebrow {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sun-600);
}
.sd-idea-where { margin: 0 0 10px; font-size: 0.86rem; color: var(--color-text-muted); }
.sd-idea-desc { margin: 0 0 18px; font-size: 0.96rem; line-height: 1.55; color: var(--brown-700); }
.sd-idea-actions { justify-content: space-between; }
.sd-idea-modal .is-success { background: var(--sun-500); }
@media (max-width: 560px) {
    .sd-idea-modal { padding: 0 20px 22px; }
    .sd-idea-photo { margin: 0 -20px 16px; height: 180px; }
}

/* "Where are you starting from?" (fork from here) */
.tp-fork-modal { max-width: 460px; }
.tp-fork-field { position: relative; margin-bottom: 14px; }
.tp-fork-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--cream-50);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--brown-900);
}
.tp-fork-input:focus { outline: none; border-color: var(--color-border-focus); box-shadow: var(--ring-primary); }
.tp-fork-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
}
.tp-fork-error { margin: 0 0 10px; }

/* Lineage line on post cards ("Forked 12 times · originally by @ava") */
.convoy-lineage {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--green-ink-800);
    font-size: 0.86rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 0;
    flex-wrap: wrap;
}
.convoy-lineage .convoy-action-icon { width: 15px; height: 15px; flex-shrink: 0; }
.convoy-lineage a { color: var(--green-800); text-decoration: none; }
.convoy-lineage a:hover { text-decoration: underline; }
.convoy-lineage-sep { color: var(--brown-300); font-weight: 500; }
.convoy-drive-hero .convoy-lineage {
    position: absolute;
    top: 12px;
    right: 14px;
    left: auto;
    max-width: calc(100% - 28px);
    justify-content: flex-end;
    color: var(--green-ink-900);
    text-shadow: 0 0 3px var(--cream-50), 0 0 6px var(--cream-50), 0 0 10px var(--cream-50);
}
.convoy-drive-hero .convoy-lineage .convoy-action-icon {
    filter: drop-shadow(0 0 2px var(--cream-50)) drop-shadow(0 0 4px var(--cream-50));
}
.convoy-drive-hero .convoy-lineage a { color: inherit; }
.convoy-drive-strip .convoy-lineage { transform: scale(0.97); transform-origin: left center; }

/* Drive view: secondary "Drive from where I am" */
.dv-from-here.is-loading { opacity: 0.7; }

/* Profile stat: "· forked 12 times" (own profile) */
.convoy-stat-static {
    font-size: 0.88rem;
    color: var(--color-text-muted);
}
.convoy-stat-static[hidden],
.convoy-forked-sep[hidden] { display: none; }

/* ------------------------------------------------------------
   Seasonal alerts for saved picks (Prompt 8): warm banners above
   the grid. A peak is a reward-like moment, so a little amber,
   kept quiet.
   ------------------------------------------------------------ */
.sd-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 16px;
}
.sd-alerts[hidden] { display: none; }
.sd-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 12px 12px 12px 14px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border-soft);
    border-left: 4px solid var(--green-300);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    animation: rise-in var(--duration-slow) var(--ease-out) both;
    transition: opacity 0.22s ease, transform 0.22s var(--ease-out);
}
.sd-alert--peak { border-left-color: var(--sun-400); background: linear-gradient(90deg, var(--sun-50), var(--color-surface) 55%); }
.sd-alert.is-leaving { opacity: 0.4; transform: translateX(6px); pointer-events: none; }
.sd-alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green-50);
    color: var(--green-700);
    flex-shrink: 0;
}
.sd-alert--peak .sd-alert-icon { background: var(--sun-100); color: var(--sun-600); }
.sd-alert-icon svg { width: 18px; height: 18px; }
.sd-alert-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-width: 0; padding-top: 5px; }
.sd-alert-text {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.45;
    color: var(--brown-900);
}
.sd-alert-actions { display: inline-flex; gap: 10px; }
.sd-alert-view,
.sd-alert-more {
    border: none;
    background: transparent;
    padding: 0;
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--green-ink-800);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: text-decoration-color var(--duration-fast) ease;
}
.sd-alert-view:hover,
.sd-alert-more:hover { text-decoration-color: currentColor; }
.sd-alert-view:focus-visible,
.sd-alert-more:focus-visible { outline: none; box-shadow: var(--ring-primary); border-radius: 4px; }
.sd-alert-more { align-self: flex-start; padding: 2px 4px; }
.sd-alert-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.sd-alert-dismiss svg { width: 16px; height: 16px; }
.sd-alert-dismiss:hover { background: var(--cream-200); color: var(--brown-900); }
.sd-alert-dismiss:focus-visible { outline: none; box-shadow: var(--ring-primary); }

/* "View" on an alert lands on the card and glows it once */
.sd-card--flash { animation: sd-flash 1.4s ease-out both; }
@keyframes sd-flash {
    0% { box-shadow: 0 0 0 0 rgba(242, 168, 84, 0.7), var(--shadow-sm); border-color: var(--sun-400); }
    60% { box-shadow: 0 0 0 8px rgba(242, 168, 84, 0), var(--shadow-sm); border-color: var(--sun-400); }
    100% { box-shadow: var(--shadow-sm); }
}
@media (max-width: 560px) {
    .sd-alert { padding: 10px 8px 10px 12px; gap: 10px; }
    .sd-alert-copy { padding-top: 3px; }
}
@media (prefers-reduced-motion: reduce) {
    .sd-alert { animation: none; transition: none; }
    .sd-card--flash { animation: none; border-color: var(--sun-400); }
}


/* C5 night forest: hardcoded day surfaces and inks follow the theme (generated from a scan, then reviewed). */
[data-theme="dark"] .sd-kind { background: var(--color-surface); }

/* C5 night forest: light inks that sit on always-dark surfaces keep their day value (the cream and pale-green tokens flip at night). */
[data-theme="dark"] .sd-home { color: #fefcf7; }
[data-theme="dark"] .sd-gone { color: #fefcf7; }
[data-theme="dark"] .sd-attribution { color: #fefcf7; }
[data-theme="dark"] .sd-idea-modal .modal-close { color: #fefcf7; }
