/*
 * Everyday Forkful - block-styles.css
 *
 * Structural and interactive CSS that theme.json cannot express:
 * - Hover transforms (card lift, image scale)
 * - Sticky positioning for header condense and share rail
 * - Media query breakpoints for mobile/desktop layout switching
 * - Block style variation implementations
 *
 * IMPORTANT: All colors come from CSS variables generated by theme.json.
 * Never hardcode hex values here. Use var(--wp--preset--color--SLUG).
 * All spacing uses the 8px scale: 8 / 16 / 24 / 32 / 48 / 64 / 96px.
 */

/* ---------------------------------------------------------------------------
   1. Header: condense on scroll
   ------------------------------------------------------------------------- */

.everydayforkful-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 72px;
  transition: height 200ms ease-out, box-shadow 200ms ease-out;
  background-color: var(--wp--preset--color--bg-card);
  border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.everydayforkful-header--condensed {
  height: 64px;
  box-shadow: 0 1px 0 var(--wp--preset--color--border-light);
}

/* Brand logo: render the badge as a circular mark (matches the footer logo) */
.everydayforkful-header__brand .wp-block-site-logo img {
  border-radius: 9999px;
}

@media (max-width: 768px) {
  .everydayforkful-header {
    height: 64px;
  }

  .everydayforkful-header__nav {
    display: none;
  }

  .everydayforkful-header__subscribe {
    display: none;
  }

  .everydayforkful-hamburger {
    display: flex;
  }
}

@media (min-width: 769px) {
  .everydayforkful-hamburger {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   2. Mobile overlay nav
   ------------------------------------------------------------------------- */

.everydayforkful-mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background-color: rgba(42, 38, 34, 0.4); /* text-primary at 40% opacity */
}

.everydayforkful-mobile-nav.is-open {
  display: block;
}

.everydayforkful-mobile-nav__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: min(320px, 85vw);
  height: 100%;
  background-color: var(--wp--preset--color--bg-card);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 24px;
  animation: slideInFromLeft 250ms ease-out;
  overflow-y: auto;
}

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.everydayforkful-mobile-nav__search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: 9999px;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 15px;
  background-color: var(--wp--preset--color--bg-primary);
  color: var(--wp--preset--color--text-primary);
  outline: none;
}

.everydayforkful-mobile-nav__search-input:focus {
  border-color: var(--wp--preset--color--accent-terracotta);
}

.everydayforkful-mobile-nav__list {
  flex: 1;
}

.everydayforkful-mobile-nav__list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.everydayforkful-mobile-nav__list li a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--wp--preset--color--border-light);
  font-family: var(--wp--preset--font-family--inter);
  font-size: 16px;
  font-weight: 500;
  color: var(--wp--preset--color--text-primary);
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.everydayforkful-mobile-nav__list li a:hover {
  color: var(--wp--preset--color--accent-terracotta);
}

.everydayforkful-mobile-nav__subscribe {
  padding-top: 8px;
}

/* ---------------------------------------------------------------------------
   3. Post card block style variation
   ------------------------------------------------------------------------- */

.wp-block-group.is-style-post-card {
  background-color: var(--wp--preset--color--bg-card);
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
  cursor: pointer;
}

.wp-block-group.is-style-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(42, 38, 34, 0.06);
}

.wp-block-group.is-style-post-card .wp-block-image img,
.wp-block-group.is-style-post-card .wp-block-post-featured-image img {
  transition: transform 220ms ease-out;
  border-radius: 0; /* images are flush to card top, no radius */
}

.wp-block-group.is-style-post-card:hover .wp-block-image img,
.wp-block-group.is-style-post-card:hover .wp-block-post-featured-image img {
  transform: scale(1.02);
}

/* ---------------------------------------------------------------------------
   4. Newsletter block style variation
   ------------------------------------------------------------------------- */

.wp-block-group.is-style-newsletter-block {
  background-color: var(--wp--preset--color--bg-muted);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
}

@media (max-width: 768px) {
  .wp-block-group.is-style-newsletter-block {
    padding: 24px;
  }
}

/* ---------------------------------------------------------------------------
   5. Sage CTA (Inline Save-to-Pinterest CTA) block style
   ------------------------------------------------------------------------- */

.wp-block-group.is-style-sage-cta {
  border: 1px solid var(--wp--preset--color--accent-sage);
  border-radius: 16px;
  padding: 24px;
}

/* ---------------------------------------------------------------------------
   6. Category pill button style variation
   ------------------------------------------------------------------------- */

.wp-block-button.is-style-category-pill .wp-block-button__link {
  border-radius: 9999px;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  background-color: var(--wp--preset--color--accent-terracotta);
  color: #ffffff;
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
   7. Pin overlay button style variation
   ------------------------------------------------------------------------- */

.wp-block-button.is-style-pin-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  opacity: 0;
  transition: opacity 150ms;
  z-index: 10;
}

.wp-block-button.is-style-pin-overlay .wp-block-button__link {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background-color: var(--wp--preset--color--accent-pinterest);
  color: #ffffff;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

/* Reveal on parent hover (desktop) */
.everydayforkful-image-wrap:hover .wp-block-button.is-style-pin-overlay {
  opacity: 1;
}

/* Tap reveal on mobile handled by Tasty Pins JS */

/* ---------------------------------------------------------------------------
   8. Outline terracotta button style variation
   ------------------------------------------------------------------------- */

.wp-block-button.is-style-outline-terracotta .wp-block-button__link {
  background-color: transparent;
  border: 1px solid var(--wp--preset--color--accent-terracotta);
  color: var(--wp--preset--color--accent-terracotta);
  border-radius: 12px;
}

.wp-block-button.is-style-outline-terracotta .wp-block-button__link:hover {
  background-color: var(--wp--preset--color--accent-terracotta);
  color: #ffffff;
}

/* ---------------------------------------------------------------------------
   9. Sticky social share rail
   ------------------------------------------------------------------------- */

/* Desktop: vertical column pinned to left of article */
.everydayforkful-share-rail {
  position: relative;
}

.everydayforkful-share-rail__desktop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 50vh;
  transform: translateY(-50%);
}

.everydayforkful-share-rail__mobile {
  display: none;
}

@media (max-width: 768px) {
  .everydayforkful-share-rail__desktop {
    display: none;
  }

  .everydayforkful-share-rail__mobile {
    display: flex;
  }
}

/* Hover state for share buttons */
.everydayforkful-share-btn:hover {
  opacity: 0.85;
  transition: opacity 150ms ease-out;
}

/* ---------------------------------------------------------------------------
   10. Utility: mobile only / desktop only
   ------------------------------------------------------------------------- */

.everydayforkful-mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .everydayforkful-mobile-only {
    display: block;
  }

  .everydayforkful-desktop-only {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   11. General buttons
   ------------------------------------------------------------------------- */

.everydayforkful-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 150ms ease-out;
  min-height: 44px;
}

.everydayforkful-btn--primary {
  background-color: var(--wp--preset--color--accent-terracotta);
  color: #ffffff;
}

.everydayforkful-btn--primary:hover {
  opacity: 0.9;
}

.everydayforkful-btn--full-width {
  display: flex;
  width: 100%;
}

/* ---------------------------------------------------------------------------
   12. Navigation active state (terracotta 2px underline)
   ------------------------------------------------------------------------- */

.everydayforkful-header__nav .current-menu-item > a,
.everydayforkful-header__nav .current-menu-ancestor > a,
.everydayforkful-header__nav .wp-block-navigation-item.current-menu-item a {
  text-decoration: underline;
  text-decoration-color: var(--wp--preset--color--accent-terracotta);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* ---------------------------------------------------------------------------
   13. Footer responsive collapse (see section 22 for full grid rules)
   ------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   14. Icon base styles
   ------------------------------------------------------------------------- */

.everydayforkful-icon {
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   15. Focus-visible ring for accessibility
   ------------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent-terracotta);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent-terracotta);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------------------
   16. Canonical card system: .everydayforkful-card and variants
   Card base: 4:3 image, 12px radius, border, white bg, hover lift.
   Variants: --feature, --compact, --numbered
   ------------------------------------------------------------------------- */

.everydayforkful-card,
.ns-post-card {
  background-color: var(--wp--preset--color--bg-card);
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.everydayforkful-card:hover,
.ns-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 38, 34, 0.08);
}

/* Image wrapper: enforces 4:3 aspect ratio, hides overflow for scale effect */
.everydayforkful-card__image,
.ns-post-card__image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  border-radius: 12px 12px 0 0;
}

.everydayforkful-card__image img,
.ns-post-card__image-wrap img,
.ns-post-card__image-wrap .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease-out;
  border-radius: 0;
}

.everydayforkful-card:hover .everydayforkful-card__image img,
.ns-post-card:hover .ns-post-card__image-wrap img,
.ns-post-card:hover .ns-post-card__image-wrap .wp-block-post-featured-image img {
  transform: scale(1.03);
}

/* Card body */
.everydayforkful-card__body,
.ns-post-card__body {
  padding: var(--wp--preset--spacing--3);
  display: flex;
  flex-direction: column;
  flex: 1;
}

@media (max-width: 768px) {
  .everydayforkful-card__body,
  .ns-post-card__body {
    padding: 18px;
  }
}

/* Category label: uppercase terracotta 11px tracked */
.everydayforkful-card__category,
.ns-post-card__category,
.ns-category-pill {
  display: block;
  font-family: var(--wp--preset--font-family--inter);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent-terracotta);
  text-decoration: none;
  margin-bottom: var(--wp--preset--spacing--1);
}

/* Card title: Fraunces serif, 22-26px */
.everydayforkful-card__title,
.ns-post-card__title {
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 500;
  line-height: 1.25;
  color: var(--wp--preset--color--text-primary);
  margin-top: 0;
  margin-bottom: var(--wp--preset--spacing--1);
  text-decoration: none;
}

/* Card meta: 12-13px muted */
.everydayforkful-card__meta,
.ns-post-card__meta {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 13px;
  font-weight: 500;
  color: var(--wp--preset--color--text-muted);
  margin-top: auto;
  padding-top: var(--wp--preset--spacing--1);
}

/* Feature variant: larger title */
.everydayforkful-card--feature .everydayforkful-card__title {
  font-size: clamp(22px, 2.2vw, 26px);
}

/* Compact variant: small thumb + title + meta, no excerpt */
.everydayforkful-card--compact {
  flex-direction: row;
  align-items: flex-start;
}

.everydayforkful-card--compact .everydayforkful-card__image {
  aspect-ratio: 1 / 1;
  width: 96px;
  min-width: 96px;
  border-radius: 8px;
}

.everydayforkful-card--compact .everydayforkful-card__body {
  padding: 12px 14px;
}

/* Numbered variant: circular rank badge top-left of image */
.everydayforkful-card--numbered {
  position: relative;
}

.everydayforkful-card--numbered .everydayforkful-card__rank {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background-color: var(--wp--preset--color--accent-terracotta);
  color: #ffffff;
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(42, 38, 34, 0.2);
}

/* Pin overlay inside card: shown on card hover */
.ns-post-card:hover .ns-pin-overlay-btn,
.everydayforkful-card:hover .ns-pin-overlay-btn {
  opacity: 1;
}

/* ---------------------------------------------------------------------------
   17. "Popular in" numbered strip section
   ------------------------------------------------------------------------- */

.ns-popular-strip {
  padding-top: var(--wp--preset--spacing--6);
  padding-bottom: var(--wp--preset--spacing--6);
}

.ns-popular-strip__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--wp--preset--spacing--4);
}

.ns-popular-strip__see-all {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 13px;
  font-weight: 600;
  color: var(--wp--preset--color--accent-terracotta);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.ns-popular-strip__see-all:hover {
  text-decoration: underline;
}

.ns-popular-strip__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--wp--preset--spacing--3);
}

@media (max-width: 1024px) {
  .ns-popular-strip__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .ns-popular-strip__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--wp--preset--spacing--2);
  }
}

@media (max-width: 480px) {
  .ns-popular-strip__grid {
    grid-template-columns: 1fr;
  }
}

/* Each numbered item in the popular strip */
.ns-popular-item {
  background-color: var(--wp--preset--color--bg-card);
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.ns-popular-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 38, 34, 0.08);
}

.ns-popular-item__image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}

.ns-popular-item__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease-out;
}

.ns-popular-item:hover .ns-popular-item__image-wrap img {
  transform: scale(1.03);
}

.ns-popular-item__rank {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background-color: var(--wp--preset--color--accent-terracotta);
  color: #ffffff;
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(42, 38, 34, 0.2);
}

.ns-popular-item__body {
  padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--3);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ns-popular-item__category {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent-terracotta);
  margin-bottom: 6px;
  text-decoration: none;
}

.ns-popular-item__title {
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--wp--preset--color--text-primary);
  text-decoration: none;
  margin: 0;
}

.ns-popular-item__title:hover {
  color: var(--wp--preset--color--accent-terracotta);
}

/* ---------------------------------------------------------------------------
   18. Newsletter band container
   ------------------------------------------------------------------------- */

.ns-newsletter-cta--full {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 22px !important;
  padding: 48px !important;
}

@media (max-width: 768px) {
  .ns-newsletter-cta--full {
    padding: 28px !important;
    border-radius: 16px !important;
  }
}

/* ---------------------------------------------------------------------------
   19. Section vertical-padding utility classes
   ------------------------------------------------------------------------- */

.ns-section {
  padding-top: var(--wp--preset--spacing--6);
  padding-bottom: var(--wp--preset--spacing--6);
}

@media (max-width: 768px) {
  .ns-section {
    padding-top: var(--wp--preset--spacing--5);
    padding-bottom: var(--wp--preset--spacing--5);
  }
}

.ns-section--xl {
  padding-top: 80px;
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .ns-section--xl {
    padding-top: 56px;
    padding-bottom: 56px;
  }
}

/* ---------------------------------------------------------------------------
   20. Grid gap utilities (homepage grids)
   ------------------------------------------------------------------------- */

.ns-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 1024px) {
  .ns-grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .ns-grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------------------------------------------------------------------------
   21. Editor's Picks section header with View-all link
   ------------------------------------------------------------------------- */

.ns-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--wp--preset--spacing--4);
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--2);
}

.ns-section-header__view-all {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 13px;
  font-weight: 600;
  color: var(--wp--preset--color--accent-terracotta);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.ns-section-header__view-all:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   22. Footer 4-column grid (Brand / Explore / Company / Legal)
   ------------------------------------------------------------------------- */

.everydayforkful-footer__columns {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--wp--preset--spacing--6);
  align-items: start;
}

@media (max-width: 1024px) {
  .everydayforkful-footer__columns {
    grid-template-columns: 1fr 1fr;
    gap: var(--wp--preset--spacing--5);
  }
}

@media (max-width: 768px) {
  .everydayforkful-footer__columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .everydayforkful-footer__col {
    width: 100% !important;
    border-bottom: 1px solid var(--wp--preset--color--border-light);
    padding-bottom: 16px;
    padding-top: 16px;
  }

  .everydayforkful-footer__col:first-child {
    padding-top: 0;
  }

  .everydayforkful-footer__bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* ---------------------------------------------------------------------------
   23. Browse-by-room section chip hover state
   ------------------------------------------------------------------------- */

.ns-browse-room-link:hover {
  transform: translateY(-3px);
  color: var(--wp--preset--color--accent-terracotta);
}

.ns-browse-room-link:hover span:first-child {
  border-color: var(--wp--preset--color--accent-terracotta);
  background-color: var(--wp--preset--color--bg-muted);
}

/* ---------------------------------------------------------------------------
   24. Article body: image radius and caption
   ------------------------------------------------------------------------- */

.wp-block-post-content .wp-block-image img,
.wp-block-post-content .wp-block-cover {
  border-radius: 12px;
}

.wp-block-post-content .wp-block-image figcaption,
.wp-block-post-content figcaption {
  font-family: var(--wp--preset--font-family--inter);
  font-size: 13px;
  color: var(--wp--preset--color--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Article body paragraph sizing */
.wp-block-post-content p {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.75;
}

.wp-block-post-content h2 {
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.15;
}

.wp-block-post-content h3 {
  font-family: var(--wp--preset--font-family--fraunces);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 500;
  line-height: 1.2;
}
