/*
Theme Name: RecipeBook
Theme URI: https://themeshaper.com/recipebook/
Author: Automattic
Author URI: https://automattic.com
Description: RecipeBook is a versatile theme designed to cater to various content creators. It explores the Query Loop element in a very particular way, with zero spacings and block strokes.
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 5.7
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: recipebook
Tags: food-and-drink, two-columns, four-columns, wide-blocks, block-patterns, block-styles, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-site-editing, full-width-template, post-formats, rtl-language-support, style-variations, template-editing, theme-options, threaded-comments, translation-ready
*/

/*
 * Control the hover stylings of outline block style.
 */
.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background):hover {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--secondary);
}

/*
 * Link styles
 */
a {
	text-decoration-thickness: .0625em !important;
	text-underline-offset: .15em;
	color: #ff6600;
}
a:hover {
	color: #e65500;
}

/* === Ajax Search Lite Custom Styling for Header === */
.ajaxsearchlite {
    max-width: 40px;
    overflow: hidden;
    background: #000 !important;
    border-radius: 6px;
    transition: max-width 0.3s ease-in-out;
    position: relative;
}
.ajaxsearchlite:focus-within { max-width: 220px; }
.ajaxsearchlite input {
    background: #000 !important; color: #fff !important;
    border: none !important; height: 32px; font-size: 14px;
    padding: 0 10px 0 28px;
}
.ajaxsearchlite input::placeholder { color: #ccc !important; }
.ajaxsearchlite::before {
    content: "\1F50D"; position: absolute; left: 8px; top: 50%;
    transform: translateY(-50%); color: #fff; font-size: 14px; pointer-events: none;
}
.ajaxsearchlite .asl_results {
    background: #fff !important; border: 1px solid #ddd !important;
    border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin-top: 4px; overflow: hidden;
}
.ajaxsearchlite .asl_results .item { padding: 8px 12px; border-bottom: 1px solid #eee; color: #000; }
.ajaxsearchlite .asl_results .item:hover { background: #000 !important; color: #fff !important; }

/* === Leaderboard + Voting Styles (ManvsDrinks look) === */
.mvdrinks-filter { margin: 0 0 20px 0; text-align: right; }
.mvdrinks-filter label { color: #000; margin-right: 8px; font-weight: 600; }
.mvdrinks-filter select {
  background: #fff8f0; color: #000; border: 2px solid #ff6600;
  padding: 6px 10px; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.mvdrinks-filter select:hover { border-color: #e65500; }

.mvdrinks-leaderboard {
  width: 100%; border-collapse: collapse; font-size: 16px;
  margin: 10px 0 30px; background: #fffef9; border-radius: 10px;
  overflow: hidden; box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
.mvdrinks-leaderboard th {
  background: #ff6600; color: #fff; padding: 12px; text-transform: uppercase;
  letter-spacing: 1px; font-size: 14px;
}
.mvdrinks-leaderboard td { padding: 12px; border-bottom: 1px solid #f0f0f0; color: #333; }
.mvdrinks-leaderboard tr:nth-child(even) { background: #fffaf5; }
.mvdrinks-leaderboard tr:hover { background: #fff2e8; }

.mvdrinks-vote-btn {
  padding: 8px 16px; background: #ff6600; color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-weight: 700;
  text-transform: uppercase; transition: all 0.2s;
}
.mvdrinks-vote-btn:hover { background: #e65500; }
.mvdrinks-vote-btn.voted, .mvdrinks-vote-btn:disabled {
  background: #ccc; color: #666; cursor: not-allowed; font-weight: 600;
}

/* === Hovercard Preview (NEW) === */
.mvdrinks-hovercard{
  position: absolute; z-index: 10000; width: 320px; pointer-events: none;
  background: #ffffff; border: 2px solid #ff6600; border-radius: 10px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18); padding: 10px;
}
.mvdrinks-hovercard .mvdrinks-hc-img{
  width: 100%; height: auto; border-radius: 8px; display: block; margin-bottom: 8px;
}
.mvdrinks-hovercard .mvdrinks-hc-title{
  font-weight: 800; color: #ff6600; margin-bottom: 6px; font-size: 18px; line-height: 1.2;
}
.mvdrinks-hovercard .mvdrinks-hc-excerpt{
  color: #333; font-size: 14px; line-height: 1.4;
}

/* ========================================================= */
/* === Header Buttons (Top Drinks + Premium Diwali) — Final === */
/* ========================================================= */

/* Shared pulse animation */
@keyframes mvdrinks-pulse {
  0%   { transform: scale(1); box-shadow: 0 4px 10px rgba(211,95,36,0.3); }
  50%  { transform: scale(1.05); box-shadow: 0 6px 18px rgba(211,95,36,0.5); }
  100% { transform: scale(1); box-shadow: 0 4px 10px rgba(211,95,36,0.3); }
}

/* Wrapper aligns buttons with search bar */
.mvdrinks-button-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 950px;
  margin: 10px auto;
  gap: 14px;
  flex-wrap: wrap;
}

/* Base style (shared by both) */
.mvdrinks-topdrinks-btn,
.mvdrinks-premium-btn {
  display: inline-block;
  padding: 12px 22px;
  color: #fff !important;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(211,95,36,0.4);
  transition: all 0.3s ease-in-out;
  animation: mvdrinks-pulse 2s infinite;
  position: relative;
  white-space: nowrap;
  text-align: center;
}

/* === COMMUNITY RATED TOP DRINKS BUTTON === */
.mvdrinks-topdrinks-btn {
  background: #ee5b2b;
}
.mvdrinks-topdrinks-btn:hover {
  background: #d24a1f;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 14px rgba(185,78,29,0.5);
}

/* === PREMIUM DIWALI COLLECTION BUTTON === */
.mvdrinks-premium-btn {
  background: linear-gradient(135deg, #ee5b2b 0%, #f7a833 100%);
  padding: 12px 16px !important;
}
.mvdrinks-premium-btn:hover {
  background: linear-gradient(135deg, #f7a833 0%, #ee5b2b 100%);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 14px rgba(185,78,29,0.5);
}

/* Diya icon animation */
.mvdrinks-premium-btn::before {
  content: "";
  margin-right: 8px;
  font-size: 1.1em;
  vertical-align: middle;
  animation: diyaGlow 2s ease-in-out infinite alternate;
}
@keyframes diyaGlow {
  0%   { text-shadow: 0 0 4px #ffd27f, 0 0 8px #ffbb33; }
  50%  { text-shadow: 0 0 8px #fff176, 0 0 14px #ffca28; }
  100% { text-shadow: 0 0 4px #ffd27f, 0 0 10px #ffa000; }
}

/* Left-right positioning */
.mvdrinks-topdrinks-btn { margin-right: auto; }
.mvdrinks-premium-btn { margin-left: auto; }

/* === Responsive behavior === */
@media (max-width: 992px) {
  .mvdrinks-button-bar {
    justify-content: center;
    gap: 12px;
  }
  .mvdrinks-topdrinks-btn,
  .mvdrinks-premium-btn {
    margin: 0;
  }
}
@media (max-width: 600px) {
  .mvdrinks-button-bar {
    flex-direction: column;
    align-items: center;
  }
  .mvdrinks-topdrinks-btn,
  .mvdrinks-premium-btn {
    width: 80%;
    text-align: center;
  }
}

/* === Force Top Drinks & Diwali Buttons Side-by-Side in Header === */
.mvdrinks-button-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 60px;
  flex-wrap: nowrap;
  position: relative;
  margin: 0;
}

/* Keep both buttons same height and line */
.mvdrinks-topdrinks-btn,
.mvdrinks-premium-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  height: 45px;
}

/* Push Diwali button closer to search bar */
header .mvdrinks-premium-btn {
  margin-left: auto;
}

/* Optional: keep layout tight and centered visually */
header .mvdrinks-button-bar {
  max-width: 100%;
  margin-left: 120px;
}

/* Make sure buttons don’t wrap below */
@media (max-width: 800px) {
  .mvdrinks-button-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-left: 0;
  }
}

/* === DRINK OF THE DAY BUTTON === */
.mvdrinks-daily-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 45px;
  padding: 12px 22px;
  color: #fff !important;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(211,95,36,0.4);
  transition: all 0.3s ease-in-out;
  animation: mvdrinks-pulse 2s infinite;
  white-space: nowrap;
  background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
}
.mvdrinks-daily-btn:hover {
  background: linear-gradient(135deg, #0072ff 0%, #00c6ff 100%);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 14px rgba(0,114,255,0.5);
}
.mvdrinks-daily-btn::before {
  content: "";
  margin-right: 8px;
  font-size: 1.1em;
  vertical-align: middle;
  animation: drinkGlow 2s ease-in-out infinite alternate;
}
@keyframes drinkGlow {
  0%   { text-shadow: 0 0 4px #8ed0ff, 0 0 8px #00c6ff; }
  50%  { text-shadow: 0 0 10px #a8dfff, 0 0 16px #33aaff; }
  100% { text-shadow: 0 0 6px #8ed0ff, 0 0 12px #0072ff; }
}
@media (max-width: 800px) {
  .mvdrinks-daily-btn {
    width: 80%;
    text-align: center;
  }
}

/* === Align header buttons slightly to the left (fix overlap with search bar) === */
header .mvdrinks-button-bar {
  max-width: 100%;
  margin-left: 1px;
}
@media (max-width: 1100px) {
  header .mvdrinks-button-bar {
    margin-left: -5px;
  }
}
@media (max-width: 800px) {
  header .mvdrinks-button-bar {
    margin-left: -30px;
    justify-content: center;
  }
}

/* =======================================================
   MOBILE FIX — align all buttons perfectly from same left start
   ======================================================= */
@media (max-width: 768px) {
  .mvdrinks-button-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;  /* align all to left edge */
    justify-content: center;
    gap: 10px !important;
    width: 100%;
    max-width: 100%;
    padding: 0 12px;
    margin: 12px 0;
    box-sizing: border-box;
  }

  /* Buttons: dynamic width, same left start, curved */
  .mvdrinks-button-bar a {
    display: inline-block;
    width: auto;                /* stretch to fit text */
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 12px 24px;
    border-radius: 10px;
    box-sizing: border-box;
    margin-left: 0 !important;  /* ensure perfect left alignment */
  }

  /* Fix: remove any odd left margin on middle button */
  .mvdrinks-button-bar a:nth-child(2) {
    margin-left: 0 !important;
  }

  /* Keep search bar separate */
  header .ajaxsearchlite {
    margin-top: 14px;
    align-self: flex-end;
  }

  html, body {
    overflow-x: hidden !important;
  }
}

/* =======================================================
   MOBILE FIX — shift search bar position horizontally only
   ======================================================= */
@media (max-width: 768px) {
  header .ajaxsearchlite {
    position: relative;
    right: -10px;              /* move slightly right, use negative to pull left */
    top: 0;
    max-width: 180px !important;
    margin: 0;
    transform: translateY(0);
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    overflow: visible !important;
    z-index: 5;
  }
}
