/* ===================================================
   Traktorbransjen Tabell – Public Styles
   =================================================== */

/* ===== CSS variables (defaults; overridden via inline style on .ktb-wrap) ===== */
.ktb-wrap {
	--ktb-accent:     #4a9e4a;
	--ktb-featured:   #4a9e4a;
	--ktb-text:       #888888;
	--ktb-bg-color:   transparent;
	--ktb-bg-padding: 0px;

	box-sizing:       border-box;
	font-family:      inherit;
	line-height:      1.5;
	background-color: var(--ktb-bg-color);
	padding:          var(--ktb-bg-padding);
}
.ktb-wrap *,
.ktb-wrap *::before,
.ktb-wrap *::after { box-sizing: border-box; }

/* Area visibility */
.ktb-area { transition: opacity .2s; }
.ktb-area.ktb-hidden { display: none; }

/* =====================================================
   Horizontal-scroll table wrapper (all themes / sizes)
   ===================================================== */
.ktb-table-outer {
	overflow-x:                 auto;
	-webkit-overflow-scrolling: touch;
	border-radius:              4px;
	/* subtle scroll hint on touch */
	scrollbar-width:            thin;
}
.ktb-table-outer::-webkit-scrollbar       { height: 4px; }
.ktb-table-outer::-webkit-scrollbar-track { background: #e0e0e0; }
.ktb-table-outer::-webkit-scrollbar-thumb { background: var(--ktb-accent); border-radius: 2px; }

/* Tables never collapse — they scroll instead */
.ktb-table {
	min-width:       580px;  /* forces horizontal scroll below this width */
	width:           100%;
	border-collapse: collapse;
	table-layout:    fixed;
}

/* Column widths */
.ktb-col-name    { width: 24%; }
.ktb-col-address { width: 28%; }
.ktb-col-phone   { width: 20%; }
.ktb-col-email   { width: 28%; }

/* ===================================================
   DARK THEME — light table cards on any background
   =================================================== */

/* Navigation */
.ktb-theme-dark .ktb-nav { margin-bottom: 40px; }
.ktb-theme-dark .ktb-nav-label {
	font-size:   24px;
	font-weight: 700;
	color:       var(--ktb-title-color, inherit);
	margin:      0 0 14px;
	line-height: 1.3;
}
.ktb-theme-dark .ktb-select {
	width:      100%;
	padding:    10px 14px;
	background: rgba(255,255,255,.15);
	border:     1px solid rgba(255,255,255,.25);
	color:      inherit;
	border-radius: 4px;
	font-size:  15px;
	cursor:     pointer;
	appearance: auto;
	-webkit-appearance: auto;
}

/* Area section */
.ktb-theme-dark .ktb-area { margin-bottom: 56px; }

/* Fylke headline — inherits page colour; override with --ktb-title-color */
.ktb-wrap .ktb-area-title,
.ktb-wrap h2.ktb-area-title {
	font-size:      26px    !important;
	font-weight:    700     !important;
	color:          var(--ktb-title-color, inherit) !important;
	margin:         0 0 16px !important;
	padding:        0        !important;
	line-height:    1.2      !important;
	border:         none     !important;
	background:     none     !important;
	text-transform: none     !important;
	letter-spacing: normal   !important;
	text-shadow:    none     !important;
}

/* Table card */
.ktb-theme-dark .ktb-table-outer {
	border: 1px solid #d0d0d0;
}
.ktb-theme-dark .ktb-table {
	background: #f5f5f5;
}

/* Header row */
.ktb-theme-dark .ktb-table thead tr { background: #e8e8e8; border-bottom: 1px solid #d0d0d0; }
.ktb-theme-dark .ktb-table thead th {
	color:       var(--ktb-accent);
	font-size:   13px;
	font-weight: 600;
	padding:     13px 18px;
	text-align:  left;
	white-space: nowrap;
}

/* Zebra rows */
.ktb-theme-dark .ktb-table tbody tr:nth-child(odd)  { background: #f5f5f5; }
.ktb-theme-dark .ktb-table tbody tr:nth-child(even) { background: #eaeaea; }
.ktb-theme-dark .ktb-table tbody tr {
	border-bottom: 1px solid #e0e0e0;
	transition:    background .1s;
}
.ktb-theme-dark .ktb-table tbody tr:last-child { border-bottom: none; }
.ktb-theme-dark .ktb-table tbody tr:hover { background: #dff0df !important; }

/* Cells */
.ktb-theme-dark .ktb-table td {
	padding:        13px 18px;
	vertical-align: top;
	font-size:      14px;
	color:          var(--ktb-text);
	word-break:     break-word;
}

/* Featured row — all cells green */
.ktb-theme-dark .ktb-company.ktb-featured td { color: var(--ktb-featured); }

/* Links inherit row colour */
.ktb-theme-dark .ktb-table a { color: inherit; text-decoration: none; }
.ktb-theme-dark .ktb-table a:hover { text-decoration: underline; }

/* ===================================================
   LIGHT THEME
   =================================================== */
.ktb-theme-light .ktb-nav { margin-bottom: 32px; }
.ktb-theme-light .ktb-nav-label { font-size: 20px; font-weight: 700; color: var(--ktb-title-color, #111); margin: 0 0 12px; }
.ktb-theme-light .ktb-select { width: 100%; padding: 10px 14px; background: #fff; border: 1px solid #ccc; color: #333; border-radius: 4px; font-size: 15px; cursor: pointer; }
.ktb-theme-light .ktb-area { margin-bottom: 48px; }
.ktb-theme-light .ktb-table-outer { border: 1px solid #e0e0e0; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.ktb-theme-light .ktb-table { background: #fff; }
.ktb-theme-light .ktb-table thead th { background: #f0f0f0; color: var(--ktb-accent); font-size: 13px; font-weight: 600; padding: 12px 16px; text-align: left; border-bottom: 1px solid #ddd; white-space: nowrap; }
.ktb-theme-light .ktb-table tbody tr:nth-child(odd)  { background: #ffffff; }
.ktb-theme-light .ktb-table tbody tr:nth-child(even) { background: #f7f7f7; }
.ktb-theme-light .ktb-table tbody tr { border-bottom: 1px solid #efefef; transition: background .1s; }
.ktb-theme-light .ktb-table tbody tr:hover { background: #edf7ed !important; }
.ktb-theme-light .ktb-table td { padding: 12px 16px; vertical-align: top; font-size: 14px; color: #666; word-break: break-word; }
.ktb-theme-light .ktb-company.ktb-featured td { color: var(--ktb-featured); }
.ktb-theme-light .ktb-table a { color: var(--ktb-accent); text-decoration: none; }
.ktb-theme-light .ktb-table a:hover { text-decoration: underline; }

/* ===================================================
   MINIMAL THEME
   =================================================== */
.ktb-theme-minimal .ktb-nav-label { font-size: 18px; font-weight: 600; color: var(--ktb-title-color, #222); margin: 0 0 10px; }
.ktb-theme-minimal .ktb-select { width: 100%; padding: 8px 12px; background: #fafafa; border: 1px solid #ddd; color: #444; border-radius: 3px; font-size: 14px; cursor: pointer; }
.ktb-theme-minimal .ktb-area { margin-bottom: 40px; }
.ktb-theme-minimal .ktb-table { background: transparent; }
.ktb-theme-minimal .ktb-table thead th { color: #666; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-bottom: 2px solid var(--ktb-accent); text-align: left; white-space: nowrap; }
.ktb-theme-minimal .ktb-table tbody tr:nth-child(odd)  { background: #fafafa; }
.ktb-theme-minimal .ktb-table tbody tr:nth-child(even) { background: #f2f2f2; }
.ktb-theme-minimal .ktb-table tbody tr { border-bottom: 1px solid #eee; }
.ktb-theme-minimal .ktb-table td { padding: 10px 12px; font-size: 14px; vertical-align: top; color: #555; word-break: break-word; }
.ktb-theme-minimal .ktb-company.ktb-featured td { color: var(--ktb-featured); font-weight: 500; }
.ktb-theme-minimal .ktb-table a { color: var(--ktb-accent); text-decoration: none; }
.ktb-theme-minimal .ktb-table a:hover { text-decoration: underline; }

/* ===================================================
   Mobile — just tighten padding, scroll handles the rest
   =================================================== */
@media (max-width: 600px) {
	.ktb-wrap .ktb-area-title,
	.ktb-wrap h2.ktb-area-title { font-size: 20px !important; }

	.ktb-theme-dark .ktb-nav-label,
	.ktb-theme-light .ktb-nav-label { font-size: 18px; }

	.ktb-theme-dark .ktb-table td,
	.ktb-theme-light .ktb-table td,
	.ktb-theme-minimal .ktb-table td { padding: 10px 12px; font-size: 13px; }

	.ktb-theme-dark .ktb-table thead th,
	.ktb-theme-light .ktb-table thead th,
	.ktb-theme-minimal .ktb-table thead th { padding: 10px 12px; font-size: 12px; }
}

/* Empty state */
.ktb-empty { padding: 32px; text-align: center; opacity: .6; }
