/* Oikopaide Free Homeschool Tools — Shared Stylesheet (v1.0.1)
 * Extends /preview/site.css?v=2 using the live site's palette and typography.
 */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.tools-page {
  padding: 24px 0 36px;
}

.tools-page h1 {
  font-size: clamp(28px, 4.4vw, 52px);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  overflow-wrap: break-word;
}

.tools-page h2 {
  font-size: clamp(21px, 2.6vw, 30px);
  margin: 0 0 14px;
  overflow-wrap: break-word;
}

.tools-page h3 {
  font-size: 20px;
  margin: 0 0 8px;
  overflow-wrap: break-word;
}

.tools-page p {
  max-width: 68ch;
  overflow-wrap: break-word;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin: 0 0 18px;
  color: #445b50;
}

.breadcrumb a {
  font-weight: 600;
  color: var(--ink);
}

/* Hero banner */
.tools-hero {
  background: var(--sage);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: clamp(20px, 4.5vw, 48px) clamp(16px, 4vw, 40px);
  margin: 0 0 32px;
}

.tools-hero p {
  margin: 0 0 14px;
  font-size: clamp(16px, 2vw, 18px);
}

.tools-badge {
  display: inline-block;
  max-width: 100%;
  background: var(--ink);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  letter-spacing: 0.01em;
}

/* Hub grid */
.tools-section {
  margin: 34px 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
  gap: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-top: 3px solid #839777;
  border-radius: 5px;
  padding: 20px;
}

.tool-card--active {
  border-top-color: var(--ink);
}

.tool-card p {
  margin: 0;
  color: #354c43;
  font-size: 16px;
}

.tool-card .tool-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.tool-card .button {
  margin: 0;
  font-size: 15px;
  padding: 10px 16px;
  max-width: 100%;
}

.tool-status {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 4px;
  background: #eef2e8;
  color: #445b50;
  border: 1px solid var(--rule);
}

.tool-status--live {
  background: var(--sage);
  color: var(--ink);
}

/* Panels */
.tool-panel {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: clamp(16px, 3vw, 28px);
  margin: 22px 0;
  min-width: 0;
}

.tool-panel--results {
  background: var(--sage);
  border-color: #b7c5ae;
}

.tool-panel--cta {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.tool-panel--cta p {
  color: #e8efe9;
}

.tool-panel--cta .button {
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  max-width: 100%;
}

/* Form controls */
.tool-page-intro {
  margin: 0 0 18px;
}

.tool-note {
  font-size: 15px;
  color: #3f554b;
  margin: 8px 0 0;
}

.tool-field-row {
  display: grid;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid #e1e6d8;
}

.tool-field-row:last-child {
  border-bottom: 0;
}

.tool-row--gpa {
  grid-template-columns: minmax(180px, 2fr) minmax(110px, 1fr) minmax(105px, 1fr) minmax(130px, 1fr) auto;
}

.tool-row--grade {
  grid-template-columns: minmax(180px, 2fr) minmax(110px, 1fr) minmax(120px, 1fr) auto;
}

.tool-row--weighted {
  grid-template-columns: minmax(180px, 2fr) minmax(115px, 1fr) minmax(115px, 1fr) auto;
}

.tool-row--credit {
  grid-template-columns: minmax(160px, 1.8fr) minmax(120px, 1.1fr) minmax(95px, 0.8fr) minmax(180px, 1.5fr) auto;
}

.tool-row--duration {
  grid-template-columns: minmax(170px, 2fr) minmax(95px, 1fr) minmax(95px, 1fr) auto;
}

.tool-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.tool-field label,
.tool-field .field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: break-word;
}

.tool-panel input[type="text"],
.tool-panel input[type="number"],
.tool-panel input[type="date"],
.tool-panel select,
.tool-panel textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 9px 10px;
  border: 1px solid #798b7f;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
}

.tool-panel textarea {
  resize: vertical;
  min-height: 76px;
}

.tool-panel input[aria-invalid="true"],
.tool-panel select[aria-invalid="true"],
.tool-panel textarea[aria-invalid="true"] {
  border-color: #b91c1c;
  background: #fef2f2;
}

.tool-panel input:focus-visible,
.tool-panel select:focus-visible,
.tool-panel textarea:focus-visible,
.tool-panel button:focus-visible,
.tool-panel summary:focus-visible {
  outline: 3px solid #916120;
  outline-offset: 2px;
}

.tool-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 8px 0;
}

.tool-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex: none;
  accent-color: var(--ink);
}

.weekday-group {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 12px 14px;
  margin: 12px 0;
  min-width: 0;
}

.weekday-group legend {
  font-size: 14px;
  font-weight: 600;
  padding: 0 6px;
}

.weekday-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.weekday-list label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.weekday-list input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--ink);
}

.row-error {
  grid-column: 1 / -1;
  font-size: 14px;
  color: #991b1b;
  font-weight: 600;
  margin: 2px 0 0;
  overflow-wrap: break-word;
}

.row-notice {
  grid-column: 1 / -1;
  font-size: 14px;
  color: #7c4a03;
  background: #fffbeb;
  border-left: 3px solid #d97706;
  padding: 6px 10px;
  border-radius: 3px;
  margin: 2px 0 0;
  overflow-wrap: break-word;
}

/* Buttons */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 4px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
}

.tool-btn:hover {
  background: #172e26;
}

.tool-btn--secondary {
  background: #ffffff;
  color: var(--ink);
  border-color: #798b7f;
}

.tool-btn--secondary:hover {
  background: #eef2e8;
}

.tool-btn--remove {
  margin-top: 24px;
  padding: 9px 12px;
  background: #f5f3ec;
  color: var(--ink);
  border: 1px solid #9aa89e;
  font-size: 14px;
}

.tool-btn--remove:hover {
  background: #fee2e2;
  border-color: #b91c1c;
  color: #991b1b;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.preset-btn {
  font: inherit;
  font-size: 14px;
  padding: 5px 10px;
  border: 1px solid #798b7f;
  border-radius: 4px;
  background: #faf7ee;
  color: var(--ink);
  cursor: pointer;
}

.preset-btn:hover {
  background: var(--sage);
}

/* Alerts & Banners */
.tool-alert {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: break-word;
}

.tool-alert:empty {
  display: none;
}

.tool-alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-left: 4px solid #b91c1c;
}

.tool-alert--warn {
  background: #fffbeb;
  color: #7c4a03;
  border: 1px solid #fcd34d;
  border-left: 4px solid #d97706;
}

.tool-alert--info {
  background: #f0f5ef;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--ink);
}

/* Results metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 14px;
  margin: 14px 0;
}

.metric-card {
  background: #ffffff;
  border: 1px solid #b7c5ae;
  border-radius: 5px;
  padding: 16px;
  text-align: center;
  min-width: 0;
}

.metric-label {
  font-size: 14px;
  font-weight: 600;
  color: #3f554b;
}

.metric-value {
  font-family: Georgia, serif;
  font-size: clamp(26px, 4vw, 40px);
  color: var(--ink);
  line-height: 1.15;
  margin: 6px 0 4px;
  overflow-wrap: break-word;
}

.metric-sub {
  font-size: 13px;
  color: #445b50;
}

.provisional-tag {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 5px 11px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  background: #fffbeb;
  color: #7c4a03;
  border: 1px solid #d97706;
}

/* Reference tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 15px;
}

.tool-table th,
.tool-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

.tool-table thead th {
  background: #eef2e8;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Related tools internal SEO links */
.related-tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.related-tools-list a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #faf7ee;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.related-tools-list a:hover {
  background: var(--sage);
  text-decoration: underline;
}

/* Print-only structured report (hidden on screen) */
.print-summary {
  display: none;
}

/* Mobile responsiveness — 780px down to 320px */
@media (max-width: 780px) {
  .tool-row--gpa,
  .tool-row--grade,
  .tool-row--weighted,
  .tool-row--credit,
  .tool-row--duration {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-field--wide {
    grid-column: 1 / -1;
  }

  .tool-btn--remove {
    margin-top: 0;
    grid-column: 1 / -1;
    justify-self: start;
  }

  .tool-grid-2,
  .tool-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  header.masthead .mast-inner {
    padding: 12px 0;
    gap: 10px;
  }

  header.masthead .portal-brand {
    min-width: 0;
    max-width: 100%;
  }

  header.masthead .brand-type {
    min-width: 0;
  }

  header.masthead .brand-type strong {
    font-size: clamp(1.35rem, 6vw, 1.85rem);
  }

  header.masthead .brand-type > span,
  header.masthead .brand-type em {
    font-size: 0.85rem;
  }

  header.masthead .menu-inner {
    gap: 0 0.75rem;
  }

  header.masthead .menu-inner a {
    padding: 0.45rem 0.1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 520px) {
  header,
  main,
  footer,
  .mast-inner,
  .menu-inner {
    width: min(1120px, 92%);
  }

  .tools-page {
    padding: 16px 0 28px;
  }

  .tool-panel {
    padding: 14px;
  }

  .tool-card {
    padding: 16px;
  }

  .tool-row--gpa,
  .tool-row--grade,
  .tool-row--weighted,
  .tool-row--credit,
  .tool-row--duration {
    grid-template-columns: 1fr;
  }

  .tool-table th,
  .tool-table td {
    padding: 6px;
    font-size: 13px;
  }

  .tool-panel--cta .button {
    margin-right: 0;
  }
}

@media (max-width: 360px) {
  header.masthead .menu-inner {
    gap: 0 0.55rem;
  }

  header.masthead .menu-inner a {
    font-size: 0.84rem;
    padding: 0.4rem 0.05rem;
  }
}

/* Professional US Letter print stylesheet */
@page {
  size: letter;
  margin: 0.55in;
}

@media print {
  html,
  body {
    background: #ffffff !important;
    color: #16241e !important;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 10pt;
    line-height: 1.38;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  header.masthead,
  footer,
  .breadcrumb,
  .tools-page > h1,
  .tools-page > .tool-page-intro,
  .tool-actions,
  .tool-btn--remove,
  .tool-panel--cta,
  .no-print,
  .interactive-only,
  .screen-only {
    display: none !important;
  }

  main,
  .tools-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-summary {
    display: block !important;
    margin: 0;
    padding: 0;
  }

  .pr-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14pt;
    padding-bottom: 8pt;
    margin-bottom: 10pt;
    border-bottom: 2pt solid #203d33;
  }

  .pr-brand {
    display: flex;
    align-items: center;
    gap: 8pt;
  }

  .pr-brand-cap {
    width: 26pt;
    height: 26pt;
    flex: none;
    color: #203d33;
  }

  .pr-brand-name {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 15pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #203d33;
    line-height: 1.05;
  }

  .pr-brand-tagline {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 8.5pt;
    color: #445b50;
  }

  .pr-brand-url {
    font-size: 8.5pt;
    font-weight: 600;
    color: #203d33;
  }

  .pr-meta {
    text-align: right;
  }

  .pr-title {
    font-family: Georgia, serif;
    font-size: 14pt;
    font-weight: 700;
    color: #203d33;
    margin: 0 0 2pt;
    line-height: 1.15;
  }

  .pr-date {
    font-size: 8.5pt;
    color: #445b50;
    margin: 0;
  }

  .pr-banner {
    background: #fffbeb;
    border: 1pt solid #d97706;
    color: #7c4a03;
    padding: 5pt 8pt;
    font-size: 9pt;
    font-weight: 700;
    margin: 0 0 8pt;
    border-radius: 3pt;
  }

  .pr-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105pt, 1fr));
    gap: 6pt;
    margin: 0 0 10pt;
    break-inside: avoid;
  }

  .pr-metric {
    background: #f3f6ef;
    border: 0.75pt solid #b7c5ae;
    border-radius: 3pt;
    padding: 6pt 8pt;
    text-align: center;
  }

  .pr-metric-label {
    font-size: 8pt;
    font-weight: 600;
    color: #3f554b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .pr-metric-value {
    font-family: Georgia, serif;
    font-size: 15pt;
    font-weight: 700;
    color: #203d33;
    margin: 2pt 0 1pt;
    line-height: 1.1;
  }

  .pr-metric-sub {
    font-size: 7.5pt;
    color: #445b50;
  }

  .pr-section-title {
    font-family: Georgia, serif;
    font-size: 11pt;
    font-weight: 700;
    color: #203d33;
    margin: 8pt 0 4pt;
    page-break-after: avoid;
    break-after: avoid;
  }

  .print-summary table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    margin: 0 0 8pt;
  }

  .print-summary thead {
    display: table-header-group;
  }

  .print-summary tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-summary th,
  .print-summary td {
    border: 0.6pt solid #9aa89e;
    padding: 3.5pt 5pt;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
  }

  .print-summary thead th {
    background: #eef2e8;
    color: #203d33;
    font-weight: 700;
  }

  .pr-note {
    font-size: 8.5pt;
    color: #354c43;
    margin: 4pt 0;
  }

  .pr-assumptions {
    margin-top: 8pt;
    padding-top: 6pt;
    border-top: 0.75pt solid #cbd2bd;
    font-size: 8pt;
    color: #445b50;
    line-height: 1.35;
    break-inside: avoid;
  }

  .pr-assumptions p {
    margin: 2pt 0;
    max-width: none;
  }
}
