/*
Theme Name: The Psychology Notebook
Theme URI: https://psychologynotebook.com
Author: Desiree Clemons
Author URI: https://psychologynotebook.com
Description: A friendly, science-backed block theme for The Psychology Notebook brand. Editorial "Open Notebook" design with a six-module color system (Biopsychology, Cognitive, Social, Behavioral, Developmental, Clinical), built-in Mailchimp newsletter, Frank the Sasquatch sections, flashcards CTA, and YouTube embeds. Fully editable via the WordPress Site Editor — change colors, fonts, images, and layouts visually without touching code.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 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: psychology-notebook
Tags: blog, education, full-site-editing, block-styles, block-patterns, custom-colors, custom-logo, custom-menu, editor-style, featured-images, threaded-comments, translation-ready, wide-blocks
*/

/* ============================================================
   The Psychology Notebook — Theme Styles
   Block themes load this AFTER theme.json variables are applied.
   Use it for things theme.json can't express:
   custom underlines, sticky-note callouts, marquee, drop-caps.
   ============================================================ */

:root {
  --pn-coral: #F07040;
  --pn-coral-soft: #FFD9C7;
  --pn-navy: #1A3A5B;
  --pn-powder: #EDF4FF;
  --pn-cream: #FFF7E8;
  --pn-teal: #1A9AAA;
  --pn-magenta: #BF4882;
  --pn-sage: #6BA368;
  --pn-purple: #5D4E8C;
  --pn-yellow: #F5C24E;

  --pn-font-display: 'Fredoka', system-ui, sans-serif;
  --pn-font-heading: 'Nunito', system-ui, sans-serif;
  --pn-font-body: 'Open Sans', system-ui, sans-serif;
}

/* ----- Prevent horizontal scroll ----- */
html, body { overflow-x: hidden; max-width: 100%; }

/* ----- Typography refinements ----- */
body { font-family: var(--pn-font-body); color: var(--pn-navy); }
h1, h2, h3, h4, h5, h6 { font-family: var(--pn-font-heading); font-weight: 800; color: var(--pn-navy); letter-spacing: -0.01em; }
.is-style-display, .pn-display, h1.pn-display, .wp-block-heading.is-style-display {
  font-family: var(--pn-font-display) !important;
  font-weight: 400 !important;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

/* ----- Hand-drawn coral squiggle underline ----- */
.pn-squiggle, .is-style-pn-squiggle {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'><path d='M2,6 Q25,0 50,6 T100,6 T150,6 T198,6' stroke='%23F07040' stroke-width='3' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.45em;
  padding-bottom: 0.18em;
}

/* ----- Sticky-note callout ----- */
.pn-sticky-note, .is-style-sticky-note {
  background: var(--pn-cream);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow:
    0 2px 4px rgba(26,58,91,0.06),
    0 12px 28px rgba(26,58,91,0.12);
  transform: rotate(-1.5deg);
  position: relative;
}
.pn-sticky-note::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 24px;
  width: 36px;
  height: 16px;
  background: rgba(245,194,78,0.55);
  border-radius: 2px;
  transform: rotate(-3deg);
}

/* ----- Drop cap for editorial paragraphs ----- */
.has-drop-cap:not(:focus)::first-letter,
.pn-drop-cap::first-letter {
  font-family: var(--pn-font-display);
  font-weight: 400;
  float: left;
  font-size: 4.6em;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 0;
  color: var(--pn-coral);
}

/* ----- Module color stripe (used on cards and post-headers) ----- */
.pn-module-stripe { display: block; height: 6px; border-radius: 999px; background: var(--pn-coral); margin-bottom: 18px; }
.pn-module-biopsych      .pn-module-stripe, .pn-module-biopsych::before     { background: var(--pn-teal); }
.pn-module-cognitive     .pn-module-stripe, .pn-module-cognitive::before    { background: var(--pn-coral); }
.pn-module-social        .pn-module-stripe, .pn-module-social::before       { background: var(--pn-magenta); }
.pn-module-behavioral    .pn-module-stripe, .pn-module-behavioral::before   { background: var(--pn-sage); }
.pn-module-developmental .pn-module-stripe, .pn-module-developmental::before{ background: var(--pn-purple); }
.pn-module-clinical      .pn-module-stripe, .pn-module-clinical::before     { background: #C84B4B; }

/* ----- Module card style (block style: Module Card) ----- */
.is-style-module-card {
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow:
    0 1px 2px rgba(26,58,91,0.04),
    0 12px 32px rgba(26,58,91,0.08);
  transition: transform .25s cubic-bezier(.23,1,.32,1), box-shadow .25s ease;
  border-top: 5px solid var(--pn-coral);
}
.is-style-module-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 1px 2px rgba(26,58,91,0.06),
    0 24px 48px rgba(26,58,91,0.12);
}

/* ----- Eyebrow label ----- */
.is-style-eyebrow, .pn-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--pn-font-heading);
  color: var(--pn-coral);
}

/* ----- Coral pill button ----- */
.wp-block-button.is-style-coral-pill .wp-block-button__link {
  background-color: var(--pn-coral);
  color: #fff;
  border-radius: 999px;
  padding: 16px 32px;
  font-family: var(--pn-font-heading);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(240,112,64,0.38);
  transition: background-color .18s cubic-bezier(.23,1,.32,1), transform .12s ease;
}
.wp-block-button.is-style-coral-pill .wp-block-button__link:hover { background-color: #E66135; }
.wp-block-button.is-style-coral-pill .wp-block-button__link:active { transform: scale(0.98); }

.wp-block-button.is-style-ghost-pill .wp-block-button__link {
  background-color: #fff;
  color: var(--pn-navy);
  border: 1px solid rgba(26,58,91,0.12);
  border-radius: 999px;
  padding: 16px 32px;
  font-family: var(--pn-font-heading);
  font-weight: 800;
  font-size: 15px;
}
.wp-block-button.is-style-ghost-pill .wp-block-button__link:hover { border-color: rgba(26,58,91,0.32); }

/* ----- Marquee strip used in hero ----- */
.pn-marquee {
  background: var(--pn-navy);
  color: #fff;
  padding: 12px 0;
  overflow: hidden;
  font-family: var(--pn-font-heading);
  font-weight: 800;
  letter-spacing: 0.22em;
  font-size: 12px;
  text-transform: uppercase;
}
.pn-marquee__track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: pn-marquee 38s linear infinite;
  width: max-content;
}
.pn-marquee__item::before {
  content: "•";
  color: var(--pn-coral);
  margin-right: 12px;
}
@keyframes pn-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .pn-marquee__track { animation: none; }
}

/* ----- Powder-blue gradient hero stage ----- */
.pn-powder-stage {
  background: linear-gradient(160deg, var(--pn-powder) 0%, #DCE9FF 50%, #CBE4FF 100%);
  position: relative;
  overflow: hidden;
}
.pn-powder-stage::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("assets/images/notebook-pattern.webp");
  background-size: 1100px auto;
  opacity: 0.18;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ----- Article cards (used by query loop) ----- */
.pn-article-grid .wp-block-post {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(26,58,91,0.04), 0 12px 28px rgba(26,58,91,0.08);
  transition: transform .25s cubic-bezier(.23,1,.32,1), box-shadow .25s ease;
}
.pn-article-grid .wp-block-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 2px rgba(26,58,91,0.06), 0 22px 44px rgba(26,58,91,0.12);
}
.pn-article-grid .wp-block-post-title a { color: var(--pn-navy); }
.pn-article-grid .wp-block-post-title a:hover { color: var(--pn-coral); }
.pn-article-grid .wp-block-post-featured-image img {
  border-radius: 12px;
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
}

/* ----- Mailchimp form polish ----- */
.pn-mailchimp-form input[type="email"] {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(26,58,91,0.12);
  font-family: var(--pn-font-body);
  font-size: 15px;
  color: var(--pn-navy);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231A3A5B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.5'><path d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/><polyline points='22,6 12,13 2,6'/></svg>");
  background-repeat: no-repeat;
  background-position: 16px center;
}
.pn-mailchimp-form input[type="email"]:focus {
  outline: none;
  border-color: var(--pn-coral);
  box-shadow: 0 0 0 3px rgba(240,112,64,0.18);
}
.pn-mailchimp-form button,
.pn-mailchimp-form input[type="submit"] {
  background: var(--pn-coral);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 16px 32px;
  font-family: var(--pn-font-heading);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(240,112,64,0.38);
  transition: background-color .18s ease;
}
.pn-mailchimp-form button:hover { background-color: #E66135; }
.pn-mailchimp-form .helper { font-size: 12px; color: rgba(26,58,91,0.6); margin-top: 8px; text-align: center; }

/* ----- Footer wave divider ----- */
.pn-wave-top {
  position: relative;
}
.pn-wave-top::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 12px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 12' preserveAspectRatio='none'><path d='M0,6 Q100,0 200,6 T400,6 T600,6 T800,6 T1000,6 T1200,6' stroke='%23F07040' stroke-width='3' fill='none' stroke-linecap='round'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* ----- Ensure containers feel right on mobile ----- */
.wp-block-group.is-layout-constrained { max-width: 1280px; }

/* ----- Reveal animation (intersection-friendly via CSS only) ----- */
@media (prefers-reduced-motion: no-preference) {
  .pn-reveal { opacity: 0; transform: translateY(16px); animation: pnReveal .9s cubic-bezier(.23,1,.32,1) .1s forwards; }
  @keyframes pnReveal { to { opacity: 1; transform: translateY(0); } }
}

/* ----- Editor body styles inherit too ----- */
.editor-styles-wrapper, .wp-block-post-content { font-family: var(--pn-font-body); color: var(--pn-navy); }

/* ============================================================
   Mobile navigation — hamburger overlay
   Make the full-screen menu match the brand instead of the
   default WordPress unstyled look.
   ============================================================ */

/* Hamburger icon button (the ☰) */
.wp-block-navigation__responsive-container-open {
  color: var(--pn-navy) !important;
  background: transparent !important;
  border: none !important;
  padding: 4px !important;
}
.wp-block-navigation__responsive-container-open:hover {
  color: var(--pn-coral) !important;
}

/* Full-screen panel that slides in */
.wp-block-navigation__responsive-container.is-menu-open {
  background: var(--pn-navy) !important;
  padding: 1.5rem 2rem 3rem !important;
}

/* Close (×) button */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__responsive-container-close {
  color: rgba(255,255,255,0.6) !important;
}
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__responsive-container-close:hover {
  color: #fff !important;
}
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__responsive-container-close svg {
  fill: currentColor;
}

/* The list of links */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__container {
  gap: 0 !important;
  margin-top: 3rem;
  width: 100%;
}

/* Divider lines between items */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  width: 100%;
}

/* Each link text */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item a {
  font-family: var(--pn-font-display) !important;
  font-weight: 400 !important;
  font-size: clamp(26px, 6vw, 36px) !important;
  color: #fff !important;
  padding: 0.9rem 0 !important;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  display: block;
  transition: color 0.15s ease, padding-left 0.15s ease;
}
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item__content:hover,
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item a:hover {
  color: var(--pn-coral-soft) !important;
  padding-left: 0.4rem !important;
}

/* Sub-menus inside the overlay */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__submenu-container {
  background: rgba(255,255,255,0.06) !important;
  padding: 0 0 0 1.25rem !important;
  border-radius: 0 !important;
}
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__submenu-container a {
  font-size: 18px !important;
  color: rgba(255,255,255,0.7) !important;
  padding: 0.6rem 0 !important;
}
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__submenu-container a:hover {
  color: var(--pn-coral-soft) !important;
}
