/*
 Theme Name:   Pen Child
 Theme URI:    https://logeheia.com
 Description:  Child theme for Pen – mobiltilpasning, post-headere og kompakt innhold
 Author:       Atle
 Template:     pen
 Version:      3.14
*/

/* =========================================================
   Generelle justeringer
   ========================================================= */
img {
  max-width: 100%;
  height: auto;
}

:root {
  --content-gutter: 1.5rem;
}

/* Mobiltilpasning av global header */
@media (max-width: 768px) {
  #pen_header {
    background-image: none !important;
  }
  #pen_header .pen_header_wrap { display: none !important; }
  #pen_header .pen_header_main .pen_container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  #pen_header .site-branding,
  #pen_header img.custom-logo {
    margin: 0 auto !important;
    display: block !important;
    max-height: 60px;
  }
  #pen_header .site-title {
    margin: 5px 0 0 0 !important;
    text-align: center !important;
    font-size: 1.2rem;
    line-height: 1.2;
  }
  #pen_header .menu-toggle { margin-top: 8px; }
}

/* Komprimer vertikal luft i post-innhold */
#main .pen_article .pen_content {
  padding: 0.25rem var(--content-gutter) !important;
}
.pen_content_title_description,
.entry-subtitle,
.entry-meta {
  margin: 0.15em 0 !important;
}
.entry-content,
.page-content,
.entry-summary {
  margin: 0.25em 0 !important;
}

/* Fjern gradient/fremhevet bilde i post-header */
#main .pen_article .pen_content_header {
  background: none !important;
  padding-bottom: 0.25rem !important;
}
#main .pen_article .pen_content_header::before,
#main .pen_article .pen_content_header::after {
  background: none !important;
  content: none !important;
}
#main .pen_article .pen_content_header .pen_content_image,
#main .pen_article .pen_content_header .thumbnail {
  display: none !important;
}

/* Mobiltilpasning av post-headere */
@media (max-width: 600px) {
  #main .pen_article .pen_content_header,
  #main .pen_article .entry-header {
    padding: 0 var(--content-gutter) !important;
    margin: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #main .pen_article .pen_content_header .entry-title,
  #main .pen_article .entry-header .entry-title,
  #main .pen_article .pen_content_header .pen_content_title_description,
  #main .pen_article .pen_content_header .entry-subtitle,
  #main .pen_article .pen_content_header .entry-meta {
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
    hyphens: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #main .pen_article .pen_content_header .entry-meta {
    font-size: 0.85rem !important;
  }
}

/* Sikre at alt innhold holder seg innenfor rammen på mobil */
@media (max-width: 600px) {
  #main .pen_article,
  #main .pen_article * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  pre, code {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-x: auto !important;
    max-width: 100% !important;
  }
}

/* =========================================================
   TablePress – standard tabeller (vanlig striping)
   ========================================================= */
.tablepress th {
  background-color: #6699cc;
  color: #fff;
  font-weight: bold;
}
.tablepress td {
  font-family: "Trebuchet MS", Helvetica, sans-serif;
  font-size: 12px;
}
.tablepress tbody tr:nth-child(odd) td {
  background-color: #d9d9d9;
}
.tablepress tbody tr:nth-child(even) td {
  background-color: #ffffff;
}
.tablepress td,
.tablepress th {
  border-right: 1px solid #ccc;
}
.tablepress td:last-child,
.tablepress th:last-child {
  border-right: none;
}

/* =========================================================
   TablePress – Rotasjonsliste (spesialbehandling)
   ========================================================= */
.tablepress.rotasjonsliste {
  font-size: 13px;
  line-height: 1.4;
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed; /* holder kolonner synkronisert */
}

/* Alle celler */
.tablepress.rotasjonsliste th,
.tablepress.rotasjonsliste td {
  border: 1px solid #ccc;
  padding: 4px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

/* Første kolonne (Adresse) */
.tablepress.rotasjonsliste th:first-child,
.tablepress.rotasjonsliste td:first-child {
  width: 140px;
  min-width: 140px;
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  padding-left: 12px;
}

/* Sum år med styreverv */
.tablepress.rotasjonsliste th:nth-last-child(2),
.tablepress.rotasjonsliste td:nth-last-child(2) {
  width: 80px;
  text-align: left;
}

/* Kommentar */
.tablepress.rotasjonsliste th:last-child,
.tablepress.rotasjonsliste td:last-child {
  width: 200px;
  text-align: left;
}

/* Årskolonner */
.tablepress.rotasjonsliste th:not(:first-child):not(:nth-last-child(2)):not(:last-child),
.tablepress.rotasjonsliste td:not(:first-child):not(:nth-last-child(2)):not(:last-child) {
  width: 40px;
  text-align: center;
}

/* Scroll wrapper */
.dataTables_wrapper {
  max-width: 100%;
  overflow-x: auto;   /* én felles scroll */
  position: relative;
}
.dataTables_scrollHead,
.dataTables_scrollBody {
  overflow-x: auto;
  overflow-y: hidden;
}
/* =========================================================
   DataTables – heading og striping
   ========================================================= */

/* Heading-style: mørk bakgrunn + hvit tekst */
table.dataTable thead th {
  background-color: #6699cc;   /* samme som TablePress */
  color: #fff;
  font-weight: bold;
  text-align: center;
}

/* Pysjamas-striper (alternating row colors) */
table.dataTable tbody tr:nth-child(odd) {
  background-color: #d9d9d9; /* lys grå */
}
table.dataTable tbody tr:nth-child(even) {
  background-color: #ffffff; /* hvit */
}

/* Hover-effekt for bedre lesbarhet */
table.dataTable tbody tr:hover {
  background-color: #e6f2ff; /* lys blå */
}

/* Sikre border rundt celler */
table.dataTable td,
table.dataTable th {
  border-right: 1px solid #ccc;
}
table.dataTable td:last-child,
table.dataTable th:last-child {
  border-right: none;
}

