/* =========================================================
   GoodDay — positive & inspirational daily news
   Stylesheet: warm, editorial, fully responsive
   ========================================================= */

:root {
  --cream: #fbf7ef;
  --cream-deep: #f4ecdd;
  --ink: #1f2a24;
  --ink-soft: #4d5a52;
  --ink-faint: #7d8b82;
  --green: #1f6a4d;
  --green-deep: #14503a;
  --green-soft: #e3f0e8;
  --amber: #e5a03c;
  --amber-soft: #fdf0da;
  --coral: #d9684f;
  --line: #e3dac9;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(31, 42, 36, .06), 0 4px 14px rgba(31, 42, 36, .06);
  --shadow-md: 0 10px 30px rgba(31, 42, 36, .10);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1220px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(229, 160, 60, .16), transparent 60%),
    radial-gradient(900px 500px at 0% 8%, rgba(31, 106, 77, .10), transparent 55%),
    var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); font-weight: 700; }
h3 { font-size: 1.06rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
a { color: var(--green); }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--green); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(251, 247, 239, .88);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--amber), var(--coral));
  color: #fff; font-size: 1.05rem; box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 900; }
.brand-text em { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); font-style: normal; }

.primary-nav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.primary-nav a {
  text-decoration: none; color: var(--ink-soft); font-size: .88rem; font-weight: 500;
  padding: .5rem .7rem; border-radius: 999px; transition: background .18s, color .18s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.primary-nav a:hover { background: var(--green-soft); color: var(--green-deep); }
.primary-nav i { font-size: .78rem; }

/* ---------------- Buttons ---------------- */
.btn {
  font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px; padding: .6rem 1.1rem;
  display: inline-flex; align-items: center; gap: .45rem; text-decoration: none;
  transition: transform .16s, box-shadow .16s, background .16s, color .16s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-deep); }
.btn-soft { background: var(--amber-soft); color: #8a5a10; border-color: #f0dcb6; }
.btn-soft:hover { background: #fbe4c4; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--white); color: var(--ink); }
.btn[aria-pressed="true"] { background: var(--green-soft); color: var(--green-deep); border-color: #bfdcc9; }
.btn i.fa-bookmark, .btn i.fa-solid.fa-bookmark { color: var(--amber); }

/* ---------------- Hero ---------------- */
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 1.25rem 1rem;
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 2.5rem;
  align-items: start;
}
.eyebrow {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .16em; font-weight: 700;
  color: var(--green); margin-bottom: .6rem;
}
.hero-copy h1 { margin-bottom: 1rem; }
.accent { color: var(--green); font-style: italic; }
.hero-lede { font-size: 1.06rem; color: var(--ink-soft); max-width: 60ch; margin-bottom: 1.8rem; }

.location-form {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow-md);
  display: grid; grid-template-columns: 1.2fr 1.1fr 1.1fr auto; gap: .9rem; align-items: end;
}
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field label { font-size: .76rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .02em; }
.field input, .field select, .field textarea {
  font: inherit; font-size: .92rem; color: var(--ink);
  padding: .62rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fffdf9; width: 100%; transition: border-color .16s, box-shadow .16s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 106, 77, .13);
}
.field-help { font-size: .72rem; color: var(--ink-faint); }

.feed-status { font-size: .84rem; color: var(--ink-faint); margin: .9rem 0 0; min-height: 1.2rem; }

.quick-picks { margin-top: 1.1rem; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.quick-label { font-size: .78rem; color: var(--ink-faint); font-weight: 600; }
.quick-cities { list-style: none; display: flex; gap: .4rem; margin: 0; padding: 0; flex-wrap: wrap; }
.quick-cities button {
  font: inherit; font-size: .8rem; cursor: pointer; background: var(--white);
  border: 1px solid var(--line); color: var(--ink-soft);
  padding: .32rem .75rem; border-radius: 999px;
}
.quick-cities button:hover { border-color: var(--green); color: var(--green-deep); background: var(--green-soft); }

/* ---------------- Hero aside ---------------- */
.hero-aside { display: flex; flex-direction: column; gap: 1rem; }
.spark-card {
  background: linear-gradient(150deg, var(--green-deep), #1c7a55 70%);
  color: #eaf6ef; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-md);
}
.spark-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: #a9dcbe; margin-bottom: .8rem; }
.spark-card blockquote { margin: 0 0 .9rem; font-family: var(--font-display); font-size: 1.16rem; line-height: 1.45; }
.spark-card footer { font-size: .8rem; color: #a9dcbe; margin-bottom: 1rem; }
.spark-card .btn-soft { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.28); }
.spark-card .btn-soft:hover { background: rgba(255,255,255,.24); }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem .75rem;
}
.hero-stats > div { text-align: center; }
.hero-stats dt { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; color: var(--green); }
.hero-stats dd { margin: 0; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); line-height: 1.3; }

/* ---------------- Feed sections ---------------- */
.feed-section { max-width: var(--max); margin: 0 auto; padding: clamp(2rem, 4vw, 3.2rem) 1.25rem; }
.feed-section-alt { background: var(--cream-deep); border-radius: 26px; margin-top: 1rem; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  padding-bottom: 1rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--line); flex-wrap: wrap;
}
.section-sub { font-size: .9rem; color: var(--ink-soft); margin: 0; max-width: 68ch; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.35rem; }

/* ---------------- Story card ---------------- */
.story-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.story-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-media { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--green-soft), var(--amber-soft)); }
.card-image { width: 100%; height: 100%; object-fit: cover; }
.card-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; color: var(--green); opacity: .5; }
.card-media .pill {
  position: absolute; left: .7rem; bottom: .7rem;
  background: rgba(255,255,255,.93); color: var(--green-deep);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  padding: .26rem .6rem; border-radius: 999px;
}
.card-body { padding: 1.05rem 1.1rem 1.15rem; display: flex; flex-direction: column; flex: 1; }
.card-title { margin-bottom: .45rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.card-summary { font-size: .88rem; color: var(--ink-soft); flex: 1; margin-bottom: .75rem; }
.card-meta { display: flex; align-items: center; gap: .4rem; font-size: .74rem; color: var(--ink-faint); margin-bottom: .9rem; flex-wrap: wrap; }
.dot { opacity: .6; }
.card-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.card-actions .btn { padding: .45rem .8rem; font-size: .8rem; }
.card-share { padding: .45rem .6rem !important; }

/* ---------------- Loading + empty states ---------------- */
.skeleton-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skeleton-media { aspect-ratio: 16/9; background: linear-gradient(90deg, var(--cream-deep) 25%, #ece3d3 50%, var(--cream-deep) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-line { height: .7rem; margin: .8rem 1.1rem; border-radius: 6px; background: linear-gradient(90deg, var(--cream-deep) 25%, #ece3d3 50%, var(--cream-deep) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-line.short { width: 45%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.state-message {
  grid-column: 1 / -1; background: var(--white); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; color: var(--ink-soft);
}
.state-message i { font-size: 1.6rem; color: var(--amber); display: block; margin-bottom: .6rem; }
.state-message strong { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.state-message p { margin: .4rem auto 0; max-width: 52ch; font-size: .9rem; }

/* ---------------- Kindness wall ---------------- */
.kudos-form {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-sm); margin-bottom: 1.75rem;
}
.field-row { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr; gap: .9rem; margin-top: .9rem; }
.field-emoji select { font-size: 1rem; }
.kudos-form > .btn { margin-top: 1rem; }
.form-note { font-size: .82rem; color: var(--green); margin: .7rem 0 0; min-height: 1.1rem; }
.form-note.is-error { color: var(--coral); }

.kudos-wall { list-style: none; margin: 0; padding: 0; columns: 3 260px; column-gap: 1.1rem; }
.kudos-item {
  break-inside: avoid; margin: 0 0 1.1rem; padding: 1.1rem 1.15rem;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--white);
  box-shadow: var(--shadow-sm); position: relative;
}
.kudos-item:nth-child(3n+1) { background: #fffdf7; }
.kudos-item:nth-child(3n+2) { background: #f5faf6; }
.kudos-item:nth-child(3n)   { background: #fff8f2; }
.kudos-emoji { font-size: 1.35rem; display: block; margin-bottom: .5rem; }
.kudos-text { font-size: .92rem; margin-bottom: .7rem; color: var(--ink); }
.kudos-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .75rem; color: var(--ink-faint); flex-wrap: wrap; }
.kudos-like {
  font: inherit; font-size: .75rem; cursor: pointer; border: 1px solid var(--line);
  background: var(--white); color: var(--ink-soft); border-radius: 999px; padding: .25rem .6rem;
}
.kudos-like:hover { border-color: var(--coral); color: var(--coral); }
.kudos-like[data-liked="true"] { background: #fdeae5; border-color: #f0c3b7; color: #b8462c; font-weight: 600; }

/* ---------------- Partner / advertisement ---------------- */
.partner-section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.25rem) 1.25rem clamp(2rem, 4vw, 3rem);
}
.partner-head { margin-bottom: 1.1rem; }
.partner-head h2 { margin-bottom: .2rem; }
.partner-head .eyebrow { color: var(--ink-faint); margin-bottom: .4rem; }

.partner-banner {
  display: block; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  background: #0f4030;              /* matches the banner's green so there is no flash */
  transition: transform .18s, box-shadow .18s;
}
.partner-banner:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(31, 42, 36, .16); }
.partner-banner img { width: 100%; height: auto; display: block; }

.partner-note {
  font-size: .74rem; line-height: 1.55; color: var(--ink-faint);
  margin: .85rem 0 0; max-width: 92ch;
}
.partner-note strong { color: var(--ink-soft); }

/* ---------------- Footer ---------------- */
.site-footer { margin-top: 2rem; background: var(--ink); color: #cfd8d2; padding: 2.25rem 1.25rem; }
.footer-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1.6fr; gap: 2rem; align-items: start; }
.footer-brand { font-family: var(--font-display); font-size: 1.25rem; color: #fff; font-weight: 900; margin-bottom: .3rem; }
.footer-tag { font-size: .85rem; color: #9fada5; margin: 0; }
.site-footer nav { display: flex; flex-direction: column; gap: .35rem; }
.site-footer nav a { color: #cfd8d2; text-decoration: none; font-size: .85rem; }
.site-footer nav a:hover { color: #fff; text-decoration: underline; }
.footer-note { font-size: .78rem; color: #8e9c94; margin: 0; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%);
  background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px;
  font-size: .85rem; box-shadow: var(--shadow-md); z-index: 90;
  transition: transform .3s ease; max-width: calc(100% - 2rem);
}
.toast.is-visible { transform: translate(-50%, 0); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .location-form { grid-template-columns: 1fr 1fr; }
  .location-form .btn-primary { grid-column: 1 / -1; justify-content: center; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-note { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .header-inner { padding: .6rem 1rem; }
  .brand-text em { display: none; }
  #surprise-button { padding: .5rem .8rem; font-size: .8rem; }
  .primary-nav { order: 3; width: 100%; margin-left: 0; gap: .15rem; overflow-x: auto; padding-bottom: .2rem; }
  .primary-nav a { font-size: .82rem; padding: .4rem .6rem; }
  .kudos-wall { columns: 2 220px; }
}

@media (max-width: 620px) {
  html { scroll-padding-top: 132px; }
  h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
  .hero { padding-top: 1.5rem; }
  .location-form { grid-template-columns: 1fr; padding: .95rem; }
  .field-row { grid-template-columns: 1fr; }
  .quick-picks { align-items: flex-start; flex-direction: column; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); padding: .85rem .5rem; }
  .hero-stats dt { font-size: 1.2rem; }
  .hero-stats dd { font-size: .6rem; }
  .card-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .section-head { align-items: flex-start; }
  .kudos-wall { columns: 1; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.4rem; }
  .btn { padding: .58rem 1rem; }
  .card-actions .btn { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
