
html {
  font-size: clamp(17px, 1.5vw, 18px);
}

body {
  font-family: Garamond, serif;
  background-color: white;
  color: #333333;
  margin: 0;
  padding: 0;
}

/* fonts */

.page-title {
  font-size: 2.25rem;
  text-align: center;
  margin-top: 40px;
  margin-bottom: 40px;
}

.subtitle {
  font-size: 1.5rem;
  text-align: center;
  margin: 20px auto;
  margin-bottom: 40px;
  max-width: 60ch; 
  padding: 0 10px;
}

.heading {
  font-size: 1.75rem;
  margin-top: 30px;
}

.subheading {
  font-size: 1.5rem;
  text-align: left;
  margin-bottom: 40px; 
  padding: 0;
  margin-top: 20px;
  font-weight: normal;
}

.section-heading {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.text-c {
  font-size: 1.2rem;
  line-height: 1.6;
  text-align: center;
  margin: 2em auto;
  min-height: 1.6em; /* forces height to match line height */
}

.text-l {
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: 2em;
  text-align: left;
}

.text-l-s {
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: 2em;
  text-align: left;
  font-weight: 600;
}

.text-3 {
  font-size: 0.8rem;
  line-height: 1.3;
  margin-bottom: 2em;
  text-align: left;
}

.download-tile p {
  text-align: center;
}


.subnote {
  font-size: 1.1rem;
  line-height: 1.3;
  margin-bottom: 1em;
  text-align: left;
}

h3.text-l {
  font-weight: 600;
}

.center-note {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.left-note {
  text-align: left;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.center-note1 {
  text-align: center;
  margin: 1rem auto;
  font-size: 1.5rem;
  line-height: 1.4;
  max-width: 60ch;
}

.section-nudge {
  text-align: center;
  font-size: 0.95rem;
  margin: 3em 0;
}

.nudge-link {
  display: inline-block;
  margin-left: 1px;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: #e4f2dc;
  color: inherit;
  text-decoration: none;
  font-weight: 600;              /* ← add this */
  transition: background-color 0.2s ease, transform 0.15s ease;
}


.nudge-link:hover {
  background-color: #d6ebc9;
  transform: translateY(-1px);
}

nav {
  text-align: center;
  padding: 20px 0;
  font-size: 1.1rem;
}

nav a {
  text-decoration: none;
  color: #333333;
  margin: 8px 15px; /* adds vertical spacing between wrapped items */
  display: inline-block; /* ensures margin applies reliably */
}

.container {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 20px;
}

.image-responsive,
.image-small,
.image-centered {
  max-width: 600px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.image-fixed-400 {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 400px;
  height: auto;
}

.image-fixed-600 {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 600px;
  height: auto;
}

.image-box {
  width: 100%;
  max-width: 800px;
  height: auto;
  display: block;
  margin: 0 auto 60px auto;
}

img.comic-panel {
  display: block;
  max-width: 300px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid #b8d5aa;           /* same as .panel border for consistency */
  padding: 4px;
  background-color: #d1e5c2;           /* a soft green to replace the white edge */
}

.panel p {
  text-align: center;
  margin-top: 0.5em;
  font-size: 0.9em;
  color: #555;
}

.contact-section {
  text-align: center;
  margin: 3rem auto;
}

.contact-section p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  font-family: 'Cormorant Garamond', serif;
}

.contact-inner {
  display: block;
  text-align: center;
}

.contact-section a.button-green {
  display: flex;
  justify-content: center;    /* center horizontally */
  align-items: center;        /* center vertically */
  height: 4rem;               /* or whatever works for your layout */
  padding: 0 2rem;            /* horizontal padding only */
  text-align: center;
  background-color: #e4f1dd;
  border-radius: 12px;
  font-size: 1.2rem;
  color: #333;
  text-decoration: none;
  margin: 1.5rem auto 0 auto;
  max-width: 300px;
}

.comic-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2em;
}

.panel {
  background-color: #e4f1dd;
  border: 1px solid #b8d5aa;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  padding: 0.5em;
  margin: 1.5em;
  width: 330px;            /* fixed width */
  min-height: 500px;
  flex: 0 0 auto;          /* prevent stretching */
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.comic-panel {
  display: block;
  width: 300px;         /* fixed image width on desktop */
  max-width: 100%;      /* allow it to shrink on mobile */
  height: auto;
  margin: 0 auto;
  flex-shrink: 0;       /* prevents flexbox from shrinking it */
}


@media (min-width: 1024px) {
  .panel {
    max-width: 60%;
  }
}

.panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.panel img {
  max-width: 300px;
}

@media (max-width: 1024px) {
  .comic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .comic-grid {
    grid-template-columns: 1fr;
  }

  .panel img {
    width: 100%;
  }
}

.unlock-banner {
  background: #e4f1dd;
  border: 1px solid #b8d5aa;
  padding: 1em;
  text-align: center;
  font-weight: bold;
  margin-bottom: 2em;
  font-size: 1.1em;
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
}

.email-form {
  text-align: center;
  margin-bottom: 2em;
}

.email-form input[type="email"] {
  padding: 0.5em;
  width: 250px;
}

.email-form button {
  width: 120px;
  background-color: #e4f1dd;
  color: #333333;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.email-form button:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.email-form .form-message {
  margin-top: 0.5em;
  font-size: 0.9em;
  color: green;
}

.cookie-note {
  font-size: 0.8em;
  color: #666;
}

.locked-button {
  display: inline-block;
  position: relative;
  background: #ddd;
  color: #333;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: not-allowed;
  font-weight: bold;
}

.hover-tooltip {
  display: none;
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.85em;
  z-index: 100;
}

.locked-button:hover .hover-tooltip {
  display: block;
}

.download-label {
  font-size: 1rem;
  margin-bottom: 10px;
}

/* Image preview styling */

.download-tile img {
  width: 100%;
  max-width: 220px;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fafafa;
}

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* force 3 per row */
  gap: 24px;
  justify-items: center;
  padding: 20px 0;
  max-width: 1100px;
  margin: 0 auto;
}

/* Force 2 per row on mid screens */
@media (max-width: 1024px) {
  .downloads-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 per row, center aligned, on mobile */
@media (max-width: 600px) {
  .downloads-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.download-tile img.thumbnail {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 10px;
  border: 1px solid #ccc;
  background-color: #fefefe;
  border-radius: 4px;
  object-fit: contain;
}

.download-tile {
  background-color: #e4f1dd; /* or your pale green if preferred */
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  width: 220px;
  margin: 1rem;
  box-shadow: none;
  transition: none;
}

.download-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
}

.thumbnail-link {
  display: inline-block;
  text-decoration: none;
}

.thumbnail {
  width: 100%;
  max-width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  object-fit: contain;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); /* permanent shadow */
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.thumbnail:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); /* double shadow on hover */
  transform: translateY(-2px); /* slight lift */
}

.thumbnail-locked img {
  opacity: 0.6;
  cursor: not-allowed;
}
.thumbnail-locked:hover img {
  opacity: 1;
}

.button-green {
  width: 300px;
  min-height: 100px;
  background-color: #e4f1dd;
  color: #333333;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  padding: 1rem 2rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.button-green:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.button-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

@media screen and (max-width: 600px) {
  .button-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .button-green {
    width: 90%;
    min-height: 120px; /* gives enough vertical room for wrapped text */
    padding: 1.2rem;
  }
}

/* recipe page specific styling */

.recipe-box {
  background-color: #fff;
  padding: 1.5rem;
  margin-bottom: 3rem;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.recipe-title {
  font-size: 1.8rem;
  margin-top: 1rem;
  margin-bottom: 0.5em;
  font-weight: normal;
}

.recipe-intro {
  font-size: 1.2rem;
  color: #444;
  margin-bottom: 1.5em;
  font-style: normal;
}

.ingredient-list {
  padding-left: 1.5rem;
  margin-bottom: 2rem;
  list-style-type: disc;
}

.ingredient-list li {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.method-text {
  font-size: 1.1rem;
  line-height: 1.6;
}

.recipe-subheading {
  font-size: 1.2rem;       /* matches text-l size */
  font-weight: 600;        /* bold but not too heavy */
  margin-top: 2rem;        /* spacing above each section */
  margin-bottom: 0.75rem;  /* tighter spacing to following text */
  line-height: 1.3;        /* consistent vertical rhythm */
  text-align: left;        /* match paragraph alignment */
}


/* === Books Section === */

/* Grid container for all books */
.book-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 1rem;
}

/* Individual book block */
.book-container {
  background-color: #e1f1da;
  border-radius: 1rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  padding: 1.5rem;
  flex: 1 1 320px;
  max-width: 400px;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Book title */
.book-container h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.amazon-links-container {
  margin-top: 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.amazon-links-container a {
  display: inline-block;
  text-align: center;
  width: fit-content;
}

/* “Select your region” heading */
.region-heading {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

/* Button container */
.region-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

/* Each button */
.region-button {
  display: inline-block;
  background-color: #e6f5e6;
  border-radius: 0.75rem;
  padding: 0.4rem 1rem;
  width: 160px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
  transition: background-color 0.3s;
  line-height: 1.1;
  margin: 0;
}

.region-buttons-with-return {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

/* Button hover */
.region-button:hover {
  background-color: #d2ecd2;
}

/* Subtext inside buttons */
.region-button small {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Stack book panels on tablets & phones */
@media (max-width: 768px) {
  .book-grid {
    flex-direction: column;
    align-items: center;
  }

  .book-container {
    max-width: 90%;
  }
}

/* Stack buttons and make image responsive on small screens */
@media (max-width: 600px) {
  .book-cover {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .region-buttons {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .region-button {
    width: 90%;
    max-width: 300px;
  }
}

.click-instruction {
  position: absolute;
  top: -0.2rem;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  font-style: italic;
  color: #333333;
  padding: 0;
  z-index: 2;
  background: none;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .click-instruction {
    margin-bottom: 0.75rem;
  }
}

/* Optional hover enhancement for desktop */
.book-cover:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.book-cover a {
  display: block;
}

.book-cover a img {
  display: block;
  width: 100%;
}

.return-to-books-button {
  display: inline-block;
  background-color: #e1f1da;
  color: #2f4f2f;
  padding: 0.8rem 1.5rem;
  margin: 2rem auto 0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  transition: background-color 0.3s ease;
  display: block;
  width: fit-content;
  margin-top: 1rem;
}

.return-to-books-button:hover {
  background-color: #c2dfbd;
}

.visually-hidden {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .region-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
  }

  .region-button {
    margin: 0 !important;
    padding: 0.6rem 1.2rem;
  }

  .return-to-books-button {
    margin-top: 0.5rem;
  }
}
 
@media (max-width: 480px) {
  .region-button {
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) and (orientation: portrait) {
  .book-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .book-cover-static {
    margin: 0 auto;
    display: block;
  }
}


.book-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.book-cover {
  border: 1px solid #4d8a45;
  border-radius: 5px;
  overflow: hidden;
  background-color: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); /* 🔥 always visible */
  flex-shrink: 0;
  width: 100%;
  max-width: 260px;
  display: block;
  margin: 0 auto;
  height: auto;
  position: relative;
}

.book-cover-static {
  flex-shrink: 0;
  width: 300px;
  max-width: 100%;
  height: auto;
  border: 1px solid #4d8a45;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (min-width: 768px) {
  .book-cover-static {
    margin-top: 1.5rem;
  }
}

/* explicitly no hover effect */
.book-cover-static:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.book-text {
  flex: 1;
  min-width: 280px;
}

/* Landscape mobile fix */
@media (max-width: 900px) and (orientation: landscape) {
  .book-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .book-text {
    text-align: center;
    padding: 0 1rem;
  }

  .amazon-links-container {
    align-items: center;
  }

  .amazon-links-container a {
    width: 90%;
    max-width: 320px;
  }

  .return-to-books-button {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Restore text container padding for portrait mobile */
@media (max-width: 768px) {
  .book-text {
    padding: 0 1rem;
  }
}

.book-text .text-l + .text-l {
  margin-top: -1em;   /* pulls second paragraph upward slightly */
  margin-bottom: 0;   /* reduces default bottom spacing */
}


@media (min-width: 768px) {
  .region-buttons-with-return {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    justify-items: center;
  }

  .region-buttons {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    justify-content: center;
  }

  .return-to-books-button {
    margin-top: 0.5rem;
  }
}


/* ===== Downloads / Social CTA buttons (site-wide) ===== */

.downloads-cta {
  margin-top: 2.5rem;
  text-align: center;
}

.downloads-cta__text {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.downloads-cta__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.social-button{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background-color: #e4f1dd;
  color: #333333;
  border: 1px solid #b8d5aa;
  transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease;
}

a.social-button,
a.social-button:visited{
  color: #333333;
  text-decoration: none;
}

/* keep modifier classes but do NOT restyle them */
.social-button--instagram,
.social-button--facebook,
.social-button--pinterest{
  background-color: #e4f1dd;
  color: #333333;
  border-color: #b8d5aa;
}


@media (hover:hover){
  .social-button:hover{
    background-color: #d4e8cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
  }
}

/* =========================
   Maths contents links
   ========================= */

.maths-links{
  max-width: 520px;
  margin: 2.5rem 0;
  font-size: inherit;
  line-height: inherit;
}

.maths-row{
  display: grid;
  grid-template-columns: 8rem 7rem auto;
  align-items: center;
  column-gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.maths-go{
  justify-self: start;   
}


.maths-title{
  font-weight: 600;
  white-space: nowrap;
  justify-self: start;
}

.maths-age{
  color: #555;
  white-space: nowrap;
  margin-left: -0.25rem;
  justify-self: start;
  text-align: left;
}


.section-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .45em 1.2em;
  border-radius: 999px;
  background: #e4f1dd;
  color: #333;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #b8d5aa;
  white-space: nowrap;
  transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease;
}

a.section-link,
a.section-link:visited,
a.section-link:hover,
a.section-link:active,
a.section-link:focus{
  color: #333 !important;
  text-decoration: none !important;
}

a.section-link{
  -webkit-appearance: none;
  appearance: none;
}


.section-link.small{
  font-size: 0.9em;
  padding: 0.25em 0.85em;
}

/* stop purple visited links on phones */
a.section-link, a.section-link:visited{ color:#333; text-decoration:none; }

/* stack on small screens; keep Go on the right */
@media (max-width: 520px){
  .maths-row{
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title title"
      "age   go";
    column-gap: 0.5rem;  
  }
  .maths-title{ grid-area:title; white-space: normal; }
  .maths-age{ grid-area:age; }
  .maths-go{
  grid-area: go;
  justify-self: start;
}

}

/* Go button hover */
.section-link:hover{
  background-color: #d4e8cc;
}

@media (hover:hover){
  .section-link:hover{
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
  }
}
