/* =============================================================
   main.css — full stylesheet for sgeo theme family
   Design tokens injected per-theme via :root overrides in
   a <style> block added by the generator (style.css header
   sets the theme name; assets/css/theme-vars.css sets tokens).
   ============================================================= */

/* ── 1. Design Tokens (defaults — overridden per theme) ──── */
:root {
  --color-primary:      #1a1a2e;
  --color-secondary:    #16213e;
  --color-accent:       #e94560;
  --color-bg:           #ffffff;
  --color-bg-alt:       #f4f6f9;
  --color-text:         #1a1a2e;
  --color-text-muted:   #6b7280;
  --color-border:       #e5e7eb;
  --color-header-bg:    var(--color-primary);
  --color-header-text:  #ffffff;
  --color-link:         var(--color-accent);
  --color-link-hover:   var(--color-secondary);
  --color-btn-bg:       var(--color-accent);
  --color-btn-text:     #ffffff;
  --font-body:          system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading:       var(--font-body);
  --font-mono:          'Courier New', Courier, monospace;
  --radius:             6px;
  --radius-lg:          12px;
  --shadow-sm:          0 1px 3px rgba(0,0,0,.08);
  --shadow-md:          0 4px 16px rgba(0,0,0,.12);
  --layout:             sidebar;   /* sidebar | wide | centered */
  --header-style:       sticky;
}

/* ── 2. Base ─────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); line-height: 1.7; }
a { color: var(--color-link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--color-link-hover); }
img, svg { max-width: 100%; height: auto; display: block; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); line-height: 1.25; color: var(--color-primary); }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
p { margin-block: .75rem; }
ul, ol { padding-left: 1.5em; margin-block: .75rem; }
code { font-family: var(--font-mono); background: var(--color-bg-alt); padding: .1em .35em; border-radius: 3px; font-size: .9em; }
pre { background: var(--color-bg-alt); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-block: 1rem; }
th, td { padding: .6rem .8rem; border: 1px solid var(--color-border); text-align: left; }
th { background: var(--color-bg-alt); font-weight: 600; }
blockquote { border-left: 4px solid var(--color-accent); margin-inline: 0; padding: .75rem 1.25rem; background: var(--color-bg-alt); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
figure { margin: 1.5rem 0; }
figcaption { font-size: .875rem; color: var(--color-text-muted); text-align: center; margin-top: .4rem; }

/* ── 3. Layout ───────────────────────────────────────────── */
.content-area.container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-block: 2rem;
}
@media (min-width: 900px) {
  .content-area.container:has(.sidebar) {
    grid-template-columns: 1fr 300px;
  }
}
main { min-width: 0; }

/* ── 4. Header ───────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-header-bg);
  color: var(--color-header-text);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
.site-tagline { font-size: .8rem; opacity: .7; margin: 0; }
.site-title-link { color: inherit; text-decoration: none; font-weight: 700; font-size: 1.25rem; }

/* ── 5. Navigation ───────────────────────────────────────── */
.primary-nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: .25rem; flex-wrap: wrap; }
.primary-nav a { display: block; padding: .45rem .85rem; color: var(--color-header-text); text-decoration: none; border-radius: var(--radius); font-weight: 500; font-size: .95rem; transition: background .15s; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: rgba(255,255,255,.15); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; color: var(--color-header-text); }
.nav-toggle__bar { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px 0; transition: transform .2s, opacity .2s; }
@media (max-width: 768px) {
  .nav-toggle { display: flex; flex-direction: column; justify-content: center; }
  .primary-nav { position: absolute; top: 64px; left: 0; right: 0; background: var(--color-header-bg); padding: 1rem; display: none; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; }
}

/* ── 6. Cards / post grid ────────────────────────────────── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.5rem; }
.card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card__thumb img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.card__body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; gap: .6rem; }
.card__title { font-size: 1.1rem; margin: 0; }
.card__title a { color: var(--color-primary); text-decoration: none; }
.card__title a:hover { color: var(--color-accent); }
.card__meta { font-size: .8rem; color: var(--color-text-muted); display: flex; gap: .75rem; flex-wrap: wrap; }
.card__excerpt { font-size: .9rem; color: var(--color-text-muted); flex: 1; }
.card__more { margin-top: auto; align-self: flex-start; }

/* ── 7. Single post / page ───────────────────────────────── */
.single-post, .page-content { max-width: 780px; }
.entry-header { margin-bottom: 1.5rem; }
.entry-title { margin-bottom: .5rem; }
.entry-meta { font-size: .85rem; color: var(--color-text-muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.entry-featured { margin-block: 1.5rem; border-radius: var(--radius-lg); overflow: hidden; }
.entry-content { font-size: 1.05rem; }
.entry-content h2, .entry-content h3 { margin-block: 1.5rem .5rem; }
.entry-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--color-border); font-size: .85rem; }

/* ── 8. Breadcrumb ───────────────────────────────────────── */
.sgeo-breadcrumb { margin-bottom: 1.25rem; font-size: .85rem; color: var(--color-text-muted); }
.sgeo-breadcrumb ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.sgeo-breadcrumb li + li::before { content: '/'; margin-right: .3rem; }
.sgeo-breadcrumb a { color: var(--color-text-muted); }

/* ── 9. Sidebar ──────────────────────────────────────────── */
.sidebar { font-size: .9rem; }
.widget { margin-bottom: 1.75rem; }
.widget-title { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75rem; padding-bottom: .4rem; border-bottom: 2px solid var(--color-accent); }
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: .3rem 0; border-bottom: 1px solid var(--color-border); }

/* ── 10. Buttons ─────────────────────────────────────────── */
.btn, button[type="submit"], input[type="submit"] {
  display: inline-block; padding: .55rem 1.4rem;
  background: var(--color-btn-bg); color: var(--color-btn-text);
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: .95rem; font-weight: 600; text-decoration: none;
  transition: filter .15s, transform .1s;
}
.btn:hover, button[type="submit"]:hover { filter: brightness(1.1); transform: translateY(-1px); color: var(--color-btn-text); }

/* ── 11. Forms ───────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="search"], textarea, select {
  width: 100%; padding: .55rem .85rem; border: 1px solid var(--color-border);
  border-radius: var(--radius); font: inherit; background: var(--color-bg);
  color: var(--color-text); transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; border-color: var(--color-accent); }
.search-form { display: flex; gap: .5rem; }
.search-field { flex: 1; }

/* ── 12. Archive / 404 ───────────────────────────────────── */
.archive-header { margin-bottom: 1.5rem; }
.archive-title { font-size: clamp(1.4rem, 3vw, 2rem); }
.error-404 { text-align: center; padding: 4rem 1rem; }
.error-404__code { font-size: 6rem; font-weight: 900; color: var(--color-accent); line-height: 1; }
.error-404__title { font-size: 1.75rem; margin-bottom: 1rem; }
.error-404__msg { color: var(--color-text-muted); margin-bottom: 1.5rem; }
.error-404__search { max-width: 420px; margin: 1.5rem auto 0; }

/* ── 13. Pagination ──────────────────────────────────────── */
.pagination { margin-top: 2.5rem; }
.page-numbers { display: inline-flex; flex-wrap: wrap; list-style: none; gap: .35rem; padding: 0; }
.page-numbers li { display: contents; }
.page-numbers a, .page-numbers span {
  display: inline-block; min-width: 2.2rem; padding: .35rem .7rem; text-align: center;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  text-decoration: none; font-size: .9rem; color: var(--color-text);
  transition: background .15s;
}
.page-numbers .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.page-numbers a:hover { background: var(--color-bg-alt); }

/* ── 14. Footer ──────────────────────────────────────────── */
.site-footer { background: var(--color-secondary); color: rgba(255,255,255,.8); margin-top: 3rem; padding-block: 2.5rem; font-size: .9rem; }
.footer-inner { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; text-align: center; }
.footer-nav ul { list-style: none; padding: 0; display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: rgba(255,255,255,.7); text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.footer-copy { color: rgba(255,255,255,.5); font-size: .8rem; }
.footer-widgets { width: 100%; }

/* ── 15. Utility / accessibility ─────────────────────────── */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.no-results { padding: 2rem; text-align: center; color: var(--color-text-muted); }

/* ── 16. Print ───────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .sidebar, .pagination, .nav-toggle { display: none !important; }
  body { font-size: 12pt; color: #000; }
  a[href]::after { content: " (" attr(href) ")"; }
}

/* ── 17. Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@import url('./theme-vars.css');
