/*
Theme Name: AIToolsNews Norsk Pro
Theme URI: https://aitoolsnews.site
Author: AIToolsNews Redaksjon
Author URI: https://aitoolsnews.site/om-oss
Description: Et lynraskt, lettvektig og profesjonelt redaksjonelt magasin-tema på 100% norsk bokmål for aitoolsnews.site. Spesialutviklet for Google AdSense-godkjenning, Core Web Vitals 95+ poeng, høy E-E-A-T troverdighet og full GDPR-overholdelse.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aitoolsnews-norsk-pro
Tags: news, blog, grid-layout, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   1. DESIGNVARIABLER (NORDISK REDAKSJONELL FARGEPALETT)
   ========================================================================== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Farger - Lys, ren og tillitsvekkende nordisk tech-stil */
  --color-primary: #1d4ed8;         /* Kongeblå */
  --color-primary-hover: #1e40af;
  --color-primary-light: #dbeafe;   /* Myk blå bakgrunn for piller */
  --color-primary-border: #93c5fd;

  --color-accent: #059669;          /* Smaragdgrønn for verifiserte merker */
  --color-accent-light: #ecfdf5;
  --color-accent-border: #a7f3d0;

  --color-bg: #f8fafc;              /* Slate 50 - myk lys bakgrunn */
  --color-surface: #ffffff;         /* Hvit kortbakgrunn */
  --color-surface-subtle: #f1f5f9;  /* Slate 100 */
  --color-border: #e2e8f0;          /* Slate 200 */
  --color-border-subtle: #f8fafc;

  --color-heading: #0f172a;         /* Slate 900 - dyp kontrast */
  --color-text: #1e293b;            /* Slate 800 - optimal lesekontrast */
  --color-text-muted: #64748b;      /* Slate 500 */
  --color-text-light: #94a3b8;      /* Slate 400 */

  /* Skygger */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --max-width: 1240px;
  --header-height: 72px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. GRUNNLEGGENDE OPPSETT & RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  color: var(--color-primary-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

p {
  margin-bottom: 1.5rem;
}

.site-container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Tilgjengelighet - Hopp til innhold */
.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 99999;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   3. LESEFREMGANGSMÅLER (READING PROGRESS BAR)
   ========================================================================== */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  z-index: 999999;
  transition: width 0.1s linear;
}

/* ==========================================================================
   4. WORDPRESS ADMIN BAR OFFSET FIX (OBLIGATORISK)
   ========================================================================== */
body.admin-bar .site-header {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* ==========================================================================
   5. TOPP-NAVIGASJON (STICKY HEADER)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 1.5rem;
}

.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--color-heading);
  font-weight: 900;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.main-site-logo {
  height: 40px;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.site-logo-link:hover .main-site-logo {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .main-site-logo {
    height: 34px;
    max-width: 190px;
  }
}

.brand-dot {
  color: var(--color-primary);
}

.brand-badge {
  background: linear-gradient(135deg, var(--color-primary), #4f46e5);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.primary-navigation {
  display: none;
}

@media (min-width: 960px) {
  .primary-navigation {
    display: flex;
    align-items: center;
  }
}

.primary-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.75rem;
}

.primary-menu li a {
  color: var(--color-heading);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

.primary-menu li a:hover,
.primary-menu li.current-menu-item a {
  color: var(--color-primary);
}

.primary-menu li.current-menu-item a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2.5px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

/* ==========================================================================
   HANDLINGSKNAPPER (SØK & MOBILMENY)
   ========================================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.action-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--color-border);
  color: var(--color-primary);
  border-color: var(--color-primary-border);
}

.action-btn:active {
  transform: scale(0.95);
  background: #e2e8f0;
}

@media (min-width: 960px) {
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* ==========================================================================
   UTVIDBART SØKEFELT MODAL (TOPP)
   ========================================================================== */
.header-search-bar {
  display: none;
  background-color: #ffffff;
  border-bottom: 2px solid var(--color-primary);
  padding: 1rem 0;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.2s ease-out;
}

.header-search-bar.active {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-form-wrapper {
  display: flex;
  max-width: 700px;
  margin: 0 auto;
  gap: 0.5rem;
  align-items: center;
}

.search-form-wrapper input[type="search"] {
  flex: 1;
  padding: 0.8rem 1.15rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-heading);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.search-form-wrapper input[type="search"]:focus {
  border-color: var(--color-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.search-submit-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
}

.search-submit-btn:hover {
  background: var(--color-primary-hover);
}

.search-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-close-btn:hover {
  color: #e02424;
}

/* ==========================================================================
   MOBILMENY FULLSKJERM SLIDE-OVER SKUFF (iOS & ANDROID TESTET)
   ========================================================================== */
body.mobile-menu-open {
  overflow: hidden !important;
  touch-action: none;
}

.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(86vw, 380px);
  height: 100vh;
  height: 100dvh;
  background-color: #ffffff;
  z-index: 99999;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(1.25rem, env(safe-area-inset-top, 1.25rem)) 1.35rem max(1.5rem, env(safe-area-inset-bottom, 1.5rem)) 1.35rem;
}

.mobile-drawer.active {
  right: 0;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}

.mobile-drawer-logo {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--color-heading);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.mobile-drawer-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-drawer-close:active {
  background: #fee2e2;
  color: #dc2626;
}

.mobile-drawer-search {
  margin-bottom: 1.5rem;
}

.mobile-drawer-search form {
  display: flex;
  align-items: center;
  background: var(--color-surface-subtle);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
}

.mobile-drawer-search input[type="search"] {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--color-heading);
  outline: none;
  padding: 0.4rem 0;
}

.mobile-drawer-search button {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.mobile-drawer-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mobile-menu-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-text-light);
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 2rem;
}

.mobile-nav-list a {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  text-decoration: none;
  transition: var(--transition);
}

.mobile-nav-list a:active,
.mobile-nav-list a:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary-border);
}

.nav-arrow {
  color: var(--color-text-light);
  font-size: 1.1rem;
}

.mobile-drawer-footer-section {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.mobile-legal-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mobile-legal-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
}

.mobile-legal-links a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   6. REDAKSJONELT TO-KOLONNERS ARTIKKEL-LAYOUT
   ========================================================================== */
.site-main {
  flex: 1;
  padding: 2.5rem 0 4.5rem;
}

.editorial-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.75rem;
}

@media (min-width: 1024px) {
  .editorial-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

.article-main-column {
  min-width: 0;
}

/* Hovedartikkel Kort (Hvit Canvas) */
.article-canvas {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  padding: 2rem 1.5rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .article-canvas {
    padding: 3rem 2.75rem;
  }
}

/* Brødsmulesti */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs .separator {
  color: var(--color-text-light);
}

/* Kategori-Pille (Royal Blue) */
.category-badge,
.category-pill {
  display: inline-block;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
  border: 1px solid var(--color-primary-border);
  transition: var(--transition);
}

.category-badge:hover,
.category-pill:hover {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* Artikkel Tittel (Stor og autoritær H1) */
.article-title {
  font-size: clamp(1.85rem, 3.5vw, 2.65rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-heading);
  letter-spacing: -0.03em;
  margin: 1rem 0 1.25rem;
}

/* Redaksjonell Forfatter- & Meta-linje */
.article-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.15rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.author-avatar {
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

.author-info-box {
  display: flex;
  flex-direction: column;
}

.author-name-title {
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.2;
}

.author-verified-tag {
  font-size: 0.76rem;
  color: var(--color-accent);
  font-weight: 600;
}

/* Enkelt Hovedbilde (Zero Duplicate Images regel) */
.single-hero-image-wrapper {
  margin-bottom: 2.25rem;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.12);
}

.single-hero-image {
  border-radius: 16px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  display: block;
}

/* ZERO DUPLICATE FIRST IMAGE FAIL-SAFE:
   Hvis hovedbildet vises ovenfor, skjul automatisk eventuelt første bildeblokk i innholdet */
.single-hero-image-wrapper + .entry-content > figure:first-child,
.single-hero-image-wrapper + .entry-content > .wp-block-image:first-child,
.single-hero-image-wrapper + .entry-content > div:first-child:has(img),
.single-hero-image-wrapper + .entry-content > p:first-child:has(img),
.single-hero-image-wrapper + .entry-content > p:first-child > img,
.single-hero-image-wrapper + .entry-content > p:first-child > a > img {
  display: none !important;
}

/* ==========================================================================
   7. LUKSURIØS INNHOLDSSTIL (.entry-content)
   ========================================================================== */
.entry-content,
.article-content {
  font-size: 1.125rem;
  line-height: 1.85;
  color: #1e293b;
  max-width: 760px;
}

/* Ingress / Første avsnitt (Drop Cap / Lead Paragraph) */
.entry-content > p:first-of-type,
.article-content > p:first-of-type {
  font-size: 1.22rem;
  line-height: 1.8;
  color: var(--color-heading);
  font-weight: 500;
  margin-bottom: 1.75rem;
}

/* Underoverskrift H2 med venstre aksentlinje og myk gradient */
.entry-content h2,
.article-content h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: #0f172a;
  border-left: 4px solid #2563eb;
  padding-left: 14px;
  padding-top: 8px;
  padding-bottom: 8px;
  background: linear-gradient(90deg, #f1f5f9 0%, transparent 100%);
  border-radius: 0 8px 8px 0;
  margin-top: 2.2em;
  margin-bottom: 1em;
  line-height: 1.35;
}

/* Underoverskrift H3 */
.entry-content h3,
.article-content h3 {
  font-size: clamp(1.22rem, 2vw, 1.45rem);
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.entry-content h4,
.article-content h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}

/* Avsnitt */
.entry-content p,
.article-content p {
  margin-bottom: 1.5em;
}

/* Egendefinerte punktlister */
.entry-content ul,
.article-content ul {
  list-style: none;
  margin: 1.5rem 0 1.75rem 0;
  padding-left: 0;
}

.entry-content ul li,
.article-content ul li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.entry-content ul li::before,
.article-content ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-primary);
  font-weight: 800;
  font-size: 1rem;
}

.entry-content ol,
.article-content ol {
  margin: 1.5rem 0 1.75rem 1.5rem;
}

.entry-content ol li,
.article-content ol li {
  margin-bottom: 0.6rem;
  line-height: 1.7;
}

/* Interaktiv Innholdsfortegnelse (.abp-toc-box) */
.abp-toc-box,
.ez-toc-container,
.lwptoc,
.table-of-contents,
div[class*="toc"] {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-left: 4px solid var(--color-primary) !important;
  border-radius: 14px !important;
  padding: 1.65rem 1.85rem !important;
  margin: 2.25rem 0 2.5rem !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04) !important;
  max-width: 100% !important;
}

.toc-header,
.ez-toc-title-container,
.lwptoc_header {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: var(--color-heading) !important;
  margin-bottom: 1rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.abp-toc-box a,
.ez-toc-container a,
.lwptoc a,
div[class*="toc"] a {
  color: var(--color-primary) !important;
  font-weight: 600 !important;
  font-size: 0.98rem !important;
  text-decoration: none !important;
  line-height: 1.6 !important;
}

.abp-toc-box a:hover,
.ez-toc-container a:hover,
div[class*="toc"] a:hover {
  text-decoration: underline !important;
}

/* Premium Datatabeller (AdSense-kompatible) */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  margin: 2.25rem 0;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.entry-content table,
.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  text-align: left;
}

.entry-content th,
.article-content th {
  background-color: #0f172a !important;
  color: #ffffff !important;
  padding: 1rem 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.entry-content td,
.article-content td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  color: #334155;
}

.entry-content tr:nth-child(even) td,
.article-content tr:nth-child(even) td {
  background-color: #f8fafc;
}

.entry-content tr:hover td,
.article-content tr:hover td {
  background-color: #eff6ff !important;
}

.entry-content tr:last-child td,
.article-content tr:last-child td {
  border-bottom: none;
}

/* Pro-Tip og Callout-Bokser (.pro-tip-box & blockquote) */
.pro-tip-box {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border-left: 5px solid #2563eb;
  border-radius: 14px;
  padding: 22px;
  margin: 2.25rem 0;
  box-shadow: var(--shadow-sm);
  color: #0f172a;
}

.pro-tip-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #1e3a8a;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 1.25rem 1.75rem;
  margin: 2.25rem 0;
  background-color: #f8fafc;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--color-heading);
  font-size: 1.15rem;
  line-height: 1.75;
}

/* FAQ Kort med ? Merke */
.faq-item-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.faq-question-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.faq-question-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  flex-shrink: 0;
}

/* ==========================================================================
   8. DELINGSKNAPPER (DEL PÅ SOSIALE MEDIER)
   ========================================================================== */
.share-bar {
  margin: 2.5rem 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.share-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.share-btn.twitter { background: #0f1419; }
.share-btn.facebook { background: #1877f2; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.copy-link {
  background: var(--color-surface-subtle);
  color: var(--color-heading);
  border: 1px solid var(--color-border);
}

/* ==========================================================================
   9. E-E-A-T FORFATTERBOKS (REDAKSJONEN I AITOOLSNEWS)
   ========================================================================== */
.eeat-author-box {
  background: linear-gradient(to right, #f8fafc, #f1f5f9);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 3.5rem 0 2.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .eeat-author-box {
    flex-direction: row;
    align-items: center;
  }
}

.eeat-avatar-wrapper {
  flex-shrink: 0;
  position: relative;
}

.eeat-avatar {
  border-radius: var(--radius-full);
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
}

.eeat-verified-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--color-accent);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.eeat-content {
  flex: 1;
}

.eeat-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.eeat-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-heading);
}

.eeat-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--color-accent-light);
  color: var(--color-accent);
  border: 1px solid var(--color-accent-border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.eeat-bio {
  font-size: 0.94rem;
  color: var(--color-text);
  line-height: 1.6;
}

/* ==========================================================================
   10. RELATERTE ARTIKLER (3 KOLONNER)
   ========================================================================== */
.related-posts-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}

.section-heading {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-heading);
}

.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

/* ==========================================================================
   11. FORSIDE & KATEGORIKORT (MAGASIN GRID)
   ========================================================================== */
/* Hero Utvalgt Artikkel */
.hero-featured-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  margin-bottom: 3.25rem;
  display: grid;
  grid-template-columns: 1fr;
  transition: var(--transition);
}

@media (min-width: 900px) {
  .hero-featured-card {
    grid-template-columns: 1.3fr 1fr;
    min-height: 420px;
  }
}

.hero-featured-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-border);
}

.hero-thumbnail-wrapper {
  position: relative;
  overflow: hidden;
  background-color: var(--color-surface-subtle);
}

.hero-thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hero-featured-card:hover .hero-thumbnail-wrapper img {
  transform: scale(1.03);
}

.hero-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 900;
  line-height: 1.25;
  margin: 0.75rem 0 1rem;
  color: var(--color-heading);
}

.hero-title a {
  color: inherit;
}

.hero-title a:hover {
  color: var(--color-primary);
}

.hero-excerpt {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* 3-Kolonners Magasin Rutenett */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-border);
}

.post-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: var(--color-surface-subtle);
  overflow: hidden;
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.04);
}

.post-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.65rem;
}

.post-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--color-heading);
}

.post-card-title a {
  color: inherit;
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-card-excerpt {
  color: var(--color-text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.post-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border-subtle);
}

.read-more-btn {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.read-more-btn:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* ==========================================================================
   12. STICKY SIDEBAR
   ========================================================================== */
.editorial-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .editorial-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    height: fit-content;
  }
}

.sidebar-widget {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--color-primary-light);
  color: var(--color-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Siste artikler widget */
.sidebar-posts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-post-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sidebar-post-thumb {
  width: 68px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--color-surface-subtle);
}

.sidebar-post-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-heading);
}

.sidebar-post-title:hover {
  color: var(--color-primary);
}

/* Kategorier med antall */
.sidebar-cats-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sidebar-cat-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-cat-item a:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.cat-count-badge {
  font-size: 0.75rem;
  background-color: var(--color-surface-subtle);
  color: var(--color-text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   13. FOOTER & NORSK GDPR INFORMASJONSKAPSEL-BANNER
   ========================================================================== */
.site-footer {
  background-color: #0b0f19;
  color: #f1f5f9;
  border-top: 1px solid #1e293b;
  margin-top: auto;
  padding-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer-col h4 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

.footer-about-text {
  color: #94a3b8;
  font-size: 0.94rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-bottom-bar {
  border-top: 1px solid #1e293b;
  padding: 1.75rem 0;
  font-size: 0.88rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom-bar {
    flex-direction: row;
    text-align: left;
  }
}

/* Norsk GDPR Informasjonskapsel-banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.12);
  padding: 1.25rem 0;
  z-index: 99999;
  display: none;
}

.cookie-banner.visible {
  display: block;
}

.cookie-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .cookie-inner {
    flex-direction: row;
  }
}

.cookie-text {
  font-size: 0.9rem;
  color: #0f172a;
  line-height: 1.55;
  flex: 1;
}

.cookie-text a {
  text-decoration: underline;
  font-weight: 700;
  color: var(--color-primary);
}

.cookie-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-cookie-accept {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-cookie-reject {
  background: var(--color-surface-subtle);
  color: var(--color-heading);
  border: 1px solid var(--color-border);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   14. KNAPPER & SIDENAVIGASJON
   ========================================================================== */
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.85rem 1.65rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

.pagination-wrapper {
  margin-top: 3.5rem;
  display: flex;
  justify-content: center;
}

.pagination-wrapper .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-heading);
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0.25rem;
  transition: var(--transition);
}

.pagination-wrapper .page-numbers.current,
.pagination-wrapper .page-numbers:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* AdSense plassholdere uten CLS */
.adsense-slot-wrapper {
  margin: 2rem auto;
  text-align: center;
  max-width: 100%;
  clear: both;
}

.adsense-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--color-text-light);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  display: block;
}

.adsense-slot-header {
  min-height: 90px;
  max-width: 728px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.25rem auto;
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle);
  border: 1px dashed var(--color-border);
  overflow: hidden;
}

.adsense-slot-inarticle {
  min-height: 250px;
  max-width: 650px;
  margin: 2rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-subtle);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}

.adsense-slot-sidebar {
  min-height: 280px;
  max-width: 300px;
  margin: 0.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-subtle);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   15. KOMPLETT MOBIL-OPTIMALISERING (PREMIUM NORDISK TECH-MAGASIN MOBIL UX)
   Spesifikt tilpasset for iPhone, iPad og Android (Retina Display & Safe-Areas)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  /* Header på mobil */
  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .header-inner {
    height: 64px;
    gap: 0.75rem;
  }

  .site-logo-link {
    font-size: 1.25rem;
  }

  .brand-badge {
    font-size: 0.62rem;
    padding: 0.15rem 0.45rem;
  }

  .action-btn {
    width: 42px;
    height: 42px;
  }

  /* Beholder på mobil */
  .site-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-main {
    padding: 1.25rem 0 3.5rem;
  }

  .editorial-layout {
    gap: 2rem;
  }

  /* Artikkel lerret på mobil */
  .article-canvas {
    padding: 1.35rem 1rem !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
  }

  .article-title {
    font-size: clamp(1.5rem, 5.5vw, 1.85rem) !important;
    line-height: 1.3 !important;
    margin: 0.6rem 0 1rem !important;
    letter-spacing: -0.025em !important;
  }

  .article-meta-bar {
    gap: 0.65rem !important;
    padding-bottom: 1rem !important;
    margin-bottom: 1.35rem !important;
    font-size: 0.84rem !important;
  }

  .single-hero-image-wrapper {
    border-radius: 12px !important;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
  }

  .single-hero-image {
    border-radius: 12px !important;
  }

  /* Artikkel tekst & typografi */
  .entry-content,
  .article-content {
    font-size: 1.05rem !important;
    line-height: 1.75 !important;
  }

  .entry-content > p:first-of-type,
  .article-content > p:first-of-type {
    font-size: 1.12rem !important;
    line-height: 1.75 !important;
  }

  .entry-content h2,
  .article-content h2 {
    font-size: 1.45rem !important;
    margin-top: 1.8em !important;
    margin-bottom: 0.8em !important;
    padding-left: 10px !important;
  }

  .entry-content h3,
  .article-content h3 {
    font-size: 1.25rem !important;
    margin-top: 1.5em !important;
  }

  /* Innholdsfortegnelse på mobil */
  .abp-toc-box,
  .ez-toc-container,
  div[class*="toc"] {
    padding: 1.25rem 1rem !important;
    margin: 1.75rem 0 2rem !important;
    border-radius: 12px !important;
  }

  /* Datatabeller på mobil */
  .table-responsive-container {
    margin: 1.75rem 0 !important;
    border-radius: 10px !important;
  }

  .entry-content th,
  .article-content th,
  .entry-content td,
  .article-content td {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.88rem !important;
  }

  /* Delingsknapper på mobil */
  .share-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin: 2rem 0;
  }

  .share-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    width: 100%;
  }

  .share-btn {
    justify-content: center;
    padding: 0.65rem 0.35rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
  }

  .share-btn span {
    font-size: 0.76rem;
  }

  /* E-E-A-T Forfatterboks på mobil */
  .eeat-author-box {
    padding: 1.35rem 1rem !important;
    border-radius: 14px !important;
    flex-direction: column !important;
    text-align: center;
    gap: 1rem !important;
    margin: 2.5rem 0 2rem !important;
  }

  .eeat-avatar-wrapper {
    margin: 0 auto;
  }

  .eeat-header {
    justify-content: center;
  }

  .eeat-name {
    font-size: 1.1rem !important;
  }

  .eeat-bio {
    font-size: 0.9rem !important;
  }

  /* Forside hero på mobil */
  .hero-featured-card {
    margin-bottom: 2rem;
    border-radius: 14px;
  }

  .hero-content {
    padding: 1.5rem 1.15rem !important;
  }

  .hero-title {
    font-size: 1.4rem !important;
    line-height: 1.3 !important;
  }

  .hero-excerpt {
    font-size: 0.96rem !important;
    margin-bottom: 1.25rem !important;
  }

  /* 3-kolonners magasin grid på mobil */
  .posts-grid {
    grid-template-columns: 1fr !important;
    gap: 1.35rem !important;
  }

  .post-card {
    border-radius: 12px;
  }

  .post-card-body {
    padding: 1.25rem 1rem !important;
  }

  .post-card-title {
    font-size: 1.15rem !important;
  }

  /* Cookie consent på mobil */
  .cookie-banner {
    padding: 1rem 0;
  }

  .cookie-inner {
    gap: 0.85rem;
  }

  .cookie-text {
    font-size: 0.84rem;
  }

  .cookie-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .btn-cookie-accept,
  .btn-cookie-reject {
    width: 100%;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.84rem;
  }

  /* Footer på mobil */
  .site-footer {
    padding-top: 2.75rem;
  }

  .footer-grid {
    gap: 2rem;
    padding-bottom: 2.5rem;
  }
}
