/* Cornell notes template — tool-specific styles (MacPlus shared.css for chrome) */

.cn-page .header-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 6px 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.cn-page .header-back-link:hover {
  border-color: var(--text-secondary);
  text-decoration: none;
}

.cn-page .page-intro {
  max-width: 42rem;
}

.cn-page .lead {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

.cn-page .guide-line {
  margin: 0.15rem 0 0.95rem;
}

.cn-page .guide-link {
  display: inline-block;
  max-width: 100%;
  padding: 0.1rem 0 0.1rem 0.7rem;
  border-left: 3px solid var(--accent);
  color: var(--accent-text);
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.45;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.cn-page .guide-link:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

.cn-page .guide-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
  box-shadow: var(--focus-ring);
}

.cn-page .privacy-line {
  margin: 0;
}

.cn-tool {
  max-width: 860px;
  margin: 0 auto 1.25rem;
}

.sheet {
  color-scheme: light;
  background: #fffcf7;
  color: #1d1d1f;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9.5rem, auto);
  gap: 0.35rem 1rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid #8aa0b8;
}

.field-topic {
  grid-column: 1 / -1;
}

.sheet label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #314152;
}

.sheet input,
.sheet textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  line-height: 1.4;
}

.sheet input {
  padding: 6px 8px;
}

.sheet input[type='text'] {
  border-bottom: 1px solid #d5dde6;
}

.field-title input {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.sheet input:focus,
.sheet textarea:focus {
  /* Negative offset keeps the 2px ring inside the field, clear of the column edge. */
  outline: 2px solid #005bb5;
  outline-offset: -4px;
}

.sheet input::placeholder,
.sheet textarea::placeholder {
  color: #4d5d6e;
}

.sheet-body {
  display: grid;
  grid-template-columns: 32% minmax(0, 1fr);
  min-height: 28rem;
}

.zone {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.zone-cues {
  border-right: 1px solid #8aa0b8;
}

.zone label {
  padding: 0.55rem 0.75rem 0;
}

.zone textarea {
  flex: 1;
  min-height: 12rem;
  resize: vertical;
  line-height: 28px;
  padding: 6px 0.75rem 0.5rem;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    #d5dde6 27px,
    #d5dde6 28px
  );
  background-position: 0 4px;
  background-attachment: local;
}

.zone-summary {
  border-top: 1px solid #8aa0b8;
}

.zone-summary textarea {
  min-height: 7rem;
}

.downloads,
.seo,
.faq,
.apps {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem 1.15rem;
  margin: 0 0 1rem;
}

.downloads h2,
.seo h2,
.faq h2,
.apps h2 {
  margin: 0 0 0.4rem;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.downloads h3 {
  margin: 0.9rem 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.downloads p,
.seo p,
.apps p,
.faq p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cn-tool button {
  font: inherit;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  cursor: pointer;
}

.cn-tool button:hover {
  border-color: var(--text-secondary);
}

.cn-tool button.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.save-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.seo h3,
.faq h3 {
  margin: 1.25rem 0 0.35rem;
  font-size: 1rem;
}

.seo ol,
.seo ul,
.apps ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.seo li,
.apps li {
  margin: 0.35rem 0;
  line-height: 1.5;
}

.faq details {
  border-top: 1px solid var(--border);
  padding: 0.7rem 0;
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details p {
  margin: 0.45rem 0 0.2rem;
}

.app-links {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 0.5rem;
}

.app-links li {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.app-links a {
  font-weight: 650;
}

.app-links span {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.cn-nav {
  margin: 0.25rem 0 0;
}

@media (max-width: 700px) {
  .sheet-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-topic {
    grid-column: 1;
  }

  .sheet-body {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .zone-cues {
    border-right: 0;
    border-bottom: 1px solid #8aa0b8;
  }

  .zone textarea {
    min-height: 9rem;
  }

  .dl-row button {
    flex: 1 1 100%;
  }
}

@media print {
  body::before,
  .site-header,
  .site-footer,
  .page-intro,
  .downloads,
  .seo,
  .faq,
  .apps,
  .save-status,
  .skip-link,
  .no-print {
    display: none !important;
  }

  body,
  main {
    margin: 0;
    padding: 0;
    max-width: none;
    background: #fff;
  }

  .cn-tool {
    max-width: none;
    margin: 0;
  }

  .sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sheet-body {
    display: grid !important;
    grid-template-columns: 32% minmax(0, 1fr) !important;
    min-height: 0;
  }

  .zone-cues {
    border-right: 1px solid #8aa0b8 !important;
    border-bottom: 0 !important;
  }

  .zone textarea {
    min-height: 0 !important;
    resize: none;
  }

  .sheet,
  .sheet textarea,
  .sheet input {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

@page {
  size: A4;
  margin: 12mm;
}
