/* ==========================================================================
   Home page virtual-folder cards, recents, shortcuts modal.
   Owning feature: home
   Load order is defined in Views/Shared/_CssIncludes.cshtml — do not reorder.
   ========================================================================== */

/* ==========================================================================
   Root Home page (/drive/browse) — minimalist virtual-folder cards
   ========================================================================== */

/* Page wrapper — same pattern as .fh-search-container / .fh-storage-page: the
   layout's .fh-content well already supplies the page padding, gutter and
   shell cap, so the page owns only its vertical rhythm and a full-width cap. */
.fh-home-page {
  width: 100%;
  max-width: var(--fh-read-max);
  margin-inline: auto;
  min-width: 0;
}

.fh-home-page .fh-content-head-main .fh-page-title-cluster {
  flex: 0 1 auto;
}
.fh-home-page .fh-page-title {
  font-size: var(--fh-text-4xl);
  font-weight: var(--fh-weight-bold);
  letter-spacing: var(--fh-tracking-tighter);
}

/* Subtitle sits under the title inside .fh-page-title-cluster (not opposite
   the title as a space-between sibling of the toolbar). */
.fh-page-subtitle {
  margin: 0;
  font-size: var(--fh-text-sm);
  color: var(--fh-muted);
  max-width: 40rem;
  line-height: 1.4;
}

/* Sections — Quick access, then a divided Recent block (the mock's rule). */
.fh-home-section {
  margin-top: var(--fh-section-gap, 1.1rem);
}

.fh-home-section-divided {
  margin-top: calc(var(--fh-section-gap, 1.1rem) * 1.5);
  padding-top: calc(var(--fh-section-gap, 1.1rem) * 1.5);
  border-top: 1px solid var(--fh-border);
}

.fh-home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 0.9rem;
  padding-inline: var(--fh-head-inset, 0);
}

/* Small uppercase section label — same rhythm as .fh-eyebrow. */
.fh-home-section-title {
  margin: 0;
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-semibold);
  letter-spacing: var(--fh-tracking-wide);
  text-transform: uppercase;
  color: var(--fh-muted);
  line-height: var(--fh-leading-none);
}

/* Always-blue action link (not muted-until-hover). */
.fh-home-section-link {
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-medium);
  color: var(--fh-primary);
  text-decoration: none;
}

.fh-home-section-link:hover {
  text-decoration: underline;
}

/* Firm two-up launchpad grid — the roots are the page's primary navigation, so
   they get an even, prominent pair on tablet/desktop and stack full-width on
   phones. minmax(0, 1fr) keeps tracks shrinkable so long names ellipsis-
   truncate instead of forcing horizontal overflow. */
.fh-home-roots {
  display: grid;
  padding-inline: var(--fh-head-inset, 0);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--fh-section-gap, 1.1rem);
}

@media (max-width: 767.98px) {
  .fh-home-roots {
    grid-template-columns: 1fr;
  }
}

.fh-home-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.875rem 2rem;
  width: 100%;
  min-height: 6.5rem;
  background: #ffffff;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-xl, 1rem);
  color: var(--fh-text);
  text-decoration: none;
  box-shadow: var(--fh-shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.fh-home-card:hover {
  border-color: var(--fh-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
  color: var(--fh-text);
}

/* Keyboard focus must be as obvious as hover — the cards are the page's only
   interactive elements. Same two-ring treatment as the app's buttons. */
.fh-home-card:focus-visible {
  outline: none;
  border-color: var(--fh-primary, #2563eb);
  box-shadow: 0 0 0 0.1rem var(--fh-focus-halo, #fff), 0 0 0 0.25rem #258cfb;
}

.fh-home-card:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
}

/* Coarse pointers: the whole card is the tap target, so keep it comfortably
   above the 44px floor the rest of the touch UI uses. */
@media (pointer: coarse) {
  .fh-home-card {
    min-height: 6.5rem;
  }
}

.fh-home-card-icon {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--fh-radius-xl, 1rem);
  background: var(--fh-primary);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fh-text-2xl);
  color: #ffffff;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fh-home-card:hover .fh-home-card-icon {
  transform: scale(1.05);
}

/* Per-kind filled tiles — Personal/Shared blue, Department amber. */
.fh-home-card[data-kind="Personal"] .fh-home-card-icon,
.fh-home-card[data-kind="Shared"] .fh-home-card-icon {
  background: var(--fh-primary);
  color: #ffffff;
}
.fh-home-card[data-kind="Department"] .fh-home-card-icon {
  background: var(--fh-warning);
  color: #ffffff;
}

.fh-home-card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fh-home-card-name {
  font-weight: var(--fh-weight-bold);
  font-size: var(--fh-text-xl);
  letter-spacing: var(--fh-tracking-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Phones: keep the roots generous but not bulky in a single column. */
@media (max-width: 575.98px) {
  .fh-home-card {
    gap: 1rem;
    padding: 1.25rem 1.25rem;
    min-height: 5rem;
  }
  .fh-home-card-icon {
    width: 3rem;
    height: 3rem;
    font-size: var(--fh-text-xl);
  }
  .fh-home-card-name {
    font-size: var(--fh-text-lg);
  }
}

/* Wide displays: step the roots up alongside the .fh-card ladder, since rem
   values otherwise only track the root font-size clamp. */
@media (min-width: 1920px) and (max-width: 2559.98px) {
  .fh-home-card {
    padding: 2.125rem 2.25rem;
    min-height: 7rem;
  }
  .fh-home-card-icon {
    width: 3.875rem;
    height: 3.875rem;
    font-size: var(--fh-text-3xl);
  }
  .fh-home-card-name {
    font-size: var(--fh-text-2xl);
  }
}

@media (min-width: 2560px) {
  .fh-home-card {
    padding: 2.375rem 2.5rem;
    min-height: 7.75rem;
  }
  .fh-home-card-icon {
    width: 4.25rem;
    height: 4.25rem;
    font-size: var(--fh-text-3xl);
  }
  .fh-home-card-name {
    font-size: var(--fh-text-2xl);
  }
}

/* Dedicated recent grid — denser than the shared browse .fh-grid: ~5 tracks
   in the read well, single column on phones. */
.fh-home-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.65rem;
  padding-inline: var(--fh-head-inset, 0);
}

@media (max-width: 575.98px) {
  .fh-home-recent-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 576px) and (max-width: 1023.98px) {
  .fh-home-recent-grid {
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  }
}

.fh-home-recent-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-lg, 0.75rem);
  box-shadow: var(--fh-shadow-sm);
  color: var(--fh-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.fh-home-recent-card:hover {
  border-color: var(--fh-border);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
  color: var(--fh-text);
}

.fh-home-recent-card:focus-visible {
  outline: none;
  border-color: var(--fh-primary, #2563eb);
  box-shadow: 0 0 0 0.1rem var(--fh-focus-halo, #fff), 0 0 0 0.25rem #258cfb;
}

@media (pointer: coarse) {
  .fh-home-recent-card {
    min-height: 3.25rem;
  }
}

/* Extension badge — uppercase ext (files) or a folder glyph (folders). */
.fh-home-recent-badge {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--fh-radius, 0.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: var(--fh-text-2xs);
  font-weight: var(--fh-weight-bold);
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  background: var(--fh-soft);
  color: var(--fh-muted);
}

/* Type tints — scoped to the home badge, so browse .fh-card-icon.icon-* is
   never retinted. Image green to match the JPG mock; pdf/video rose;
   folder/presentation/archive amber; document blue; audio violet. */
.fh-home-page .fh-home-recent-badge.icon-image,
.fh-home-page .fh-home-recent-badge.icon-spreadsheet {
  background: rgba(var(--fh-success-rgb, 22, 163, 74), 0.12);
  color: var(--fh-success);
}
.fh-home-page .fh-home-recent-badge.icon-pdf,
.fh-home-page .fh-home-recent-badge.icon-video {
  background: rgba(var(--fh-danger-rgb, 220, 38, 38), 0.12);
  color: var(--fh-danger);
}
.fh-home-page .fh-home-recent-badge.icon-document {
  background: rgba(37, 99, 235, 0.12);
  color: var(--fh-primary);
}
.fh-home-page .fh-home-recent-badge.icon-presentation,
.fh-home-page .fh-home-recent-badge.icon-archive,
.fh-home-page .fh-home-recent-badge-folder {
  background: rgba(var(--fh-warning-rgb, 217, 119, 6), 0.12);
  color: var(--fh-warning);
}
.fh-home-page .fh-home-recent-badge.icon-audio {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}
.fh-home-page .fh-home-recent-badge-folder {
  font-size: var(--fh-text-sm);
}

.fh-home-recent-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.fh-home-recent-name {
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fh-home-recent-meta {
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keycap — shortcuts modal. */
.fh-shortcut-list kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0.12rem 0.4rem;
  background: var(--fh-soft);
  border: 1px solid var(--fh-border);
  border-bottom-width: 2px;
  border-radius: 0.375rem;
  color: var(--fh-text);
  font-family: var(--fh-font-sans);
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-semibold);
  line-height: var(--fh-leading-snug);
}

/* Shortcuts modal — one row per shortcut: keycaps left, action right. */
.fh-shortcut-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.fh-shortcut-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.fh-shortcut-keys {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--fh-muted);
  font-size: var(--fh-text-xs);
  white-space: nowrap;
}
.fh-shortcut-action {
  color: var(--fh-text);
  font-size: var(--fh-text-base);
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .fh-home-card,
  .fh-home-card-icon,
  .fh-home-recent-card {
    transition: none;
  }
  .fh-home-card:active {
    transform: none;
  }
}

