/* ==========================================================================
   MY YEAR 2026 — layout.css
   App shell, navigation, grids, page regions.
   ========================================================================== */

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) calc(var(--space-12) + var(--nav-height));
}

/* Top app bar — visible on all sizes */
.app-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(248, 247, 244, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.app-bar-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  height: 56px;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-family: var(--font-display);
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: 0;
}
.brand-name { font-size: var(--fs-md); line-height: 1; }
.brand-year { color: var(--color-accent); font-size: var(--fs-sm); }

.app-bar-spacer { flex: 1 1 auto; }

/* Network status pill */
.net-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.net-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-success);
}
.net-status.offline .dot { background: var(--color-warning); }
.net-status.offline .label-online { display: none; }
.net-status.online .label-offline { display: none; }

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  font-size: var(--fs-xs);
}
.lang-toggle button {
  padding: var(--space-1) var(--space-3);
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-toggle button.active {
  background: var(--color-primary);
  color: #fff;
}

/* Top-right icon buttons */
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--color-surface-sunken); color: var(--color-primary); }
.icon-btn svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   Bottom navigation (mobile-first)
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
  position: relative;
  min-height: 44px;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--color-primary); }
.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  background: var(--color-accent);
}
.bottom-nav a:active { color: var(--color-accent-700); }

/* --------------------------------------------------------------------------
   Page header (within main)
   -------------------------------------------------------------------------- */
.page-header {
  margin-bottom: var(--space-8);
}
.page-header .eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.page-header h1 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-2);
}
.page-header p {
  color: var(--color-text-muted);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  max-width: 60ch;
}
.page-header .actions {
  margin-top: var(--space-5);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Section
   -------------------------------------------------------------------------- */
.section {
  margin-bottom: var(--space-12);
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.section-title h2 {
  font-size: var(--fs-lg);
}
.section-title .link-action {
  font-size: var(--fs-sm);
  color: var(--color-accent-700);
  font-weight: 600;
}
.section-title .link-action:hover { color: var(--color-primary); }

/* --------------------------------------------------------------------------
   Grids
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
.grid-stats { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Year progress band */
.year-progress-band {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}
.year-progress-band .bg-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  filter: saturate(0.7);
}
.year-progress-band .inner { position: relative; z-index: 1; }
.year-progress-band .eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.year-progress-band h2 {
  color: #fff;
  font-size: var(--fs-xl);
  margin-bottom: var(--space-3);
  line-height: var(--lh-snug);
}
.year-progress-band .meta {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
}
.year-progress-band .meta strong { font-size: var(--fs-lg); display: block; color: #fff; font-family: var(--font-display); }
.year-progress-band .meta span { color: rgba(255,255,255,0.7); }
.year-progress-bar {
  margin-top: var(--space-5);
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.year-progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #E0BC7E);
  border-radius: inherit;
  transition: width var(--dur-slow) var(--ease);
}

/* --------------------------------------------------------------------------
   Settings page layout
   -------------------------------------------------------------------------- */
.settings-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.settings-section h3 {
  margin-bottom: var(--space-2);
  font-size: var(--fs-md);
}
.settings-section p { color: var(--color-text-muted); font-size: var(--fs-sm); margin-bottom: var(--space-4); }

/* --------------------------------------------------------------------------
   Print layout for Year Summary
   -------------------------------------------------------------------------- */
@media print {
  .app-bar, .bottom-nav, .page-header .actions, .no-print { display: none !important; }
  .app-main { padding: 0; max-width: none; }
  body { background: #fff; }
  .print-page { page-break-after: always; }
  .print-page:last-child { page-break-after: auto; }
}
