/*
Theme Name: WhiskAtHome Child
Theme URI: https://whiskathome.com
Author: WhiskAtHome
Author URI: https://whiskathome.com
Description: A warm, premium child theme for WhiskAtHome home cooking recipes, built on Astra. All custom code lives in this child theme.
Template: astra
Version: 1.0.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: whiskathome-child
*/

:root {
  --wh-cream: #FDF8EE;
  --wh-cream-dark: #F5EEDD;
  --wh-forest: #2E4B3A;
  --wh-forest-dark: #22382C;
  --wh-terracotta: #C1663A;
  --wh-terracotta-dark: #A8542E;
  --wh-ink: #2B2620;
  --wh-muted: #6B6257;
  --wh-white: #FFFFFF;
  --wh-border: #E5DCC8;
  --wh-radius: 16px;
  --wh-shadow: 0 10px 30px rgba(43, 38, 32, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wh-cream);
  color: var(--wh-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--wh-forest-dark);
  line-height: 1.25;
  margin-top: 0;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.5rem; }

a { color: var(--wh-forest); }
a:hover { color: var(--wh-terracotta); }

img { max-width: 100%; height: auto; display: block; }

.wh-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.wh-page { min-height: 100vh; display: flex; flex-direction: column; }
.wh-main { flex: 1; }

/* Header */
.wh-site-header {
  background: var(--wh-white);
  border-bottom: 1px solid var(--wh-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.wh-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.wh-brand-text {
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--wh-forest-dark);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wh-brand-mark { color: var(--wh-terracotta); }

.wh-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.wh-nav-list a {
  text-decoration: none;
  color: var(--wh-ink);
  font-weight: 600;
  font-size: 0.98rem;
}

.wh-nav-list a:hover { color: var(--wh-terracotta); }

.wh-header-cta { display: flex; align-items: center; gap: 16px; }

.wh-nav-toggle {
  display: none;
  background: var(--wh-forest);
  color: var(--wh-white);
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem;
  cursor: pointer;
}

/* Buttons */
.wh-btn {
  display: inline-block;
  background: var(--wh-terracotta);
  color: var(--wh-white);
  text-decoration: none;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}

.wh-btn:hover { background: var(--wh-terracotta-dark); color: var(--wh-white); }

.wh-btn-outline {
  background: transparent;
  color: var(--wh-forest);
  border: 2px solid var(--wh-forest);
}

.wh-btn-outline:hover { background: var(--wh-forest); color: var(--wh-white); }

.wh-btn-small { padding: 9px 18px; font-size: 0.92rem; }

/* Hero */
.wh-hero {
  background: var(--wh-forest-dark);
  color: var(--wh-white);
  padding: 72px 0;
}

.wh-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.wh-hero h1 { color: var(--wh-white); font-size: 3rem; margin-bottom: 16px; }
.wh-hero p { color: #E8E2D2; font-size: 1.15rem; }
.wh-hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.wh-hero-actions .wh-btn-outline { color: var(--wh-white); border-color: var(--wh-white); }
.wh-hero-actions .wh-btn-outline:hover { background: var(--wh-white); color: var(--wh-forest-dark); }

.wh-hero-img {
  border-radius: var(--wh-radius);
  overflow: hidden;
  box-shadow: var(--wh-shadow);
}

.wh-hero-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

/* Sections */
.wh-section { padding: 72px 0; }
.wh-section-alt { background: var(--wh-cream-dark); }
.wh-section-head { max-width: 720px; margin-bottom: 36px; }
.wh-section-head p { color: var(--wh-muted); }

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

.wh-grid-2 { grid-template-columns: repeat(2, 1fr); }

.wh-card {
  background: var(--wh-white);
  border: 1px solid var(--wh-border);
  border-radius: var(--wh-radius);
  overflow: hidden;
  box-shadow: var(--wh-shadow);
  display: flex;
  flex-direction: column;
}

.wh-card-img img { width: 100%; height: 220px; object-fit: cover; }
.wh-card-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.wh-card-body p { color: var(--wh-muted); margin: 0; }
.wh-card-body h3 { margin: 0; }
.wh-card-body h3 a { text-decoration: none; color: var(--wh-forest-dark); }
.wh-card-body h3 a:hover { color: var(--wh-terracotta); }
.wh-card-link { margin-top: auto; font-weight: 700; text-decoration: none; }

.wh-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.9rem;
  color: var(--wh-muted);
}

.wh-meta span {
  background: var(--wh-cream-dark);
  border: 1px solid var(--wh-border);
  border-radius: 999px;
  padding: 4px 12px;
}

/* CTA band */
.wh-cta {
  background: var(--wh-terracotta);
  color: var(--wh-white);
  border-radius: var(--wh-radius);
  padding: 48px;
  text-align: center;
}

.wh-cta h2 { color: var(--wh-white); }
.wh-cta p { color: #FBEADF; }
.wh-cta .wh-btn { background: var(--wh-white); color: var(--wh-terracotta-dark); }

/* Single recipe */
.wh-recipe-meta {
  background: var(--wh-white);
  border: 1px solid var(--wh-border);
  border-radius: var(--wh-radius);
  padding: 24px;
  margin: 28px 0;
}

.wh-recipe-meta table { width: 100%; border-collapse: collapse; }
.wh-recipe-meta th { text-align: left; padding: 8px 16px 8px 0; color: var(--wh-muted); font-weight: 600; width: 180px; }
.wh-recipe-meta td { padding: 8px 0; }

.wh-recipe-img { border-radius: var(--wh-radius); overflow: hidden; margin: 24px 0; }
.wh-recipe-img img { width: 100%; height: 420px; object-fit: cover; }

.wh-content { max-width: 760px; }
.wh-content ul, .wh-content ol { padding-left: 24px; }
.wh-content li { margin-bottom: 8px; }

.wh-article { padding: 56px 0; }
.wh-article-head { max-width: 760px; }

/* Forms */
.wh-form { max-width: 640px; }
.wh-field { margin-bottom: 20px; }
.wh-field label { display: block; font-weight: 700; margin-bottom: 6px; }
.wh-field input[type="text"],
.wh-field input[type="email"],
.wh-field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--wh-border);
  border-radius: 10px;
  background: var(--wh-white);
  font: inherit;
}

.wh-honeypot { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.wh-notice { border-radius: 10px; padding: 16px 20px; margin-bottom: 24px; }
.wh-notice-success { background: #EAF3EC; border: 1px solid #B9D6C0; color: #234534; }
.wh-notice-error { background: #FBEDE8; border: 1px solid #E8B4A0; color: #7A2E1A; }

/* Footer */
.wh-footer {
  background: var(--wh-forest-dark);
  color: #E8E2D2;
  padding: 56px 0 28px;
  margin-top: 0;
}

.wh-footer a { color: #E8E2D2; text-decoration: none; }
.wh-footer a:hover { color: var(--wh-white); }
.wh-footer h4 { color: var(--wh-white); margin-bottom: 14px; }

.wh-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
}

.wh-footer-menu { list-style: none; margin: 0; padding: 0; }
.wh-footer-menu li { margin-bottom: 10px; }
.wh-footer-brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; color: var(--wh-white); }

.wh-footer-contact { margin-top: 20px; font-size: 0.95rem; }
.wh-footer-contact p { margin: 4px 0; }

.wh-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 40px;
  padding-top: 20px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Shop */
.woocommerce ul.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.woocommerce ul.products li.product { background: var(--wh-white); border: 1px solid var(--wh-border); border-radius: var(--wh-radius); padding: 20px; text-align: left; }
.woocommerce ul.products li.product img { border-radius: 10px; }
.woocommerce ul.products li.product .price { color: var(--wh-terracotta-dark); font-weight: 700; }
.woocommerce a.button, .woocommerce button.button { background: var(--wh-terracotta); color: var(--wh-white); border-radius: 999px; }
.woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--wh-terracotta-dark); color: var(--wh-white); }

/* WooCommerce container — patch v1.0.1.
   WooCommerce templates do not use this theme's .wh-container, so the
   WooCommerce wrappers themselves are contained to the same 1120px
   centred width as the rest of the site. Header and footer already use
   .wh-container and are not touched by these rules. */
body.woocommerce .ast-container,
body.woocommerce-page .ast-container,
body.woocommerce .site-content > .ast-container,
body.woocommerce-page .site-content > .ast-container,
body.woocommerce div.ast-container,
body.woocommerce-page div.ast-container,
body.woocommerce .woocommerce,
body.woocommerce-page .woocommerce,
body.woocommerce .woocommerce-notices-wrapper,
body.woocommerce-page .woocommerce-notices-wrapper {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* WooCommerce container — patch v1.0.2, root-cause fix.
   Why v1.0.1 did not show: v1.0.1 targeted .ast-container and a
   descendant .woocommerce element. Neither exists in this child theme:
   header.php bypasses Astra's wrapper and outputs <main class="wh-main">
   directly, and WooCommerce templates output straight into that <main>,
   with no .wh-container and no .ast-container around them. That is why
   Shop and single product pages ran edge-to-edge while header/footer
   (which do use .wh-container) looked contained.
   Fix: contain <main> itself, but only on WooCommerce pages, so normal
   pages (which already wrap their content in .wh-container) are untouched. */
body.woocommerce .wh-main,
body.woocommerce-page .wh-main {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 24px;
  box-sizing: border-box;
  width: 100%;
}

/* Belt-and-braces: if WooCommerce/Astra do output a wrapper on some
   pages, keep it inside the same container instead of full width. */
body.woocommerce .wh-main > .woocommerce,
body.woocommerce-page .wh-main > .woocommerce,
body.woocommerce .wh-main > div.product,
body.woocommerce-page .wh-main > div.product,
body.woocommerce .wh-main > .woocommerce-products-header,
body.woocommerce-page .wh-main > .woocommerce-products-header {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Single product: keep the two-column layout inside the container. */
.woocommerce div.product div.images {
  float: left;
  width: 48%;
}
.woocommerce div.product div.summary {
  float: right;
  width: 48%;
}
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .related,
.woocommerce div.product .upsells {
  clear: both;
  padding-top: 32px;
}
.woocommerce .woocommerce-breadcrumb {
  margin-bottom: 24px;
}

/* WooCommerce product grids: 3 columns on desktop, overriding the
   columns-3 / columns-4 widths WooCommerce and Astra would otherwise apply. */
body.woocommerce ul.products,
body.woocommerce-page ul.products,
.woocommerce ul.products.columns-3,
.woocommerce ul.products.columns-4,
.woocommerce .related ul.products,
.woocommerce .upsells ul.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product,
.woocommerce ul.products.columns-3 li.product,
.woocommerce ul.products.columns-4 li.product,
.woocommerce .related ul.products li.product,
.woocommerce .upsells ul.products li.product {
  width: auto;
  float: none;
  margin: 0;
}

/* Pagination — patch v1.0.1: WooCommerce, WordPress blog/archives,
   and recipe archives share these classes. WordPress templates already
   output the_posts_pagination(); WooCommerce archives output
   woocommerce_pagination(); no custom paginator is used. */
.navigation.pagination,
.woocommerce-pagination {
  text-align: center;
  margin: 48px 0 0;
  clear: both;
}
.nav-links,
.woocommerce-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0;
}
.woocommerce-pagination ul.page-numbers li {
  border: 0;
  margin: 0;
  padding: 0;
}
.nav-links a,
.nav-links span,
.woocommerce-pagination ul.page-numbers li a,
.woocommerce-pagination ul.page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--wh-border);
  border-radius: 999px;
  background: var(--wh-white);
  color: var(--wh-forest);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-sizing: border-box;
}
.nav-links a:hover,
.woocommerce-pagination ul.page-numbers li a:hover {
  background: var(--wh-cream-dark);
  border-color: var(--wh-forest);
  color: var(--wh-forest-dark);
}
.nav-links span.current,
.nav-links span.page-numbers.current,
.woocommerce-pagination ul.page-numbers li span.current,
.woocommerce-pagination ul.page-numbers li span.page-numbers.current {
  background: var(--wh-forest);
  border-color: var(--wh-forest);
  color: var(--wh-white);
}
.nav-links span.dots,
.woocommerce-pagination ul.page-numbers li span.dots {
  border-color: transparent;
  background: transparent;
  min-width: auto;
  padding: 0 4px;
}

/* Contact details block — patch v1.0.1: dedicated styling, shown only
   when at least one Customizer contact value is filled. */
.wh-contact-details {
  background: var(--wh-white);
  border: 1px solid var(--wh-border);
  border-radius: var(--wh-radius);
  padding: 28px;
  margin: 28px 0;
}
.wh-contact-details h2 {
  margin-bottom: 16px;
}
.wh-contact-row {
  margin: 10px 0;
}
.wh-contact-label {
  display: inline-block;
  min-width: 90px;
  font-weight: 700;
  color: var(--wh-forest);
}

/* Header icons and search bar — patch v1.0.3. */
.wh-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--wh-border);
  border-radius: 50%;
  background: var(--wh-white);
  color: var(--wh-forest-dark);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  flex-shrink: 0;
}

.wh-icon-btn:hover { border-color: var(--wh-forest); color: var(--wh-terracotta); }

/* Patch v1.0.4: header icons must look identical whether they are a link
   or a button. Theme button styles were overriding the search <button>
   (terracotta pill, icon invisible), while the cart <a> rendered correctly
   as a white circle. These stronger rules force both icons to the same
   white circle, with no button padding, background, or shadow. */
.wh-header-cta .wh-icon-btn,
.wh-header-cta a.wh-icon-btn,
.wh-header-cta button.wh-icon-btn {
  background: var(--wh-white);
  color: var(--wh-forest-dark);
  border: 1px solid var(--wh-border);
  border-radius: 50%;
  padding: 0;
  width: 44px;
  height: 44px;
  box-shadow: none;
  text-decoration: none;
}

.wh-header-cta .wh-icon-btn:hover,
.wh-header-cta a.wh-icon-btn:hover,
.wh-header-cta button.wh-icon-btn:hover {
  background: var(--wh-white);
  color: var(--wh-terracotta);
  border-color: var(--wh-forest);
}

.wh-header-cta .wh-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
}


.wh-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wh-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--wh-terracotta);
  color: var(--wh-white);
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-sizing: border-box;
}

.wh-search-bar {
  display: none;
  background: var(--wh-white);
  border-top: 1px solid var(--wh-border);
  padding: 16px 0;
}

.wh-search-bar.wh-search-open { display: block; }

.wh-search-bar form { display: flex; gap: 12px; flex-wrap: wrap; }

.wh-search-bar input[type="search"] {
  flex: 1 1 220px;
  padding: 12px 16px;
  border: 1px solid var(--wh-border);
  border-radius: 10px;
  background: var(--wh-white);
  font: inherit;
}


/* Responsive */
@media (max-width: 900px) {
  .wh-grid { grid-template-columns: repeat(2, 1fr); }
  .wh-hero-grid { grid-template-columns: 1fr; }
  .wh-footer-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2.1rem; }
  .wh-hero h1 { font-size: 2.3rem; }
  .woocommerce ul.products,
  body.woocommerce ul.products,
  body.woocommerce-page ul.products,
  .woocommerce ul.products.columns-3,
  .woocommerce ul.products.columns-4,
  .woocommerce .related ul.products,
  .woocommerce .upsells ul.products { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .wh-grid, .wh-grid-2 { grid-template-columns: 1fr; }
  .wh-footer-grid { grid-template-columns: 1fr; }
  .wh-section { padding: 48px 0; }
  .wh-hero { padding: 48px 0; }
  .wh-cta { padding: 32px 20px; }
  .wh-recipe-img img { height: 260px; }
  .woocommerce ul.products,
  body.woocommerce ul.products,
  body.woocommerce-page ul.products,
  .woocommerce ul.products.columns-3,
  .woocommerce ul.products.columns-4,
  .woocommerce .related ul.products,
  .woocommerce .upsells ul.products { grid-template-columns: 1fr; }
  .woocommerce div.product div.images,
  .woocommerce div.product div.summary {
    float: none;
    width: 100%;
  }
  body.woocommerce .ast-container,
  body.woocommerce-page .ast-container,
  body.woocommerce .woocommerce,
  body.woocommerce-page .woocommerce,
  body.woocommerce .woocommerce-notices-wrapper,
  body.woocommerce-page .woocommerce-notices-wrapper {
    padding-left: 16px;
    padding-right: 16px;
  }
  body.woocommerce .wh-main,
  body.woocommerce-page .wh-main {
    padding: 32px 16px;
  }

  .wh-nav-toggle { display: inline-block; }
  .wh-main-nav { display: none; width: 100%; }
  .wh-main-nav.wh-nav-open { display: block; }
  .wh-header-inner { flex-wrap: wrap; }
  .wh-nav-list { flex-direction: column; gap: 12px; padding: 16px 0 4px; }
}
