/* ============================================
   FoodLore Custom CSS \u2014 Kadence Theme
   ============================================ */

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #1A3C34, #D4920B);
  z-index: 99999;
  transition: width 0.1s ease;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.dark-mode-toggle:hover {
  background: rgba(0,0,0,0.05);
}

/* Dark Mode Styles */
body.dark-mode {
  --global-palette1: #D4920B;
  --global-palette2: #B07A09;
  --global-palette3: #E8E8E8;
  --global-palette4: #D1D1D1;
  --global-palette5: #AAAAAA;
  --global-palette6: #888888;
  --global-palette7: #2A2A2A;
  --global-palette8: #1A1A1A;
  --global-palette9: #121212;
  background-color: #121212 !important;
  color: #D1D1D1 !important;
}
body.dark-mode .site-header,
body.dark-mode .entry-content,
body.dark-mode .site-footer {
  background-color: #121212;
}
body.dark-mode .article-card,
body.dark-mode .bento-card {
  background-color: #1E1E1E !important;
  border-color: #333 !important;
}
body.dark-mode .article-card:hover,
body.dark-mode .bento-card:hover {
  border-color: #D4920B !important;
}

/* Pullquotes */
.wp-block-pullquote {
  border-left: 4px solid #D4920B;
  border-top: none;
  border-bottom: none;
  border-right: none;
  padding: 20px 30px;
  margin: 32px 0;
  font-style: italic;
}
.wp-block-pullquote blockquote p {
  font-size: 1.25em;
  line-height: 1.5;
  color: #1A3C34;
}

/* FAQ Accordion */
.faq-accordion details {
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.faq-accordion details[open] {
  border-color: #D4920B;
  box-shadow: 0 2px 8px rgba(212, 146, 11, 0.1);
}
.faq-accordion summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Space Grotesk', sans-serif;
}
.faq-accordion summary::-webkit-details-marker {
  display: none;
}
.faq-accordion details \u003E div,
.faq-accordion details \u003E p {
  padding: 0 20px 16px;
  color: #4B5563;
  line-height: 1.6;
}

/* Stats Bars */
.stat-bar {
  background: #F5EDE0;
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0 16px;
}
.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1A3C34, #D4920B);
  border-radius: 8px;
  transition: width 0.8s ease;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.share-buttons a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #E5E7EB;
  color: #1A3C34;
}
.share-buttons a:hover {
  background: #1A3C34;
  color: white;
  border-color: #1A3C34;
}

/* Homepage Hero - Override Kadence defaults */
.homepage-hero .wp-block-cover__inner-container {
  max-width: 800px;
}

/* Bento Grid */
.bento-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}
.bento-card {
  border-radius: 20px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  min-height: 200px !important;
}
.bento-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 12px 32px rgba(26, 60, 52, 0.15) !important;
  border-color: #D4920B !important;
}
.bento-wide {
  grid-column: span 2 !important;
}

/* Article Cards */
.article-card {
  background: white !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
  transition: all 0.3s ease !important;
}
.article-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
}
.overlay-cards .wp-block-post-featured-image {
  aspect-ratio: 16/9 !important;
  overflow: hidden !important;
}
.overlay-cards .wp-block-post-featured-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 0.3s ease !important;
}
.article-card:hover .wp-block-post-featured-image img {
  transform: scale(1.05) !important;
}

/* Category Filter Tabs */
.category-tabs .wp-block-button .wp-block-button__link {
  border-radius: 24px !important;
  padding: 8px 20px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: 'Space Grotesk', sans-serif !important;
  transition: all 0.2s ease !important;
  border: 1.5px solid #1A3C34 !important;
}

/* Newsletter section */
.homepage-newsletter .wp-block-jetpack-subscriptions {
  --subscribe-block-border-radius: 8px;
}

/* Sticky header shadow */
.item-is-fixed:not(.item-at-start):not(.item-hidden-above) .site-header-row-container-inner {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Mobile responsive */
@media (max-width: 781px) {
  .bento-grid {
    grid-template-columns: 1fr !important;
  }
  .bento-wide {
    grid-column: span 1 !important;
  }
}

/* Hide homepage page title above hero */
.home .entry-hero { display: none; }


/* Footer Styling */
.site-footer .site-middle-footer-wrap { background: #1A3C34 !important; padding: 48px 0; }
.site-footer .site-bottom-footer-wrap { background: #1A3C34 !important; padding: 24px 0; }
.site-footer .site-middle-footer-wrap .widget h3,
.site-footer .site-middle-footer-wrap .widget p,
.site-footer .site-middle-footer-wrap .widget a,
.site-footer .site-middle-footer-wrap .widget li { color: rgba(255,255,255,0.7); }
.site-footer .site-middle-footer-wrap .widget a:hover { color: #ffffff; }
.site-footer .site-bottom-footer-wrap .widget { color: rgba(255,255,255,0.5); }

/* Blog archive - title color consistent with homepage */
.entry-title a, 
.wp-block-post-title a {
  color: #1A3C34 !important;
  text-decoration: none;
}
.entry-title a:hover,
.wp-block-post-title a:hover {
  color: #D4920B !important;
}

/* FAQ Accordion Styling (global - all details elements) */
details {
  background: #EFECE9;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(139, 158, 126, 0.2);
  overflow: hidden;
}
details summary {
  padding: 16px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #1A3C34;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: '+';
  display: inline-block;
  margin-right: 12px;
  font-weight: 700;
  color: #D4920B;
  transition: transform 0.2s ease;
}
details[open] summary::before {
  content: '\2212';
}
details[open] summary {
  background: rgba(139, 158, 126, 0.1);
  border-bottom: 1px solid rgba(139, 158, 126, 0.15);
}
details > div,
details > p {
  padding: 16px 24px;
  color: #2D2D2D;
  line-height: 1.7;
}

/* Logo Fix - display logo as background since wp_get_attachment_image is not rendering */
.site-branding a.brand {
  display: block;
  width: 150px;
  height: 30px;
  background-image: url('https://foodlore.blog/wp-content/uploads/2026/03/foodlore-full-1.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center left;
}
.site-branding a.brand img {
  max-width: 150px;
  height: auto;
}

/* Tables — Bento Grid Style */
.entry-content table,
.wp-block-table table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: rgba(239, 236, 233, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  margin: 2em 0;
}

.entry-content table thead tr,
.wp-block-table table thead tr {
  background: #1A3C34;
}

.entry-content table thead th,
.wp-block-table table thead th {
  color: #D4920B;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 20px;
  text-align: left;
  border: none;
}

.entry-content table tbody td,
.wp-block-table table tbody td {
  padding: 12px 20px;
  color: #2D2D2D;
  font-size: 0.95rem;
  border: none;
  border-bottom: 1px solid rgba(139, 158, 126, 0.15);
}

.entry-content table tbody tr:last-child td,
.wp-block-table table tbody tr:last-child td {
  border-bottom: none;
}

.entry-content table tbody tr:nth-child(even),
.wp-block-table table tbody tr:nth-child(even) {
  background: rgba(239, 236, 233, 0.4);
}

.entry-content table tbody tr:hover,
.wp-block-table table tbody tr:hover {
  background: rgba(139, 158, 126, 0.12);
  transition: background 0.2s ease;
}

/* Table header — Force Forest Green */
table thead tr,
.entry-content table thead tr,
.wp-block-table table thead tr,
.wp-block-table.is-style-stripes table thead tr,
figure.wp-block-table table thead tr {
  background: #1A3C34 !important;
}

table thead th,
.entry-content table thead th,
.wp-block-table table thead th,
.wp-block-table.is-style-stripes table thead th,
figure.wp-block-table table thead th {
  background: #1A3C34 !important;
  color: #D4920B !important;
}

/* Responsive table */
@media (max-width: 781px) {
  .entry-content table,
  .wp-block-table table {
    font-size: 0.85rem;
  }
  .entry-content table thead th,
  .wp-block-table table thead th,
  .entry-content table tbody td,
  .wp-block-table table tbody td {
    padding: 10px 14px;
  }
}

/* ============================================
   Global Rounded Corners — Everything soft, no sharp edges
   ============================================ */

/* Images in articles and archives */
.entry-content img,
.wp-block-image img,
.post-thumbnail img,
.wp-block-post-featured-image img {
  border-radius: 12px;
}

/* Post cards in archive/blog grid */
.entry.post,
.wp-block-post {
  border-radius: 16px;
  overflow: hidden;
}

/* Buttons */
.wp-block-button__link,
.wp-element-button,
button,
input[type="submit"],
.kb-button {
  border-radius: 10px !important;
}

/* Navbar dropdown menu */
.sub-menu,
.kadence-menu-mega-enabled > .sub-menu,
.navigation .sub-menu,
header .sub-menu,
.header-navigation .sub-menu {
  border-radius: 12px !important;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Individual dropdown items — round top/bottom of first/last */
.sub-menu li:first-child > a {
  border-radius: 12px 12px 0 0;
}
.sub-menu li:last-child > a {
  border-radius: 0 0 12px 12px;
}

/* Search input */
input[type="search"],
input[type="text"],
input[type="email"],
textarea {
  border-radius: 10px !important;
}

/* Comments */
.comment-body,
.comment-respond {
  border-radius: 12px;
}

/* Blockquotes and pullquotes */
blockquote,
.wp-block-quote,
.wp-block-pullquote {
  border-radius: 12px;
}

/* Separator/divider */
.wp-block-separator {
  border-radius: 4px;
}

/* Author bio card */
.author-bio,
.entry-author-box {
  border-radius: 16px;
}

/* Related posts cards */
.jp-related-posts-i2__post {
  border-radius: 12px !important;
}
.jp-related-posts-i2__post-img {
  border-radius: 12px 12px 0 0 !important;
}

/* Share buttons */
.sharedaddy .sd-button,
.sd-social-icon .sd-content a {
  border-radius: 10px !important;
}

/* WP block group with backgrounds */
.wp-block-group.has-background {
  border-radius: 16px;
}

/* Kadence blocks */
.kt-accordion-panel-inner,
.kb-tabs-content-inner,
.kt-info-box-wrap {
  border-radius: 12px;
}

/* Cover blocks (hero sections) */
.wp-block-cover {
  border-radius: 0;  /* Keep hero full-bleed, no rounding */
}

/* Footer — keep square since it's edge-to-edge */
footer, .site-footer {
  border-radius: 0;
}

/* Navigation bar — keep square since it's edge-to-edge */
header, .site-header {
  border-radius: 0;
}

/* Pagination */
.pagination .page-numbers,
.nav-links .page-numbers {
  border-radius: 10px !important;
}

/* Category badges/pills */
.cat-links a,
.taxonomy-category a {
  border-radius: 20px;
  padding: 4px 12px;
}

/* Category Filter Bar — Blog Page */
.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 24px 0 32px;
  max-width: 800px;
  margin: 0 auto;
}

.filter-pill {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1.5px solid #1A3C34;
  color: #1A3C34;
  background: transparent;
}

.filter-pill:hover {
  background: #1A3C34;
  color: #EFECE9;
}

.filter-pill.filter-active {
  background: #1A3C34;
  color: #EFECE9;
}

/* All pill hover — lighten on hover when active */
.filter-pill.filter-active:hover {
  background: #2a5c4e;
  color: #EFECE9;
}

/* Highlight current category page */
body.category-urban-farming .filter-pill[href*="urban-farming"],
body.category-food-tech .filter-pill[href*="food-tech"],
body.category-food-and-planet .filter-pill[href*="food-and-planet"],
body.category-food-industry .filter-pill[href*="food-industry"] {
  background: #1A3C34;
  color: #EFECE9;
}

/* On category pages, "All" is not active */
body.category .filter-pill.filter-active {
  background: transparent;
  color: #1A3C34;
}

@media (max-width: 600px) {
  .filter-pill {
    padding: 8px 18px;
    font-size: 0.8rem;
  }
}

/* Hero/Featured image on single posts — rounded */
.entry-thumbnail img,
.post-thumbnail img,
.kadence-thumbnail-position img,
.entry-content > .wp-block-post-featured-image img,
.singular .post-thumbnail img {
  border-radius: 16px !important;
}