/* =============================================
   @theadhdtruth Brand Design System v2.0
   Fonts: Lexend + Quicksand (Google Fonts)
   Colors: WCAG 2.1 AA compliant overrides
   ============================================= */

/* Import brand fonts */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700;800&family=Quicksand:wght@300;400;500;600;700&display=swap');

/* === BODY / GLOBAL: Quicksand Medium === */
body,
.wp-site-blocks,
p,
li,
td,
th,
dd,
figcaption,
.wp-block-paragraph,
.entry-content,
.comment-body {
  font-family: 'Quicksand', sans-serif !important;
  font-weight: 500;
}

/* === HEADINGS: Lexend Bold === */
h1, h2, h3, h4, h5, h6,
.wp-block-heading,
.wp-block-post-title,
.wp-block-post-title a,
.entry-title,
.entry-title a {
  font-family: 'Lexend', sans-serif !important;
  font-style: normal !important;
  font-weight: 700 !important;
}

/* H5/H6 slightly lighter */
h5, h6 {
  font-weight: 600 !important;
}

/* === SITE TITLE: Lexend Bold, no italic === */
.wp-block-site-title,
.wp-block-site-title a,
.site-title,
.site-title a {
  font-family: 'Lexend', sans-serif !important;
  font-style: normal !important;
  font-weight: 700 !important;
}

/* === NAVIGATION: Lexend SemiBold === */
.wp-block-navigation,
.wp-block-navigation a,
.wp-block-navigation .wp-block-navigation-item__content,
.wp-block-navigation-item a {
  font-family: 'Lexend', sans-serif !important;
  font-weight: 600 !important;
  font-size: 1.05rem !important;
}

/* === BUTTONS: Lexend Bold === */
.wp-block-button__link,
.wp-element-button,
.wp-block-search__button {
  font-family: 'Lexend', sans-serif !important;
  font-weight: 700 !important;
}

/* === NAV BAR CONTRAST FIX ===
   Old: green #2B7A3A on coral #E8593C = 1.50:1 (FAIL)
   Fix: white text on coral = 3.17:1+ for large text
   Better: swap nav bg to green with cream text = 4.76:1 (PASS) */
.wp-block-navigation a,
.wp-block-navigation .wp-block-navigation-item__content,
.wp-block-navigation-item a {
  color: #F5F2EC !important;
}

/* Nav hover state */
.wp-block-navigation a:hover,
.wp-block-navigation .wp-block-navigation-item__content:hover {
  color: #FFFFFF !important;
  text-decoration: underline !important;
}

/* Mobile hamburger icon visibility */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-open svg {
  color: #F5F2EC !important;
  fill: #F5F2EC !important;
}

/* Mobile menu panel */
.wp-block-navigation__responsive-container.is-menu-open {
  background-color: #2B7A3A !important;
}

.wp-block-navigation__responsive-container.is-menu-open a {
  color: #F5F2EC !important;
}

/* Close button in mobile menu */
.wp-block-navigation__responsive-container-close,
.wp-block-navigation__responsive-container-close svg {
  color: #F5F2EC !important;
  fill: #F5F2EC !important;
}

/* === GOLD HEADING CONTRAST FIX ===
   Old: #D4A017 on cream #F5F2EC = 2.13:1 (FAIL)
   Fix: Darken to #8B6914 = 4.58:1 (PASS AA for large text) */
.has-text-color[style*="D4A017"],
.has-text-color[style*="d4a017"] {
  color: #8B6914 !important;
}

/* === CORAL TEXT CONTRAST FIX ===
   Old: #E8593C on cream #F5F2EC = 3.17:1 (FAIL for normal text)
   Fix: Darken coral to #C7432A = 4.52:1 (PASS AA) */
.has-text-color[style*="E8593C"],
.has-text-color[style*="e8593c"] {
  color: #C7432A !important;
}

/* Ensure body text stays dark slate for readability */
.entry-content p,
.wp-block-paragraph {
  color: #1E293B;
}

/* === SIDEBAR: Lexend for headings === */
.widget-title,
.wp-block-heading.widget-title {
  font-family: 'Lexend', sans-serif !important;
  font-weight: 600 !important;
}

/* === BLOCKQUOTES: Quicksand Light Italic === */
blockquote,
.wp-block-quote,
.wp-block-pullquote {
  font-family: 'Quicksand', sans-serif !important;
  font-weight: 300 !important;
  font-style: italic !important;
}

/* === FOOTER: consistent fonts === */
footer,
.wp-block-template-part footer {
  font-family: 'Quicksand', sans-serif !important;
}

footer h1, footer h2, footer h3,
footer h4, footer h5, footer h6 {
  font-family: 'Lexend', sans-serif !important;
}

/* =============================================
   Day 9: Blog Listing + Homepage Layout Fixes
   ============================================= */

/* 9.1 Blog listing: 2-column card grid */
.wp-block-post-template {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 2rem !important;
}

.wp-block-post-template > li {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  padding-bottom: 1.5rem;
}

.wp-block-post-template > li:hover {
  box-shadow: 0 4px 16px rgba(30, 41, 59, 0.14);
  transform: translateY(-2px);
}

/* 9.2 Consistent thumbnail sizes */
.wp-block-post-template .wp-block-post-featured-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  margin-bottom: 0;
}

.wp-block-post-template .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wp-block-post-template .wp-block-post-title {
  padding: 1rem 1.5rem 0.25rem;
  font-size: 1.25rem !important;
  line-height: 1.3 !important;
}

.wp-block-post-template .wp-block-post-title a {
  color: #1E293B !important;
  text-decoration: none !important;
}

.wp-block-post-template .wp-block-post-title a:hover {
  color: #2B7A3A !important;
}

.wp-block-post-template .wp-block-post-excerpt,
.wp-block-post-template .wp-block-post-date {
  padding: 0 1.5rem;
  font-size: 0.9rem;
}

.wp-block-post-template .wp-block-post-date {
  color: #64748b;
  font-size: 0.8rem;
}

/* 9.3 Homepage hero: reduce top spacing */
.home .wp-block-post-content > .wp-block-group:first-child,
.home .entry-content > .wp-block-group:first-child {
  margin-top: 0 !important;
  padding-top: 1rem !important;
}

/* 9.4 Sidebar: reduce prominence */
.wp-block-columns > .wp-block-column:last-child {
  font-size: 0.9rem;
}

.wp-block-columns > .wp-block-column:last-child .wp-block-heading {
  font-size: 1.1rem !important;
  color: #2B7A3A !important;
  border-bottom: 2px solid #D4A017;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* 9.5 Footer gap fix */
.wp-site-blocks > footer,
footer.wp-block-template-part {
  margin-top: 0 !important;
  padding-top: 2rem;
}

/* 9.6 Reading time style (for WPCode snippet) */
.reading-time {
  display: inline-block;
  color: #64748b;
  font-size: 0.85rem;
  font-family: 'Quicksand', sans-serif;
  margin-bottom: 1rem;
  padding: 0.25rem 0.75rem;
  background: #F5F2EC;
  border-radius: 20px;
}

.reading-time::before {
  content: '⏱ ';
}

/* Mobile responsive: single column on small screens */
@media (max-width: 768px) {
  .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
  
  .wp-block-columns {
    flex-direction: column !important;
  }
  
  .wp-block-columns > .wp-block-column {
    flex-basis: 100% !important;
  }
}

/* =============================================
   Day 12: Mobile + Accessibility Polish
   ============================================= */

/* 12.2 Mobile hamburger contrast fix */
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-open {
  color: #F5F2EC !important;
  fill: #F5F2EC !important;
}

.wp-block-navigation__responsive-container-close svg,
.wp-block-navigation__responsive-container-close {
  color: #F5F2EC !important;
  fill: #F5F2EC !important;
}

/* 12.3 Subscribe form mobile optimization */
@media (max-width: 768px) {
  .wp-block-jetpack-subscriptions form {
    flex-direction: column !important;
  }
  
  .wp-block-jetpack-subscriptions input[type="email"] {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    font-size: 16px !important; /* Prevents iOS zoom */
    border-radius: 8px !important;
    margin-bottom: 0.5rem !important;
  }
  
  .wp-block-jetpack-subscriptions button,
  .wp-block-jetpack-subscriptions input[type="submit"] {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }
}

/* 12.6 Focus indicators for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #D4A017 !important;
  outline-offset: 2px !important;
  border-radius: 3px;
}

.wp-block-navigation a:focus-visible {
  outline-color: #F5F2EC !important;
  outline-offset: 3px !important;
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: #2B7A3A;
  color: #F5F2EC;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
  top: 0;
}

/* Improve link visibility in content */
.entry-content a,
.wp-block-post-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.entry-content a:hover,
.wp-block-post-content a:hover {
  text-decoration-thickness: 2px;
  color: #2B7A3A !important;
}

/* === NAV BAR BACKGROUND: coral -> green for WCAG AA contrast === */
.has-tertiary-background-color {
  background-color: #2B7A3A !important;
}


/* === FEATURED IMAGE: constrain portrait images on single posts === */
.wp-block-post-featured-image img {
  max-height: 500px;
  width: auto;
  object-fit: contain;
}

/* === INLINE IMAGES in classic/freeform blocks: center + constrain === */
.entry-content li > a > img,
.entry-content p > a > img {
  max-width: 100%;
  height: auto;
  max-height: 600px;
  display: block;
  margin: 1.5rem auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(30, 41, 59, 0.08);
}