/*
Theme Name: Windham Free Press
Theme URI: https://windhamfreepress.org
Description: Custom GeneratePress child theme for Windham Free Press.
Author: Windham Free Press at Project Imo
Template: generatepress
Version: 1.0.0
Text Domain: wfp
*/

/* =============================================================================
   TOKENS
   ============================================================================= */

:root {
  /* COLOR SYSTEM */
  --contrast: #141414;
  --contrast-2: #3b3b3b;
  --contrast-3: #6f6f6f;

  --base: #f7f5f1;
  --base-2: #fcfaf7;
  --base-3: #ffffff;

  --accent: #9f1d20;
  --accent-hover: #7f1719;

  --accent-2: #0f5e91;
  --accent-2-hover: #0b476d;

  --border-color: hsl(0 0% 0% / 0.1);
  --border: 1px solid var(--border-color);

  /* TYPE SCALE */
  --step--2: clamp(0.75rem, 0.7rem + 0.12vw, 0.85rem);
  --step--1: clamp(0.875rem, 0.84rem + 0.15vw, 0.95rem);
  --step-0: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.16rem + 0.4vw, 1.5rem);
  --step-2: clamp(1.563rem, 1.4rem + 0.7vw, 1.95rem);
  --step-3: clamp(1.953rem, 1.7rem + 1vw, 2.45rem);
  --step-4: clamp(2.441rem, 2.05rem + 1.5vw, 3.05rem);
  --step-5: clamp(3.052rem, 2.5rem + 2vw, 3.85rem);
  --step-6: clamp(3.815rem, 3rem + 2.8vw, 4.85rem);

  /* SPACING */
  --space-3xs: 0.3125rem;
  --space-2xs: 0.5625rem;
  --space-xs: 0.875rem;
  --space-s: 1.125rem;
  --space-m: 1.6875rem;
  --space-l: 2.25rem;
  --space-xl: 3.375rem;
  --space-2xl: 4.5rem;
  --space-3xl: 6.75rem;

  /* LAYOUT */
  --wfp-content-width: 1200px;
  --wfp-gutter: var(--space-m);

  /* UI */
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;
  --radius-full: 999px;

  --shadow-s: 0 1px 3px hsl(0 0% 0% / 0.08);
  --shadow: 0 4px 12px hsl(0 0% 0% / 0.1);
  --shadow-l: 0 10px 24px hsl(0 0% 0% / 0.14);

  --transition-1: 150ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-2: 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* =============================================================================
   BASE
   ============================================================================= */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--base);
  color: var(--contrast);
  font-size: var(--step-0);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
}

.site-content {
  padding-bottom: var(--space-2xl);
}

/* =============================================================================
   LAYOUT
   ============================================================================= */

.wfp-container,
.wfp-section__inner {
  width: 100%;
  max-width: var(--wfp-content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--wfp-gutter);
  padding-right: var(--wfp-gutter);
}

.wfp-bleed {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

.inside-header.grid-container,
.inside-navigation.grid-container,
.inside-article,
.inside-footer-widgets,
.inside-site-info {
  padding-left: var(--wfp-gutter);
  padding-right: var(--wfp-gutter);
}

/* =============================================================================
   TYPOGRAPHY / PROSE
   ============================================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--contrast);
  line-height: 1.15;
  overflow-wrap: break-word;
  margin: 0;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-3); }
h4 { font-size: var(--step-2); }
h5 { font-size: var(--step-1); }
h6 { font-size: var(--step-0); }

:is(.entry-content, .editor-styles-wrapper, .wfp-prose) :where(p, ul, ol, blockquote, figure, pre, table, hr) {
  margin: 0;
}

:is(.entry-content, .editor-styles-wrapper, .wfp-prose) :where(p, ul, ol, blockquote, figure, pre, table, hr) + :where(p, ul, ol, blockquote, figure) {
  margin-top: var(--space-s);
}

:is(.entry-content, .editor-styles-wrapper, .wfp-prose) :where(h1, h2, h3, h4, h5, h6) + :where(p, ul, ol, blockquote, figure) {
  margin-top: var(--space-xs);
}

:is(.entry-content, .editor-styles-wrapper, .wfp-prose) :where(p, ul, ol, blockquote, figure, pre, table, hr) + :where(h1, h2, h3, h4, h5, h6) {
  margin-top: var(--space-l);
}

:is(.entry-content, .editor-styles-wrapper, .wfp-prose) :where(p, li, blockquote) {
  overflow-wrap: anywhere;
  hyphens: auto;
}

blockquote {
  padding-left: var(--space-m);
  border-left: 4px solid var(--accent);
  color: var(--contrast-2);
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

a.button,
.wp-block-button__link,
.gb-button,
button,
input[type="submit"] {
  border-radius: var(--radius-full);
  transition:
    background-color var(--transition-2),
    color var(--transition-2),
    border-color var(--transition-2),
    transform var(--transition-1);
}

.wp-block-button__link,
.gb-button,
button,
input[type="submit"] {
  background: var(--accent);
  color: var(--base-3);
  border: 1px solid var(--accent);
}

.wp-block-button__link:hover,
.wp-block-button__link:focus-visible,
.gb-button:hover,
.gb-button:focus-visible,
button:hover,
button:focus-visible,
input[type="submit"]:hover,
input[type="submit"]:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--base-3);
}

.wfp-button-secondary,
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--accent);
  border: 1px solid currentColor;
}

/* =============================================================================
   CARDS
   ============================================================================= */

.wfp-card {
  background: var(--base-3);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  padding: var(--space-m);
}

.wfp-card--feature {
  box-shadow: var(--shadow);
}

.wfp-card--accent {
  background: var(--accent);
  color: var(--base-3);
  border-color: hsl(0 0% 100% / 0.2);
}

/* =============================================================================
   FORMS
   ============================================================================= */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select {
  border: var(--border);
  border-radius: var(--radius-s);
  background: var(--base-3);
}

label {
  font-weight: 600;
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background: var(--accent);
  color: var(--base-3);
}

.wfp-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

.wfp-text-center {
  text-align: center;
}

.wfp-no-radius {
  border-radius: 0 !important;
}

.wfp-section + .wfp-section {
  margin-top: var(--space-xl);
}

/* =============================================================================
   REDUCED MOTION
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================================================
   MOBILE
   ============================================================================= */

@media (max-width: 782px) {
  .wp-block-button__link,
  .gb-button,
  button,
  input[type="submit"] {
    min-height: 44px;
  }
}