/* Poo Today — NHS-style layout and colours */

:root {
  --nhs-blue: #005eb8;
  --nhs-blue-dark: #003d78;
  --nhs-white: #fff;
  --nhs-black: #231f20;
  --nhs-grey-1: #425563;
  --nhs-grey-2: #768692;
  --nhs-grey-3: #aeb7bd;
  --nhs-grey-4: #d8dde0;
  --nhs-grey-5: #f0f4f5;
  --nhs-green: #007f3b;
  --focus-yellow: #ffeb3b;
  --max-width: 960px;
  --spacing: 1rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--nhs-black);
  background: var(--nhs-white);
  -webkit-font-smoothing: antialiased;
}

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--spacing);
  padding: 0.75rem 1rem;
  background: var(--nhs-blue);
  color: var(--nhs-white);
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--spacing);
  outline: 3px solid var(--focus-yellow);
  outline-offset: 2px;
}

/* Header — NHS-style blue bar */
.site-header {
  background: var(--nhs-blue);
  color: var(--nhs-white);
  padding: 1rem 0 0;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing) 1rem;
}

.site-name {
  display: inline-block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--nhs-white);
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.site-name:hover {
  text-decoration: underline;
}

.site-tagline {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.main-nav a {
  color: var(--nhs-white);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0;
  display: inline-block;
  border-bottom: 3px solid transparent;
}

.main-nav a:hover,
.main-nav a:focus {
  border-bottom-color: var(--nhs-white);
}

.main-nav a:focus {
  outline: 3px solid var(--focus-yellow);
  outline-offset: 2px;
}

/* Main content */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing) 3rem;
}

/* Hero / landing */
.hero {
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--nhs-grey-4);
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--nhs-black);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--nhs-grey-1);
  max-width: 42em;
}

/* Hero boxes (vote + National Poo Day side by side) */
.hero-boxes {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .hero-boxes {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .hero-boxes .vote-block,
  .hero-boxes .national-poo-day-callout {
    flex: 1;
    min-width: 240px;
  }
}

/* Vote block */
.vote-block {
  padding: 1.5rem;
  background: var(--nhs-grey-5);
  border: 1px solid var(--nhs-grey-4);
  border-radius: 4px;
  max-width: 28em;
}

.hero-boxes .vote-block,
.hero-boxes .national-poo-day-callout {
  max-width: none;
}

.vote-prompt {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--nhs-black);
}

.vote-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.vote-btn {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border: 2px solid var(--nhs-blue);
  border-radius: 4px;
  cursor: pointer;
  background: var(--nhs-white);
  color: var(--nhs-blue);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.vote-btn:hover {
  background: var(--nhs-blue);
  color: var(--nhs-white);
}

.vote-btn:focus {
  outline: 3px solid var(--focus-yellow);
  outline-offset: 2px;
}

.vote-btn[aria-pressed="true"] {
  background: var(--nhs-blue);
  color: var(--nhs-white);
  cursor: default;
}

.vote-btn-yes[aria-pressed="true"] {
  background: var(--nhs-green);
  border-color: var(--nhs-green);
}

.vote-btn-no[aria-pressed="true"] {
  background: var(--nhs-grey-1);
  border-color: var(--nhs-grey-1);
}

.vote-results {
  margin-bottom: 0.5rem;
}

.vote-result-line {
  margin-bottom: 0.25rem;
  color: var(--nhs-grey-1);
  font-size: 1rem;
}

.vote-count {
  font-weight: 700;
  color: var(--nhs-black);
}

.vote-note {
  font-size: 0.875rem;
  color: var(--nhs-grey-2);
  margin: 0;
}

@media (min-width: 600px) {
  .hero-title {
    font-size: 2.5rem;
  }
}

/* Featured cards (NHS-style grid) */
.featured {
  padding: 2rem 0;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: var(--nhs-white);
  border: 1px solid var(--nhs-grey-4);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--nhs-black);
  display: block;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: var(--nhs-blue);
  box-shadow: 0 4px 0 0 var(--nhs-blue);
}

.card:focus {
  outline: 3px solid var(--nhs-blue);
  outline-offset: 2px;
}

.card-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--nhs-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9375rem;
  color: var(--nhs-grey-1);
  line-height: 1.5;
}

/* National Poo Day */
.national-poo-day-banner {
  padding: 1rem var(--spacing);
  background: linear-gradient(135deg, var(--nhs-green) 0%, #004d29 100%);
  color: var(--nhs-white);
  text-align: center;
}

.national-poo-day-banner .banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.national-poo-day-banner strong {
  margin-right: 0.25rem;
}

.national-poo-day-banner .banner-emoji {
  margin-right: 0.5rem;
}

.national-poo-day-callout {
  padding: 1.5rem;
  background: var(--nhs-grey-5);
  border: 1px solid var(--nhs-grey-4);
  border-left: 4px solid var(--nhs-blue);
  border-radius: 4px;
  max-width: 28em;
}

.national-poo-day-callout .callout-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--nhs-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem 0;
}

.national-poo-day-callout p {
  margin: 0;
  color: var(--nhs-grey-1);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Callout (NHS 111 style) */
.callout {
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 4px solid var(--nhs-blue);
  background: var(--nhs-grey-5);
}

.callout-urgent {
  border-left-color: var(--nhs-green);
}

.callout-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.callout p {
  margin-bottom: 0.5rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout a {
  color: var(--nhs-blue);
  font-weight: 600;
}

.callout a:hover {
  text-decoration: underline;
}

/* Content sections */
.content-section {
  padding: 2rem 0;
  border-bottom: 1px solid var(--nhs-grey-4);
}

.content-section:last-of-type {
  border-bottom: none;
}

.content-section-alt {
  background: var(--nhs-grey-5);
  margin: 0 calc(-1 * var(--spacing));
  padding-left: var(--spacing);
  padding-right: var(--spacing);
}

.section-inner {
  max-width: 42em;
}

.content-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--nhs-black);
}

.content-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--nhs-black);
}

.content-section p {
  margin-bottom: 1rem;
  color: var(--nhs-grey-1);
}

.content-list {
  margin: 1rem 0 1rem 1.5rem;
  padding: 0;
  list-style: disc;
}

.content-list li {
  margin-bottom: 0.5rem;
  color: var(--nhs-grey-1);
}

.content-section a {
  color: var(--nhs-blue);
  font-weight: 600;
}

.content-section a:hover {
  text-decoration: underline;
}

/* Questionnaire (TCM poo health) */
.questionnaire-section .section-inner {
  max-width: 36em;
}

.form-disclaimer {
  font-size: 0.875rem;
  color: var(--nhs-grey-2);
  margin-bottom: 1.25rem;
  padding: 0.5rem 0;
}

.questionnaire-form {
  margin-top: 1rem;
}

.form-fieldset {
  border: 0;
  padding: 0 0 1.25rem;
  margin: 0 0 1.25rem;
  border-bottom: 1px solid var(--nhs-grey-4);
}

.form-fieldset:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-fieldset legend {
  font-weight: 600;
  font-size: 1rem;
  color: var(--nhs-black);
  margin-bottom: 0.5rem;
  padding: 0;
}

.radio-label {
  display: block;
  margin: 0.35rem 0 0 0;
  padding: 0.4rem 0 0 1.75rem;
  position: relative;
  font-size: 1rem;
  color: var(--nhs-grey-1);
  cursor: pointer;
}

.radio-label input {
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  cursor: pointer;
}

.radio-label:focus-within {
  color: var(--nhs-black);
}

.questionnaire-submit {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  margin-top: 0.5rem;
  background: var(--nhs-blue);
  color: var(--nhs-white);
  border: 2px solid var(--nhs-blue);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.questionnaire-submit:hover {
  background: var(--nhs-blue-dark);
  border-color: var(--nhs-blue-dark);
}

.questionnaire-submit:focus {
  outline: 3px solid var(--focus-yellow);
  outline-offset: 2px;
}

.questionnaire-result {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--nhs-grey-5);
  border: 1px solid var(--nhs-grey-4);
  border-radius: 4px;
}

.questionnaire-result[hidden] {
  display: none !important;
}

.questionnaire-result h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.result-pattern {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--nhs-black);
  margin-bottom: 0.75rem;
}

.result-pattern .pattern-name {
  display: block;
  color: var(--nhs-blue);
  margin-bottom: 0.25rem;
}

.result-advice {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--nhs-grey-1);
}

.result-advice ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.result-advice li {
  margin-bottom: 0.35rem;
}

.result-disclaimer {
  font-size: 0.8125rem;
  color: var(--nhs-grey-2);
  margin-bottom: 1rem;
}

.result-reset {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--nhs-blue);
  border: 2px solid var(--nhs-blue);
  border-radius: 4px;
  cursor: pointer;
}

.result-reset:hover {
  background: var(--nhs-blue);
  color: var(--nhs-white);
}

/* Footer */
.site-footer {
  background: var(--nhs-grey-5);
  padding: 1.75rem var(--spacing) 1.25rem;
  margin-top: 2rem;
  border-top: 1px solid var(--nhs-grey-4);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.footer-nav-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--nhs-grey-1);
  margin-right: 0.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1rem;
  margin: 0;
  padding: 0;
}

.footer-links li {
  display: inline;
}

.footer-links li::after {
  content: " · ";
  color: var(--nhs-grey-3);
  font-weight: 400;
}

.footer-links li:last-child::after {
  content: none;
}

.footer-nav a {
  color: var(--nhs-blue);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-legal {
  font-size: 0.8125rem;
  color: var(--nhs-grey-2);
  line-height: 1.5;
  margin: 0 0 0.75rem;
  max-width: 42em;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--nhs-grey-2);
  margin: 0;
}

/* Bristol Stool Chart */
.bristol-chart {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.bristol-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  background: var(--nhs-grey-5);
  border: 1px solid var(--nhs-grey-4);
  border-radius: 4px;
  text-align: center;
}

.bristol-item.bristol-healthy {
  border-color: var(--nhs-green);
  background: rgba(0, 127, 59, 0.08);
}

.bristol-type {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--nhs-black);
  margin-bottom: 0.5rem;
}

.bristol-shape {
  display: block;
  width: 40px;
  height: 24px;
  margin: 0.5rem auto;
  background: #8B7355;
  border-radius: 4px;
}

.bristol-item:nth-child(1) .bristol-shape {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6B5344;
}

.bristol-item:nth-child(2) .bristol-shape {
  width: 36px;
  height: 16px;
  border-radius: 8px;
  background: #7A6248;
}

.bristol-item:nth-child(3) .bristol-shape {
  width: 44px;
  height: 18px;
  border-radius: 6px;
  background: #8B7355;
}

.bristol-item:nth-child(4) .bristol-shape {
  width: 44px;
  height: 20px;
  border-radius: 10px;
  background: #9A7B5A;
}

.bristol-item:nth-child(5) .bristol-shape,
.bristol-item:nth-child(6) .bristol-shape,
.bristol-item:nth-child(7) .bristol-shape {
  width: 44px;
  height: 22px;
  border-radius: 50%;
  background: #A88B65;
  opacity: 0.9;
}

.bristol-item:nth-child(7) .bristol-shape {
  height: 28px;
  border-radius: 50%;
  background: #B89A70;
  opacity: 0.7;
}

.bristol-desc {
  font-size: 0.75rem;
  color: var(--nhs-grey-1);
  line-height: 1.3;
}

/* Stool colour chart */
.stool-colour-chart {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

.colour-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 0.75rem;
  background: var(--nhs-white);
  border: 1px solid var(--nhs-grey-4);
  border-radius: 4px;
}

.colour-box {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.colour-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--nhs-black);
}

.colour-note {
  font-size: 0.75rem;
  color: var(--nhs-grey-2);
  margin-top: 0.25rem;
  text-align: center;
}

.colour-disclaimer {
  font-size: 0.875rem;
  color: var(--nhs-grey-2);
  margin-top: 1rem !important;
}

@media (min-width: 600px) {
  .bristol-chart {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* AI summary section */
.ai-summary {
  margin-top: 2rem;
  padding: 1rem;
  border-top: 1px solid var(--nhs-grey-4);
}

.ai-summary details {
  font-size: 0.875rem;
  color: var(--nhs-grey-2);
}

.ai-summary summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--nhs-grey-1);
}

.ai-summary-content {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--nhs-grey-4);
}

.ai-summary-content p {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.ai-summary-content p:last-child {
  margin-bottom: 0;
}

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