/*
Theme Name: Life of John Child
Theme URI: https://lifeofjohn.club
Description: Life of John child theme for Storefront / WooCommerce. Calm, spacious shop design inspired by large high-street retailers: slim black announcement strip, white header with central search, centred department nav with Christmas Sale in red, red sale prices, cream / forest green / deep red seasonal sections, sale carousel, service strip and pale-grey footer. Products, checkout, stock and orders remain 100% WooCommerce — add products in Products > Add New as usual.
Author: Life of John
Template: storefront
Version: 1.2.10
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: life-of-john-child
Tags: woocommerce, e-commerce, custom-logo, custom-menu
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ============ Tokens & base ============ */
:root{
  --loj-red:#b3001b;
  --loj-red-dark:#8f0016;
  --loj-green:#1e3d2f;
  --loj-cream:#faf6ef;
  --loj-ink:#161616;
  --loj-grey:#6f6f6f;
  --loj-line:#e6e2da;
  --loj-footer:#e8e8e4;
  --loj-footer-text:#555550;
  --loj-footer-border:#c9c6bd;
  --loj-max:1240px;
}
*,*::before,*::after{box-sizing:border-box}
/* v1.2.1: NO overflow-x on html/body. v1.2.0 set overflow-x:clip
   here; on phones that can stop the whole page rendering (blank
   white screen) in some mobile browsers, while desktop is fine.
   The layout rules below are written so nothing needs it: every
   wide row scrolls inside its own container instead. */
body{color:var(--loj-ink);background:#fff;font-family:"Helvetica Neue",Arial,sans-serif;-webkit-font-smoothing:antialiased}
img{max-width:100%;height:auto}
a{color:var(--loj-ink)}
a:hover{color:var(--loj-red-dark)}
.site-content .col-full,
.loj-wrap{max-width:var(--loj-max);margin-left:auto;margin-right:auto;padding-left:20px;padding-right:20px}
h1,h2,h3{letter-spacing:-.01em;color:var(--loj-ink)}
h2.loj-section-title{font-size:clamp(24px,3.4vw,36px);margin:0 0 8px;font-weight:700}
.loj-section-sub{color:var(--loj-grey);margin:0 0 22px;max-width:640px}
.loj-btn{display:inline-block;background:var(--loj-ink);color:#fff!important;padding:13px 26px;border-radius:999px;font-weight:600;text-decoration:none;border:1px solid var(--loj-ink)}
.loj-btn:hover{background:var(--loj-red);border-color:var(--loj-red);color:#fff!important}
.loj-btn--light{background:#fff;color:var(--loj-ink)!important;border-color:#fff}
.loj-btn--red{background:var(--loj-red);border-color:var(--loj-red)}

/* ============ Announcement strip ============ */
.loj-announcement{background:#000;color:#fff;text-align:center;font-size:13px;letter-spacing:.02em;padding:8px 16px;line-height:1.45}
.loj-announcement a{color:#fff;text-decoration:underline}

/* ============ Header (Storefront markup, restyled) ============ */
.site-header{background:#fff;border-bottom:1px solid var(--loj-line);padding-top:14px}
.site-header .col-full{display:flex;flex-wrap:wrap;align-items:center;gap:14px 22px;max-width:var(--loj-max)}
.site-branding{order:1;flex:0 1 auto;margin:0}
.site-branding .custom-logo{max-height:64px;width:auto}
.site-title{font-size:26px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;margin:0}
.site-title a{text-decoration:none}
.site-description{display:none}
.site-search{order:2;flex:1 1 320px;margin:0}
.site-search .widget_product_search form,
.site-search form.woocommerce-product-search{display:flex;margin:0}
.site-search input[type="search"]{flex:1 1 auto;width:100%;padding:12px 16px;border:1px solid #cfcfcf;border-radius:999px;background:#fff;font-size:15px}
.site-search button[type="submit"]{margin-left:8px;border-radius:999px;background:var(--loj-ink);color:#fff;padding:12px 20px}
.storefront-secondary-navigation{order:3;flex:0 0 auto;margin:0}
.storefront-secondary-navigation ul{list-style:none;display:flex;gap:16px;margin:0;padding:0}
.site-header-cart{order:4;flex:0 0 auto;margin:0}
.site-header-cart .cart-contents{color:var(--loj-ink);text-decoration:none;font-weight:600}

/* Centred department nav row — DESKTOP ONLY (v1.2.1).
   In v1.2.0 this flex row applied at every width and the phone
   rules forced the menu into a sideways-scrolling flex row,
   overriding Storefront's own mobile navigation. The centred
   flex row is now scoped to min-width:768px, so below that
   Storefront's normal hamburger (menu toggle) navigation —
   which works on its own — is left completely alone. */
.main-navigation{order:5;flex:1 1 100%}
@media (min-width:768px){
  .main-navigation{text-align:center}
  .main-navigation ul.menu,
  .main-navigation ul.nav-menu{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 26px;margin:0;padding:10px 0 4px}
}
.main-navigation ul li a{color:var(--loj-ink);font-size:15px;padding:6px 2px;text-decoration:none}
.main-navigation ul li a:hover{color:var(--loj-red-dark);text-decoration:underline;text-underline-offset:4px}
.main-navigation ul li.loj-nav-sale > a,
.main-navigation ul li a.loj-nav-sale{color:var(--loj-red)!important;font-weight:700}

/* ============ Homepage sections ============ */
.loj-hero{background:var(--loj-green);color:#fff;margin:0 0 34px;overflow:hidden}
.loj-hero__inner{max-width:var(--loj-max);margin:0 auto;padding:28px 20px 44px;display:grid;grid-template-columns:1.05fr .95fr;gap:30px;align-items:center}
.loj-hero__kicker{text-transform:uppercase;letter-spacing:.14em;font-size:13px;font-weight:700;color:#f3d9a4;margin:0 0 10px}
.loj-hero h1{color:#fff;font-size:clamp(30px,4.6vw,54px);line-height:1.05;margin:0 0 12px}
.loj-hero__discount{color:#ff5a5a;font-weight:800}
.loj-hero p{color:#eef2ec;max-width:520px}
.loj-hero__actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:18px}
.loj-hero__media img{display:block;width:100%;border-radius:14px;object-fit:cover}
.loj-hero__note{font-size:13px;color:#cfd8cf;margin-top:12px}

.loj-tiles{max-width:var(--loj-max);margin:0 auto 38px;padding:0 20px;display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.loj-tile{background:var(--loj-cream);border:1px solid var(--loj-line);border-radius:14px;padding:24px;text-decoration:none;display:block}
.loj-tile h3{margin:0 0 6px;font-size:20px}
.loj-tile p{margin:0;color:var(--loj-grey)}
.loj-tile span{display:inline-block;margin-top:12px;font-weight:700;text-decoration:underline;text-underline-offset:4px}

.loj-section{max-width:var(--loj-max);margin:0 auto 42px;padding:0 20px}
.loj-sale{background:var(--loj-cream);border-top:1px solid var(--loj-line);border-bottom:1px solid var(--loj-line);padding-top:30px;padding-bottom:30px;max-width:none}
.loj-sale .loj-section{margin-bottom:0}
.loj-carousel-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
.loj-carousel-btns button{border:1px solid #bbb;background:#fff;border-radius:999px;width:42px;height:42px;font-size:20px;cursor:pointer}
/* Wide product row — SHARED by Christmas Sale and Latest in the
   shop (v1.2.0). One rule set for both sections, so Latest uses the
   exact same layout as the Sale: same container (.loj-section,
   1240px), same wide 260px cards, same 18px gap, same card padding,
   image, title and price styling (global card rules below), and the
   same sideways-scrolling row with prev / next buttons. Latest no
   longer uses the narrower floated WooCommerce columns-4 grid.
   v1.2.1: no scroll-snap on this row any more — the mandatory
   scroll-snap-type / scroll-snap-align from v1.2.0 is removed, as
   mandatory snapping can trap or blank scrolling on some phones.
   The row still scrolls sideways in exactly the same way. */
.loj-sale ul.products,
.loj-latest ul.products{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:18px;padding:6px 2px 14px;-webkit-overflow-scrolling:touch;max-width:100%;box-sizing:border-box;margin:0;list-style:none}
.loj-sale ul.products::before,.loj-sale ul.products::after,
.loj-latest ul.products::before,.loj-latest ul.products::after{content:none!important;display:none!important}
.loj-sale ul.products li.product,
.loj-latest ul.products li.product{flex:0 0 260px;width:260px;max-width:260px;margin:0!important;float:none!important;clear:none!important;box-sizing:border-box}
.loj-latest{margin-bottom:42px}

.loj-feature{background:var(--loj-green);color:#fff;border-radius:16px;padding:34px;display:grid;grid-template-columns:1fr 1fr;gap:26px;align-items:center}
.loj-feature h2{color:#fff}
.loj-feature p{color:#e7ede7}
.loj-feature .loj-price{font-size:22px;font-weight:700;color:#fff}
.loj-story{max-width:760px}
.loj-story p{color:#333;line-height:1.7}

.loj-services{background:#fff;border-top:1px solid var(--loj-line);border-bottom:1px solid var(--loj-line)}
.loj-services__inner{max-width:var(--loj-max);margin:0 auto;padding:24px 20px;display:grid;grid-template-columns:repeat(3,1fr);gap:18px;text-align:center}
.loj-services strong{display:block;font-size:16px;margin-bottom:4px}
.loj-services p{margin:0;color:var(--loj-grey);font-size:14px}

.loj-newsletter{background:var(--loj-cream);border:1px solid var(--loj-line);border-radius:16px;padding:30px;text-align:center}
.loj-newsletter form{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:14px}
.loj-newsletter input[type="email"]{flex:1 1 260px;max-width:420px;padding:12px 16px;border:1px solid #cfcfcf;border-radius:999px}
.loj-newsletter button{background:var(--loj-red);color:#fff;border:0;border-radius:999px;padding:12px 24px;font-weight:700;cursor:pointer}
.loj-notice{background:#eaf6ec;border:1px solid #bfe0c4;padding:12px 16px;border-radius:10px}

/* ============ WooCommerce product cards & prices ============ */
ul.products li.product{background:#fff;border:1px solid var(--loj-line);border-radius:14px;padding:14px;text-align:left}
ul.products li.product img{border-radius:10px;width:100%}
ul.products li.product .woocommerce-loop-product__title{font-size:16px;line-height:1.35;margin:10px 0 6px}
ul.products li.product .price{font-size:17px;color:var(--loj-ink)}
/* Sale price in RED, original price struck through in black */
.products .price del,
.product .summary .price del,
.single-product .price del{color:#111;opacity:1;text-decoration:line-through;margin-right:8px}
.products .price ins,
.product .summary .price ins,
.single-product .price ins,
ul.products li.product .price ins{background:none;color:var(--loj-red);font-weight:800;text-decoration:none}
.woocommerce span.onsale,
ul.products li.product .onsale{background:var(--loj-red);color:#fff;border:0;border-radius:999px;padding:4px 10px;font-weight:700;min-height:0;min-width:0;line-height:1.4}
.loj-out-of-stock{display:inline-block;background:#111;color:#fff;border-radius:999px;padding:4px 10px;font-size:13px;font-weight:700;margin:6px 0}
ul.products li.product .button{background:var(--loj-ink);color:#fff;border-radius:999px;padding:11px 18px;font-weight:600}
ul.products li.product .button:hover{background:var(--loj-red)}
.single-product .cart .button,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button{background:var(--loj-ink);color:#fff;border-radius:999px}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-checkout #place_order{background:var(--loj-red)}
.woocommerce-message{border-top-color:var(--loj-green)}

/* ============ Footer (v1.1.0 — fixed vertical lists) ============
   Storefront / widget styles can lay a plain <ul> out in a row.
   Every rule below therefore states the layout explicitly, with
   high-specificity selectors, so HELP / DELIVERY & RETURNS / SHOP /
   CONTACT always stack one item per line. */
.site-footer{background:var(--loj-footer);color:#333;border-top:3px solid var(--loj-ink);padding:44px 0 14px}
.site-footer .col-full{max-width:var(--loj-max);margin-left:auto;margin-right:auto;padding-left:20px;padding-right:20px;box-sizing:border-box}
/* Upper tier (Storefront footer widgets: About This Site / Find Us):
   same look, just tightened so it no longer leaves a 70–80px gap
   above the link row. Trim its text in Widgets — see README. */
.site-footer .footer-widgets{padding-top:6px;padding-bottom:0;margin-bottom:26px;border-bottom:0}
.site-footer .footer-widgets .widget{margin-bottom:14px}
.site-footer .footer-widgets .widget-title{margin-bottom:10px}
/* Lower tier */
.loj-footer{max-width:var(--loj-max);margin:0 auto;padding:0}
.site-footer .loj-footer__grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:28px 32px;align-items:start}
.loj-footer__col{min-width:0}
.site-footer .loj-footer h4,
.site-footer .loj-footer__col h4{margin:0 0 14px;padding:0 0 8px;font-size:15px;line-height:1.3;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--loj-ink);border-bottom:2px solid var(--loj-footer-border)}
/* The lists: one item per line, always. Never a row. */
.site-footer .loj-footer ul.loj-footer__list,
.site-footer .loj-footer__col ul{
  display:block!important;flex:none!important;float:none!important;
  list-style:none!important;list-style-type:none!important;
  margin:0!important;padding:0!important;width:100%;
}
.site-footer .loj-footer ul.loj-footer__list > li,
.site-footer .loj-footer__col ul > li{
  display:block!important;flex:none!important;float:none!important;
  width:100%;max-width:100%;margin:0!important;padding:0;
  font-size:15px;line-height:1.8;color:var(--loj-ink);
  white-space:normal;word-break:normal;overflow-wrap:break-word;
}
.site-footer .loj-footer ul.loj-footer__list > li::before,
.site-footer .loj-footer ul.loj-footer__list > li::after{content:none!important;display:none!important}
/* Links look like links: black, underline only on hover/focus. */
.site-footer .loj-footer__list a,
.site-footer .loj-footer__col a{
  display:inline-block;color:var(--loj-ink);text-decoration:none;
  line-height:1.8;
}
.site-footer .loj-footer__list a:hover,
.site-footer .loj-footer__list a:focus,
.site-footer .loj-footer__col a:hover{text-decoration:underline;text-underline-offset:3px;color:var(--loj-red-dark)}
/* Plain statements (Delivery & Returns) look like plain text: grey,
   never link-black, never underlined — even on hover. */
.site-footer .loj-footer li.loj-footer__note,
.site-footer .loj-footer__list--notes > li{
  color:var(--loj-footer-text)!important;text-decoration:none!important;cursor:default;
}
/* Contact column: same vertical list, grey-black running text. */
.site-footer .loj-footer__contact li{color:#3d3d3a}
.site-footer .loj-footer__social{margin-top:4px}
.loj-footer__etsy{font-size:13px;color:var(--loj-grey);margin:26px 0 0}
.loj-footer__etsy a{color:var(--loj-grey);text-decoration:underline;text-underline-offset:3px}
.loj-footer__base{border-top:1px solid var(--loj-footer-border);margin-top:22px;padding:16px 0 6px;font-size:13px;line-height:1.6;color:var(--loj-footer-text);display:flex;flex-wrap:wrap;gap:6px 20px;justify-content:space-between}
.storefront-handheld-footer-bar ul li > a{background:#fff;color:var(--loj-ink)}

/* ============ Shop archive: keep the grid inside the page ============
   Scoped to the Shop / category archives only, so the homepage
   grids and sale carousel are untouched. Storefront floats its
   archive cards with percentage widths that can push the last
   card past the right edge; a contained grid cannot overflow. */
body.post-type-archive-product .site-content .col-full,
body.tax-product_cat .site-content .col-full,
body.tax-product_tag .site-content .col-full{
  max-width:var(--loj-max);margin-left:auto;margin-right:auto;
  padding-left:20px;padding-right:20px;box-sizing:border-box;
}
body.post-type-archive-product .content-area,
body.tax-product_cat .content-area,
body.tax-product_tag .content-area{min-width:0;max-width:100%}
body.post-type-archive-product ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px;margin:0;padding:0;max-width:100%;box-sizing:border-box;
}
body.post-type-archive-product ul.products::before,
body.post-type-archive-product ul.products::after,
body.tax-product_cat ul.products::before,
body.tax-product_cat ul.products::after{content:none!important;display:none!important}
body.post-type-archive-product ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product{
  width:auto!important;max-width:100%;min-width:0;
  float:none!important;margin:0!important;box-sizing:border-box;
}
@media (max-width:1024px){
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:640px){
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ============ Phone: stack, no sideways scroll ============ */
@media (max-width:768px){
  .site-header .col-full{gap:10px}
  .site-branding{flex:1 1 auto}
  .site-branding .custom-logo{max-height:52px}
  .site-search{order:5;flex:1 1 100%}
  .storefront-secondary-navigation{display:none}
  /* v1.2.1: mobile navigation is Storefront's own hamburger menu
     again. Deliberately NO display / flex / overflow rules for
     .main-navigation or its lists in this block — the desktop
     flex row above is scoped to min-width:768px, so Storefront's
     menu toggle shows and hides the list exactly as it does in
     plain Storefront (which works on mobile). */
  .loj-hero__inner{grid-template-columns:1fr;padding-top:20px}
  .loj-tiles{grid-template-columns:1fr}
  .loj-feature{grid-template-columns:1fr;padding:24px}
  .loj-services__inner{grid-template-columns:1fr;text-align:left}
  .site-footer .loj-footer__grid{grid-template-columns:1fr 1fr}
  ul.products li.product{width:100%}
  .loj-sale ul.products li.product,
  .loj-latest ul.products li.product{flex-basis:78vw;width:78vw;max-width:78vw}
}
@media (max-width:480px){.site-footer .loj-footer__grid{grid-template-columns:1fr}}
