/*
Theme Name: THC Twenty Twenty-Five
Theme URI: https://herpcollective.org/
Description: A presentation-focused child theme for The Herpetology Collective, inheriting Twenty Twenty-Five.
Author: The Herpetology Collective
Author URI: https://herpcollective.org/
Template: twentytwentyfive
Version: 0.1.1
Requires at least: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: thc-twentytwentyfive
*/

/* Gate 3C: approved local typography. Four WOFF2 faces, no runtime third party. */
@font-face {
  font-family: "THC Platypi";
  src: url("../twentytwentyfive/assets/fonts/platypi/Platypi-VariableFont_wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

@font-face {
  font-family: "THC Fira Sans";
  src: url("../twentytwentyfive/assets/fonts/fira-sans/FiraSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "THC Fira Sans";
  src: url("../twentytwentyfive/assets/fonts/fira-sans/FiraSans-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "THC Fira Sans";
  src: url("../twentytwentyfive/assets/fonts/fira-sans/FiraSans-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

/* Theme.json owns the tokens and scale; these rules enforce them on legacy/plugin surfaces. */
body,
:where(button, input, select, textarea, label),
:where(.wp-element-button, .wp-block-button__link, .wp-block-navigation, .wp-block-search),
:where(.tutor-wrap, .tutor-dashboard, .tutor-screen-frontend-dashboard, .tutor-login-wrap),
:where(.woocommerce, .woocommerce-page, .wc-block-components-button, .wc-block-components-form, .wc-block-components-notice-banner) {
  font-family: "THC Fira Sans", "Segoe UI", Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-heading,
.product_title,
.wc-block-components-product-name {
  font-family: "THC Platypi", Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: normal;
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(2.5rem, 1.8rem + 2.8vw, 4.25rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(2rem, 1.55rem + 1.8vw, 3rem);
  line-height: 1.1;
}

h3 {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  line-height: 1.18;
}

h4 {
  font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  line-height: 1.25;
}

h5 {
  font-size: 1.25rem;
  line-height: 1.3;
}

h6 {
  font-size: 1.0625rem;
  line-height: 1.35;
}

h1, h2, h3,
.wp-block-post-title,
.product_title,
.wc-block-components-product-name {
  text-wrap: balance;
}

/* Keep the existing header/footer identity compact when the Site Title is an H1/H2. */
.wp-block-site-title {
  font-family: "THC Platypi", Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

/* Tutor declares Inter on utility classes; functional Tutor text stays on approved Fira Sans. */
:where(.tutor-wrap, .tutor-dashboard, .tutor-screen-frontend-dashboard, .tutor-login-wrap, .tutor-course-single-content-wrapper, .tutor-course-single-sidebar-wrapper)
  :where(.tutor-h1, .tutor-h2, .tutor-h3, .tutor-h4, .tutor-h5, .tutor-h6, .tutor-form-control, .tutor-input, .tutor-label, .tutor-small, .tutor-btn, .tutor-nav-link, .tutor-dashboard-menu-item-link) {
  font-family: "THC Fira Sans", "Segoe UI", Arial, sans-serif !important;
  letter-spacing: normal;
}

/* Tutor's full-screen lesson template sets Inter on body and its own controls. */
body.single-lesson,
body.single-lesson .tutor-learning-area,
body.single-lesson .tutor-learning-area :where(button, input, select, textarea, label, a, h1, h2, h3, h4, h5, h6, .tutor-btn, .tutor-nav-link) {
  font-family: "THC Fira Sans", "Segoe UI", Arial, sans-serif !important;
}

/* Lesson editorial headings remain major content headings, distinct from Tutor chrome. */
body.single-lesson .tutor-lesson-wrapper :where(h1, h2, h3, h4, h5, h6) {
  font-family: "THC Platypi", Georgia, "Times New Roman", serif !important;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* The authenticated dashboard uses the same Tutor full-screen reset as lessons. */
body.tutor-screen-frontend-dashboard,
body.tutor-screen-frontend-dashboard .tutor-dashboard,
body.tutor-screen-frontend-dashboard :where(button, input, select, textarea, label, a, h1, h2, h3, h4, h5, h6, .tutor-btn, .tutor-nav-link, .tutor-dashboard-menu-item-link) {
  font-family: "THC Fira Sans", "Segoe UI", Arial, sans-serif !important;
}

/* Woo product/content titles remain Platypi; functional drawer/checkout/cart headings use Fira Sans. */
:where(.wc-block-mini-cart__drawer, .wc-block-cart, .wc-block-checkout, .woocommerce-MyAccount-content)
  :where(h2, h3, h4, h5, h6, .wc-block-components-title) {
  font-family: "THC Fira Sans", "Segoe UI", Arial, sans-serif !important;
  letter-spacing: normal;
}

/* Retain the Gate 1 CHG title protection on the narrow product summary column. */
.single-product .wp-block-post-title {
  font-size: clamp(1.7rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  hyphens: auto;
}

/* Gate 3A: non-typographic design-system primitives. */
:root {
  --thc-canvas: #F7F1E4;
  --thc-surface-raised: #FCF8EF;
  --thc-surface-muted: #ECE4D9;
  --thc-border: #D9D0BC;
  --thc-text: #332D25;
  --thc-leaf: #5E7D53;
  --thc-leaf-deep: #3F5C3B;
  --thc-sage: #A8B79A;
  --thc-control-stroke: #8A7F66;
  --thc-error: #8A2F29;
  --thc-space-2xs: 0.25rem;
  --thc-space-xs: 0.5rem;
  --thc-space-sm: 0.75rem;
  --thc-space-md: 1rem;
  --thc-space-lg: 1.5rem;
  --thc-space-xl: 2rem;
  --thc-space-2xl: 3rem;
  --thc-space-3xl: 4.5rem;
  --thc-content: 720px;
  --thc-wide: 1200px;
  --thc-radius-sm: 6px;
  --thc-radius-md: 10px;
  --thc-radius-lg: 16px;
  --thc-radius-pill: 999px;
  --thc-shadow-subtle: 0 1px 2px rgba(51, 45, 37, 0.05), 0 8px 24px rgba(51, 45, 37, 0.06);
  --thc-shadow-lifted: 0 2px 6px rgba(51, 45, 37, 0.07), 0 14px 34px rgba(51, 45, 37, 0.08);
}

html {
  background: var(--thc-canvas);
}

body,
.wp-site-blocks {
  background: var(--thc-canvas);
  color: var(--thc-text);
}

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

.thc-container,
.thc-container-wide {
  box-sizing: content-box;
  margin-inline: auto;
  padding-inline: clamp(var(--thc-space-md), 4vw, var(--thc-space-xl));
}

.thc-container {
  max-width: var(--thc-content);
}

.thc-container-wide {
  max-width: var(--thc-wide);
}

.thc-section {
  padding-block: clamp(var(--thc-space-2xl), 7vw, var(--thc-space-3xl));
}

.thc-surface-raised,
.thc-card {
  background: var(--thc-surface-raised);
  border: 1px solid var(--thc-border);
  border-radius: var(--thc-radius-lg);
}

.thc-surface-muted {
  background: var(--thc-surface-muted);
  border: 1px solid var(--thc-border);
  border-radius: var(--thc-radius-md);
}

.thc-card {
  box-shadow: var(--thc-shadow-subtle);
  padding: clamp(var(--thc-space-lg), 4vw, var(--thc-space-xl));
}

:where(main, footer) a:not(.wp-element-button, .wp-block-button__link, .button) {
  color: var(--thc-leaf-deep);
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

:where(main, footer) a:not(.wp-element-button, .wp-block-button__link, .button):visited {
  color: var(--thc-text);
  text-decoration-color: var(--thc-leaf-deep);
}

:where(main, footer) a:not(.wp-element-button, .wp-block-button__link, .button):hover {
  color: var(--thc-leaf);
  text-decoration-thickness: 0.14em;
}

:where(.wp-element-button, .wp-block-button__link, .button, button[type="submit"], button[type="button"], input[type="submit"], input[type="button"]) {
  align-items: center;
  background: var(--thc-leaf-deep);
  border: 1px solid var(--thc-leaf-deep);
  border-radius: var(--thc-radius-md);
  color: var(--thc-surface-raised);
  cursor: pointer;
  display: inline-flex;
  font-weight: 600;
  gap: var(--thc-space-xs);
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

:where(.wp-element-button, .wp-block-button__link, .button, button[type="submit"], button[type="button"], input[type="submit"], input[type="button"]):hover {
  background: var(--thc-text);
  border-color: var(--thc-text);
  color: var(--thc-surface-raised);
  transform: translateY(-1px);
}

:where(.wp-block-button.is-style-outline > .wp-block-button__link, .thc-button-secondary, button[type="reset"], input[type="reset"]) {
  background: transparent;
  border: 1px solid var(--thc-leaf-deep);
  border-radius: var(--thc-radius-md);
  color: var(--thc-leaf-deep);
  cursor: pointer;
  display: inline-flex;
  font-weight: 600;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
}

:where(.wp-block-button.is-style-outline > .wp-block-button__link, .thc-button-secondary, button[type="reset"], input[type="reset"]):hover {
  background: var(--thc-surface-muted);
  border-color: var(--thc-leaf-deep);
  color: var(--thc-leaf-deep);
}

:where(button, input[type="submit"], input[type="button"], input[type="reset"], .wp-element-button, .wp-block-button__link, .button):disabled,
:where(.wp-element-button, .wp-block-button__link, .button)[aria-disabled="true"] {
  background: var(--thc-surface-muted);
  border-color: var(--thc-border);
  color: var(--thc-text);
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--thc-leaf-deep);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--thc-canvas);
}

:where(input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="search"], input[type="password"], input[type="number"], input[type="date"], select, textarea) {
  appearance: none;
  background: var(--thc-surface-raised);
  border: 1px solid var(--thc-control-stroke);
  border-radius: var(--thc-radius-sm);
  color: var(--thc-text);
  min-height: 44px;
  padding: 0.72rem 0.85rem;
  width: 100%;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

select {
  appearance: auto;
}

::placeholder {
  color: var(--thc-text);
  opacity: 0.62;
}

:where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--thc-error);
  box-shadow: 0 0 0 1px var(--thc-error);
}

:where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--thc-leaf-deep);
  block-size: 1.15rem;
  inline-size: 1.15rem;
}

:where(input, select, textarea):disabled {
  background: var(--thc-surface-muted);
  border-color: var(--thc-border);
  color: var(--thc-text);
  cursor: not-allowed;
  opacity: 0.72;
}

.thc-field {
  display: grid;
  gap: var(--thc-space-xs);
}

.thc-field label,
.thc-label {
  color: var(--thc-text);
  font-weight: 600;
}

.thc-help {
  color: var(--thc-text);
  font-size: 0.875rem;
  line-height: 1.45;
  opacity: 0.78;
}

.thc-message-error,
.thc-message-success {
  border-inline-start: 4px solid currentColor;
  border-radius: var(--thc-radius-sm);
  padding: var(--thc-space-sm) var(--thc-space-md);
}

.thc-message-error {
  background: var(--thc-surface-raised);
  color: var(--thc-error);
}

.thc-message-success {
  background: var(--thc-surface-raised);
  color: var(--thc-leaf-deep);
}

.thc-divider,
.thc-style-test hr {
  border: 0;
  border-top: 1px solid var(--thc-border);
  margin-block: var(--thc-space-xl);
}

.thc-badge {
  background: var(--thc-sage);
  border: 1px solid var(--thc-leaf);
  border-radius: var(--thc-radius-pill);
  color: var(--thc-leaf-deep);
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.32rem 0.7rem;
}

.thc-media-frame {
  background: var(--thc-surface-raised);
  border: 1px solid var(--thc-border);
  border-radius: var(--thc-radius-md);
  overflow: hidden;
}

.thc-media-frame img {
  display: block;
  height: auto;
  width: 100%;
}

.thc-style-test-main {
  padding-block: clamp(var(--thc-space-xl), 5vw, var(--thc-space-3xl));
}

.thc-style-test-grid,
.thc-style-test-form-grid,
.thc-style-test-image-grid {
  display: grid;
  gap: var(--thc-space-lg);
}

.thc-style-test-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.thc-style-test-form-grid,
.thc-style-test-image-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.thc-style-test-swatch,
.thc-style-test-panel {
  padding: var(--thc-space-lg);
}

.thc-style-test-swatch {
  border: 1px solid var(--thc-border);
  border-radius: var(--thc-radius-md);
  min-height: 8rem;
}

.thc-style-test-swatch--canvas {
  background: var(--thc-canvas);
}

.thc-style-test-swatch--raised {
  background: var(--thc-surface-raised);
  box-shadow: var(--thc-shadow-subtle);
}

.thc-style-test-swatch--muted {
  background: var(--thc-surface-muted);
}

.thc-style-test-dark {
  background: var(--thc-leaf-deep);
  border-radius: var(--thc-radius-lg);
  color: var(--thc-surface-raised);
  padding: clamp(var(--thc-space-lg), 4vw, var(--thc-space-xl));
}

.thc-style-test-dark :where(h2, h3, p) {
  color: inherit;
}

.thc-style-test-dark .thc-button-on-dark {
  background: var(--thc-surface-raised);
  border-color: var(--thc-surface-raised);
  color: var(--thc-leaf-deep);
}

.thc-style-test-dark .thc-button-on-dark:hover {
  background: var(--thc-surface-muted);
  border-color: var(--thc-surface-muted);
  color: var(--thc-text);
}

.thc-style-test-actions,
.thc-style-test-checks {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--thc-space-md);
}

.thc-style-test-checks label {
  align-items: center;
  display: inline-flex;
  gap: var(--thc-space-xs);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 600px) {
  .thc-section {
    padding-block: var(--thc-space-2xl);
  }

  .thc-card,
  .thc-style-test-panel,
  .thc-style-test-swatch {
    padding: var(--thc-space-md);
  }
}

/* Tutor colours editorial headings only inside its lesson wrapper. Assignment and quiz
   descriptions fall back to the global heading colour, which is fixed dark and fails
   contrast in Tutor's dark theme. Follow Tutor's own heading colour in both themes. */
:is(.tutor-assignment-description, .tutor-quiz-intro-description) :where(h1, h2, h3, h4, h5, h6) {
  color: var(--tutor-text-primary, inherit);
}

/* Lesson list spacing (2026-09-23, Micha). Tutor sets list items flush (0 margin at a
   22px line-height), so long bullet lists read as a wall of text. Add about half a line
   between items in lesson and assignment bodies; nested lists get the same gap above. */
:is(.tutor-lesson-wrapper, .tutor-assignment-description) li {
  margin-bottom: 0.6875em;
}

:is(.tutor-lesson-wrapper, .tutor-assignment-description) li:last-child {
  margin-bottom: 0;
}

:is(.tutor-lesson-wrapper, .tutor-assignment-description) li > :is(ul, ol) {
  margin-top: 0.6875em;
}
