/*
 * palveluseutu.css
 * PalveluSeutu / Meicat — julkisen puolen tyylit
 *
 * Versio:   0.2 (siirtymävaihe - osin aktiivinen)
 * Päivätty: 2026-05-30
 * Standardi: PSR-5 kommentointi, BEM-inspiroitu nimeäminen
 *
 * JÄRJESTYSSÄÄNTÖ: Myöhempi sääntö kumoaa aiemman ristiriidassa.
 * Tiedosto luetaan ennen inline-tyylejä — inline style="" voittaa aina.
 *
 * SIIRTYMÄTILA: 
 * Merkintä "AKTIIVINEN" lisätään kun PHP-koodista poistetaan vastaava
 * inline-tyyli tai style-lohko.
 *
 * Rakenne:
 *   1. CSS-muuttujat (:root)
 *   2. Reset ja perusasetukset
 *   3. Typografia
 *   4. Layout — rakenne ja kontainerit
 *   5. Navigaatio — header ja nav
 *   6. Hero-alue
 *   7. Napit (buttons)
 *   8. Kortit (cards)
 *   9. Lomakkeet (forms)
 *  10. Taulut (tables)
 *  11. Badget ja merkit
 *  12. Hakusivu — kategoriat ja tulokset
 *  13. Etusivu — kategoriagrid
 *  14. Palveluntuottajan sivu
 *  15. Portaali — tuottajan hallintanäkymä
 *  16. Artikkeli ja uutissivu
 *  17. Footer
 *  18. Apuluokat (utilities)
 *  19. Responsiivisuus (media queries)
 */


/* ═══════════════════════════════════════════════════════════
   1. CSS-MUUTTUJAT
   Kaikki värit, koot ja muut toistuvat arvot muuttujina.
   Area-kohtaiset värit ylikirjoitetaan PHP:stä.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Värit — Putkilahti-teema */
  --bg:          #FAF5E8;   /* pellonhiekka — sivupohja */
  --surface:     #FDFBF2;   /* lähes valkoinen — kortit */
  --border:      #D0C090;   /* olkisavi — reunukset */
  --text:        #1a1a18;   /* lähes musta — perusteksti */
  --muted:       #7A6840;   /* ruskea — toissijainen teksti */
  --accent:      #3A2E1A;   /* multamaa — navigaatio, CTA */
  --accent2:     #B85E28;   /* pihlaja — hover, korostus */
  --accent-lt:   #f0ead8;   /* vaalea aksentti — taustat */
  --highlight:   #E8C87A;   /* olki — logo, korostus navissa */

  /* Vihreät — kysynnän pampulat, onnistuminen */
  --green-lt:    #86efac;   /* vaalea vihreä — 1 pyyntö */
  --green-md:    #15803d;   /* keskivihreä — 2-4 pyyntöä */
  --green-dk:    #166534;   /* tummanvihreä — 5+ pyyntöä */

  /* Varoitus ja virhe */
  --danger:      #8b2020;
  --danger-lt:   #fdf0f0;
  --warning-bg:  #fef9e8;
  --warning-text: #7a5f10;

  /* Muoto */
  --radius:      4px;
  --radius-lg:   8px;

  /* Typografia */
  --font-ui:     'Sora', system-ui, sans-serif;
  --font-prose:  'Lora', Georgia, serif;
  --font-mono:   'Courier New', monospace;

  /* Hero */
  --hero-height: clamp(120px, 22vh, 260px);
}


/* ═══════════════════════════════════════════════════════════
   2. RESET JA PERUSASETUKSET
   ═══════════════════════════════════════════════════════════ */

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

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--accent2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════════
   3. TYPOGRAFIA — AKTIIVINEN 2026-05-30
   UI-teksti: Sora. Vapaa teksti (artikkelit, kuvaukset): Lora.
   bold (600-700) = interaktiivinen, regular (400) = informatiivinen.
   ═══════════════════════════════════════════════════════════ */

h1 {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

h2 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.2rem;
}

h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
}

/* Vapaa teksti — palvelukuvaukset, artikkelit */
.prose,
.article-body,
.post-content,
.listing-description,
.provider-description {
  font-family: var(--font-prose);
  font-weight: 400;
  line-height: 1.7;
}

.muted   { color: var(--muted); }
.sm      { font-size: 12px; }
.mono    { font-family: var(--font-mono); }


/* ═══════════════════════════════════════════════════════════
   4. LAYOUT — AKTIIVINEN 2026-05-30
   ═══════════════════════════════════════════════════════════ */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px;
}


/* ═══════════════════════════════════════════════════════════
   5. NAVIGAATIO — AKTIIVINEN 2026-05-30
   Tumma palkki, highlight-väri logolle, Sora bold linkeille.
   ═══════════════════════════════════════════════════════════ */

header {
  background: var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}

.site-name {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--highlight);
}

.site-name a {
  color: inherit;
}

nav a {
  font-family: var(--font-ui);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

nav a:hover {
  color: #fff;
  text-decoration: none;
}

/* Hamburger-valikko — mobiili */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
}

/* Avatar-ympyrä kirjautuneelle */
.nav-avatar {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════
   6. HERO-ALUE — AKTIIVINEN 2026-05-30
   Korkeus: clamp() suhteessa selainikkunaan.
   Teksti vasemmassa alakulmassa gradienttia vasten.
   ═══════════════════════════════════════════════════════════ */

.site-hero {
  height: var(--hero-height);
  background-size: cover;
  background-position: center 25%;
  position: relative;
}

.site-hero--gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
}

.site-hero__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.2rem 2rem;
  background: linear-gradient(
    to top,
    rgba(30, 20, 10, 0.75) 0%,
    rgba(30, 20, 10, 0.2) 60%,
    transparent 100%
  );
}

.site-hero__title {
  font-family: var(--font-ui);
  font-weight: 700;
  color: #fff;
  font-size: clamp(1.3rem, 4vw, 2rem);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}


/* ═══════════════════════════════════════════════════════════
   7. NAPIT — AKTIIVINEN 2026-05-30
   Primary: tumma tausta, highlight-teksti.
   Ghost: läpinäkyvä, reunaviiva.
   ═══════════════════════════════════════════════════════════ */

.btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
}

.btn:hover {
  opacity: .85;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost   { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.btn-sm      { padding: 4px 10px; font-size: 12px; }
.btn-approve { background: var(--accent-lt); color: var(--accent); border: 1px solid #b0d4be; }
.btn-reject  { background: var(--danger-lt); color: var(--danger); border: 1px solid #e0b0b0; }

.btn:hover  { opacity: .85; text-decoration: none; }
.btn-ghost  { background: transparent; color: var(--accent); border: 1px solid var(--border); padding: 7px 14px; }

/* Etusivun CTA-napit */
.btn-cta {
  padding: 12px 28px;
  font-size: 15px;
}

.btn-cta--ghost {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-cta--suggest {
  background: #f0f7f3;
  color: var(--accent);
  border: 1px solid #b0d4be;
  margin-top: 8px;
}


/* ═══════════════════════════════════════════════════════════
   8. KORTIT
   ═══════════════════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}


/* ═══════════════════════════════════════════════════════════
   9. LOMAKKEET
   ═══════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 3px;
}

input[type=text],
input[type=email],
input[type=url],
input[type=password],
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}


/* ═══════════════════════════════════════════════════════════
   10. TAULUT
   ═══════════════════════════════════════════════════════════ */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  padding: 10px 13px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #faf9f7;
}

tbody tr {
  border-bottom: 1px solid #eeecea;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: #faf9f7;
}

tbody td {
  padding: 9px 13px;
  vertical-align: top;
}


/* ═══════════════════════════════════════════════════════════
   11. BADGET JA MERKIT
   ═══════════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.badge-approved, .badge-active   { background: var(--accent-lt); color: var(--accent); }
.badge-pending                   { background: var(--warning-bg); color: var(--warning-text); }
.badge-rejected, .badge-inactive { background: var(--danger-lt); color: var(--danger); }
.badge-neutral                   { background: #f0f0f0; color: var(--text); }


/* ═══════════════════════════════════════════════════════════
   12. HAKUSIVU — KATEGORIAT JA TULOKSET — AKTIIVINEN 2026-05-30
   ═══════════════════════════════════════════════════════════ */

.cat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.cat-chip:hover,
.cat-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

.cat-chip--parent {
  text-transform: uppercase; font-size: 11px; letter-spacing: .06em; 
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}


.search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
}

.search-hint      { font-size: 13px; color: var(--accent); }
.search-hint-link { font-size: 13px; margin-top: 8px; display: inline-block; }

.search-empty-box { margin-top: 32px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.search-empty-box p { font-size: 15px; margin-bottom: 12px; color: var(--muted); }

.results-meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; font-family: var(--font-mono); }
.listing-grid { display: grid; gap: 14px; }


.cat-group  { margin-bottom: 6px; }
.cat-parent { font-size: 10px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.pagination { display: flex; gap: 8px; margin-top: 24px; }
.page-link  { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--surface); }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }


/* ═══════════════════════════════════════════════════════════
   13. ETUSIVU — KATEGORIAGRID
   Pääkategorioiden korttiruudukko etusivulla.
   ═══════════════════════════════════════════════════════════ */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
}

.cat-grid__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .75rem .6rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color .15s;
}

.cat-grid__item:hover {
  border-color: var(--accent2);
  text-decoration: none;
}

.cat-grid__name  { font-weight: 600; font-size: .85rem; }
.cat-grid__count { font-size: .72rem; color: var(--muted); }
.cat-grid__demand {
  font-size: .7rem;
  color: #fff;
  border-radius: 20px;
  padding: 1px 6px;
}

.home-hero         { max-width: 640px; margin: 0 auto; text-align: center; padding: 40px 20px 0; }
.home-hero h1      { font-size: 28px; margin-bottom: 16px; }
.home-hero p       { font-size: 16px; line-height: 1.7; color: var(--muted); margin-bottom: 32px; }
.home-cta-wrap     { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.cat-grid-wrap     { margin: 32px 0; text-align: left; }
.home-notice       { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: left; font-size: 14px; line-height: 1.7; }
.home-suggest-hint { margin-top: 24px; font-size: 13px; color: var(--muted); }



/* ═══════════════════════════════════════════════════════════
   14. PALVELUNTUOTTAJAN SIVU — AKTIIVINEN 2026-05-30
   ═══════════════════════════════════════════════════════════ */

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.listing-title  { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.listing-meta   { font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }

.provider-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.listing-card:hover { border-color: #bbb; }

.listing-header  { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.listing-title   { font-size: 16px; font-weight: bold; }
.listing-cat     { font-size: 12px; color: var(--muted); font-family: var(--font-mono); background: #f0eeea; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.listing-provider { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.listing-desc    { font-size: 14px; line-height: 1.6; color: #333; margin-bottom: 10px; }
.listing-meta    { display: flex; gap: 16px; flex-wrap: wrap; }
.listing-breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.listing-name      { font-size: 22px; margin-bottom: 4px; }
.listing-provider-link { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.listing-body     { font-size: 15px; line-height: 1.7; margin-bottom: 20px; }
.listing-location { font-size: 14px; color: var(--muted); }

.meta-item       { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.meta-item strong { color: var(--text); }

.provider-name   { font-size: 20px; margin-bottom: 4px; }
.provider-meta   { font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.provider-desc     { font-size: 15px; line-height: 1.6; margin-top: 8px; }

.detail-grid  { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.detail-box   { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.detail-row   { display: flex; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.detail-label { color: var(--muted); font-family: var(--font-mono); font-size: 12px; min-width: 80px; padding-top: 2px; }

.alv-note { color: var(--muted); font-size: 12px; }

.claim-hint { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.claim-link { font-size: 13px; color: var(--muted); }

.claim-page       { max-width: 580px; }
.page-title       { margin-bottom: 20px; }
.page-title--sm   { margin-bottom: 8px; }
.claim-ytunnus    { margin-bottom: 24px; }
.listing-card--mb { margin-bottom: 24px; }

.listing-title--lg { font-size: 18px; margin-bottom: 8px; }
.claim-intro       { margin-bottom: 24px; }
.claim-user        { margin-bottom: 16px; }
.urgency           { display: none; }



/* ═══════════════════════════════════════════════════════════
   15. SUGGEST-SIVU
   ═══════════════════════════════════════════════════════════ */

.suggest-intro  { color: var(--muted); margin-bottom: 20px; font-size: 15px; }
.suggest-ok     { background: var(--accent-lt); color: var(--accent); border: 1px solid #b0d4be; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; }
.suggest-form   { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 560px; }

.suggest-notify { background: #f0f7f3; border: 1px solid #b0d4be; border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; margin-bottom: 12px; }

.suggest-notify__title { font-size: 14px; color: var(--accent); margin-bottom: 10px; font-weight: bold; }
.suggest-notify__text  { font-size: 13px; color: var(--text); margin-bottom: 10px; }


/* ═══════════════════════════════════════════════════════════
   16. ARTIKKELI JA UUTISSIVU — AKTIIVINEN 2026-05-30
   ═══════════════════════════════════════════════════════════ */

.article-body h1,
.article-body h2,
.article-body h3 {
  font-family: var(--font-prose);
  margin: 1.2rem 0 .5rem;
}

.article-body p {
  margin-bottom: 1rem;
}

.posts-title    { margin-bottom: 24px; }
.post-item      { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.post-item h2   { font-size: 18px; margin-bottom: 4px; }

.post-meta      { margin-bottom: 8px; }
.post-back      { font-size: 13px; color: var(--muted); }
.post-title     { margin-top: 12px; margin-bottom: 4px; }
.post-date      { margin-bottom: 24px; }




/* ═══════════════════════════════════════════════════════════
   17. FOOTER
   ═══════════════════════════════════════════════════════════ */

footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

footer a {
  color: var(--muted);
}


/* ═══════════════════════════════════════════════════════════
   18. APULUOKAT
   ═══════════════════════════════════════════════════════════ */

.alert         { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 18px; font-size: 13px; }
.alert-error   { background: var(--danger-lt); color: var(--danger); border: 1px solid #e0b0b0; }
.alert-ok      { background: var(--accent-lt); color: var(--accent); border: 1px solid #b0d4be; }
.alert-pending { background: var(--warning-bg); color: var(--warning-text); border: 1px solid #e8d890; }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.back-link { font-size: 13px; color: var(--muted); text-decoration: none; margin-left: 14px;  }


/* ═══════════════════════════════════════════════════════════
   19. RESPONSIIVISUUS
   Mobile-first: perusasetukset pienille, overridet isommille.
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .nav-burger { display: flex; }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--accent);
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  }

  nav.is-open {
    display: flex;
    flex-direction: column;
  }

  nav a {
    padding: .75rem 1.5rem;
    border-bottom: .5px solid rgba(255, 255, 255, .08);
  }

  .container { padding: 16px 16px; }
}

@media (max-width: 600px) {
  :root { --hero-height: clamp(90px, 18vh, 160px); }
  .site-hero__title { font-size: 1.3rem; }
  .search-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ═══════════════════════════════════════════════════════════
   20. KEHITYSYMPÄRISTÖ — AKTIIVINEN 2026-05-30  (uusi)
   ═══════════════════════════════════════════════════════════ */

.beta-bar    { background: #92400e; color: #fef3c7; font-size: 11px; font-family: "Courier New", monospace; text-align: center; padding: 3px 12px; letter-spacing: .05em; }
.beta-branch { opacity: .45; margin-left: 10px; font-size: 10px; }
