/* File: assets/css/notes.css */

/* Base & Typography */
:root{
  --bg: ;
  --ink: #1f2937;          /* slate-800 */
  --muted: #6b7280;        /* gray-500 */
  --accent: #2A9D8F;       /* D2D emerald */
  --accent-2: #F4A261;     /* D2D sunset */
  --card: #f9fafb;         /* gray-50 */
  --ring: rgba(42,157,143,0.25);
  --bubble: #ffffff;
  --shadow: 0 6px 24px rgba(2, 6, 23, 0.08), 0 1px 2px rgba(2, 6, 23, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --space: 1rem;
}

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

.notes{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding: clamp(16px, 3vw, 28px);
  line-height: 1.6;
  font-size: 16px; /* minimum 16px for readability */
}

.notes .page-header{
  margin-bottom: clamp(16px, 3vw, 28px);
  padding: clamp(12px, 2.5vw, 20px);
  background: linear-gradient(180deg, #ffffff, #fcfcfd);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notes .kicker{
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0 0 0.25rem 0;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.notes h1{
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.notes .lead{
  margin: 0.5rem 0 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.05rem);
}

.notes h2{
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin: 1.25rem 0 0.5rem 0;
}

.notes h3{
  font-size: 1rem;
  margin: 1rem 0 0.25rem 0;
}

.notes p, .notes ul, .notes ol{
  margin: 0.5rem 0;
}

.notes ul, .notes ol{
  padding-inline-start: 1.2rem; /* touch-friendly indentation */
}

.notes em { font-style: italic; }

/* Grid utilities */
.notes .grid{
  display: grid;
  gap: clamp(12px, 2vw, 18px);
  margin: 0.75rem 0;
}
.notes .grid.two{ grid-template-columns: 1fr; }
@media (min-width: 720px){
  .notes .grid.two{ grid-template-columns: 1fr 1fr; }
}

/* Table: Bubble Architecture */
.table-responsive{
  margin: 1rem 0;
  overflow-x: auto;       /* horizontal scroll on small screens */
  -webkit-overflow-scrolling: touch;
  background: transparent;
}

.table-bubble{
  width: 100%;
  border-collapse: separate;      /* required for border-radius on cells */
  border-spacing: 10px 10px;      /* even gaps between “bubbles” */
  font-size: 0.95rem;
}

.table-bubble thead th{
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #f1faf8, #ecfdf5);
  color: #0f766e;
  font-weight: 700;
  text-align: left;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15,118,110,0.15);
}

.table-bubble td{
  background: var(--bubble);
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  vertical-align: top;
  border: 1px solid rgba(2,6,23,0.06);
}

.table-bubble tr td:first-child{
  background: linear-gradient(180deg, #fff7ed, #fffbeb);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #b45309;
  font-weight: 600;
}

/* Caption styling */
.table-responsive figcaption h2{
  margin: 0 0 .5rem 0;
}

/* Lists within table cells */
.table-bubble td ul{
  margin: 0.25rem 0 0 1rem;
}

/* Excerpt block */
.excerpt blockquote{
  margin: 0.75rem 0;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-left: 6px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.excerpt .source-label{
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* Footer note */
.page-footer{
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(2,6,23,0.12);
}
.page-footer .footnote{
  color: var(--muted);
  font-size: 0.95rem;
}

/* Links (if any appear) */
.notes a{
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(42,157,143,0.35);
}
.notes a:hover{
  color: #1d776c;
  border-bottom-color: rgba(42,157,143,0.6);
}

/* Touch-friendly tap targets */
.notes button, .notes a, .notes th, .notes td{
  min-height: 44px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}
.contentReference {
  display: none !important;
}
span[class*="contentReference"],
div[class*="contentReference"] {
  display: none !important;
}

/* Table of Contents */
.toc {
  margin: 2rem 0;
  padding: 1.25rem;
  background: #fafafa;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.toc h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: #264653;
}
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc ul li {
  margin: 0.5rem 0;
}
.toc ul li a {
  color: #2A9D8F;
  text-decoration: none;
  font-weight: 500;
}
.toc ul li a:hover {
  color: #F4A261;
  text-decoration: underline;
}

/* Go to Top button */
#goTopBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2A9D8F;
  color: white;
  border: none;
  border-radius: 50%;
  padding: 12px 16px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: background 0.3s ease;
  z-index: 1000;
}
#goTopBtn:hover {
  background: #F4A261;
}

.related-links-grid {
  margin: 2.5rem 0;
}

.related-links-grid h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #264653; /* charcoal gray */
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card-link {
  background: #fafafa;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.card-link h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #2A9D8F; /* emerald green */
}

.card-link p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.card-link a {
  font-weight: 600;
  color: #F4A261; /* sunset orange */
  text-decoration: none;
}

.card-link a:hover {
  text-decoration: underline;
  color: #E76F51; /* deeper orange */
}