/*
Theme Name: TruLife Bookstore
Theme URI: https://shop.trulifebooks.com/
Author: TruLife Books LLC
Author URI: https://trulifebooks.com/
Description: A book-first WooCommerce theme for the TruLife Books online bookstore. Responsive product grids, editorial-style book pages, product search, cart access, genre browsing, and WooCommerce gallery support.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: trulife-bookstore
Tags: e-commerce, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --tl-navy: #074669;
  --tl-navy-deep: #053650;
  --tl-green: #009167;
  --tl-green-dark: #007a57;
  --tl-ink: #1d2932;
  --tl-muted: #66737c;
  --tl-line: #dde4e7;
  --tl-bg: #f6f8f8;
  --tl-white: #ffffff;
  --tl-radius: 18px;
  --tl-shadow: 0 16px 42px rgba(7, 70, 105, .10);
  --tl-container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--tl-ink);
  background: var(--tl-white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--tl-navy); text-decoration: none; }
a:hover { color: var(--tl-green-dark); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button, .button, input[type="submit"], .wp-element-button {
  border: 0;
  border-radius: 10px;
}

.tl-container { width: min(calc(100% - 40px), var(--tl-container)); margin-inline: auto; }
.tl-main { min-height: 55vh; }
.tl-content { padding-block: 54px 72px; }
.tl-narrow { max-width: 820px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--tl-line);
  backdrop-filter: blur(12px);
}
.admin-bar .site-header { top: 32px; }
.tl-header-row {
  min-height: 88px; display: grid; grid-template-columns: auto 1fr auto;
  gap: 28px; align-items: center;
}
.site-branding { min-width: 190px; }
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: 72px; width: auto; }
.tl-fallback-logo { display: inline-flex; align-items: center; }
.tl-fallback-logo img { width: 170px; max-height: 74px; object-fit: contain; }
.primary-navigation ul { display: flex; justify-content: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.primary-navigation a { color: var(--tl-ink); font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.primary-navigation a:hover, .primary-navigation .current-menu-item > a { color: var(--tl-green); }
.tl-header-actions { display: flex; align-items: center; gap: 10px; }
.tl-icon-link {
  display: inline-flex; min-height: 42px; align-items: center; gap: 7px; padding: 8px 11px;
  color: var(--tl-navy); background: var(--tl-bg); border-radius: 11px; font-weight: 700; font-size: 14px;
}
.tl-cart-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 999px; background: var(--tl-green); color: #fff; font-size: 12px;
}
.tl-menu-toggle { display: none; border: 1px solid var(--tl-line); background: #fff; color: var(--tl-navy); padding: 9px 12px; cursor: pointer; }
.tl-searchbar { border-top: 1px solid #edf1f2; background: #fff; }
.tl-search-form { max-width: 760px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 8px; }
.tl-search-form input[type="search"] { flex: 1; border: 1px solid var(--tl-line); border-radius: 10px; padding: 10px 13px; min-width: 0; }
.tl-search-form button { background: var(--tl-navy); color: #fff; padding: 10px 18px; font-weight: 700; cursor: pointer; }

/* Hero */
.tl-hero { padding: 52px 0 36px; background: linear-gradient(180deg, #f7faf9 0%, #fff 100%); }
.tl-hero-card {
  overflow: hidden; position: relative; border-radius: 28px; padding: 76px 64px;
  background: radial-gradient(circle at 85% 25%, rgba(0,145,103,.30), transparent 28%), linear-gradient(125deg, var(--tl-navy-deep), var(--tl-navy));
  color: #fff; box-shadow: var(--tl-shadow);
}
.tl-hero-card::after {
  content: ""; position: absolute; width: 330px; height: 330px; border: 52px solid rgba(255,255,255,.05);
  border-radius: 50%; right: -100px; bottom: -155px;
}
.tl-kicker { display: inline-block; color: #bcead9; text-transform: uppercase; letter-spacing: .16em; font-size: 13px; font-weight: 800; }
.tl-hero h1 { max-width: 760px; margin: 12px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 72px); line-height: 1.03; }
.tl-hero p { max-width: 650px; margin: 0 0 28px; color: #e6f0f4; font-size: clamp(17px, 2vw, 21px); }
.tl-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px;
  border-radius: 11px; font-weight: 800; transition: transform .15s ease, background .15s ease;
}
.tl-button:hover { transform: translateY(-1px); }
.tl-button-primary { background: var(--tl-green); color: #fff; }
.tl-button-primary:hover { background: #00a676; color: #fff; }
.tl-button-secondary { border: 1px solid rgba(255,255,255,.55); color: #fff; margin-left: 9px; }
.tl-button-secondary:hover { background: #fff; color: var(--tl-navy); }

/* Home sections */
.tl-trust-strip { padding: 6px 0 44px; }
.tl-trust-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.tl-trust-item { padding: 19px 20px; border: 1px solid var(--tl-line); border-radius: 14px; background: #fff; }
.tl-trust-item strong { display: block; color: var(--tl-navy); }
.tl-trust-item span { color: var(--tl-muted); font-size: 14px; }
.tl-section { padding: 54px 0; }
.tl-section-soft { background: var(--tl-bg); }
.tl-section-head { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 26px; }
.tl-section-head h2 { margin: 0; color: var(--tl-navy); font: 700 clamp(30px,4vw,44px)/1.15 Georgia,serif; }
.tl-section-head p { max-width: 590px; margin: 8px 0 0; color: var(--tl-muted); }
.tl-text-link { font-weight: 800; white-space: nowrap; color: var(--tl-green-dark); }
.tl-category-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.tl-category-card { min-height: 220px; padding: 28px; display: flex; flex-direction: column; justify-content: end; position: relative; overflow: hidden; border-radius: 20px; background: var(--tl-navy); color: #fff; }
.tl-category-card::before { content:""; position:absolute; inset:0; background: linear-gradient(180deg,transparent 10%,rgba(3,35,51,.78)); }
.tl-category-card.has-image { background-position:center; background-size:cover; }
.tl-category-card > * { position: relative; z-index: 1; }
.tl-category-card h3 { margin: 0; font: 700 27px/1.15 Georgia,serif; }
.tl-category-card span { color: #d8eeea; font-size: 14px; }
.tl-publisher-cta { margin: 48px 0 0; padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 25px; background: var(--tl-navy); color:#fff; border-radius: 22px; }
.tl-publisher-cta h2 { margin: 0 0 7px; font-family: Georgia,serif; font-size: 34px; }
.tl-publisher-cta p { margin: 0; color: #dce9ee; }

/* General content */
.entry-header { margin-bottom: 28px; }
.entry-title, .page-title { color: var(--tl-navy); font-family: Georgia,"Times New Roman",serif; line-height: 1.15; }
.entry-title { font-size: clamp(34px,5vw,54px); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2, .entry-content h3 { color: var(--tl-navy); }
.entry-content blockquote { margin-inline: 0; padding: 8px 0 8px 24px; border-left: 4px solid var(--tl-green); color: #43505a; }
.wp-caption, .wp-block-image { max-width: 100%; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.pagination, .nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 36px; }
.page-numbers { padding: 8px 13px; border-radius: 8px; background: var(--tl-bg); }
.page-numbers.current { background: var(--tl-navy); color: #fff; }

/* Footer */
.site-footer { margin-top: 0; background: #082f43; color: #d8e5ea; }
.tl-footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 54px; padding: 58px 0 38px; }
.site-footer h3, .site-footer h4 { color: #fff; margin-top: 0; }
.site-footer a { color: #d8e5ea; }
.site-footer a:hover { color: #9be0c7; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 8px 0; }
.tl-footer-brand img { width: 180px; background:#fff; border-radius:12px; padding:8px; margin-bottom: 15px; }
.tl-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: 13px; color: #a9c0ca; display:flex; justify-content:space-between; gap:20px; }

@media (max-width: 980px) {
  .tl-header-row { grid-template-columns: 1fr auto; min-height: 76px; }
  .tl-menu-toggle { display: inline-block; }
  .primary-navigation { display: none; grid-column: 1 / -1; padding-bottom: 16px; }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { align-items: flex-start; flex-direction: column; gap: 8px; }
  .primary-navigation a { display: block; padding: 7px 0; }
  .tl-header-actions { justify-self: end; }
  .tl-header-actions .tl-account-text { display:none; }
  .tl-trust-grid, .tl-category-grid { grid-template-columns: repeat(2,1fr); }
  .tl-footer-grid { grid-template-columns: 1fr 1fr; }
  .tl-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .admin-bar .site-header { top: 46px; }
  .tl-container { width: min(calc(100% - 28px), var(--tl-container)); }
  .tl-header-row { gap: 10px; }
  .site-branding { min-width: 130px; }
  .custom-logo, .tl-fallback-logo img { max-width: 145px; max-height: 60px; }
  .tl-icon-link { padding: 7px 9px; }
  .tl-icon-link .tl-cart-label { display:none; }
  .tl-hero { padding-top: 26px; }
  .tl-hero-card { padding: 46px 28px; border-radius: 20px; }
  .tl-button-secondary { margin: 10px 0 0; }
  .tl-trust-grid, .tl-category-grid { grid-template-columns: 1fr; }
  .tl-section-head, .tl-publisher-cta { align-items: flex-start; flex-direction: column; }
  .tl-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .tl-footer-brand { grid-column: auto; }
  .tl-footer-bottom { flex-direction: column; }
}
