/* =============================================
   NOTES.CSS — Notes index, category, and note pages
   ============================================= */

/* ---- NOTES HERO (index) ---- */
.notes-hero {
  padding: 80px 0 0;
  background: linear-gradient(160deg, #f8fafc 0%, #eff6ff 100%);
}
body.dark .notes-hero {
  background: linear-gradient(160deg, #0f172a 0%, #0a1f44 100%);
}
.notes-hero-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 max(8%, 24px) 72px;
}
.notes-hero-inner h1 {
  font-size: 52px; font-weight: 800;
  max-width: 680px; line-height: 1.1; margin-bottom: 20px;
}
body.dark .notes-hero-inner h1 { color: #f1f5f9; }
.notes-hero-inner p {
  font-size: 18px; opacity: 0.72;
  max-width: 580px; line-height: 1.75;
}
body.dark .notes-hero-inner p { color: #94a3b8; opacity: 1; }

/* ---- NOTES INDEX SECTION ---- */
.notes-section { padding: 64px 0 100px; }
.notes-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 max(8%, 24px);
}

/* ---- CATEGORY GRID ---- */
.notes-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.notes-cat-card {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 28px; border: 1px solid var(--color-border);
  border-radius: 18px; background: #fff;
  text-decoration: none; color: inherit;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
body.dark .notes-cat-card { border-color: #2d3f5a; background: #1a2744; }
.notes-cat-card:hover {
  border-color: #2563eb;
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(37,99,235,0.1);
}
body.dark .notes-cat-card:hover { box-shadow: 0 12px 32px rgba(37,99,235,0.18); }

.notes-cat-icon {
  font-size: 32px; flex-shrink: 0;
  line-height: 1; margin-top: 2px;
}
.notes-cat-info { flex: 1; }
.notes-cat-info h2 {
  font-size: 17px; font-weight: 800; margin-bottom: 7px;
}
body.dark .notes-cat-info h2 { color: #f1f5f9; }
.notes-cat-info p {
  font-size: 13px; opacity: 0.7;
  line-height: 1.65; margin-bottom: 14px;
}
body.dark .notes-cat-info p { color: #94a3b8; opacity: 1; }

.notes-cat-meta {
  display: flex; align-items: center;
  justify-content: space-between;
}
.notes-cat-count {
  font-size: 12px; color: #2563eb;
  font-weight: 600;
}
.notes-cat-arrow {
  font-size: 16px; opacity: 0.35;
  transition: opacity 0.2s, transform 0.2s;
}
.notes-cat-card:hover .notes-cat-arrow {
  opacity: 1; transform: translateX(4px);
}

/* =============================================
   CATEGORY PAGE
   ============================================= */
.notes-cat-hero {
  padding: 48px 0 0;
  background: linear-gradient(160deg, #f8fafc 0%, #eff6ff 100%);
}
body.dark .notes-cat-hero {
  background: linear-gradient(160deg, #0f172a 0%, #0a1f44 100%);
}
.notes-cat-hero-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 max(8%, 24px) 56px;
}

.notes-breadcrumb {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: #2563eb; margin-bottom: 24px;
  text-decoration: none; transition: opacity 0.2s;
}
.notes-breadcrumb:hover { opacity: 0.75; }

.notes-cat-hero-meta {
  display: flex; gap: 20px; align-items: flex-start;
}
.notes-cat-hero-icon {
  font-size: 48px; flex-shrink: 0; line-height: 1;
}
.notes-cat-hero-meta h1 {
  font-size: 42px; font-weight: 800;
  line-height: 1.1; margin-bottom: 10px;
}
body.dark .notes-cat-hero-meta h1 { color: #f1f5f9; }
.notes-cat-hero-meta p {
  font-size: 16px; opacity: 0.7; max-width: 520px;
}
body.dark .notes-cat-hero-meta p { color: #94a3b8; opacity: 1; }

/* LIST */
.notes-list-section { padding: 48px 0 100px; }
.notes-list-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 max(8%, 24px);
}

.notes-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.notes-list-card {
  display: flex; flex-direction: column;
  padding: 24px 28px; border: 1px solid var(--color-border);
  border-radius: 16px; background: #fff;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  gap: 10px;
}
body.dark .notes-list-card { border-color: #2d3f5a; background: #1a2744; }
.notes-list-card:hover { border-color: #2563eb; transform: translateY(-3px); }

.notes-list-card-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px;
}
.notes-list-card h2 {
  font-size: 16px; font-weight: 800;
  line-height: 1.3; flex: 1;
}
body.dark .notes-list-card h2 { color: #f1f5f9; }
.notes-list-date {
  font-size: 11px; opacity: 0.5;
  white-space: nowrap; margin-top: 2px; flex-shrink: 0;
}
body.dark .notes-list-date { color: #64748b; opacity: 1; }

.notes-list-card > p {
  font-size: 13px; opacity: 0.7;
  line-height: 1.65; flex: 1;
}
body.dark .notes-list-card > p { color: #94a3b8; opacity: 1; }

.notes-list-card-footer {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: 4px;
}
.notes-item-count {
  font-size: 12px; color: #2563eb; font-weight: 600;
}
.notes-list-arrow { font-size: 16px; opacity: 0.35; }
.notes-list-card:hover .notes-list-arrow { opacity: 1; }

/* =============================================
   INDIVIDUAL NOTE PAGE
   ============================================= */
.note-main { padding-bottom: 80px; }

/* ---- NOTE HEADER ---- */
.note-header-wrap {
  background: linear-gradient(160deg, #f8fafc 0%, #eff6ff 100%);
  padding: 48px 0 56px;
}
body.dark .note-header-wrap {
  background: linear-gradient(160deg, #0f172a 0%, #0a1f44 100%);
}
.note-header-inner {
  max-width: 860px; margin: 0 auto;
  padding: 0 max(8%, 24px);
}

.note-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; margin-bottom: 20px;
  flex-wrap: wrap;
}
.note-breadcrumb a {
  color: #2563eb; font-weight: 600;
  text-decoration: none; transition: opacity 0.2s;
}
.note-breadcrumb a:hover { opacity: 0.7; }
.note-breadcrumb span[aria-hidden] { opacity: 0.4; font-size: 16px; }
.note-breadcrumb span:last-child { opacity: 0.6; }

.note-title {
  font-size: 42px; font-weight: 800;
  line-height: 1.15; margin-bottom: 16px;
}
body.dark .note-title { color: #f1f5f9; }

.note-subtitle {
  font-size: 17px; opacity: 0.72;
  line-height: 1.75; max-width: 680px;
  margin-bottom: 24px;
}
body.dark .note-subtitle { color: #94a3b8; opacity: 1; }

.note-meta-row {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.note-meta-cat {
  font-size: 12px; font-weight: 700;
  background: #eff6ff; color: #1d4ed8;
  padding: 4px 12px; border-radius: 20px;
}
body.dark .note-meta-cat { background: #1e3a5f; color: #93c5fd; }
.note-meta-date {
  font-size: 12px; opacity: 0.55; font-weight: 500;
}
body.dark .note-meta-date { color: #64748b; opacity: 1; }
.note-meta-count {
  font-size: 12px; color: #2563eb; font-weight: 600;
}

/* ---- NOTE BODY ---- */
.note-body-wrap { padding: 56px 0 0; }
.note-body-inner {
  max-width: 860px; margin: 0 auto;
  padding: 0 max(8%, 24px);
}

/* ---- ITEM ---- */
.note-item {
  padding: 0 0 52px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 52px;
}
body.dark .note-item { border-color: #2d3f5a; }
.note-item:last-of-type { border-bottom: none; }

.note-item-header { margin-bottom: 28px; }

.note-item-name {
  font-size: 24px; font-weight: 800;
  margin-bottom: 12px; color: #0f172a;
}
body.dark .note-item-name { color: #f1f5f9; }

.note-item-desc {
  font-size: 15px; line-height: 1.85;
  opacity: 0.82; max-width: 720px;
}
body.dark .note-item-desc { color: #cbd5e1; opacity: 1; }
.note-item-desc strong { color: #2563eb; font-weight: 700; }

/* ---- HOW-TO BLOCK ---- */
.note-how-block {
  margin-bottom: 28px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
body.dark .note-how-block { border-color: #2d3f5a; background: #111827; }

.note-how-label-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--color-border);
}
body.dark .note-how-label-row {
  background: #1e293b; border-color: #2d3f5a;
}

.note-how-label {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; opacity: 0.65;
  color: #374151;
}
body.dark .note-how-label { color: #94a3b8; opacity: 1; }

/* ---- COPY BUTTON ---- */
.note-copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: #2563eb; background: transparent;
  border: 1.5px solid #2563eb30; border-radius: 8px;
  padding: 5px 12px; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
}
.note-copy-btn svg {
  width: 13px; height: 13px; flex-shrink: 0;
}
.note-copy-btn:hover {
  background: #eff6ff; border-color: #2563eb;
}
body.dark .note-copy-btn {
  color: #60a5fa; border-color: #60a5fa30;
}
body.dark .note-copy-btn:hover {
  background: #1e3a5f; border-color: #60a5fa;
}
.note-copy-btn.copied {
  color: #16a34a; border-color: #16a34a;
  background: #f0fdf4;
}
body.dark .note-copy-btn.copied {
  color: #4ade80; border-color: #4ade80;
  background: #14532d20;
}

/* ---- CODE BLOCK ---- */
.note-code {
  margin: 0; padding: 20px 22px;
  font-size: 13.5px; line-height: 1.7;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  overflow-x: auto; background: #0f172a; color: #e2e8f0;
  border-radius: 0;
  -webkit-overflow-scrolling: touch;
}
body.dark .note-code { background: #020617; }
.note-code code { background: none; padding: 0; font-size: inherit; }

/* ---- HOW IT WORKS ---- */
.note-how-works {
  padding: 14px 18px 18px;
  font-size: 13.5px; line-height: 1.8;
  opacity: 0.8; color: #374151;
  border-top: 1px solid var(--color-border);
  background: #fafbfc;
}
body.dark .note-how-works {
  color: #94a3b8; opacity: 1;
  border-color: #2d3f5a; background: #0f172a;
}
.note-how-works code {
  font-size: 12.5px;
  background: #e2e8f0; color: #1e293b;
  padding: 1px 6px; border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}
body.dark .note-how-works code {
  background: #1e293b; color: #93c5fd;
}

/* ---- RECOMMENDATIONS ---- */
#recommendations {
  margin-top: 56px; padding-top: 40px;
  border-top: 1px solid var(--color-border);
}
body.dark #recommendations { border-color: #2d3f5a; }
.recommendations-title {
  font-size: 14px; font-weight: 800;
  letter-spacing: 2px; opacity: 0.5;
  text-transform: uppercase; margin-bottom: 20px;
}
body.dark .recommendations-title { color: #94a3b8; opacity: 1; }
.recommendations-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.rec-card {
  padding: 18px; border: 1px solid var(--color-border);
  border-radius: 12px; text-decoration: none;
  color: inherit; transition: border-color 0.2s;
  display: flex; flex-direction: column; gap: 6px;
}
body.dark .rec-card { border-color: #2d3f5a; background: #1a2744; }
.rec-card:hover { border-color: #2563eb; }
.rec-card-cat {
  font-size: 11px; font-weight: 700;
  color: #2563eb; opacity: 0.8;
}
body.dark .rec-card-cat { color: #60a5fa; }
.rec-card-title {
  font-size: 13px; font-weight: 700;
  line-height: 1.4;
}
body.dark .rec-card-title { color: #e2e8f0; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .notes-categories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .notes-hero-inner h1 { font-size: 36px; }
  .notes-cat-hero-meta { flex-direction: column; gap: 12px; }
  .notes-cat-hero-meta h1 { font-size: 32px; }
  .notes-cat-hero-icon { font-size: 36px; }
  .note-title { font-size: 30px; }
  .notes-list-grid { grid-template-columns: 1fr; }
  .recommendations-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .notes-categories-grid { grid-template-columns: 1fr; }
  .note-code { font-size: 12px; padding: 16px; }
}