/* ============================================================
 * Home / Calendar / Stream styling
 * Warm, notebook-shelf aesthetic. Soft entry animations.
 * ============================================================ */

.home-screen {
  padding: var(--spacing-m) var(--spacing-m) 88px;
  max-width: 600px;
  margin: 0 auto;
}

/* -------- hero -------- */
.hero {
  position: relative;
  padding: var(--spacing-m) 4px var(--spacing-l);
  overflow: hidden;
  isolation: isolate;
}
.hero.has-hero-bg {
  padding: 28px 24px 32px;
  margin: 0 calc(-1 * var(--spacing-m)) var(--spacing-m);
  border-radius: 0 0 24px 24px;
  min-height: 220px;
  display: flex; align-items: flex-end;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: -1;
  background-image: var(--hero-bg-url, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.9;
}
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(in srgb, var(--ui-card-bg, #fff) 5%, transparent) 40%,
    color-mix(in srgb, var(--ui-card-bg, #fff) 70%, transparent) 100%
  );
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}
.hero.has-hero-bg .hero-inner {
  background: color-mix(in srgb, var(--ui-card-bg, #fff) 70%, transparent);
  padding: 12px 16px;
  border-radius: var(--radius-m);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.hero-greeting {
  font-family: var(--typography-family-display, var(--typography-family-ja));
  font-size: var(--typography-size-l);
  font-weight: var(--typography-weight-medium);
  color: var(--text);
  line-height: 1.4;
}
.hero-greeting-main { color: var(--text-muted); }
.hero-greeting-name { color: var(--text); }
.hero-date {
  margin-top: 6px;
  display: flex; align-items: baseline; gap: var(--spacing-xs);
  color: var(--text-muted);
  font-size: var(--typography-size-s);
}
.hero-date-day {
  font-size: var(--typography-size-xl);
  font-weight: var(--typography-weight-bold);
  color: var(--primary);
}
.hero-date-dow { }
.hero-birthday-ribbon {
  margin-top: 10px;
  display: inline-flex;
  padding: 6px 14px;
  background: var(--primary);
  color: var(--ui-button-text, white);
  font-size: 13px;
  font-weight: var(--typography-weight-medium);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 40%, transparent);
  animation: birthday-ribbon-bob 2.4s ease-in-out infinite;
}
@keyframes birthday-ribbon-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* -------- today CTA -------- */
.today-cta {
  display: block;
  margin: var(--spacing-s) 0 var(--spacing-xl);
  padding: 28px 24px;
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,
    var(--primary) 0%,
    var(--secondary) 100%);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  transform: translateZ(0);
  transition: transform var(--motion-duration-normal) var(--motion-ease-out),
              box-shadow var(--motion-duration-normal) var(--motion-ease-out);
}
.today-cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at top right, rgba(255,255,255,.4) 0, transparent 60%);
  pointer-events: none;
}
.today-cta::after {
  content: '';
  position: absolute; bottom: -8px; right: -8px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}
.today-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.12); }
.today-cta:active { transform: scale(0.98); }
.today-cta-inner {
  position: relative; z-index: 1;
  display: grid; gap: 8px;
}
.today-cta-label {
  font-size: var(--typography-size-xl);
  font-weight: var(--typography-weight-bold);
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,.06);
  line-height: 1.3;
}
.today-cta-sub {
  font-size: var(--typography-size-s);
  color: rgba(255,255,255,0.9);
  line-height: 1.5;
}
.today-cta-arrow {
  position: absolute; top: 50%; right: 12px;
  transform: translateY(-50%);
  font-size: 22px;
  color: white;
  opacity: 0.7;
}
/* dark theme CTAs need dark text */
[data-theme="yozora"] .today-cta-label { color: var(--ui-button-text); }
[data-theme="yozora"] .today-cta-sub { color: rgba(27,40,56,0.8); }

/* -------- home sections -------- */
.home-section { margin-bottom: var(--spacing-xl); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--spacing-s);
  padding: 0 4px;
}
.section-head h2 {
  margin: 0;
  font-size: var(--typography-size-m);
  font-weight: var(--typography-weight-medium);
  color: var(--text);
  letter-spacing: 0.01em;
}
.section-link {
  font-size: var(--typography-size-s);
  color: var(--text-muted);
  text-decoration: none;
}
.section-link:hover { color: var(--primary); }

/* -------- mini calendar -------- */
.mini-calendar {
  background: var(--ui-card-bg);
  border-radius: var(--radius-l);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--ui-border, rgba(0,0,0,0.04));
}
.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.cal-dow > :first-child { color: color-mix(in srgb, var(--danger) 80%, var(--text-muted)); }
.cal-dow > :last-child  { color: color-mix(in srgb, var(--primary) 80%, var(--text-muted)); }
.cal-cells {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background var(--motion-duration-quick);
  overflow: hidden;
}
.cal-day {
  position: relative;
  z-index: 2;
  font-size: 11px;
  color: var(--text-muted);
  align-self: flex-start;
  padding: 2px 4px;
  line-height: 1;
}
.cal-cell.today .cal-day { color: var(--primary); font-weight: var(--typography-weight-bold); }
.cal-thumb-img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  z-index: 1;
}
.cal-cell.empty { pointer-events: none; }
.cal-cell:hover:not(.empty):not(.future) {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.cal-cell.has {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--text);
}
.cal-cell.today {
  outline: 2px solid var(--primary);
  font-weight: var(--typography-weight-bold);
}
.cal-cell.future { color: var(--text-muted); opacity: 0.4; }
.cal-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--primary);
  position: absolute; bottom: 4px;
}

/* -------- stream (recent entries) -------- */
.stream { display: grid; gap: 10px; }
.stream-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--ui-card-bg);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--ui-border, rgba(0,0,0,0.04));
  text-decoration: none;
  color: inherit;
  transition: transform var(--motion-duration-quick), box-shadow var(--motion-duration-quick);
}
.stream-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.stream-date {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 56px;
  padding: 8px 4px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-radius: 10px;
  font-family: var(--typography-family-display, var(--typography-family-ja));
}
.stream-month {
  font-size: 11px; color: var(--text-muted); line-height: 1;
}
.stream-slash { display: none; }
.stream-day {
  font-size: 22px; font-weight: var(--typography-weight-bold);
  color: var(--primary); line-height: 1.1;
}
.stream-dow {
  font-size: 10px; color: var(--text-muted); line-height: 1;
}
.stream-body {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.stream-meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
}
.stream-thumbs {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.stream-thumb {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 12%, var(--bg-soft, #f7f0ec));
  padding: 2px;
  flex: 0 0 auto;
}
.stream-thumb img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.stream-thumb-fallback {
  background: color-mix(in srgb, var(--text-muted) 18%, transparent);
}
.stream-thumb-more {
  font-size: 11px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  border-radius: 6px;
  padding: 4px 8px;
  height: 26px;
  display: inline-flex; align-items: center;
}
.stream-preview {
  font-size: var(--typography-size-s);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}
.stream-arrow {
  color: var(--text-muted); font-size: 18px;
  flex: 0 0 auto;
}

/* -------- empty state -------- */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.7; }
.empty-state-text { font-size: var(--typography-size-s); line-height: 1.7; }
.empty-state-illust { padding: 32px 16px 40px; }
.empty-state-img {
  display: block;
  width: 200px; max-width: 60vw;
  height: auto;
  margin: 0 auto 16px;
  opacity: 0.95;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.08));
}

/* ============================================================
 * Full calendar view (separate page /#/calendar)
 * ============================================================ */
.calendar-screen { max-width: 560px; margin: 0 auto; padding: var(--spacing-m) var(--spacing-m) 100px; }

/* Seasonal banner above calendar */
.cal-season-banner {
  position: relative;
  height: 120px;
  border-radius: var(--radius-l);
  overflow: hidden;
  margin-bottom: var(--spacing-m);
  background-image: var(--cal-season-url, none);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-card);
}
.cal-season-banner::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--ui-card-bg, #fff) 40%, transparent) 0%,
    transparent 60%
  );
}
.cal-season-inner {
  position: absolute;
  left: 18px; bottom: 14px;
  z-index: 1;
}
.cal-season-label {
  display: inline-block;
  padding: 4px 14px;
  background: color-mix(in srgb, var(--ui-card-bg, #fff) 88%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--radius-pill);
  color: var(--primary);
  font-family: var(--typography-family-display, var(--typography-family-ja));
  font-size: var(--typography-size-m);
  font-weight: var(--typography-weight-bold);
  letter-spacing: 0.08em;
}
.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--spacing-m);
  padding: 0 4px;
}
.calendar-nav button {
  background: transparent; border: none; color: var(--primary);
  font-size: 20px; padding: 8px 12px; cursor: pointer;
  border-radius: 8px;
}
.calendar-nav button:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.calendar-nav .cal-title {
  font-family: var(--typography-family-display, var(--typography-family-ja));
  font-size: var(--typography-size-l);
  font-weight: var(--typography-weight-bold);
  color: var(--text);
}
.big-cal {
  background: var(--ui-card-bg);
  border-radius: var(--radius-l);
  padding: 16px 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--ui-border, rgba(0,0,0,0.04));
  margin-bottom: var(--spacing-l);
}
.big-cal .cal-cells { gap: 6px; }
.big-cal .cal-cell {
  aspect-ratio: 1;
  padding: 4px 2px;
  font-size: 15px;
}
.big-cal .cal-thumbs {
  display: flex; gap: 2px;
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
}
.big-cal .cal-thumb {
  width: 12px; height: 12px; border-radius: 3px;
  background: var(--primary) no-repeat center/cover;
  opacity: 0.9;
}
