/* ── Samlet CSS for objektsiden (single-objekt.php + fanene i objekt-views/) ──
   Flyttet ut av separate inline <style>-tagger midt i hver PHP-fil (der de
   ble strømmet til nettleseren midtveis i HTML-en, etter at mye av
   innholdet allerede var mottatt) og inn i én enqueued stylesheet som
   lastes i <head> som all annen CSS — det var årsaken til at siden virket
   "crunchet mot venstre" et øyeblikk før design kom på plass. Innholdet
   under er flyttet verbatim fra hver fil, ikke omskrevet, for å unngå å
   endre hvordan noe faktisk ser ut. */

/* ===== fra single-objekt.php ===== */

.to-single-objekt .to-object-container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Litt strammere på veldig store skjermer */
@media (min-width: 1600px) {
  .to-single-objekt .to-object-container {
    max-width: 1100px;
  }
}

/* --- Base --- */
.to-object-tabs {
  margin-top: 2rem;
}

.to-tab-nav {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid #ddd;
  margin-bottom: 2rem;
}

.to-tab {
  background: none;
  border: none;
  padding: 0.75rem 0;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.to-tab.active {
  border-color: #2f5f63;
  color: #2f5f63;
}

.to-tab-panel {
  display: none;
}

.to-tab-panel.active {
  display: block;
}

.to-panel-inner {
  padding: 1rem 0;
}

/* --- Accordion titles (hidden on desktop) --- */
.to-accordion-title {
  display: none;
  font-size: 1.1rem;
  margin: 0;
  padding: 1rem 0;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

/* --- Mobile layout --- */
@media (max-width: 768px) {

  .to-tab-nav {
    display: none;
  }

  .to-tab-panel {
    display: block;
    border-bottom: 1px solid #eee;
  }

  .to-accordion-title {
    display: block;
  }

  .to-panel-inner {
    display: none;
    padding-bottom: 1.5rem;
  }

  /* 👇 accordion styres av .open – IKKE .active */
  .to-tab-panel.open .to-panel-inner {
    display: block;
  }

@media (max-width: 768px) {

  .to-accordion-title {
    position: relative;
    padding: 1rem 2.5rem 1rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #2f5f63;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
  }

  /* Touch feedback */
  .to-accordion-title:active {
    background: rgba(47, 95, 99, 0.08);
  }

  /* Chevron */
  .to-accordion-title::after {
    content: "›";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    font-size: 1.6rem;
    color: #2f5f63;
    transition: transform 0.25s ease;
  }

  /* Open state */
  .to-tab-panel.open .to-accordion-title::after {
    transform: translateY(-50%) rotate(90deg);
  }

  /* Litt luft mellom seksjoner */
  .to-tab-panel {
    padding: 0.25rem 0;
  }
}
@media (max-width: 768px) {

  .to-accordion-title {
    position: relative;
    z-index: 1;
  }

  .to-accordion-title::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: rgba(47, 95, 99, 0.06);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
  }

  /* Hover / active */
  .to-accordion-title:hover::before,
  .to-accordion-title:active::before {
    opacity: 1;
  }

  /* Når seksjonen er åpen */
  .to-tab-panel.open .to-accordion-title::before {
    opacity: 1;
  }
}
@media (max-width: 768px) {

  /* Strek mellom hver accordion-rad */
  .to-tab-panel {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  /* Valgfritt: også strek øverst */
  .to-tab-panel:first-child {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
}


/* Banner container */
.objekt-banner {
  position: relative;
  width: 100%;
  height: 26vh;
  min-height: 220px;
  max-height: 360px;
  overflow: hidden;
}

/* Tving bildet til å fylle containeren */
.objekt-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
}

/* Desktop – litt mer crop */
@media (min-width: 1024px) {
  .objekt-banner {
    height: 24vh;
  }
}

/* Mobil */
@media (max-width: 768px) {
  .objekt-banner {
    height: 20vh;
    min-height: 160px;
  }
}


}


/* Oversikt – featured image skal være mindre enn banner */
.overview-featured-image {
  max-width: 900px;        /* juster 800–1000px etter smak */
  margin: 0 auto 1.5rem;
}

.overview-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Banner – ALLTID høyde */
.objekt-banner {
  width: 100%;
  height: 280px;          /* ← dette er nøkkelen */
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
}

/* Mobil – litt lavere */
@media (max-width: 768px) {
  .objekt-banner {
    height: 180px;
  }
}

.objekt-banner {
  position: relative;
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
}

/* Gradient overlay */
.objekt-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 35%,
    rgba(0, 0, 0, 0.0) 70%
  );
}

/* Innhold i banner */
.objekt-banner-inner {
  position: relative;
  z-index: 3;
  padding: 2rem 2rem 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.objekt-banner-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* Mobil */
@media (max-width: 768px) {
  .objekt-banner {
    height: 180px;
  }

  .objekt-banner-inner {
    padding: 1.25rem 1.25rem 1rem;
  }
}

.intro-section > h1 {
  font-size: 1.25rem;
  font-weight: 200;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #9a8f80;
}

.objekt-banner::after {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    to top,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0.25) 35%,
    rgba(0,0,0,0.05) 65%,
    rgba(0,0,0,0) 85%
  );

  z-index: 2;
  pointer-events: none;
}

.overview-layout {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: 2.5rem;
    align-items: start;
}

.overview-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

@media (max-width: 900px) {
    .overview-layout {
        grid-template-columns: 1fr;
    }
}


.tomtetabell {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tomtetabell th {
    text-align: left;
    padding: 10px 12px;
    background: #f4f3ee;
    border-bottom: 2px solid #d6d3c8;
    font-weight: 600;
}

.tomtetabell td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e0d8;
}

.tomtetabell tr:hover {
    filter: brightness(0.98);
}

/* Ledig – dus grønn */
.tomtetabell tr.status-ledig {
    background-color: rgba(76, 140, 74, 0.10);
}

/* Ledig, bebygd – dus grønn, litt mørkere */
.tomtetabell tr.status-ledig-bebygd {
    background-color: rgba(56, 120, 64, 0.12);
}

/* Reservert – dus gul */
.tomtetabell tr.status-reservert {
    background-color: rgba(214, 170, 70, 0.12);
}

/* Opptatt – dus rød */
.tomtetabell tr.status-opptatt {
    background-color: rgba(170, 70, 70, 0.10);
}

/* Listing av relaterte objekter */

.to-relaterte-objekter{
    margin-top:60px;
}

.to-rel-type{
    margin-bottom:50px;
}

.to-rel-type h2{
    margin-bottom:20px;
}

.to-objekt-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
    gap:20px;
}

.to-objekt-card{
    display:block;
    border:1px solid #e3e3e3;
    border-radius:8px;
    overflow:hidden;
    text-decoration:none;
    color:inherit;
    background:#fff;
    transition:transform .15s ease, box-shadow .15s ease;
}

.to-objekt-card:hover{
    transform:translateY(-3px);
    box-shadow:0 8px 18px rgba(0,0,0,0.08);
}

.to-objekt-bilde img{
    width:100%;
    height:180px;
    object-fit:cover;
}

.to-objekt-innhold{
    padding:14px;
}

.to-objekt-innhold h3{
    margin:0 0 6px 0;
    font-size:18px;
}

.to-objekt-innhold p{
    margin:0;
    color:#666;
    font-size:14px;
}

/* Tilbake-knapper nederst på objektvisning som kommer fra en parent */

.to-back-wrapper{
margin-top:50px;
padding-top:25px;
border-top:1px solid #eee;
text-align:center;
}

.to-back-title{
margin-bottom:10px;
font-weight:600;
color:#666;
}

.to-back-button{
display:inline-block;
margin:6px;
padding:10px 18px;
background:#2f5f63;
color:#fff;
border-radius:6px;
text-decoration:none;
font-weight:600;
transition:all .15s ease;
}

.to-back-button:hover{
background:#24484c;
}

/* Leverandør-sidebar */
.to-with-sidebar {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.to-with-sidebar .to-object-tabs {
    flex: 1 1 0;
    min-width: 0;
    margin-top: 0;
}

.to-leverandor-sidebar {
    flex: 0 0 260px;
    width: 260px;
    position: sticky;
    top: 100px;
}

.to-lev-heading {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 0 0 0.75rem;
}

.to-lev-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
    background: #fff;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.to-lev-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #5a7f6e;
}

.to-lev-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
    margin-bottom: 0.2rem;
}

.to-lev-dist {
    font-size: 0.78rem;
    color: #5a7f6e;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.to-lev-desc {
    font-size: 0.82rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .to-with-sidebar {
        flex-direction: column;
    }
    .to-leverandor-sidebar {
        width: 100%;
        flex: none;
        position: static;
    }
}

/* ===== fra objekt-views/tab-oversikt.php ===== */

.to-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 25px 0;
}

.to-fact-box {
    width: 140px; /* FIXED bredde */
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.to-fact-icon {
    font-size: 20px;
    color: #c59d5f;
    margin-bottom: 6px;
}

.to-fact-value {
    font-size: 18px;
    font-weight: 600;
}

.to-fact-label {
    font-size: 12px;
    color: #666;
}

.to-fact-updated {
    font-size: 10px;
    color: #999;
}

.to-fact-stale {
    opacity: 0.5;
}

.to-inline-image {
    margin: 20px 0;
}

.to-inline-image img {
    width: 100%;
    border-radius: 8px;
}

/* Overskrift */
.overview-description h3 {
    margin-bottom: 10px;   /* mindre luft under */
}

/* Avsnitt */
.overview-description p {
    margin-bottom: 10px;
}

/* Liste */
.overview-description ul {
    margin-top: 5px;       /* mindre luft over lista */
    margin-bottom: 10px;
    padding-left: 18px;
}

/* Punkter */
.overview-description li {
    margin-bottom: 4px;    /* tettere mellom punkter */
}

.to-map-embed {
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
}

.to-map-embed iframe {
    display: block;
    width: 100%;
    height: 420px;
}

/* spacing */
.to-pane-inner h1,
.to-pane-inner h2,
.to-pane-inner h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.to-pane-inner p {
    margin-bottom: 12px;
}

/* lists */
.to-pane-inner ul {
    margin: 10px 0 15px 20px;
}

.to-pane-inner li {
    margin-bottom: 6px;
}

/* checklist */
.to-checklist {
    list-style: none;
    padding-left: 0;
}

.to-checklist li::before {
    content: "✓";
    margin-right: 8px;
    color: #6b8f6a;
    font-weight: bold;
}

/* image */
.to-image img {
    width: 100%;
    border-radius: 10px;
    margin: 20px 0;
}

/* map */
.to-map-embed {
    margin: 25px 0;
    border-radius: 10px;
    overflow: hidden;
}

.to-map-embed iframe {
    width: 100%;
    height: 420px;
    border: 0;
}

/* video */
.to-video {
    margin: 25px 0;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.to-video iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 0;
}

.to-content-full {
    margin-top: 40px;
    max-width: 900px;
}

.overview-layout + .to-content-full {
    grid-column: 1 / -1; /* full bredde */
}

/* ===== fra objekt-views/tab-detaljer.php ===== */

/* =========================================================
   DETALJER – HOVEDLAYOUT (2 KOLONNER)
   ========================================================= */

.details-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr);
  gap: 4rem;
  align-items: start;
}

/* =========================================================
   HOVEDKOLONNE – FELTVISNING
   ========================================================= */

.details-table {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 2rem;
  row-gap: 0.9rem;
}

/* Én rad = label + verdi */
.detail-row {
  display: contents;
}

/* Label (høyrejustert, dempet) */
.detail-row .label {
  text-align: right;
  font-weight: 600;
  color: #6b6b6b;
  white-space: nowrap;
}

/* Verdi (rolig, lesbar) */
.detail-row .value {
  color: #222;
  line-height: 1.55;
  max-width: 60ch;
}

/* Litt luft etter "blokker" */
.detail-row + .detail-row {
  margin-top: 0.2rem;
}

/* =========================================================
   SEKSJONSOVERSKRIFTER (Utsikt, Fasiliteter osv.)
   ========================================================= */

.details-section h4 {
  grid-column: 1 / -1;
  margin: 2.5rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #8b5a2b;
}

/* Lister under seksjoner */
.details-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.details-section li {
  margin-bottom: 0.35rem;
}

/* =========================================================
   HØYREKOLONNE – BOKSER
   ========================================================= */

.details-aside {
  position: sticky;
  top: 6rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.details-aside-card {
  background: #f0f8ff;
  border:  1px solid #cce;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 6px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

/* Overskrifter i bokser */
.details-aside-card h4 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.25rem;
  color: #7a4a2e;
}

/* =========================================================
   CTA
   ========================================================= */

.btn-primary {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.7rem 1.4rem;
  background: #2f5f63;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

/* =========================================================
   MOBIL
   ========================================================= */

@media (max-width: 900px) {
  .details-layout {
    grid-template-columns: 1fr;
  }

  .details-aside {
    position: static;
  }

  .details-table {
    grid-template-columns: 1fr;
  }

  .detail-row .label {
    text-align: left;
    font-weight: 700;
    margin-top: 1rem;
  }
}

/* ===== fra objekt-views/tab-video.php ===== */

/* ============================= */
/* Video – full bredde i kolonne */
/* ============================= */

#video .video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    margin: 0;
}

#video .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;

    width: 100% !important;
    height: 100% !important;

    border: 0;
    display: block;
}

/* ===== fra objekt-views/tab-dokumenter.php ===== */

/* ===========================
   Dokumenter – pen liste
   =========================== */

#docs .to-panel-inner { padding-top: 6px; }

.to-docs-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.to-doc{
    display:flex;
    gap:14px;
    align-items:center;
    padding:14px;
    border:1px solid #e6ecea;
    border-radius:14px;
    background:#fff;
}

.to-doc-icon{
    width:52px;
    height:52px;
    border-radius:14px;
    background:#f2f6f5;
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    border:1px solid #e6ecea;
}

.to-doc-badge{
    font-weight:800;
    font-size:12px;
    letter-spacing:.4px;
    color:#2f5f63;
}

.to-doc-meta{
    min-width:0;
    flex:1 1 auto;
}

.to-doc-title{
    font-weight:800;
    font-size:16px;
    line-height:1.2;
    color:#1f2a2a;
    margin-bottom:4px;
    word-break:break-word;
}

.to-doc-sub{
    font-size:13px;
    opacity:.75;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}

.to-doc-file{
    opacity:.9;
}

.to-doc-actions{
    display:flex;
    gap:10px;
    flex:0 0 auto;
}

.to-doc-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:8px 12px;
    border-radius:10px;
    border:1px solid #cfe0da;
    background:#fff;
    color:#2f5f63;
    text-decoration:none;
    font-weight:800;
    font-size:14px;
}

.to-doc-btn:hover{
    background:#f2f6f5;
}

.to-doc-btn-primary{
    background:#2f5f63;
    border-color:#2f5f63;
    color:#fff;
}

.to-doc-btn-primary:hover{
    filter:brightness(.95);
}

@media (max-width: 700px){
    .to-doc{
        flex-direction:column;
        align-items:flex-start;
    }
    .to-doc-actions{
        width:100%;
    }
    .to-doc-btn{
        width:100%;
    }
}

/* ===== ny: objekt-views/tab-beliggenhet.php ===== */

.to-loc-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 700px) {
  .to-loc-layout {
    grid-template-columns: 1fr;
  }
}

.to-loc-map {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  background: #eee;
}

.to-loc-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.to-loc-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.to-loc-row:last-of-type {
  border-bottom: none;
}

.to-loc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #888;
}

.to-loc-value {
  font-size: 15px;
  color: #222;
}

.to-loc-route {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 16px;
  background: #2f5f63;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  width: fit-content;
}

.to-loc-route:hover {
  background: #245055;
}

/* ===== ny: objekt-views/tab-kontakt.php ===== */

.to-contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 700px) {
  .to-contact-layout {
    grid-template-columns: 1fr;
  }
}

.to-contact-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.to-contact-form-wrap h4 {
  margin: 0 0 14px;
  font-size: 16px;
}

.to-contact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.to-contact-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #888;
}

.to-contact-field input,
.to-contact-field textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #222;
  background: #fff;
}

.to-contact-field input:focus,
.to-contact-field textarea:focus {
  outline: none;
  border-color: #2f5f63;
}

.to-contact-field textarea {
  resize: vertical;
}

.to-contact-form-wrap button.to-loc-route {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.to-contact-form-wrap button.to-loc-route:disabled {
  opacity: .6;
  cursor: default;
}

.to-kf-msg {
  margin-top: 10px;
  font-size: 14px;
}

.to-kf-msg.to-kf-ok {
  color: #1e7a34;
}

.to-kf-msg.to-kf-err {
  color: #b3261e;
}

/* Honeypot — skjult for ekte besøkende, men fortsatt til stede i DOM-en
   (ikke display:none) slik at enkle bots som ikke leser CSS fyller det ut. */
.to-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
