@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Source+Sans+3:wght@400;600;700&display=swap');

/* Selg hos oss – felles Meirbruk-side, same drakt som portalen */
body.selg {
  --green: #0a2f24;
  --mustard: #c8963a;
  --mustard-dark: #a97a24;
  --ink: #1f2420;
  --muted: #5a635c;
  --paper: #f7f4ee;
  --banner: #2a2f2b;        /* nøytral mørk – ingen avdeling eig han */
  --line: #ddd6c8;

  font-family: 'Source Sans 3', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

/* Banner med hylle */
.sg-banner {
  position: relative;
  background: var(--banner);
  padding-bottom: 30px;
  color: var(--paper);
  overflow: hidden;
}
.sg-banner .sg-top-addr { color: rgba(247,244,238,.72); }
.sg-banner .sg-top-addr:hover { color: var(--mustard); }
.sg-banner .sg-head { border-bottom: none; padding: 34px 1.4rem 30px; }
.sg-banner .sg-head h1 { color: #fff; }
.sg-banner .sg-head p { color: rgba(247,244,238,.82); }

.sg-shelf {
  display: block;
  width: 100%;
  height: 112px;
}
.sg-shelf .c1 { fill: var(--mustard); }
.sg-shelf .c2 { fill: #f7f4ee; }
.sg-shelf .c3 { fill: #7f9b7a; }
.sg-shelf .board { fill: #06231b; }
.sg-shelf .stroke { stroke: #f7f4ee; }
@media (max-width: 640px) { .sg-shelf { height: 84px; } }

/* Topplinje */
.sg-top {
  max-width: 880px;
  margin: 0 auto;
  padding: 26px 1.4rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.sg-top-logo img { height: 27px; width: auto; }
.sg-top-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sg-top-login {
  font-size: 13px;
  font-weight: 600;
  color: var(--mustard);
  text-decoration: none;
  white-space: nowrap;
}
.sg-top-login:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  .sg-top { flex-wrap: wrap; }
  .sg-top-right { width: 100%; justify-content: flex-start; gap: 14px; margin-top: 8px; }
}
.sg-top-addr {
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--muted);
  text-decoration: none;
}
.sg-top-addr:hover { color: var(--mustard-dark); text-decoration: underline; text-underline-offset: 3px; }

.sg-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.4rem 3rem;
}

/* Tittel */
.sg-head {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 1.4rem 26px;
  border-bottom: 1px solid var(--line);
}
.sg-head h1 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.9rem, 4.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--green);
  margin: 0 0 12px;
}
.sg-head p {
  margin: 0;
  max-width: 44ch;
  font-size: 17px;
  color: var(--muted);
}

/* Spor */
.sg-track { padding-top: 40px; }
.sg-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mustard-dark);
}
.sg-track h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  color: var(--green);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.sg-lead {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
}

/* To modellar for gjenbruk */
.sg-models {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 26px 0 16px;
}
@media (min-width: 720px) {
  .sg-models { grid-template-columns: 1fr 1fr; }
}
.sg-model {
  background: var(--paper);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
}
.sg-who {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mustard-dark);
}
.sg-model h3, .sg-maker h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.15rem;
  color: var(--green);
  margin: 0 0 10px;
  line-height: 1.3;
}
.sg-model p, .sg-maker p {
  margin: 0 0 20px;
  font-size: 0.97rem;
  color: var(--muted);
}
.sg-model .sg-btns { margin-top: auto; }
.sg-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.sg-btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  background: var(--mustard);
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.2s, transform 0.2s;
}
.sg-btn:hover { filter: brightness(1.05); transform: translateY(-2px); }
.sg-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.sg-btn-line {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  font-weight: 600;
}
.sg-btn-line:hover { background: #fff8ee; }

.sg-note {
  margin: 0 0 8px;
  max-width: 62ch;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Stega – ei rekkjefølgje, difor nummer */
.sg-steps { margin-top: 8px; }
.sg-steps h3, .sg-tips h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.1rem;
  color: var(--green);
  margin: 0 0 14px;
}
.sg-steps ol {
  list-style: none;
  counter-reset: steg;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.sg-steps li {
  counter-increment: steg;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.sg-steps li::before {
  content: counter(steg);
  font-family: 'Libre Baskerville', serif;
  font-size: 1.25rem;
  color: var(--mustard-dark);
  line-height: 1.2;
}
.sg-steps li > h4, .sg-steps li > p { grid-column: 2; }
.sg-steps h4, .sg-tip h4 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  margin: 0 0 4px;
}
.sg-steps p, .sg-tip p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
  max-width: 60ch;
}
.sg-steps a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sg-steps a:hover { color: var(--mustard-dark); }

/* Tips – ikkje ei rekkjefølgje, difor utan nummer */
.sg-tips { margin-top: 36px; }
.sg-tip-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (min-width: 620px) {
  .sg-tip-grid { grid-template-columns: 1fr 1fr; }
}
.sg-tip { background: #fffdf8; padding: 20px 22px; }

/* Nye varer */
.sg-makers {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 26px;
}
@media (min-width: 760px) {
  .sg-makers { grid-template-columns: repeat(3, 1fr); }
}
.sg-maker {
  background: var(--paper);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
}
.sg-maker .sg-btn { margin-top: auto; align-self: flex-start; }

/* Botn */
.sg-foot {
  margin-top: 52px;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--muted);
}
.sg-foot .cols { display: grid; gap: 1rem; }
@media (min-width: 640px) {
  .sg-foot .cols { grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
}
.sg-foot strong { color: var(--green); display: block; margin-bottom: 0.2rem; }
.sg-foot p { margin: 0 0 0.2rem; }
.sg-foot a { color: var(--green); font-weight: 500; }
.sg-cross {
  margin-top: 1.5rem !important;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
.sg-cross a { text-decoration: underline; text-underline-offset: 3px; }
.sg-org { margin-top: 0.4rem !important; font-size: 0.82rem; }

/* Lenkje vidare frå eit kort */
.sg-more { margin: 16px 0 0; font-size: 0.92rem; }
.sg-more a {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sg-more a:hover { color: var(--mustard-dark); }

/* Undersida: slankare banner */
.sg-banner-sub .sg-head { padding-top: 26px; }
.sg-back { margin: 0 0 10px !important; font-size: 0.9rem; }
.sg-banner .sg-back a { color: var(--mustard); text-decoration: none; font-weight: 600; }
.sg-banner .sg-back a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sg-banner-sub .sg-head h1 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); }

/* Bestillingsboks nedst på undersida */
.sg-bestill {
  margin-top: 40px;
  padding: 26px 24px;
  background: #fff8ee;
  border: 1px solid #ead9b8;
}
.sg-bestill h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.15rem;
  color: var(--green);
  margin: 0 0 8px;
}
.sg-bestill p { margin: 0 0 18px; color: var(--muted); max-width: 52ch; }

/* Inngangsboksar under heroen */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.sg-track, .sg-maker { scroll-margin-top: 18px; }

.sg-entry {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 36px;
}
.sg-index, .sg-shop { padding: 24px 24px 26px; }
.sg-index { background: var(--paper); }
.sg-shop { background: #fff8ee; }
.sg-index h2, .sg-shop h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.1rem;
  color: var(--green);
  margin: 0 0 14px;
}
.sg-index ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
}
.sg-index ul a {
  display: block;
  text-align: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.sg-index ul a:hover { border-color: var(--green); background: #fff8ee; }
.sg-index ul a:focus-visible { outline: 2px solid var(--mustard); outline-offset: 2px; }

.sg-index-note {
  margin: 14px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.sg-index-note a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sg-index-note a:hover { color: var(--mustard-dark); }

.sg-shop p { margin: 0 0 16px; color: var(--muted); font-size: 0.95rem; max-width: 40ch; }
.sg-shop-note { margin: 12px 0 0 !important; font-size: 0.88rem; }
.sg-shop-note a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sg-shop-note a:hover { color: var(--mustard-dark); }

/* Flat liste over salsformer */
.sg-ways {
  margin-top: 40px;
  border-top: 1px solid var(--line);
}
.sg-way {
  display: grid;
  gap: 16px 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 18px;
}

.sg-way h2 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.3rem;
  color: var(--green);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.sg-way p { margin: 0; color: var(--muted); max-width: 58ch; }
.sg-way .sg-who { margin: 0 0 4px; }
.sg-way .sg-more { margin-top: 12px; }
.sg-way .sg-note { margin-top: 10px; font-size: 0.88rem; }

/* Gjenbruk: to måtar under same kategori */
@media (min-width: 720px) {
  .sg-way-wide { grid-template-columns: 1fr; }
}
.sg-sub {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 6px;
}
@media (min-width: 640px) {
  .sg-sub { grid-template-columns: 1fr 1fr; }
}
.sg-sub-item {
  background: #fffdf8;
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.sg-sub-item h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.05rem;
  color: var(--green);
  margin: 0 0 6px;
}
.sg-sub-item p { margin: 0 0 18px; font-size: 0.95rem; flex: 1; }
.sg-sub-item p a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.sg-sub-item p a:hover { color: var(--mustard-dark); }
.sg-sub-item .sg-more { margin: 12px 0 0; }

/* Bilete øvst i dei to gjenbruk-boksane */
.sg-sub-img {
  display: block;
  width: calc(100% + 44px);
  max-width: none;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: -20px -22px 18px;
  background: #e9e3d6;
}

/* Alternativ veg under hovudknappen */
.sg-alt {
  margin: 12px 0 0 !important;
  font-size: 0.88rem !important;
  color: var(--muted);
  max-width: 240px !important;
  margin-left: auto !important;
}
.sg-alt a, .sg-inline {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.sg-alt a:hover, .sg-inline:hover { color: var(--mustard-dark); }
@media (max-width: 719px) { .sg-alt { margin-left: 0 !important; } }

/* Bilete av hylla på hylleleige-sida */
.sg-fig { margin: 0 0 30px; max-width: 420px; }
.sg-fig img { display: block; width: 100%; height: auto; }
.sg-fig figcaption { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }

/* Rader med bilete til venstre */
.sg-way-thumb {
  display: block;
  width: 100%;
  max-width: 150px;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #e9e3d6;
}
.sg-way-body { display: grid; gap: 16px; align-content: start; }
@media (min-width: 560px) {
  .sg-way-img { grid-template-columns: 170px minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .sg-way-thumb { max-width: none; }
}

.sg-track h2 { line-height: 1.25; text-wrap: balance; }

/* Bilete inne i eit steg */
.sg-stepfig { grid-column: 2; margin: 14px 0 0; }
.sg-stepfig img { display: block; width: 100%; max-width: 220px; height: auto; }
.sg-stepfig figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); max-width: 52ch; }

/* Avdelingsfarge som markør på kvar salsform */
.sg-way { padding-left: 16px; border-left: 4px solid transparent; }
#gjenbruk, #handverk { border-left-color: #41562f; }
#lokalmat { border-left-color: #5C3A21; }
#boker { border-left-color: #2E4156; }

/* Kollasjen på sida om sal utan hylle */
.sg-fig-wide { max-width: none; }

/* Prismodellar på sida om sal utan hylle */
.sg-prismodell { margin: 6px 0 30px; padding: 22px 24px; border: 1px solid var(--line); background: #fffdf8; }
.sg-prismodell h3 { font-family: 'Libre Baskerville', serif; font-size: 1.05rem; color: var(--green); margin: 0 0 8px; }
.sg-prismodell > p { margin: 0; color: var(--muted); }
.sg-rates { margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.sg-rates div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sg-rates dt { font-family: 'Libre Baskerville', serif; font-weight: 700; font-size: 1.1rem; color: var(--green); }
.sg-rates dd { margin: 0; color: var(--ink); font-size: 0.95rem; }
