/* Homepage feature carousel (users/templates/index.html):
   Journal, Habits & To-Dos, Time Log. Replaces timetracking/css/time-log-home.css.
   Without JS the slides are stacked; home-carousel.js adds .is-enhanced and turns
   the track into a one-slide-at-a-time scroll-snap row. */

.ayat-home-band--showcase { background: linear-gradient(180deg, #f5f7ff 0%, #fff 100%); border-top: 1px solid #eef0f2; border-bottom: 1px solid #eef0f2; }

/* No visible heading: the carousel region carries the accessible name (aria-label), and the slides start right at the top of the band. */
.ayat-home-showcase-band__inner { padding-top: 1.75rem; padding-bottom: 2.5rem; }
@media (max-width: 575px) {
    .ayat-home-showcase-band__inner { padding-top: 1.25rem; padding-bottom: 2rem; }
}
/* The carousel is the first band after the hero. On phones and tablets the mobile hero
   already ends with a border, so drop ours there to avoid a doubled line. */
@media (max-width: 991px) {
    .ayat-home > .ayat-home-band--showcase:first-of-type { border-top: 0; }
}

/* --- Carousel shell ----------------------------------------------------- */
.ayat-home-carousel { position: relative; display: flex; flex-direction: column; border-radius: 18px; }
/* Controls come first in the DOM (so keyboard and screen reader users meet them first) but sit under the slides. */
.ayat-home-carousel__controls { order: 2; }
/* Countdown to the next slide: full at slide start, shrinks to nothing, then the
   slide changes. home-carousel.js sets scaleX from the same clock that advances. */
.ayat-home-carousel__timer { order: 1; position: relative; height: 3px; margin: 1.1rem auto 0; width: min(100%, 22rem); border-radius: 999px; background: #e0e7ff; overflow: hidden; }
.ayat-home-carousel__timer[hidden] { display: none; }
.ayat-home-carousel__bar { position: absolute; inset: 0; border-radius: inherit; background: #6366f1; transform-origin: left center; transform: scaleX(1); will-change: transform; }
.ayat-home-carousel.is-paused .ayat-home-carousel__bar { background: #a5b4fc; }
.ayat-home-carousel.is-autoplay-off .ayat-home-carousel__timer { display: none; }
.ayat-home-carousel.is-enhanced .ayat-home-carousel__controls { margin-top: 0.6rem; }
.ayat-home-carousel:focus { outline: none; }
.ayat-home-carousel:focus-visible { outline: 3px solid #6366f1; outline-offset: 6px; }
.ayat-home-carousel__track { display: flex; flex-direction: column; gap: 2rem; }
.ayat-home-carousel__slide { min-width: 0; }

.ayat-home-carousel.is-enhanced .ayat-home-carousel__track {
    flex-direction: row; gap: 0; align-items: stretch;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ayat-home-carousel.is-enhanced .ayat-home-carousel__track::-webkit-scrollbar { display: none; }
.ayat-home-carousel.is-enhanced .ayat-home-carousel__slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; padding: 0 0.25rem; }
/* Every slide is as tall as the tallest one (the flex row stretches them), so changing slides never shifts the page. */
.ayat-home-carousel.is-enhanced .ayat-home-showcase { height: 100%; align-items: start; }
/* Top-aligned so every slide starts right at the top of the band (shorter slides leave room below, never above). */

.ayat-home-carousel__controls { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }
.ayat-home-carousel__controls[hidden] { display: none; }
.ayat-home-carousel__btn { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 1px solid #d1d5db; border-radius: 999px; background: #fff; color: #374151; cursor: pointer; }
.ayat-home-carousel__btn:hover { background: #f3f4f6; }
.ayat-home-carousel__dots { display: inline-flex; gap: 0.15rem; margin: 0 0.35rem; }
.ayat-home-carousel__dot { width: 2rem; height: 2.5rem; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; }
.ayat-home-carousel__dot::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0.7rem; height: 0.7rem; margin: -0.35rem 0 0 -0.35rem; border-radius: 999px; background: #cbd5e1; transition: width 0.2s, margin 0.2s, background 0.2s; }
.ayat-home-carousel__dot[aria-current="true"]::before { width: 1.6rem; margin-left: -0.8rem; background: #4f46e5; }
.ayat-home-carousel__btn:focus-visible, .ayat-home-carousel__dot:focus-visible { outline: 3px solid #6366f1; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .ayat-home-carousel.is-enhanced .ayat-home-carousel__track { scroll-behavior: auto; }
    .ayat-home-carousel__dot::before { transition: none; }
}

/* --- Slide layout --------------------------------------------------------- */
.ayat-home-showcase { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.ayat-home-showcase__eyebrow { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0 0 0.6rem; padding: 0.25rem 0.7rem; border-radius: 999px; background: #eef2ff; color: #4338ca; font-size: 0.8125rem; font-weight: 700; }
.ayat-home-showcase__eyebrow--journal { background: #eff6ff; color: #1d4ed8; }
.ayat-home-showcase__eyebrow--planner { background: #f5f3ff; color: #6d28d9; }
.ayat-home-showcase__title { margin: 0 0 0.75rem; font-size: 1.6rem; font-weight: 700; line-height: 1.25; color: #111827; }
.ayat-home-showcase__lead { margin: 0 0 1rem; font-size: 1rem; line-height: 1.6; color: #4b5563; }
.ayat-home-showcase__list { list-style: none; margin: 0 0 1rem; padding: 0; font-size: 0.9rem; line-height: 1.5; color: #374151; }
.ayat-home-showcase__list li { display: flex; gap: 0.5rem; }
.ayat-home-showcase__list li + li { margin-top: 0.4rem; }
.ayat-home-showcase__list .fa { margin-top: 0.25rem; color: #16a34a; }
.ayat-home-showcase__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ayat-home-timelog__free { margin: 0 0 1.25rem; padding: 0.6rem 0.85rem; border-radius: 10px; background: #fff; border: 1px dashed #c7d2fe; font-size: 0.9rem; color: #374151; }

/* --- Shared "tiny screenshot" card ------------------------------------------ */
.ayat-home-mock, .ayat-home-timelog__card { padding: 1.1rem 1.2rem 0.9rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 18px 40px rgba(30, 41, 59, 0.10); }
.ayat-home-mock__head, .ayat-home-timelog__card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; font-size: 0.85rem; font-weight: 700; color: #111827; }
.ayat-home-mock__chip { display: inline-flex; align-items: center; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.ayat-home-mock__chip--blue { background: #eff6ff; color: #1d4ed8; }
.ayat-home-mock__chip--green { background: #ecfdf5; color: #047857; }
.ayat-home-mock__chip--purple { background: #f5f3ff; color: #6d28d9; }
.ayat-home-mock__chip--amber { background: #fff7ed; color: #b45309; margin-left: auto; }

/* Journal editor */
.ayat-home-mock__toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.4rem 0.5rem; border: 1px solid #e5e7eb; border-bottom: 0; border-radius: 10px 10px 0 0; background: #f9fafb; font-size: 0.72rem; color: #4b5563; }
.ayat-home-mock__toolbar > * { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; height: 1.4rem; padding: 0 0.25rem; border-radius: 5px; background: #fff; border: 1px solid #e5e7eb; font-style: normal; text-decoration: none; }
.ayat-home-mock__toolbar i:not(.fa) { font-style: italic; }
.ayat-home-mock__toolbar u { text-decoration: underline; }
.ayat-home-mock__paper { padding: 0.8rem 0.9rem; border: 1px solid #e5e7eb; border-radius: 0 0 10px 10px; min-height: 8.5rem; }
.ayat-home-mock__entry-title { margin: 0 0 0.45rem; font-size: 0.98rem; font-weight: 700; color: #111827; }
.ayat-home-mock__entry-text { margin: 0 0 0.4rem; font-size: 0.8rem; line-height: 1.55; color: #4b5563; }
.ayat-home-mock__entry-text--faded { color: #6b7280; margin-bottom: 0; }
.ayat-home-mock__caret { display: inline-block; width: 2px; height: 0.95em; margin-left: 2px; vertical-align: -0.12em; background: #4f46e5; }
.ayat-home-mock__foot { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.8rem; font-size: 0.75rem; color: #6b7280; }
.ayat-home-mock__save { margin-left: auto; padding: 0.25rem 0.75rem; border-radius: 999px; background: #2563eb; color: #fff; font-weight: 600; }

/* Habits and to-dos */
.ayat-home-mock__label { margin: 0.2rem 0 0.4rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9ca3af; }
.ayat-home-mock__habits, .ayat-home-mock__todos { list-style: none; margin: 0 0 0.6rem; padding: 0; font-size: 0.82rem; color: #1f2937; }
.ayat-home-mock__habits li, .ayat-home-mock__todos li { display: flex; align-items: center; gap: 0.55rem; padding: 0.42rem 0.55rem; border: 1px solid #eef0f2; border-radius: 10px; }
.ayat-home-mock__habits li + li, .ayat-home-mock__todos li + li { margin-top: 0.35rem; }
.ayat-home-mock__check { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; border: 2px solid #cbd5e1; border-radius: 5px; font-size: 0.6rem; color: #fff; }
.is-done > .ayat-home-mock__check { border-color: #16a34a; background: #16a34a; }
.ayat-home-mock__todos s { color: #9ca3af; }
.ayat-home-mock__streak { margin-left: auto; font-size: 0.75rem; font-weight: 700; color: #ea580c; }
.ayat-home-mock__progress { flex: 1 1 auto; max-width: 6rem; margin-left: auto; height: 0.4rem; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.ayat-home-mock__progress > span { display: block; height: 100%; background: #7c3aed; border-radius: 999px; }
.ayat-home-mock__habits em { font-style: normal; font-size: 0.72rem; color: #6b7280; white-space: nowrap; }
.ayat-home-mock__todos .ayat-home-mock__sub { margin-left: 1.4rem; font-size: 0.78rem; color: #4b5563; }

/* Time Log (unchanged visual) */
.ayat-home-timelog__running { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: #ecfdf5; color: #047857; font-weight: 600; font-variant-numeric: tabular-nums; }
.ayat-home-timelog__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #10b981; }
.ayat-home-timelog__chart { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.ayat-home-timelog__donut { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 7.5rem; height: 7.5rem; border-radius: 50%; background: conic-gradient(#dc2626 0 38.9%, #ea580c 38.9% 74.3%, #0f766e 74.3% 78.5%, #64748b 78.5% 84.7%, #e5e7eb 84.7% 100%); }
.ayat-home-timelog__donut > span { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 4.9rem; height: 4.9rem; border-radius: 50%; background: #fff; line-height: 1.15; }
.ayat-home-timelog__donut strong { font-size: 0.9rem; color: #111827; }
.ayat-home-timelog__donut small { font-size: 0.7rem; color: #6b7280; }
.ayat-home-timelog__rows { flex: 1 1 auto; min-width: 0; list-style: none; margin: 0; padding: 0; font-size: 0.8rem; color: #374151; }
.ayat-home-timelog__rows li { display: grid; grid-template-columns: 0.7rem 4.2rem minmax(0, 1fr) 3.6rem; align-items: center; gap: 0.45rem; }
.ayat-home-timelog__rows li + li { margin-top: 0.45rem; }
.ayat-home-timelog__rows em { font-style: normal; text-align: right; color: #6b7280; font-variant-numeric: tabular-nums; }
.ayat-home-timelog__rows .ayat-home-timelog__ungrouped { font-style: italic; text-align: left; color: #374151; }
.ayat-home-timelog__swatch { width: 0.65rem; height: 0.65rem; border-radius: 50%; }
.ayat-home-timelog__bar { height: 0.45rem; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.ayat-home-timelog__bar > span { display: block; height: 100%; border-radius: 999px; }
.ayat-home-timelog__day { display: flex; height: 0.9rem; border-radius: 999px; overflow: hidden; gap: 2px; }
.ayat-home-timelog__ticks { display: flex; justify-content: space-between; margin-top: 0.3rem; font-size: 0.68rem; color: #9ca3af; }

@media (max-width: 991px) {
    .ayat-home-showcase { grid-template-columns: 1fr; gap: 1.5rem; align-content: start; }
}
@media (max-width: 575px) {
    .ayat-home-showcase__title { font-size: 1.3rem; }
    .ayat-home-timelog__chart { flex-direction: column; align-items: stretch; }
    .ayat-home-timelog__donut { margin: 0 auto; }
    .ayat-home-showcase__actions .ayat-action { flex: 1 1 100%; text-align: center; }
    .ayat-home-mock__foot { flex-wrap: wrap; gap: 0.5rem; }
}
