/* rust.az — hand-written CSS, no build step (keeps the Pi deploy to a single
   static file, no Node/Tailwind toolchain required). Palette lifted from the
   original design mockup so the shipped site matches it exactly. */

:root {
  --main: #0f111a;
  --panel: #1e2130;
  --panel-2: #171a26;
  --rust: #f34b3f;
  --rust-hover: #d93e34;
  --rust-light: #ff7066;
  --blue: #3b82f6;
  --border: #2a2e40;
  --text: #ffffff;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --muted-3: #4b5563;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--main);
  color: var(--text);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; width: 100%; }

/* ---------- Nav ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 26, 0.8);
  backdrop-filter: blur(12px);
}
.navbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 1rem; padding-bottom: 1rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand i { font-size: 2.1rem; transition: transform .7s ease; }
.brand:hover i { transform: rotate(90deg); }
.brand h1 { font-size: 1.4rem; font-weight: 900; letter-spacing: 0.08em; margin: 0; line-height: 1; }
.brand h1 .dim { color: var(--muted); }
.brand p { font-size: 0.62rem; font-weight: 500; color: var(--muted); letter-spacing: 0.2em; margin: 0.25rem 0 0; }

.nav-links { display: flex; align-items: center; gap: 1.75rem; font-size: 0.85rem; font-weight: 600; color: #d1d5db; flex-wrap: wrap; }
.nav-links a { padding: 0.25rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--rust); border-bottom: 2px solid var(--rust); }
.nav-lang { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.nav-lang:hover { color: var(--text); }

@media (max-width: 900px) {
  .nav-links { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero .wrap { padding: 4rem 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 3rem; }
.hero-glow {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 800px; height: 200px; background: var(--rust); opacity: 0.07; filter: blur(120px);
  pointer-events: none;
}
.hero-text { flex: 1 1 30rem; }
.hero-text h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; line-height: 1.15; margin: 0 0 1.25rem; }
.hero-text h2 .rust-word { color: var(--rust); text-shadow: 0 0 15px rgba(243, 75, 63, 0.5); }
.hero-text p { color: var(--muted); font-size: 1.15rem; font-weight: 300; margin: 0 0 2rem; max-width: 40rem; line-height: 1.6; }
.btn-rust {
  display: inline-block; background: var(--rust); color: #fff; font-weight: 700; letter-spacing: 0.03em;
  padding: 1rem 2.25rem; border-radius: 999px; border: none; cursor: pointer;
  box-shadow: 0 0 20px rgba(243, 75, 63, 0.4); transition: all .3s ease;
}
.btn-rust:hover { background: var(--rust-hover); box-shadow: 0 0 30px rgba(243, 75, 63, 0.6); transform: translateY(-2px); }

.hero-art { flex: 1 1 18rem; display: flex; justify-content: center; align-items: center; position: relative; min-height: 12rem; }
.hero-art .glow1 { position: absolute; width: 16rem; height: 16rem; background: var(--rust); opacity: 0.2; filter: blur(100px); border-radius: 999px; }
.hero-art .glow2 { position: absolute; width: 10rem; height: 10rem; background: var(--blue); opacity: 0.1; filter: blur(80px); border-radius: 999px; transform: translateX(5rem); }
.hero-art .fa-cog.big { font-size: 9rem; color: #e5e7eb; filter: drop-shadow(0 0 25px rgba(243, 75, 63, 0.6)); position: relative; z-index: 2; }

/* ---------- Sections ---------- */
main { flex: 1; }
.section-title { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin: 0 0 1.5rem; }
.section-sub { color: var(--muted); font-size: 0.9rem; margin: -1rem 0 1.5rem; }
.page-header { padding: 3rem 0 1rem; }
.page-header h2 { font-size: 2rem; font-weight: 800; margin: 0 0 0.5rem; }
.page-header p { color: var(--muted); margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3rem; }
.col-7 { grid-column: span 12; } .col-5 { grid-column: span 12; }
@media (min-width: 1024px) { .col-7 { grid-column: span 7; } .col-5 { grid-column: span 5; } }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
@media (min-width: 640px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .card-grid.cols-3-md { grid-template-columns: repeat(3, 1fr); } }

.news-card {
  background: linear-gradient(145deg, rgba(243,75,63,0.1) 0%, var(--panel) 100%);
  border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.4rem;
  display: flex; flex-direction: column; gap: 1.2rem; transition: all .3s ease;
}
.news-card:hover { border-color: rgba(243,75,63,0.5); transform: translateY(-3px); box-shadow: 0 10px 30px -10px rgba(243,75,63,0.15); }
.news-card .icon { width: 3.2rem; height: 3.2rem; border-radius: 0.8rem; background: rgba(243,75,63,0.1); border: 1px solid rgba(243,75,63,0.2); display: flex; align-items: center; justify-content: center; }
.news-card .icon i { color: var(--rust); font-size: 1.4rem; }
.news-card .thumb {
  width: 100%; aspect-ratio: 16 / 9; border-radius: 0.8rem; overflow: hidden;
  background: rgba(243,75,63,0.1); border: 1px solid rgba(243,75,63,0.2);
}
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.news-card h4 { font-size: 0.9rem; font-weight: 600; line-height: 1.4; margin: 0; }
.news-card time { color: var(--muted-2); font-size: 0.72rem; }

.resource-list { display: flex; flex-direction: column; gap: 0.75rem; }
.resource-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 0.85rem;
  padding: 0.9rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: border-color .2s;
}
.resource-item:hover { border-color: #6b7280; }
.resource-item .left { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.resource-item .icon { width: 2.5rem; height: 2.5rem; flex: none; border-radius: 0.6rem; background: #1f2937; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.resource-item:hover .icon { background: rgba(243,75,63,0.2); }
.resource-item .icon i { color: var(--rust); opacity: .9; }
.resource-item .label { font-size: 0.85rem; font-weight: 700; color: #e5e7eb; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-item .chev { color: var(--muted-3); font-size: 0.85rem; flex: none; }
.resource-item:hover .chev { color: var(--rust); }
.resource-item .desc { color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }

.guide-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 0.85rem; padding: 1.1rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; transition: all .3s ease;
}
.guide-card:hover { border-color: rgba(243,75,63,0.4); }
.guide-card .left { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.guide-card i.type-icon { color: var(--rust); font-size: 1.2rem; opacity: .85; flex: none; }
.guide-card span.label { font-size: 0.85rem; font-weight: 700; color: #d1d5db; line-height: 1.4; }

.type-pill {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--rust-light);
  background: rgba(243,75,63,0.12); border: 1px solid rgba(243,75,63,0.25);
  padding: 0.2rem 0.6rem; border-radius: 999px;
}

.type-jump-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.type-jump-row a {
  font-size: 0.78rem; font-weight: 600; color: var(--muted); background: var(--panel);
  border: 1px solid var(--border); padding: 0.45rem 0.9rem; border-radius: 999px; transition: all .2s;
}
.type-jump-row a:hover { color: var(--text); border-color: var(--rust); }

.resource-section { margin-bottom: 3rem; scroll-margin-top: 6rem; }
.resource-section h3 { display: flex; align-items: center; gap: 0.6rem; }
.empty-note { color: var(--muted-2); font-size: 0.85rem; padding: 1.5rem 0; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); background: var(--main); padding: 2rem 0; margin-top: auto; }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.social { display: flex; align-items: center; gap: 1.25rem; }
.social a { color: var(--muted-2); font-size: 1.15rem; transition: color .2s; }
.social a:hover { color: var(--text); }
.copyright { font-size: 0.85rem; font-weight: 500; color: var(--muted-2); }
.built-with { font-size: 0.78rem; color: var(--muted-3); }
.built-with .rust { color: var(--rust); }

/* ---------- Forms / Admin ---------- */
.admin-shell { max-width: 68rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.admin-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 2rem; font-size: 0.85rem; font-weight: 600; }
.admin-nav a { color: var(--muted); padding: 0.4rem 0.8rem; border-radius: 0.5rem; border: 1px solid var(--border); }
.admin-nav a:hover, .admin-nav a.active { color: var(--text); border-color: var(--rust); }
.admin-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; }
.stat-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.stat-box { flex: 1 1 10rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-box .num { font-size: 2rem; font-weight: 800; color: var(--rust-light); }
.stat-box .label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.admin-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); }
table.admin-table td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
table.admin-table a.edit { color: var(--blue); }
table.admin-table a.edit:hover { text-decoration: underline; }
table.admin-table .del-btn { background: none; border: none; color: var(--rust-light); cursor: pointer; font: inherit; padding: 0; }
table.admin-table .del-btn:hover { text-decoration: underline; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 0.5rem; padding: 0.55rem 0.7rem; font: inherit; font-size: 0.9rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--rust); }
.field textarea { min-height: 5rem; resize: vertical; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.btn-secondary {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 0.6rem 1.3rem; border-radius: 0.5rem; font-weight: 600; cursor: pointer;
}
.btn-secondary:hover { color: var(--text); border-color: var(--muted); }
.btn-submit {
  background: var(--rust); border: none; color: #fff; padding: 0.6rem 1.5rem;
  border-radius: 0.5rem; font-weight: 700; cursor: pointer;
}
.btn-submit:hover { background: var(--rust-hover); }

.flash { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35); color: #6ee7b7; padding: 0.7rem 1rem; border-radius: 0.6rem; margin-bottom: 1.5rem; font-size: 0.85rem; }
.notice-local { color: var(--muted-2); font-size: 0.78rem; margin-top: -1.2rem; margin-bottom: 1.5rem; }
