/*
Theme Name: NN Store
Theme URI: https://namynot.com
Author: NAMYNOT
Author URI: https://namynot.com
Description: Classic WordPress and WooCommerce theme that ports the Mini Cravings engine site into WordPress. The engine stylesheet lives in assets/css/engine.css and is loaded first; this file holds only the WordPress specific overrides.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
WC requires at least: 9.0
WC tested up to: 9.9
License: Proprietary
Text Domain: nn-store
*/

/* ---------- WordPress plumbing the engine never needed ---------- */

/* The sticky header sits under the admin bar when someone is logged in.
   Below 600px the admin bar scrolls away, so the header goes back to 0. */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard focus. Only on :focus-visible, so mouse and touch users see the
   engine design untouched. Form fields keep the engine's own focus ring. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid var(--teal-deep);
  outline-offset: 3px;
}
.btn:focus-visible { outline-offset: 4px; }

/* Eight nav items instead of six: keep each label on one line. */
.nav a { white-space: nowrap; }

/* Cart link in the main nav, count bubble refreshed by cart fragments. */
.nn-cart-link { display: inline-flex; align-items: center; gap: 6px; }
.nn-cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--choc);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Flavor cards driven by WooCommerce ---------- */

/* The product name links to the product page without changing the look. */
.flavor__name a { color: inherit; text-decoration: none; }
.flavor__name a:hover { color: var(--teal-deep); }

/* After an ajax add to cart, WooCommerce appends a "View cart" link next to
   the button. Let it drop to its own line instead of squeezing the row. */
.flavor__foot { flex-wrap: wrap; }
.flavor__foot .added_to_cart {
  flex-basis: 100%;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-deep);
  padding: 0;
}
/* WooCommerce's layout CSS sets ".woocommerce img { height: auto }", which
   ties with the engine's fixed 224px jar height and loads later. On the shop
   and product pages that let tall jars spill past the tint block. Pin it. */
html .flavor .flavor__shot img {
  width: 100%;
  max-width: 100%;
  height: 224px;
  object-fit: contain;
  object-position: bottom center;
}

.flavor__price del { font-size: 15px; color: var(--choc-soft); margin-right: 6px; }
.flavor__price ins { text-decoration: none; }

/* The WooCommerce stylesheet styles a.button inside .woocommerce. These
   selectors outrank it so a card button looks the same on the home page,
   the shop and the related products row. Values mirror .btn .btn--sm. */
body .flavor .flavor__foot a.btn.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 133, 135, 0.32);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}
body .flavor .flavor__foot a.btn.button:hover {
  background: var(--teal-deep);
  color: #fff;
  transform: translateY(-2px);
}
body .flavor .flavor__foot a.btn.button.loading { opacity: 0.7; }

/* ---------- Form thank-you and error notices ---------- */

.form-thanks {
  background: var(--teal-tint-soft);
  border: 2px solid var(--teal-tint);
  border-radius: 16px;
  padding: 22px 24px;
}
.form-thanks:focus { outline: 3px solid var(--teal); outline-offset: 3px; }
.form-thanks__title { font-family: var(--head); font-size: 22px; line-height: 1.2; margin: 0 0 6px; color: var(--teal-deep); }
.form-thanks p { margin: 0; color: var(--choc-soft); }

.form-error {
  background: #fff0f6;
  border: 2px solid var(--pink);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 0 0 18px;
  font-weight: 600;
}

/* Spam trap, hidden from people and assistive tech. */
.nn-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Legal and plain pages (engine legal layout) ---------- */

.legal { padding-block: 56px 88px; }
.legal__inner { max-width: 72ch; margin-inline: auto; padding-inline: 24px; box-sizing: border-box; }
.legal__inner h2 { margin-top: 2.2em; }
.legal__inner ul, .legal__inner ol { margin: 1em 0 1em 1.2em; }
.legal__inner li { margin: 0.4em 0; }
.legal__inner img { border-radius: var(--radius); }

.nn-page-title { font-size: clamp(30px, 4.4vw, 46px); }

/* ---------- Search form, 404, index ---------- */

.nn-search { display: flex; flex-wrap: wrap; gap: 10px; max-width: 520px; margin-inline: auto; }
.nn-search input[type="search"] {
  flex: 1 1 220px;
  min-width: 0;
  font-family: var(--body);
  font-size: 16px;
  color: var(--choc);
  background: var(--cream);
  border: 2px solid var(--teal-tint);
  border-radius: 999px;
  padding: 12px 18px;
}
.nn-search input[type="search"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 133, 135, 0.14);
}

.nn-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 26px; }

.nn-posts { display: grid; gap: clamp(20px, 2.6vw, 30px); }
.nn-post {
  background: var(--white);
  border: 2px solid var(--teal-tint);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(22px, 3vw, 32px);
}
.nn-post h2 { font-size: clamp(22px, 2.6vw, 28px); }
.nn-post h2 a { color: inherit; text-decoration: none; }

/* Core alignment classes, for anything pasted into a page. */
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { font-size: 14px; color: var(--choc-soft); }
