/* ==========================================================================
   ows_ledger — custom template for OnlineWebWorks.com
   Design concept: a well-kept ledger / ruled notebook — fitting for tools
   that track payments, hours and expenses. Deep navy + brass accent on a
   soft paper background; hairline borders instead of shadows and rounded
   card kits.
   ========================================================================== */

:root {
  --bg: #EFF1EC;
  --surface: #FFFFFF;
  --ink: #16202A;
  --ink-soft: #4B5A68;
  --primary: #1F3A5F;
  --primary-dark: #142943;
  --accent: #B08D57; /* overridden per-site via template param */
  --line: #D7DAD2;
  --line-strong: #B7BCB2;
  --radius: 3px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------------------------------------------------------- */
/* Header                                                                */
/* -------------------------------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand__wordmark {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand__logo { height: 70px; width: 220px; display: block; }

.brand__tagline {
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-left: 1px solid var(--line-strong);
  padding-left: 10px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover {
  color: var(--primary);
  text-decoration: none;
  border-bottom-color: var(--accent);
}

.header-search input[type="text"] {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-family: var(--sans);
  font-size: 0.9rem;
}

/* -------------------------------------------------------------------- */
/* Hero — the one place the ruled-paper texture lives                   */
/* -------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  padding: 56px 0;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero .wrap > * + * { margin-top: 14px; }

/* Faint scattered "window" wireframes — schematic, not real screenshots.
   Kept very low-contrast so the headline stays the focal point. */
.hero-scatter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-scatter rect {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 0.16;
}
.hero-scatter line {
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 0.16;
}
.hero-scatter circle {
  fill: var(--accent);
  opacity: 0.22;
}

.hero h1, .col-main h1, .item-page h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1.15;
  max-width: 22ch;
  margin: 0 0 12px;
  color: var(--ink);
}

.hero p { max-width: 60ch; color: var(--ink-soft); font-size: 1.05rem; }

/* -------------------------------------------------------------------- */
/* Breadcrumbs                                                          */
/* -------------------------------------------------------------------- */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 10px 0;
}
.breadcrumb-bar a { color: var(--ink-soft); }
.breadcrumb-bar ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.breadcrumb-bar li { display: flex; align-items: center; gap: 6px; }
.breadcrumb-bar li:not(:last-child)::after {
  content: "/";
  color: var(--line-strong);
}

/* -------------------------------------------------------------------- */
/* Main layout                                                          */
/* -------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding: 40px 24px;
  align-items: start;
}

.layout:has(.col-sidebar--left):has(.col-sidebar--right) {
  grid-template-columns: 220px 1fr 220px;
}
.layout:has(.col-sidebar--left):not(:has(.col-sidebar--right)) {
  grid-template-columns: 220px 1fr;
}
.layout:not(:has(.col-sidebar--left)):has(.col-sidebar--right) {
  grid-template-columns: 1fr 220px;
}

.col-main { min-width: 0; }

/* Real CSS Grid for the homepage product cards, targeting the markup
   from our own html/com_content/category/blog.php override — no
   guessing about Joomla's internal structure, and no Safari multi-
   column bugs. */
.ledger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  align-items: start;
}
.ledger-grid__item h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  margin: 0 0 14px;
}
.ledger-grid__item h2 a { color: inherit; }

/* The guaranteed card look: wrap each article's body content in
   <div class="ledger-card">...</div> and it will look right no matter
   what Joomla wraps around it. */
.ledger-card {
  break-inside: avoid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  margin-bottom: 28px;
}

.ledger-card h2 { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); margin-top:0; }
.ledger-card h3 { font-family: var(--serif); font-size: 1.1rem; margin-top: 1.4em; }
.ledger-card ul { padding-left: 1.2em; }
.ledger-card li { margin-bottom: 6px; }

/* Responsive image + text feature row, for use inside article content
   instead of raw float:left images (which don't clear cleanly and can
   overlap the text below on wide screens). Image is capped to a fixed
   column width and vertically centered against the text block; both
   stack into a single column below 640px. */
.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}
.feature-row__media {
  flex: 0 0 320px;
  max-width: 100%;
}
.feature-row__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.feature-row__body {
  flex: 1 1 320px;
  min-width: 0;
}
.feature-row__body > *:first-child { margin-top: 0; }
@media (max-width: 640px) {
  .feature-row__media { flex-basis: 100%; max-width: 280px; margin: 0 auto; }
}

/* Fallback support for older/legacy Joomla markup that does use these
   classes (harmless if unmatched). */
.item-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
}
.item-page h3 { font-family: var(--serif); font-size: 1.1rem; margin-top: 1.4em; }

/* Buy / subscribe buttons — whether they arrive with inline styles from
   article content, or with the .btn-buy class in new content. */
.col-main a[style*="background:#2c2c66"],
.col-main a[style*="background: #2c2c66"],
.ledger-card a[style*="background:#2c2c66"],
.ledger-card a[style*="background: #2c2c66"],
.col-main a.btn-buy {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  background: var(--primary) !important;
  color: #fff !important;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  border-bottom: 3px solid var(--accent);
  text-decoration: none !important;
}
.col-main a[style*="background:#2c2c66"]:hover,
.col-main a[style*="background: #2c2c66"]:hover,
.ledger-card a[style*="background:#2c2c66"]:hover,
.ledger-card a[style*="background: #2c2c66"]:hover,
.col-main a.btn-buy:hover {
  background: var(--primary-dark) !important;
}

/* -------------------------------------------------------------------- */
/* Sidebar "card" chrome (see html/modules.php)                         */
/* -------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}
.card__title {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
/* Reset default browser list styling for any menu-type module that
   ends up inside a card (e.g. a menu shown in the sidebar). */
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { margin-bottom: 6px; }

/* Generic form styling so unstyled Joomla module output (login form,
   search, etc.) still looks consistent with the rest of the site. */
.card input[type="text"],
.card input[type="password"],
.card input[type="email"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.card input[type="submit"],
.card button[type="submit"] {
  background: var(--primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius) !important;
  padding: 9px 18px !important;
  font-weight: 600 !important;
  font-family: var(--sans) !important;
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.card input[type="submit"]:hover,
.card button[type="submit"]:hover { background: var(--primary-dark) !important; }
.card label { font-size: 0.85rem; color: var(--ink-soft); }

/* -------------------------------------------------------------------- */
/* Footer                                                                */
/* -------------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: #DCE1E6;
  padding: 30px 0;
  border-top: 3px solid var(--accent);
  margin-top: 40px;
  font-size: 0.9rem;
}
.site-footer a { color: #DCE1E6; }
.site-footer a:hover { color: #fff; }

/* -------------------------------------------------------------------- */
/* Responsive                                                            */
/* -------------------------------------------------------------------- */
@media (max-width: 720px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; }
  .main-nav ul { gap: 14px; }

  .layout,
  .layout:has(.col-sidebar--left):has(.col-sidebar--right),
  .layout:has(.col-sidebar--left):not(:has(.col-sidebar--right)),
  .layout:not(:has(.col-sidebar--left)):has(.col-sidebar--right) {
    grid-template-columns: 1fr !important;
  }

  .hero { padding: 36px 0; }
  .hero-scatter { opacity: 0.6; }
}
