*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:       #1a1a1a;
  --ink-light: #444;
  --ink-muted: #888;
  --rule:      #ddd;
  --bg:        #f5f3ef;
  --bg-white:  #fff;
  --accent:    #c0392b;
  --accent-dk: #96281b;
  --left:      #2980b9;
  --center:    #27ae60;
  --right:     #e67e22;
  --panel-w:   620px;
  --radius:    4px;
  --shadow:    0 2px 12px rgba(0,0,0,.12);
}

html { font-size: 16px; }

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  width: 100%;
  background: var(--bg-white);
  color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

/* Masthead */
#masthead {
  background: var(--bg-white);
  border-bottom: 3px double var(--ink);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#masthead .brand {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.5px;
}
#masthead .brand span { color: var(--accent); }

#masthead .tagline {
  font-style: italic;
  color: var(--ink-muted);
  font-size: .85rem;
}

#masthead .auth-area {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-family: Arial, sans-serif;
  font-size: .85rem;
}

.btn {
  font-family: Arial, sans-serif;
  font-size: .85rem;
  padding: .4rem .9rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: background .15s, color .15s;
  background: var(--bg-white);
  color: var(--ink);
}
.btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent-dk); }
.btn-primary:hover { background: var(--accent-dk); }
.btn-sm { padding: .25rem .6rem; font-size: .8rem; }

/* Category nav */
#cat-nav {
  background: var(--ink);
  color: #fff;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
#cat-nav button {
  color: #ddd;
  padding: .55rem 1.2rem;
  font-family: Arial, sans-serif;
  font-size: .82rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
#cat-nav button:hover  { background: rgba(255,255,255,.1); color: #fff; }
#cat-nav button.active { background: var(--accent); color: #fff; }
#cat-nav .nav-link-btn {
  color: #ddd;
  padding: .55rem 1.2rem;
  font-family: Arial, sans-serif;
  font-size: .82rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, color .15s;
  display: inline-flex;
  align-items: center;
}
#cat-nav .nav-link-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Overlay background */
#overlay-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
}
#overlay-bg.open { display: block; }

/* Toast */
#toast {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(3rem);
  background: var(--ink);
  color: #fff;
  padding: .6rem 1.4rem;
  border-radius: 20px;
  font-family: Arial, sans-serif;
  font-size: .9rem;
  z-index: 999;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Auth modal */
#auth-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}
#auth-modal.open { display: flex; }
.modal-box {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  width: min(440px, 95vw);
}
.modal-box h2 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .75rem;
}
.modal-box .field { margin-bottom: 1rem; }
.modal-box .field label {
  display: block;
  font-family: Arial, sans-serif;
  font-size: .82rem;
  color: var(--ink-muted);
  margin-bottom: .3rem;
}
.modal-box .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
}
.modal-switch {
  font-family: Arial, sans-serif;
  font-size: .83rem;
  color: var(--accent);
  cursor: pointer;
}
.modal-switch:hover { text-decoration: underline; }

/* Lean badge */
.lean-badge {
  font-family: Arial, sans-serif;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 3px;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: .3px;
}
.lean-left   { background: var(--left); }
.lean-center { background: var(--center); }
.lean-right  { background: var(--right); }

/* Language switcher */
.lang-btn {
  font-family: Arial, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  padding: .25rem .5rem;
  border-radius: 3px;
  border: 1px solid var(--rule);
  line-height: 1;
  transition: all .15s;
  cursor: pointer;
  background: var(--bg-white);
  color: var(--ink-muted);
}
.lang-btn:hover  { color: var(--ink); border-color: #aaa; }
.lang-btn.active { color: var(--accent); border-color: var(--accent); background: #fff8f7; }

/* Misc */
.divider { border: none; border-top: 1px solid var(--rule); margin: 1rem 0; }
.label {
  font-family: Arial, sans-serif;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-muted);
}

/* Footer */
#site-footer {
  background: #0d1a35;
  color: #fff;
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: 1.4rem;
}
.footer-logo {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
}
.fl-s { color: #fff; }
.fl-o { color: var(--accent); }
.footer-network {
  font-family: Arial, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  padding-bottom: .2rem;
}

.footer-sites {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 0;
  margin-bottom: 1.25rem;
}
.footer-sites a {
  font-family: Arial, sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  padding: .3rem 1.1rem .3rem 0;
  margin-right: 1rem;
  border-right: 1px solid rgba(255,255,255,.15);
  transition: color .15s;
  white-space: nowrap;
}
.footer-sites a:last-child { border-right: none; }
.footer-sites a:hover { color: #fff; }

.footer-rule {
  border: none;
  border-top: 1px solid rgba(255,255,255,.12);
  margin: 1.25rem 0;
}

.footer-columns {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
  margin-bottom: .25rem;
}
.footer-col-title {
  font-family: Arial, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.4);
  margin-bottom: .75rem;
}
.footer-about-text {
  font-family: Arial, sans-serif;
  font-size: .82rem;
  line-height: 1.65;
  color: rgba(255,255,255,.55);
}
.footer-sitemap {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.footer-sitemap a {
  font-family: Arial, sans-serif;
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  transition: color .15s;
}
.footer-sitemap a:hover { color: #fff; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.footer-legal a {
  font-family: Arial, sans-serif;
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  transition: color .15s;
}
.footer-legal a:hover { color: rgba(255,255,255,.85); }


/* Newsletter subscribe form in footer */
.footer-newsletter .fn-desc {
  font-family: Arial, sans-serif;
  font-size: .82rem;
  line-height: 1.5;
  color: rgba(255,255,255,.55);
  margin-bottom: .75rem;
}
.fn-input, .fn-select {
  width: 100%;
  padding: .45rem .65rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: .82rem;
  margin-bottom: .5rem;
  outline: none;
  transition: border-color .15s;
}
.fn-input::placeholder { color: rgba(255,255,255,.35); }
.fn-input:focus, .fn-select:focus { border-color: rgba(255,255,255,.5); }
.fn-select option { background: #1a1a2e; color: #fff; }
.fn-btn {
  width: 100%;
  padding: .5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.fn-btn:hover { background: var(--accent-dk); }
.fn-btn:disabled { opacity: .6; cursor: not-allowed; }
.fn-msg { font-family: Arial, sans-serif; font-size: .78rem; margin-top: .4rem; min-height: 1rem; }
.fn-ok  { color: #7bcc8a; }
.fn-err { color: #ff8080; }

.footer-copy {
  font-family: Arial, sans-serif;
  font-size: .75rem;
  color: rgba(255,255,255,.35);
}

/* Mobile */
@media (max-width: 600px) {
  #masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
    padding: .6rem 1rem;
  }
  #masthead .brand { font-size: 1.5rem; }
  #masthead .auth-area { width: 100%; justify-content: flex-end; }

  #cat-nav button {
    padding: .45rem .75rem;
    font-size: .75rem;
  }

  .modal-box { padding: 1.25rem; }

  .footer-logo { font-size: 2.2rem; }
  .footer-sites a { font-size: .82rem; padding-right: .7rem; margin-right: .7rem; }
  .footer-columns { grid-template-columns: 1fr 1fr; }
  .footer-newsletter { grid-column: 1 / -1; }
  .footer-col:first-child { grid-column: 1 / -1; }
}

/* OAuth buttons */
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: #fff;
  color: #333;
  font-family: Arial, sans-serif;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  text-decoration: none;
}
.btn-oauth:hover { background: #f5f5f5; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.btn-oauth svg { flex-shrink: 0; }
.oauth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  font-family: Arial, sans-serif;
  font-size: .8rem;
  color: var(--ink-muted);
}
.oauth-divider::before, .oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.oauth-btns { display: flex; flex-direction: column; gap: .5rem; }
