/*
Theme Name: Tutors in Preston
Theme URI: https://wwebdesign.co.uk/
Author: W Web Design & Hosting
Author URI: https://wwebdesign.co.uk/
Description: Lean custom theme for Tutors in Preston — code-registered ACF blocks, no page builder, no build step.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: tutors-in-preston
*/

/* ==========================================================================
   Design tokens — the ONLY place cross-block values live.
   Anything used by more than one block belongs here. Anything used by exactly
   one block belongs in that block's own style.css.
   ========================================================================== */

:root {
  /* Brand — lifted from the Pinnacle theme options on the live site (Phase 0).
     primary_color #1e73be, topbar_background #00437a, footer_background #48a6dc,
     slider button #00437a hover #48a6dc, infobox icon circle #3cc14b. */
  --tutors-in-preston-brand:        #1e73be;
  --tutors-in-preston-brand-dark:   #00437a;
  --tutors-in-preston-accent:       #48a6dc;
  --tutors-in-preston-green:        #3cc14b;

  /* Surfaces.
     NEVER set a section background to #fff — leave sections transparent so
     they inherit --tutors-in-preston-bg, and fill --tutors-in-preston-card-bg on inner cards. */
  --tutors-in-preston-bg:           #ffffff;
  --tutors-in-preston-bg-alt:       #f5f5f5;
  --tutors-in-preston-bg-alt2:      #eaeaea;
  --tutors-in-preston-card-bg:      #ffffff;
  --tutors-in-preston-border:       #e4e4e4;

  /* Text */
  --tutors-in-preston-text:         #444444;
  --tutors-in-preston-text-muted:   #6b6b6b;
  --tutors-in-preston-text-invert:  #ffffff;
  --tutors-in-preston-heading:      #1e73be;

  /* Type — the live site is Raleway throughout, loaded from Google. */
  --tutors-in-preston-font:         "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tutors-in-preston-font-heading: var(--tutors-in-preston-font);

  /* Layout — the old theme runs a 1140px container. */
  --tutors-in-preston-content-max:  1140px;
  --tutors-in-preston-gutter:       15px;
  --tutors-in-preston-section-y:    clamp(40px, 5vw, 70px);
  --tutors-in-preston-radius:       0px;
  --tutors-in-preston-header-height: 120px;
  --tutors-in-preston-topbar-height: 30px;

  /* Motion */
  --tutors-in-preston-ease:         cubic-bezier(.22,.61,.36,1);
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--tutors-in-preston-bg);
  color: var(--tutors-in-preston-text);
  font-family: var(--tutors-in-preston-font);
  /* The old theme set body copy at 14px/20px. Kept, so line lengths and block
     heights match the original rather than reflowing every paragraph. */
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--tutors-in-preston-font-heading);
  line-height: 1.15;
  margin: 0 0 .5em;
  text-wrap: balance;
}
/* Type scale copied from the Pinnacle theme options: h1 700/44, h2 400/32,
   h3 400/26, h4 400/24, h5 400/18. Clamped at the small end so headings stay
   readable on a phone, which the fixed pixel sizes did not do well. */
h1 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem);    font-weight: 400; }
h3 { font-size: clamp(1.25rem, 2vw, 1.625rem); font-weight: 400; }
h4 { font-size: clamp(1.15rem, 1.8vw, 1.5rem); font-weight: 400; }
h5 { font-size: 1.125rem;                      font-weight: 400; }

/* Headings on this site are brand blue, not body colour. */
h1, h2, h3, h4, h5 { color: var(--tutors-in-preston-heading); }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Shared layout primitives — used by chrome AND blocks.
   -------------------------------------------------------------------------- */

.tutors-in-preston-wrap {
  width: 100%;
  max-width: var(--tutors-in-preston-content-max);
  margin-inline: auto;
  padding-inline: var(--tutors-in-preston-gutter);
}

.tutors-in-preston-section { padding-block: var(--tutors-in-preston-section-y); }

.tutors-in-preston-section__head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.tutors-in-preston-section__head--center { margin-inline: auto; text-align: center; }

.tutors-in-preston-eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tutors-in-preston-accent);
  margin-bottom: .75em;
}

.tutors-in-preston-lede { font-size: 1.1rem; color: var(--tutors-in-preston-text-muted); }

/* Buttons */
.tutors-in-preston-btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .85em 1.6em;
  border: 1px solid transparent;
  border-radius: var(--tutors-in-preston-radius);
  background: var(--tutors-in-preston-brand);
  color: var(--tutors-in-preston-text-invert);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s var(--tutors-in-preston-ease), transform .25s var(--tutors-in-preston-ease);
}
.tutors-in-preston-btn:hover { background: var(--tutors-in-preston-brand-dark); transform: translateY(-1px); }

.tutors-in-preston-btn--ghost {
  background: transparent;
  color: var(--tutors-in-preston-text);
  border-color: var(--tutors-in-preston-border);
}
.tutors-in-preston-btn--ghost:hover { background: var(--tutors-in-preston-card-bg); }

/* Cards — the ONLY place --tutors-in-preston-card-bg should appear. */
.tutors-in-preston-card {
  background: var(--tutors-in-preston-card-bg);
  border: 1px solid var(--tutors-in-preston-border);
  border-radius: var(--tutors-in-preston-radius);
  padding: clamp(20px, 2.5vw, 32px);
}

/* Screen-reader only */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* WP core alignment classes */
.alignfull { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); }
.alignwide { max-width: calc(var(--tutors-in-preston-content-max) + 160px); margin-inline: auto; }
.aligncenter { margin-inline: auto; }

/* --------------------------------------------------------------------------
   Layout utilities, applied via a block's "Additional CSS class".
   -------------------------------------------------------------------------- */

/* Two equal text columns. The home page's closing copy sat in two columns, one
   under each tutor card; a single wysiwyg block with this class reproduces that
   without needing a bespoke two-column block. */
.tutors-in-preston-cols-2 .tutors-in-preston-wysiwyg__inner {
  column-count: 2;
  column-gap: 30px;
}
.tutors-in-preston-cols-2 .tutors-in-preston-wysiwyg__inner > p { break-inside: avoid; }
.tutors-in-preston-cols-2 .tutors-in-preston-wysiwyg__inner > p:first-child { margin-top: 0; }

@media (max-width: 780px) {
  .tutors-in-preston-cols-2 .tutors-in-preston-wysiwyg__inner { column-count: 1; }
}

/* Tighter vertical rhythm between two blocks that read as one section — used
   where the old page had a heading row immediately above a card grid. */
.tutors-in-preston-tight-top    { padding-top: 0 !important; }
.tutors-in-preston-tight-bottom { padding-bottom: 0 !important; }

/* Alternate section background, matching the banded look of the old home page. */
.tutors-in-preston-band     { background: var(--tutors-in-preston-bg-alt); }
.tutors-in-preston-band-alt { background: var(--tutors-in-preston-bg-alt2); }

/* Centred heading block. The subject pages and Our Tutors headed their content
   with a centred blue heading on white — not a coloured banner — so this is what
   those pages use rather than the page-hero band. */
.tutors-in-preston-center .tutors-in-preston-wysiwyg__inner {
  max-width: none;
  text-align: center;
}
.tutors-in-preston-center .tutors-in-preston-wysiwyg__inner h2 { margin-bottom: 0; }
