/* =========================================================
   FWYMI MEMO THEME (inherits FWYMI base + shared components)
   Usage:
     <link rel="stylesheet" href="/css/fwymi-themes.css" />
     <link rel="stylesheet" href="/css/fwymi-memo.css" />
     <body class="fwymi" data-theme="memo">
   ========================================================= */

/* Theme tokens: mirror "primary" but scoped to memo */
body.fwymi[data-theme="memo"] {
  /* mirror primary palette */
  --page-bg: #31445b;
  --shell-bg: #f5f5f7;
  --shell-border: #3f536c;
  --card-bg: #ffffff;
  --card-border: #d5d9e2;
  --text-main: #1f2933;
  --text-muted: #6b7280;
  --text-soft: #6b7280;
  --accent-main: #d4b27a;
  --accent-soft: #f1e0c2;
  --accent-strong: #0ea5e9;
  --accent-secondary: #3f536c;

  background: var(--page-bg);
  color: var(--text-main);
  padding: 2.5rem 1rem 3rem;
}

/* Memo shell: slightly more “document-like” than the landing page */
body.fwymi[data-theme="memo"] .shell {
  background: var(--shell-bg);
  border-radius: 26px;
  padding: 2.4rem 2.75rem 2.3rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.55);
  border: 3px solid var(--shell-border);
  position: relative;
  overflow: hidden;
}

body.fwymi[data-theme="memo"] .shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8%;
  width: 60%;
  height: 12px;
  background: var(--accent-main);
  border-radius: 0 0 999px 0;
}

/* Memo header */
body.fwymi[data-theme="memo"] header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.6rem;
}

body.fwymi[data-theme="memo"] header img.logo {
  width: 56px;
  height: auto;
  border-radius: 8px;
}

body.fwymi[data-theme="memo"] .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

body.fwymi[data-theme="memo"] h1 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-secondary);
}

body.fwymi[data-theme="memo"] .subtitle {
  margin-top: 0.55rem;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 740px;
  line-height: 1.55;
}

/* Memo body typography (readability) */
body.fwymi[data-theme="memo"] .memo {
  max-width: 860px;
  margin: 0 auto;
}

body.fwymi[data-theme="memo"] .memo h2 {
  margin-top: 2.0rem;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-secondary);
  border-bottom: 1px solid #dde2ee;
  padding-bottom: 0.4rem;
}

body.fwymi[data-theme="memo"] .memo h3 {
  margin-top: 1.35rem;
  margin-bottom: 0.45rem;
  font-size: 1.02rem;
  color: var(--accent-secondary);
}

body.fwymi[data-theme="memo"] .memo p,
body.fwymi[data-theme="memo"] .memo li {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-main);
}

body.fwymi[data-theme="memo"] .memo p.muted,
body.fwymi[data-theme="memo"] .memo .muted {
  color: var(--text-muted);
}

/* “Document” callouts */
body.fwymi[data-theme="memo"] .memo .callout {
  background: #ffffff;
  border: 1px solid #e7ebf3;
  border-left: 6px solid var(--accent-main);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

body.fwymi[data-theme="memo"] .memo .callout b {
  color: var(--accent-secondary);
}

/* Inline code */
body.fwymi[data-theme="memo"] code {
  background: #eef2f7;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  padding: 0.08rem 0.35rem;
}

/* Footer */
body.fwymi[data-theme="memo"] footer {
  margin-top: 2.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

body.fwymi[data-theme="memo"] .footer-track {
  flex: 1;
  height: 3px;
  background: #d7dde9;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

body.fwymi[data-theme="memo"] .footer-track::before {
  content: "";
  position: absolute;
  left: 0;
  width: 32%;
  top: 0;
  bottom: 0;
  background: var(--accent-main);
}

body.fwymi[data-theme="memo"] .footer-label {
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-secondary);
  color: #f9fafb;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 640px) {
  body.fwymi[data-theme="memo"] header {
    flex-direction: column;
    text-align: center;
  }
  body.fwymi[data-theme="memo"] .shell {
    padding: 1.8rem 1.4rem 2rem;
    border-radius: 20px;
  }
  body.fwymi[data-theme="memo"] h1 {
    font-size: 1.35rem;
  }
}

/* =========================================================
   Memo Library Grid + Cards (inherits Hub aesthetic)
   ========================================================= */

body.fwymi[data-theme="memo"] .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

@media (max-width: 860px) {
  body.fwymi[data-theme="memo"] .grid {
    grid-template-columns: 1fr;
  }
}

body.fwymi[data-theme="memo"] a.card {
  display: block;
  text-decoration: none;
  color: inherit;
}

body.fwymi[data-theme="memo"] .card {
  background: #ffffff;
  border: 1px solid #d5d9e2;
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

body.fwymi[data-theme="memo"] .card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

body.fwymi[data-theme="memo"] .card h3 {
  margin: 0.65rem 0 0.35rem;
  color: var(--accent-secondary);
  letter-spacing: 0.02em;
}

body.fwymi[data-theme="memo"] .card p {
  margin: 0;
  color: var(--text-muted);
}

body.fwymi[data-theme="memo"] .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}

body.fwymi[data-theme="memo"] .tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #d7dde9;
  background: #f2f5fb;
  color: #4b5563;
}

body.fwymi[data-theme="memo"] .tag.live {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: #f9fafb;
}
