/*
 * Default theme styles.
 * Colors, font and container width come from Themes > Customize (CSS variables).
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--cms-font, system-ui, sans-serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--cms-text, #1f2937);
  background: var(--cms-bg, #fff);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
.cms-picture { display: contents; }
a { color: var(--cms-accent, #4f46e5); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4, h5, h6 { line-height: 1.2; margin: 0 0 .6em; color: #0f172a; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
blockquote { margin: 0; padding-left: 1em; border-left: 4px solid var(--cms-accent); font-style: italic; color: #475569; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: #000; color: #fff; padding: 8px 12px; z-index: 1000; }
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: var(--cms-content-width, 1140px); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 760px; }
.site-main { min-height: 50vh; }
.site-main > .container { padding-top: 56px; padding-bottom: 72px; }

/* Header */
.site-header { border-bottom: 1px solid #eef0f4; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 50; }
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.site-brand { font-weight: 800; font-size: 1.2rem; color: #0f172a; text-decoration: none; margin-right: auto; display: flex; align-items: center; }
.site-nav .menu { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.site-nav .menu a { display: block; padding: 8px 12px; border-radius: 8px; color: #334155; text-decoration: none; font-weight: 500; }
.site-nav .menu a:hover, .site-nav .menu .is-active > a { background: #f1f5f9; color: #0f172a; }
.site-nav .menu li { position: relative; }
.site-nav .cms-submenu { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; list-style: none; margin: 0; padding: 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.site-nav li:hover > .cms-submenu, .site-nav li:focus-within > .cms-submenu { display: block; }
.site-nav__toggle { display: none; align-items: center; justify-content: center; background: none; border: 0; padding: 8px; margin: -8px -8px -8px 0; cursor: pointer; color: #0f172a; font-size: 26px; line-height: 1; border-radius: 8px; }
.site-nav__toggle:hover { background: #f1f5f9; }
.site-header .cms-search-form input { width: 160px; }

/* Mobile: logo and hamburger on the same row, menu in an off-canvas panel (frontend.css) */
@media (max-width: 800px) {
  .site-nav, .site-header .cms-search-form { display: none; }
  .site-nav__toggle { display: inline-flex; }
}

/* Entries */
.entry__header { margin-bottom: 24px; }
.entry__title { margin-bottom: .3em; }
.entry__meta { color: #64748b; font-size: .95rem; }
.entry__terms a { display: inline-block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; text-decoration: none; margin-right: 10px; }
.entry__image { border-radius: 14px; margin-bottom: 28px; width: 100%; }
.entry__content > * + * { margin-top: 1em; }
.has-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
@media (max-width: 900px) { .has-sidebar { grid-template-columns: 1fr; } }

/* Archives */
.archive-header { margin-bottom: 36px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
.card { border: 1px solid #eef0f4; border-radius: 14px; overflow: hidden; background: #fff; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 12px 32px rgba(15, 23, 42, .08); transform: translateY(-2px); }
.card__image img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card__body { padding: 22px; }
.card__meta { color: #64748b; font-size: .85rem; margin-bottom: 6px; }
.card__title { font-size: 1.25rem; }
.card__title a { color: inherit; text-decoration: none; }
.search-result { padding: 20px 0; border-bottom: 1px solid #eef0f4; }
.not-found { text-align: center; }
.not-found__code { font-size: 6rem; font-weight: 800; color: #e2e8f0; margin: 0; line-height: 1; }
.not-found .cms-search-form { justify-content: center; margin: 24px 0; }

/* Footer */
.site-footer { border-top: 1px solid #eef0f4; background: #f8fafc; margin-top: 0; padding: 40px 0; color: #64748b; font-size: .95rem; }
.site-footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-footer__bottom p { margin: 0; }
.menu--inline { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; flex-wrap: wrap; }
.menu--inline a { color: #475569; text-decoration: none; }
