/* ================================================================
   French 75 Tracker — Site CSS
   Structure: CSS custom properties → reset → layout → components
   To theme the site, change the :root variables only.
   ================================================================ */

/* ---------------------------------------------------------------
   THEME VARIABLES
--------------------------------------------------------------- */
:root {
  /* Palette */
  --color-bg:           #f8f6f2;
  --color-surface:      #ffffff;
  --color-border:       #e3ddd5;
  --color-text:         #1c1a18;
  --color-text-muted:   #6b6358;
  --color-accent:       #b5924c;
  --color-accent-hover: #9d7d3e;

  /* Header / footer */
  --color-chrome-bg:    #18140f;
  --color-chrome-text:  #ede8e0;
  --color-chrome-link:  #c4aa7c;
  --color-chrome-hover-bg: rgba(255,255,255,0.09);

  /* Misc */
  --font:         system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius:       6px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow-md:    0 3px 10px rgba(0,0,0,.10);

  /* Layout widths */
  --content-width: 680px;
  --admin-width:   1100px;
}

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

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ---------------------------------------------------------------
   HEADER
--------------------------------------------------------------- */
.site-header {
  background: var(--color-chrome-bg);
  color: var(--color-chrome-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.site-header__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 52px;
}

.site-header.wide .site-header__inner {
  max-width: var(--admin-width);
}

.site-logo {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-chrome-text);
  text-decoration: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--color-chrome-link); text-decoration: none; }

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.site-nav a {
  color: var(--color-chrome-link);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--color-chrome-hover-bg); color: var(--color-chrome-text); text-decoration: none; }

.nav-sep { color: #3a3028; padding: 0; line-height: 1; font-size: 0.7rem; }

.nav-bell          { font-size: 1rem; }
.nav-bell--unread  { color: #f0c060; }

/* Admin breadcrumb bar below the main header */
.admin-bar {
  background: #100d09;
  border-bottom: 1px solid #2e2620;
}
.admin-bar__inner {
  max-width: var(--admin-width);
  margin: 0 auto;
  padding: 5px 16px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.admin-bar a { color: #8a7e6e; text-decoration: none; }
.admin-bar a:hover { color: var(--color-chrome-text); text-decoration: none; }

/* ---------------------------------------------------------------
   MAIN CONTENT
--------------------------------------------------------------- */
.site-main {
  flex: 1;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 16px;
  width: 100%;
}

.site-main.wide {
  max-width: var(--admin-width);
}

/* ---------------------------------------------------------------
   FOOTER
--------------------------------------------------------------- */
.site-footer {
  background: var(--color-chrome-bg);
  color: #4e4840;
  text-align: center;
  padding: 18px 16px;
  font-size: 0.78rem;
  margin-top: auto;
}
.site-footer a { color: #6e6258; }
.site-footer a:hover { color: #9e9288; }

/* ---------------------------------------------------------------
   TYPOGRAPHY
--------------------------------------------------------------- */
h1 { font-size: 1.7rem; font-weight: 700; margin-bottom: 1rem; line-height: 1.25; }
h2 { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.8rem; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.6rem; }

p               { margin-bottom: 0.75rem; }
p:last-child    { margin-bottom: 0; }
blockquote      { border-left: 3px solid var(--color-border); padding: 8px 14px; margin: 14px 0; color: var(--color-text-muted); font-style: italic; }
hr              { border: none; border-top: 1px solid var(--color-border); margin: 20px 0; }
small           { color: var(--color-text-muted); font-size: 0.83rem; }
ul, ol          { padding-left: 1.4em; margin-bottom: 0.75rem; }
li              { margin-bottom: 0.3rem; }

/* ---------------------------------------------------------------
   FORMS
--------------------------------------------------------------- */
.form            { max-width: 420px; }

label {
  display: block;
  font-weight: 500;
  font-size: 0.92rem;
  margin-bottom: 16px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-top: 5px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(181,146,76,.15);
}

input[type="range"] { width: 100%; margin: 6px 0; accent-color: var(--color-accent); }
output              { display: inline-block; margin-left: 8px; font-weight: 600; }
textarea            { resize: vertical; }

/* ---------------------------------------------------------------
   BUTTONS
--------------------------------------------------------------- */
button, .btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  line-height: 1.4;
  vertical-align: middle;
}
button:hover, .btn:hover { background: var(--color-accent-hover); text-decoration: none; }

button.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

button.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
button.btn-ghost:hover { background: var(--color-border); }

/* ---------------------------------------------------------------
   CARDS  (feed items, notifications, etc.)
--------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden; /* clearfix for floated thumbnail */
}
.card::after    { content: ""; display: table; clear: both; }

.card-title     { font-weight: 600; margin-bottom: 3px; }
.card-meta      { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 6px; }
.card-body      { margin-bottom: 8px; }
.card-actions   { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-thumb     { float: right; width: 80px; height: 80px; object-fit: cover; margin-left: 14px; border-radius: var(--radius); }

/* Managed / dim state for notifications */
.card--dim { opacity: 0.45; }

/* ---------------------------------------------------------------
   TABLES  (admin pages)
--------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

th, td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f2ede8;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td      { background: #faf8f5; }

/* ---------------------------------------------------------------
   STATUS BADGES
--------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge--pending  { background: #fff3cd; color: #856404; }
.badge--public   { background: #d1eddb; color: #155724; }
.badge--spam     { background: #f8d7da; color: #721c24; }
.badge--admin    { background: #cfe2ff; color: #0a367a; }

/* ---------------------------------------------------------------
   FEED
--------------------------------------------------------------- */
.feed-sort {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.btn-active {
  font-weight: 600;
  outline: 2px solid var(--color-primary, #333);
  outline-offset: 1px;
}
.card--new {
  border-left: 4px solid var(--color-primary, #333);
}

/* ---------------------------------------------------------------
   MAPS
--------------------------------------------------------------- */
.map-container {
  height: 250px;
  border-radius: var(--radius);
  margin: 16px 0;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

/* ---------------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------------- */
@media (max-width: 540px) {
  .site-header__inner { padding: 0 12px; gap: 8px; min-height: 46px; }
  .site-nav a          { padding: 5px 5px; font-size: 0.78rem; }
  .site-logo           { font-size: 0.85rem; }
  .site-main           { padding: 16px 12px; }
  h2                   { font-size: 1.15rem; }
  .card                { padding: 10px; }
  .card-thumb          { width: 60px; height: 60px; }
  th, td               { padding: 7px 8px; }
  table                { font-size: 0.8rem; }
  button, .btn         { padding: 7px 12px; }
}
