/*
Theme Name: Adhibe Rationem
Author: OpenAI
Description: Custom WooCommerce theme based on the supplied Adhibe Rationem PDF mockup.
Version: 1.1.1
Requires PHP: 8.0
Text Domain: adhibe-rationem
*/

:root{
  --bg:#f6f1e7;
  --bg-soft:#fbf8f2;
  --wine:#671321;
  --wine2:#a84d4d;
  --text:#5c2b2d;
  --white:#fff;
  --max:1180px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:Georgia,"Times New Roman",serif;line-height:1.6}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}
.ar-container{width:min(calc(100% - 40px),var(--max));margin:auto}
.site-header{background:var(--bg-soft)}
.ar-topbar{min-height:76px;display:grid;grid-template-columns:1fr auto 1fr;align-items:end;gap:24px;padding:18px 0 10px;font-family:Arial,sans-serif;font-size:12px;text-transform:uppercase}
.ar-nav ul,.ar-utility ul{display:flex;gap:28px;list-style:none;margin:0;padding:0}
.ar-utility{justify-self:end}
.ar-language-switcher{display:flex;gap:8px;justify-content:flex-end;margin-bottom:6px}
.ar-hero{background:var(--wine);color:#fff;padding:36px 20px;text-align:center}
.ar-logo{display:inline-flex;flex-direction:column;align-items:center;gap:8px}
.ar-logo-symbol{width:74px;height:74px;border:1px solid #fff;border-radius:50%;display:grid;place-items:center;font-size:30px}
.ar-logo-title{font-size:clamp(18px,2.3vw,28px);letter-spacing:.34em;text-transform:uppercase}
.ar-logo-tagline{font-style:italic;font-size:clamp(16px,2vw,24px)}
.ar-category-strip{display:grid;grid-template-columns:repeat(3,1fr)}
.ar-category-card img{width:100%;height:190px;object-fit:cover}
.ar-category-label{display:grid;place-items:center;min-height:38px;background:var(--wine2);color:#fff;font-family:Arial,sans-serif;font-size:12px;letter-spacing:.25em;text-transform:uppercase}
.ar-section{padding:44px 0}
.ar-section-title{font-family:Arial,sans-serif;font-size:17px;font-weight:500;text-transform:uppercase}
.ar-copy{max-width:980px;font-size:19px;font-style:italic}
.ar-media-banner{min-height:330px;background:var(--ar-banner-image,#d7d0c7);background-position:center;background-size:cover;display:grid;place-items:center;color:#fff;font:32px Arial,sans-serif;text-transform:uppercase;text-align:center}
.site-footer{margin-top:60px;background:var(--wine);color:#fff;padding:36px 0;font-family:Arial,sans-serif;font-size:13px}
.site-footer .ar-container{display:flex;justify-content:space-between;gap:24px;flex-wrap:wrap}
.woocommerce ul.products{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px}
.woocommerce ul.products li.product{width:auto!important;margin:0!important}
.woocommerce ul.products li.product .woocommerce-loop-product__title{background:var(--wine2);color:#fff;text-align:center;font-family:Arial,sans-serif;font-size:13px;font-weight:400;text-transform:uppercase;padding:10px}
.woocommerce ul.products li.product .button{display:none}
.woocommerce div.product .product_title{font-family:Arial,sans-serif;text-transform:uppercase;color:var(--wine)}
.woocommerce div.product form.cart .button,.woocommerce a.button,.woocommerce button.button,.woocommerce input.button{border-radius:0;background:var(--wine);color:#fff;text-transform:uppercase}
@media(max-width:900px){.ar-topbar{grid-template-columns:auto 1fr;align-items:center}.ar-category-strip{grid-template-columns:1fr}.woocommerce ul.products{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.woocommerce ul.products{grid-template-columns:1fr}}


/* Header language switcher + product search */
.ar-language-switcher a{
  font-size:18px;
  line-height:1;
  opacity:.65;
  transition:opacity .15s ease,transform .15s ease;
}
.ar-language-switcher a:hover,
.ar-language-switcher a:focus{
  opacity:1;
  transform:translateY(-1px);
}
.ar-language-switcher a[aria-current="true"]{opacity:1}
.ar-search-toggle{
  appearance:none;
  border:0;
  padding:0;
  margin:0;
  background:transparent;
  color:inherit;
  font:inherit;
  text-transform:inherit;
  cursor:pointer;
}
.ar-search-panel{
  border-top:1px solid rgba(103,19,33,.12);
  background:var(--bg-soft);
  padding:14px 0 18px;
}
.ar-product-search-form{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
}
.ar-product-search-form input[type="search"]{
  width:100%;
  min-height:42px;
  border:1px solid rgba(103,19,33,.35);
  border-radius:0;
  background:#fff;
  color:var(--text);
  padding:8px 12px;
  font:16px Georgia,"Times New Roman",serif;
}
.ar-product-search-form button{
  min-height:42px;
  border:0;
  border-radius:0;
  background:var(--wine);
  color:#fff;
  padding:8px 22px;
  font:12px Arial,sans-serif;
  letter-spacing:.08em;
  text-transform:uppercase;
  cursor:pointer;
}
.ar-search-result{
  padding:20px 0;
  border-bottom:1px solid rgba(103,19,33,.15);
}
.ar-search-result h2{margin:0 0 8px}
.screen-reader-text{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
@media(max-width:600px){
  .ar-product-search-form{grid-template-columns:1fr}
  .ar-language-switcher{justify-content:flex-start}
}

/* v1.3.0 shop/category layout */
.ar-shop-tabs{margin:0 auto;max-width:1200px}
.ar-category-placeholder{height:190px;background:linear-gradient(135deg,#ded7ce,#c4b8aa)}
.ar-shop-tabs .ar-category-card.is-active .ar-category-label{box-shadow:inset 0 -4px 0 rgba(255,255,255,.75);font-weight:700}
.ar-woo-content{padding-top:48px;padding-bottom:72px}
.ar-shop-intro{padding-top:56px;padding-bottom:56px}
.ar-page-content{padding-top:40px;padding-bottom:60px}
.ar-woo-content .woocommerce-products-header{margin-bottom:34px}
.ar-woo-content .woocommerce-products-header__title.page-title{text-align:center;text-transform:uppercase}
@media(max-width:900px){.ar-shop-tabs{grid-template-columns:1fr}.ar-shop-tabs .ar-category-card img,.ar-shop-tabs .ar-category-placeholder{height:150px}}


/* Mobile navigation */
.ar-menu-toggle{
  display:none;
  appearance:none;
  border:0;
  background:transparent;
  padding:8px 4px;
  margin:0;
  cursor:pointer;
}

.ar-menu-toggle span{
  display:block;
  width:26px;
  height:2px;
  margin:5px 0;
  background:var(--wine);
  transition:transform .2s ease, opacity .2s ease;
}

@media(max-width:900px){
  .ar-menu-toggle{
    display:block;
    align-self:end;
    margin-bottom:2px;
    z-index:20;
  }

  .ar-utility{
    justify-self:end;
  }

  .ar-nav{
    display:none;
    grid-column:1 / -1;
    width:100%;
    padding:12px 0 8px;
  }

  .ar-nav.is-open{
    display:block;
  }

  .ar-nav ul{
    display:flex;
    flex-direction:column;
    gap:0;
  }

  .ar-nav li{
    border-top:1px solid rgba(104,30,39,.18);
  }

  .ar-nav li:last-child{
    border-bottom:1px solid rgba(104,30,39,.18);
  }

  .ar-nav a{
    display:block;
    padding:13px 4px;
  }

  .ar-menu-toggle[aria-expanded="true"] span:nth-child(1){
    transform:translateY(7px) rotate(45deg);
  }

  .ar-menu-toggle[aria-expanded="true"] span:nth-child(2){
    opacity:0;
  }

  .ar-menu-toggle[aria-expanded="true"] span:nth-child(3){
    transform:translateY(-7px) rotate(-45deg);
  }
}


/* =========================================================
   Shop landing / category navigation – PDF layout
   ========================================================= */

.ar-shop-tabs{
  width:100%;
  max-width:none;
  margin:0;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:0;
}

.ar-shop-tabs .ar-category-card{
  display:block;
  min-width:0;
  text-decoration:none;
  overflow:hidden;
  background:#fff;
}

.ar-shop-tabs .ar-category-card img,
.ar-shop-tabs .ar-category-placeholder{
  display:block;
  width:100%;
  height:clamp(230px,27vw,390px);
  object-fit:cover;
  margin:0;
}

.ar-shop-tabs .ar-category-label{
  min-height:54px;
  padding:8px 16px;
  background:var(--wine2);
  color:#fff;
  font-family:Arial,sans-serif;
  font-size:13px;
  font-weight:400;
  line-height:1.3;
  letter-spacing:.22em;
  text-align:center;
  text-transform:uppercase;
}

.ar-shop-tabs .ar-category-card.is-active .ar-category-label{
  box-shadow:inset 0 -4px 0 rgba(255,255,255,.75);
  font-weight:700;
}

/* Brand-description block from page 1 of the PDF */
.ar-shop-intro{
  padding:72px 20px 66px;
}

.ar-shop-intro .ar-container{
  max-width:1200px;
}

.ar-shop-intro .ar-section-title{
  margin:0 0 28px;
  font-family:Arial,sans-serif;
  font-size:17px;
  font-weight:500;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.ar-shop-intro .ar-copy{
  max-width:1100px;
  font-size:18px;
  line-height:1.65;
  font-style:italic;
}

.ar-shop-intro .ar-copy p{
  margin:0;
}

/* Temporary media placeholder from the PDF */
.ar-shop-media{
  min-height:430px;
  margin:0;
  background:#d5cec5;
  display:grid;
  place-items:center;
  padding:30px;
}

.ar-shop-media span{
  font-family:Arial,sans-serif;
  font-size:clamp(22px,3vw,36px);
  font-weight:400;
  letter-spacing:.04em;
  color:#fff;
  text-align:center;
  text-transform:uppercase;
}

@media(max-width:900px){
  .ar-shop-tabs{
    grid-template-columns:1fr;
  }

  .ar-shop-tabs .ar-category-card img,
  .ar-shop-tabs .ar-category-placeholder{
    height:260px;
  }

  .ar-shop-intro{
    padding:48px 24px;
  }

  .ar-shop-media{
    min-height:300px;
  }
}

@media(max-width:600px){
  .ar-shop-tabs .ar-category-card img,
  .ar-shop-tabs .ar-category-placeholder{
    height:220px;
  }

  .ar-shop-tabs .ar-category-label{
    min-height:48px;
    font-size:11px;
  }

  .ar-shop-intro .ar-copy{
    font-size:16px;
  }
}


/* =========================================================
   Product category – PDF layout
   ========================================================= */

body.tax-product_cat .ar-woo-content{
  max-width:1200px;
  padding-top:0;
}

.ar-category-intro{
  padding:68px 0 54px;
}

.ar-category-intro-title{
  margin:0 0 28px;
  font-family:Arial,sans-serif;
  font-size:17px;
  line-height:1.3;
  font-weight:500;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.ar-category-intro-copy{
  max-width:1100px;
  font-size:18px;
  line-height:1.65;
  font-style:italic;
}

.ar-category-intro-copy p{
  margin:0;
}

/* Products below category description */
body.tax-product_cat ul.products{
  margin-top:0;
  padding-top:0;
}

body.tax-product_cat ul.products li.product{
  margin-bottom:55px;
}

body.tax-product_cat ul.products li.product img{
  width:100%;
  aspect-ratio:3 / 4;
  object-fit:cover;
}

body.tax-product_cat ul.products li.product .woocommerce-loop-product__title{
  font-family:Arial,sans-serif;
  font-size:15px;
  font-weight:400;
  letter-spacing:.06em;
  text-transform:uppercase;
}

@media(max-width:900px){
  .ar-category-intro{
    padding:48px 24px 42px;
  }

  .ar-category-intro-copy{
    font-size:16px;
  }
}


/* =========================================================
   Real Adhibe Rationem logo extracted from supplied PDF
   ========================================================= */

.ar-hero .ar-logo{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  text-decoration:none;
}

.ar-hero .ar-logo-image{
  display:block;
  width:min(460px,72vw);
  height:auto;
  max-height:210px;
  object-fit:contain;
}


/* =========================================================
   Language Learning – visual 1+2 promo
   ========================================================= */

.ar-language-promo{
  width:min(360px,100%);
  min-height:220px;
  margin:30px 0 70px auto;
  border:1px solid rgba(112,20,35,.35);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:32px;
  text-align:center;
  text-transform:uppercase;
  color:var(--wine);
  background:#fff;
  font-family:Arial,sans-serif;
}

.ar-language-promo span,
.ar-language-promo strong{
  display:block;
  font-size:24px;
  line-height:1.3;
  font-weight:400;
  letter-spacing:.02em;
}

.ar-language-promo strong{
  margin-top:3px;
}

@media(max-width:900px){
  .ar-language-promo{
    width:100%;
    min-height:170px;
    margin:20px 0 50px;
  }

  .ar-language-promo span,
  .ar-language-promo strong{
    font-size:20px;
  }
}


/* =========================================================
   Category products + promo – PDF-style grid
   ========================================================= */

@media(min-width:901px){

  body.tax-product_cat ul.products{
    display:grid !important;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:28px;
    align-items:start;
  }

  body.tax-product_cat ul.products::before,
  body.tax-product_cat ul.products::after{
    display:none !important;
  }

  body.tax-product_cat ul.products li.product{
    width:auto !important;
    float:none !important;
    clear:none !important;
    margin:0 0 55px !important;
  }

  body.tax-product_cat ul.products li.product.first,
  body.tax-product_cat ul.products li.product.last{
    clear:none !important;
  }

  body.tax-product_cat ul.products li.ar-promo-grid-item{
    display:block;
  }

  body.tax-product_cat .ar-promo-grid-item .ar-language-promo{
    box-sizing:border-box;
    width:100%;
    min-height:0;
    aspect-ratio:3 / 4;
    margin:0;
    padding:32px;
  }
}

@media(max-width:900px){

  body.tax-product_cat ul.products li.ar-promo-grid-item{
    width:100% !important;
    float:none !important;
    clear:both !important;
  }

  body.tax-product_cat .ar-promo-grid-item .ar-language-promo{
    box-sizing:border-box;
    width:100%;
    margin:0 0 45px;
  }
}


/* Promo is emitted at loop-end, but displayed after products 1 + 2. */
@media(min-width:901px){

  body.tax-product_cat ul.products{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:28px;
  }

  body.tax-product_cat ul.products > li.product{
    order:10;
  }

  body.tax-product_cat ul.products > li.product:nth-child(1){
    order:1;
  }

  body.tax-product_cat ul.products > li.product:nth-child(2){
    order:2;
  }

  body.tax-product_cat ul.products > li.ar-promo-grid-item{
    order:3;
    width:auto !important;
    float:none !important;
    margin:0 0 55px !important;
  }

  body.tax-product_cat .ar-promo-grid-item .ar-language-promo{
    width:100%;
    box-sizing:border-box;
    aspect-ratio:3 / 4;
    min-height:0;
    margin:0;
  }
}


/* =========================================================
   Category grid – final visual polish
   ========================================================= */

body.tax-product_cat ul.products{
  row-gap:42px !important;
}

/* Product cards */
body.tax-product_cat ul.products li.product{
  margin-bottom:0 !important;
}

/* Product image */
body.tax-product_cat ul.products li.product:not(.ar-promo-grid-item) img{
  display:block;
  width:100%;
  margin:0 !important;
  aspect-ratio:3 / 4;
  object-fit:cover;
}

/* Burgundy product-title bar */
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title{
  box-sizing:border-box;
  min-height:54px;
  margin:0 !important;
  padding:10px 14px !important;

  display:flex;
  align-items:center;
  justify-content:center;

  background:var(--wine2);
  color:#fff;

  font-family:Arial,sans-serif;
  font-size:14px;
  line-height:1.25;
  font-weight:600;
  letter-spacing:.025em;
  text-align:center;
  text-transform:uppercase;
}

/* Price */
body.tax-product_cat ul.products li.product .price{
  display:block;
  margin:8px 0 0 !important;

  color:var(--wine) !important;

  font-family:Arial,sans-serif;
  font-size:14px !important;
  line-height:1.3;
  font-weight:400;
}

body.tax-product_cat ul.products li.product .price .amount,
body.tax-product_cat ul.products li.product .price ins,
body.tax-product_cat ul.products li.product .price del{
  color:inherit !important;
}

/* Promo tile */
body.tax-product_cat .ar-promo-grid-item{
  margin:0 !important;
}

body.tax-product_cat .ar-promo-grid-item .ar-language-promo{
  border:1px solid rgba(112,20,35,.28);
  background:#fff;
}

body.tax-product_cat .ar-promo-grid-item .ar-language-promo span,
body.tax-product_cat .ar-promo-grid-item .ar-language-promo strong{
  color:var(--wine);
  font-size:23px;
  line-height:1.3;
  font-weight:400;
}


/* Desktop */
@media(min-width:901px){

  body.tax-product_cat ul.products{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    column-gap:28px !important;
    row-gap:42px !important;
  }

  body.tax-product_cat ul.products > li.product{
    width:auto !important;
    margin:0 !important;
  }

  /*
   * Promo has the same 3:4 area as the product image.
   * Product title/price naturally continue below their images.
   */
  body.tax-product_cat .ar-promo-grid-item .ar-language-promo{
    width:100%;
    aspect-ratio:3 / 4;
    min-height:0;
    margin:0 !important;
  }
}


/* Mobile */
@media(max-width:900px){

  body.tax-product_cat ul.products{
    row-gap:32px !important;
  }

  body.tax-product_cat ul.products li.product .woocommerce-loop-product__title{
    min-height:50px;
    font-size:13px;
  }

  body.tax-product_cat ul.products li.product .price{
    margin-top:7px !important;
  }

  body.tax-product_cat .ar-promo-grid-item .ar-language-promo{
    margin:0 !important;
  }
}
