/*
Theme Name: Teach Us On Tour
Theme URI: https://teachusontour.co.uk
Author: Dave Bradley-Bowles
Description: Custom theme for Teach Us On Tour — hands-on STEM, PE & PSHE school workshops in Chesterfield. Built from the Claude design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: teachusontour
*/

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #F5F5FC; scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }
img { max-width: 100%; height: auto; }

@keyframes tuot-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes tuot-float  { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-20px) rotate(3deg); } }
@keyframes tuot-float2 { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(16px) rotate(-4deg); } }
::selection { background: #F7C2E6; color: #25286B; }

/* ---- Responsive: collapse the design's fixed two-column grids on small screens ---- */
@media (max-width: 900px) {
  .tuot-grid-2,
  .tuot-grid-2-rev,
  .tuot-hero-grid { grid-template-columns: 1fr !important; }
  .tuot-stats-grid { grid-template-columns: repeat(2,1fr) !important; }
  .tuot-why-grid  { grid-template-columns: 1fr !important; }
  .tuot-cards-grid { grid-template-columns: 1fr !important; }
  .tuot-season-grid { grid-template-columns: repeat(2,1fr) !important; }
  .tuot-nav-links { display: none !important; }
  .tuot-hero-media { height: 360px !important; }
}

/* ---- Mobile navigation ----------------------------------------------------
   The desktop .tuot-nav-links block holds BOTH the nav links and the "Book a
   Workshop" button, and is hidden under 900px. These rules supply the phone
   equivalent: a persistent Book button (so the CTA is never more than one tap
   away) plus a burger that opens the full menu. Shown only where the desktop
   nav is hidden, so the two can never appear together. */
.tuot-mobile-bar  { display: none; align-items: center; gap: 10px; }
.tuot-mobile-menu { display: none; }

@media (max-width: 900px) {
  .tuot-mobile-bar { display: flex; }

  .tuot-mobile-cta {
    font-weight: 700; font-size: 14px; color: #fff; background: #E21B9C;
    text-decoration: none; padding: 10px 18px; border-radius: 999px;
    box-shadow: 0 12px 24px -14px rgba(226,27,156,.9); white-space: nowrap;
  }

  .tuot-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 10px;   /* 44px = minimum tap target */
    background: transparent; border: 0; cursor: pointer;
  }
  .tuot-burger__bar {
    display: block; height: 2px; width: 100%; border-radius: 2px; background: #25286B;
    transition: transform .25s ease, opacity .2s ease;
  }
  .tuot-burger.is-open .tuot-burger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .tuot-burger.is-open .tuot-burger__bar:nth-child(2) { opacity: 0; }
  .tuot-burger.is-open .tuot-burger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .tuot-mobile-menu {
    display: block;
    border-top: 1px solid #E5E8F6;
    background: rgba(245,245,252,.98);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    padding: 10px 22px 22px;
  }
  .tuot-mobile-menu[hidden] { display: none; }

  .tuot-mobile-link {
    display: block; padding: 15px 0; font-weight: 600; font-size: 17px;
    color: #3A3D72; text-decoration: none; border-bottom: 1px solid #E5E8F6;
  }
  .tuot-mobile-link.is-active { color: #E21B9C; font-weight: 700; }

  .tuot-mobile-book {
    display: block; margin-top: 18px; padding: 15px 24px; border-radius: 999px;
    background: #E21B9C; color: #fff; font-weight: 700; font-size: 16px;
    text-align: center; text-decoration: none;
    box-shadow: 0 14px 28px -16px rgba(226,27,156,.9);
  }
  .tuot-mobile-call {
    display: block; margin-top: 12px; padding: 4px 0; text-align: center;
    font-weight: 600; font-size: 15px; color: #3A3D72; text-decoration: none;
  }

  /* "For schools" group heading + its indented children inside the burger menu */
  .tuot-mobile-group {
    padding: 16px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: #9FA3C2;
  }
  .tuot-mobile-sublink { padding-left: 14px; font-size: 16px; border-bottom: 1px solid #EDEFF8; }
}

@media (prefers-reduced-motion: reduce) {
  .tuot-burger__bar { transition: none; }
}

/* ---- "For Schools" desktop dropdown -------------------------------------------
   Lives inside .tuot-nav-links, which is hidden under 900px, so these styles are
   desktop-only. Opens on hover (CSS) and on click/keyboard (JS in header.php). */
.tuot-dropdown { position: relative; }
.tuot-dropdown__trigger {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 15px; color: #3A3D72;
  background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; line-height: 1;
}
.tuot-dropdown__trigger.is-active,
.tuot-dropdown__trigger[aria-expanded="true"] { color: #E21B9C; }
.tuot-dropdown__caret { font-size: 11px; transition: transform .2s ease; }
.tuot-dropdown:hover .tuot-dropdown__caret,
.tuot-dropdown__trigger[aria-expanded="true"] .tuot-dropdown__caret { transform: rotate(180deg); }

.tuot-dropdown__panel {
  position: absolute; top: 100%; left: 50%;
  margin-top: 14px; min-width: 256px;
  background: #fff; border: 1px solid #E5E8F6; border-radius: 16px; padding: 8px;
  box-shadow: 0 26px 54px -26px rgba(37,40,107,.5);
  opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 70;
}
/* invisible bridge so the pointer can travel from trigger to panel without the
   :hover gap closing it */
.tuot-dropdown__panel::before {
  content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px;
}
.tuot-dropdown:hover .tuot-dropdown__panel,
.tuot-dropdown.is-open .tuot-dropdown__panel {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.tuot-dropdown__link {
  display: block; padding: 11px 14px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600; color: #3A3D72; text-decoration: none; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.tuot-dropdown__link:hover,
.tuot-dropdown__link:focus-visible { background: #F5F5FC; color: #E21B9C; }
.tuot-dropdown__link.is-active { color: #E21B9C; }
@media (max-width: 600px) {
  .tuot-stats-grid, .tuot-season-grid { grid-template-columns: 1fr !important; }
  .tuot-pad { padding-left: 22px !important; padding-right: 22px !important; }
}

/* ---- Additional page layouts (About, Workshops, Testimonials, Contact, Blog, Article) ---- */
@media (max-width: 980px) {
  .tuot-split    { grid-template-columns: 1fr !important; }
  .tuot-cards-3  { grid-template-columns: 1fr 1fr !important; }
  .tuot-cols-3   { columns: 2 !important; }
  .tuot-how-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 720px) {
  .tuot-cards-3, .tuot-cards-2 { grid-template-columns: 1fr !important; }
  .tuot-cols-3   { columns: 1 !important; }
  .tuot-form-grid { grid-template-columns: 1fr !important; }
  .tuot-how-grid { grid-template-columns: 1fr !important; }
  .tuot-feature  { grid-template-columns: 1fr !important; }
}

/* ---- Photo rotator: cards that cycle several shots of the same activity ----
   Images stack in source order, so each one fades in ON TOP of the previous one
   while that one is still opaque — a clean cross-fade with no background bleed.
   The outgoing image only drops once the incoming one is fully covering it. */
.tuot-rotate > img { opacity: 0; animation: tuot-rotate-fade 12s infinite; }
.tuot-rotate > img:nth-child(1) { animation-delay: 0s; }
.tuot-rotate > img:nth-child(2) { animation-delay: 4s; }
.tuot-rotate > img:nth-child(3) { animation-delay: 8s; }
@keyframes tuot-rotate-fade {
  0%     { opacity: 0; }
  3%     { opacity: 1; }
  37%    { opacity: 1; }
  37.01% { opacity: 0; }
  100%   { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tuot-rotate > img { animation: none; opacity: 0; }
  .tuot-rotate > img:first-child { opacity: 1; }
}

/* ---- Single post body typography (the_content output) ---- */
.tuot-article { font-family: 'Poppins', sans-serif; }
.tuot-article > p:first-of-type { font-size: 20px; line-height: 1.6; color: #3A3D72; font-weight: 500; margin: 0; }
.tuot-article p { font-size: 17px; line-height: 1.75; color: #5A5E86; font-weight: 400; margin: 14px 0 0; }
.tuot-article h2 { font-weight: 800; font-size: 28px; letter-spacing: -.02em; color: #25286B; margin: 40px 0 0; }
.tuot-article h3 { font-weight: 700; font-size: 22px; color: #25286B; margin: 32px 0 0; }
.tuot-article ul, .tuot-article ol { font-size: 17px; line-height: 1.75; color: #5A5E86; margin: 14px 0 0; padding-left: 22px; }
.tuot-article li { margin: 6px 0; }
.tuot-article a { color: #E21B9C; font-weight: 600; }
.tuot-article img { border-radius: 18px; margin: 28px 0; height: auto; }
.tuot-article blockquote {
  margin: 40px 0 0; padding: 28px 32px; background: #fff; border-left: 5px solid #E21B9C;
  border-radius: 0 18px 18px 0; box-shadow: 0 22px 44px -38px rgba(37,40,107,.4);
}
.tuot-article blockquote p { font-style: italic; font-weight: 500; font-size: 20px; line-height: 1.45; color: #25286B; margin: 0; }

/* ---- Mobile hardening: no horizontal overflow + restack overlapping photo collages ---- */
@media (max-width: 820px) {
  /* let grid/flex children shrink instead of forcing horizontal overflow */
  .tuot-hero-grid > *, .tuot-split > *, .tuot-grid-2 > *,
  .tuot-cards-2 > *, .tuot-cards-3 > *, .tuot-how-grid > * { min-width: 0; }

  /* the designed photo collages overlap on desktop; on phones stack them cleanly */
  .tuot-collage, .tuot-hero-media { height: auto !important; display: flex; flex-direction: column; gap: 14px; }
  .tuot-collage > * {
    position: relative !important;
    inset: auto !important; top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
    width: 100% !important; max-width: 100% !important; height: auto !important;
    border-radius: 22px !important;
    transform: none !important;
    overflow: hidden;
  }
  /* show the whole photo (natural aspect) instead of centre-cropping it —
     otherwise portrait shots like Lizzie & Holly get their heads cut off */
  .tuot-collage > * > img {
    position: relative !important;
    inset: auto !important; top: auto !important; left: auto !important;
    width: 100% !important; height: auto !important;
    object-fit: contain !important;
    display: block !important;
  }
  .tuot-collage-badge { display: none !important; }

  /* guarantee text wraps inside the viewport — sized to the screen, not a
     (possibly overflowing) parent — so nothing clips on the right edge */
  h1, h2, h3, p { max-width: calc(100vw - 44px) !important; overflow-wrap: break-word; word-wrap: break-word; }
  header h1 { font-size: clamp(30px, 8.5vw, 44px) !important; }
}

/* WordPress core alignment/caption helpers */
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.wp-caption-text { font-size: 13px; color: #9FA3C2; text-align: center; }
