/* SiteForge — public base styles. Theme variables come from <style> in <head>. */
* { box-sizing: border-box; }
body.forge { margin: 0; }
.forge img { max-width: 100%; height: auto; }
.forge-main { min-height: 50vh; }

/* Header */
.forge-header { position: sticky; top: 0; z-index: 50; background: var(--forge-bg); border-bottom: 1px solid rgba(0,0,0,.07); backdrop-filter: saturate(180%) blur(6px); }
.forge-header-inner { max-width: var(--forge-maxw); margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.25rem; }
.forge-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--forge-text); }
.forge-logo { height: 44px; width: auto; }
.forge-sitename { font-family: var(--forge-font-head); font-weight: 700; font-size: 1.35rem; }
.forge-nav { flex: 1; }
.forge-header-a .forge-header-navrow .forge-nav { flex: 0 1 auto; }
.forge-header-a .forge-header-navrow .forge-nav ul { justify-content: center; }
.forge-nav ul { list-style: none; display: inline-flex; gap: .35rem; margin: 0; padding: 0; flex-wrap: wrap; }
.forge-nav a { display: inline-block; padding: .5rem .85rem; border-radius: 8px; text-decoration: none; color: var(--forge-text); font-weight: 500; }
.forge-nav a:hover { background: rgba(0,0,0,.05); }
.forge-nav a.active { color: var(--forge-primary); }
.forge-nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--forge-text); cursor: pointer; }

/* Blocks */
.forge-block { width: 100%; }
.forge-richtext > *:first-child { margin-top: 0; }
.forge-richtext img { border-radius: var(--forge-radius); max-width: 100%; height: auto; }
/* Inline images sit beside the text (like the About module): float left by default,
   text wraps alongside. Centre-align makes it a block; right-align floats right. */
.forge-richtext p > img,
.forge-richtext p > a > img { float: left; margin: .25rem 1.5rem 1rem 0; }
.forge-richtext p.ql-align-right > img,
.forge-richtext p.ql-align-right > a > img { float: right; margin: .25rem 0 1rem 1.5rem; }
.forge-richtext p.ql-align-center { text-align: center; }
.forge-richtext p.ql-align-center > img,
.forge-richtext p.ql-align-center > a > img { float: none; display: block; margin: 1rem auto; }
.forge-richtext p > a { display: inline; }
.forge-richtext::after { content: ""; display: block; clear: both; }
/* Explicit image-alignment classes (set by the editor toolbar) are authoritative:
   they must win over the legacy paragraph-based ql-align rules above, regardless
   of the image's nesting or its paragraph's alignment. */
.forge-richtext img.forge-img-left { float: left !important; margin: .3rem 1.4rem 1rem 0 !important; max-width: 50%; height: auto; }
.forge-richtext img.forge-img-right { float: right !important; margin: .3rem 0 1rem 1.4rem !important; max-width: 50%; height: auto; }
.forge-richtext img.forge-img-center { float: none !important; display: block !important; clear: both; margin: 1rem auto !important; max-width: 100%; height: auto; }
/* Drop cap (the inline style on the span is primary; this is a fallback) */
.forge-dropcap-letter { float: left; font-size: 3.2em; line-height: .72; font-weight: 700; margin: .04em .12em 0 0; }
.forge-hidden-flag { background: repeating-linear-gradient(45deg,#fff3cd,#fff3cd 10px,#ffe69c 10px,#ffe69c 20px); color: #664d03; text-align: center; font-size: .8rem; padding: .25rem; font-weight: 600; }

/* Footer */
.forge-footer { background: #0f172a; color: #cbd5e1; margin-top: 3rem; }
.forge-footer-inner { max-width: var(--forge-maxw); margin: 0 auto; padding: 2.5rem 1.25rem 1.5rem; }
.footer-cols { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.forge-footer h4 { color: #fff; font-family: var(--forge-font-head); }
.footer-social a { color: #cbd5e1; font-size: 1.4rem; margin-left: .9rem; }
.footer-social a:hover { color: #fff; }
.footer-copyright { border-top: 1px solid rgba(255,255,255,.1); margin-top: 1.5rem; padding-top: 1rem; font-size: .85rem; opacity: .8; }

/* Scroll top */
.forge-scrolltop { position: fixed; right: 1.1rem; bottom: 1.1rem; width: 44px; height: 44px; border-radius: 50%; background: var(--forge-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; opacity: 0; pointer-events: none; transition: opacity .2s; text-decoration: none; z-index: 60; }
.forge-scrolltop.show { opacity: 1; pointer-events: auto; }

/* Responsive */
@media (max-width: 768px) {
  .forge-header-inner { flex-wrap: wrap; align-items: center; }
  .forge-nav { display: flex; flex-wrap: wrap; align-items: center; }
  .forge-nav-toggle { display: inline-flex; align-items: center; order: 9; }
  body.burger-right .forge-nav-toggle { margin-left: auto; }
  body.burger-left  .forge-nav-toggle { margin-right: auto; order: -1; }
  .forge-nav ul { display: none; flex-direction: column; width: 100%; padding-top: .5rem; order: 10; }
  .forge-nav ul.open { display: flex; }
  .forge-nav ul li { width: 100%; }
  .forge-nav ul a { display: block; width: 100%; }
  .forge-topmenu-inner { flex-wrap: wrap; justify-content: flex-start !important; }
  .forge-nav .forge-dropdown { position: static; display: block; box-shadow: none; padding-left: 1rem; min-width: 0; }
  .forge-block { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* Print / export */
@media print {
  .forge-header, .forge-footer, .forge-scrolltop, .forge-nav-toggle { display: none !important; }
  .forge-block { break-inside: avoid; padding: 1rem 0 !important; }
  .block-bg, .block-overlay { display: none !important; }
  body.forge { color: #000; background: #fff; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
}

/* ── v0.3 borrowings ─────────────────────────────────────────────────── */
/* Top bar */
.forge-topbar { font-size: .85rem; }
.forge-topbar-inner { max-width: var(--forge-maxw); margin: 0 auto; padding: .4rem 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.forge-topbar-contact a { margin-left: 1rem; text-decoration: none; }
.forge-topbar-contact a:first-child { margin-left: 0; }

/* Dropdown menus */
.forge-nav .forge-has-children { position: relative; }
.forge-nav .forge-dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; background: var(--forge-bg); box-shadow: 0 10px 30px rgba(0,0,0,.12); border-radius: 10px; padding: .4rem; z-index: 60; flex-direction: column; }
.forge-nav .forge-has-children:hover .forge-dropdown { display: flex; }
.forge-nav .forge-dropdown li { display: block; }
.forge-nav .forge-dropdown a { display: block; white-space: nowrap; }

/* Nav search */
.forge-nav-search { display: inline-flex; margin-left: .5rem; vertical-align: middle; }
.forge-nav-search input { border: 1px solid rgba(0,0,0,.15); border-radius: 8px 0 0 8px; padding: .35rem .6rem; font-size: .9rem; max-width: 150px; }
.forge-nav-search button { border: 0; background: var(--forge-primary); color: #fff; border-radius: 0 8px 8px 0; padding: 0 .7rem; cursor: pointer; }

/* Vertical menu layout */
body.nav-vertical .forge-shell { display: flex; align-items: flex-start; max-width: var(--forge-maxw); margin: 0 auto; gap: 0; }
body.nav-vertical .forge-sidebar { flex: 0 0 230px; position: sticky; top: 0; padding: 1.5rem 1rem; }
body.nav-vertical .forge-nav-vertical ul { flex-direction: column; align-items: stretch; gap: .15rem; }
body.nav-vertical .forge-nav-vertical .forge-dropdown { position: static; display: flex; box-shadow: none; padding-left: 1rem; }
body.nav-vertical .forge-nav-vertical .forge-has-children:hover .forge-dropdown { display: flex; }
body.nav-vertical .forge-content { flex: 1; min-width: 0; }

/* Footer legal links */
.footer-legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 1.25rem; padding-top: 1rem; display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-legal a { color: #cbd5e1; text-decoration: none; font-size: .85rem; }
.footer-legal a:hover { color: #fff; }

@media (max-width: 768px) {
  body.nav-vertical .forge-shell { flex-direction: column; }
  body.nav-vertical .forge-sidebar { flex-basis: auto; width: 100%; position: static; }
  .forge-nav-search input { max-width: 110px; }
}

/* ── v0.4: themes / regions, masthead search, top-menu strip ─────────── */
.forge-masthead { display: flex; align-items: center; padding: 1rem 1.25rem; position: relative; }
.forge-mast-search-btn { position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%); background: transparent; border: 0; font-size: 1.3rem; color: inherit; cursor: pointer; opacity: .85; }
.forge-mast-search-btn:hover { opacity: 1; }
.forge-mast-search-panel { background: rgba(0,0,0,.04); border-bottom: 1px solid rgba(0,0,0,.06); padding: 1.25rem; }
.forge-mast-search-form { max-width: var(--forge-maxw); margin: 0 auto; display: flex; gap: .5rem; }
.forge-mast-search-form input { flex: 1; border: 1px solid rgba(0,0,0,.15); border-radius: var(--forge-radius); padding: .7rem 1rem; font-size: 1.05rem; }
.forge-mast-search-form button { border: 0; background: var(--forge-primary); color: #fff; border-radius: var(--forge-radius); padding: .7rem 1.4rem; cursor: pointer; }

/* Standalone horizontal top-menu strip */
.forge-topmenu { background: var(--forge-bg); border-top: 1px solid rgba(0,0,0,.06); border-bottom: 1px solid rgba(0,0,0,.06); }
.forge-topmenu-inner { max-width: var(--forge-maxw); margin: 0 auto; padding: .35rem 1.25rem; display: flex; align-items: center; justify-content: center; gap: 1rem; }
.forge-topmenu-inner ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; margin: 0; padding: 0; align-items: center; }
.forge-topmenu-inner a { text-decoration: none; padding: .35rem .25rem; }

/* Right-hand side menu (mirror of the left vertical layout) */
body.nav-vertical.side-right .forge-shell { flex-direction: row-reverse; }

/* v0.4.1: top bar inline spans spacing */
.forge-topbar-text > span + span { margin-left: 1rem; }
.forge-topbar-text { display: inline-flex; flex-wrap: wrap; align-items: center; }

/* Countdown module */
.forge-countdown .fc-title { margin: 0 0 .5rem; }
.forge-countdown .fc-intro { margin: 0 0 1.4rem; max-width: 60ch; opacity: .95; }
.fc-banner-content { max-width: 50%; }
.fc-timer { display: flex; flex-wrap: wrap; gap: .75rem; }
.fc-unit { background: var(--fc-accent, var(--forge-primary)); color: #fff; border-radius: var(--forge-radius);
  min-width: 88px; padding: .95rem .6rem; text-align: center; display: flex; flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.fc-num { font-size: 2.5rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.fc-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; margin-top: .4rem; opacity: .9; }
.fc-expired { font-size: 1.7rem; font-weight: 700; }
@media (max-width: 768px) {
  .fc-banner-content { max-width: 100%; }
  .fc-num { font-size: 1.9rem; }
  .fc-unit { min-width: 68px; padding: .7rem .45rem; }
}

/* Catalogue module */
.forge-catalog { display: grid; grid-template-columns: repeat(var(--cat-cols, 4), 1fr); gap: 1.5rem; }
.forge-cat-card { display: flex; flex-direction: column; }
.forge-cat-thumb { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--forge-radius); display: block; background: #f1f5f9; }
.forge-cat-noimg { display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #cbd5e1; }
.forge-cat-body { padding-top: .6rem; }
.forge-cat-title { font-size: 1.02rem; margin: 0 0 .15rem; line-height: 1.25; }
.forge-cat-title a { color: inherit; text-decoration: none; }
.forge-cat-title a:hover { text-decoration: underline; }
.forge-cat-sub { font-size: .9rem; opacity: .8; margin: 0 0 .2rem; }
.forge-cat-meta { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; opacity: .6; margin: 0 0 .35rem; }
.forge-cat-excerpt { font-size: .88rem; opacity: .85; margin: 0 0 .5rem; }
.forge-cat-price { font-weight: 700; margin: 0 0 .5rem; }
.forge-cat-btn { padding: .35rem .9rem; font-size: .85rem; }
@media (max-width: 992px) { .forge-catalog { grid-template-columns: repeat(min(var(--cat-cols,4), 3), 1fr); } }
@media (max-width: 680px)  { .forge-catalog { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .forge-catalog { grid-template-columns: 1fr; } }

/* Item detail page */
.forge-item-grid { display: grid; grid-template-columns: 320px 1fr; gap: 2rem; align-items: start; }
.forge-item-cover img { width: 100%; border-radius: var(--forge-radius); display: block; }
@media (max-width: 720px) { .forge-item-grid { grid-template-columns: 1fr; } }

/* Hero positioned boxes — stack on small screens so they never overlap */
@media (max-width: 768px) {
  .forge-hero-positioned { display: flex; flex-direction: column; justify-content: center; }
  .forge-hero-positioned .forge-hero-box { position: static !important; transform: none !important; width: auto !important; max-width: 100% !important; margin: 0 0 1rem !important; }
  .forge-hero-row { flex-direction: column; }
  .forge-hero-row .forge-hero-box { width: auto !important; flex: 0 0 auto !important; }
}
/* Events flexible layout */
.forge-events-flex > div { box-sizing: border-box; }

/* Inline separators inserted via the Quill editor */
.forge-richtext hr.forge-hr { border: 0; height: 0; border-top: 2px solid var(--forge-primary); width: 120px; margin: 1.5rem auto; }

/* Quill stores paragraph alignment as classes; the public page must define them
   (Quill's own stylesheet only loads in the admin editor). Without these, a
   justified/left/right paragraph inherits the section's alignment instead. */
.ql-align-left    { text-align: left; }
.ql-align-center  { text-align: center; }
.ql-align-right   { text-align: right; }
.ql-align-justify { text-align: justify; }

/* Columns module: flexible widths; stack on small screens */
.forge-smart::after { content: ""; display: block; clear: both; }
@media (max-width: 768px) {
  .forge-cols { flex-direction: column; }
  .forge-cols .forge-col { width: auto !important; flex: 0 0 auto !important; }
}
@media (max-width: 576px) {
  .forge-smart img { float: none !important; width: auto !important; max-width: 100% !important; display: block; margin: 0 0 1rem !important; }
}

/* CTA button press effect */
.forge-cta-btn { transition: transform .09s ease, box-shadow .09s ease, filter .09s ease; }
.forge-cta-btn:active, .forge-cta-btn.is-pressed { transform: translateY(2px) scale(.985); filter: brightness(.94); }

/* Page Layout module: multi-column grids are contained & centred; single-column
   rows stay full-width so a block's own chrome controls its width (heroes etc.) */
.forge-row-grid.forge-row-contained {
  max-width: var(--forge-content-w, 1200px);
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: border-box;
}
.forge-layout-cell { min-width: 0; }
.forge-layout-cell img, .forge-layout-cell video, .forge-layout-cell iframe { max-width: 100%; }
.forge-layout-cell table { display: block; max-width: 100%; overflow-x: auto; }
@media (max-width: 768px) {
  .forge-row-grid { grid-template-columns: 1fr !important; }
}

/* Auto-flow text columns reflow to one column on small screens */
@media (max-width: 768px) { .forge-richtext { column-count: 1 !important; } }
