/* ==========================================================================
   LA7TN - Tore Sandring | Felles stilark (style.css)
   Moderne, responsivt design for amatørradio-nettsted
   ========================================================================== */

:root {
  --primary: #162447;
  --primary-light: #1f4068;
  --accent: #C54C00;
  --accent-hover: #e65a00;
  --accent-gold: #ffd166;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-alt: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Grunnleggende reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-page);
  padding: 20px 10px;
  min-height: 100vh;
}

a {
  color: var(--primary-light);
  text-decoration: underline;
  transition: color 0.2s ease;
}

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

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

/* Hovedramme */
.page-container {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

/* Sidekolonne med meny */
.sidebar {
  position: sticky;
  top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  box-shadow: var(--shadow-md);
}

.sidebar-brand {
  text-align: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.sidebar-callsign {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
}

.sidebar-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Navigasjonsmeny */
.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-menu li {
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #ffffff !important;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease-in-out;
}

.nav-menu li a:hover {
  background: var(--accent);
  border-left-color: var(--accent-gold);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  color: #ffffff !important;
}

.nav-menu li.active a {
  background: var(--accent);
  border-left-color: var(--accent-gold);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(197, 76, 0, 0.35);
  color: #ffffff !important;
}

.nav-menu .menu-icon {
  font-size: 16px;
  line-height: 1;
}

/* Hovedinnhold */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header-kort */
.header-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.site-title {
  font-size: 40px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 2px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.site-subtitle {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.site-qth {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* Hero-bilde */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-card a {
  display: block;
}

.hero-card img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

.hero-caption {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: #ffffff;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* Standard innholdskort (Card) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  color: var(--accent);
}

/* To-kolonne oppsett for innhold og utstyr */
.content-grid-shack {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

/* Infobokser / avsnitt */
.info-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.highlight-box {
  background: #fff8f0;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
}

.badge-orange {
  background: var(--accent);
}

/* Utstyrsliste / Rigg-kort i høyrekolonne */
.rig-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rig-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rig-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.rig-item img {
  margin: 0 auto 8px auto;
  border-radius: 4px;
  max-height: 140px;
  object-fit: contain;
}

.rig-brand {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 1px;
}

.rig-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

/* QRZ Loggbok */
.logbook-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.logbook-iframe-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
}

.logbook-iframe-container iframe {
  width: 100%;
  min-width: 640px;
  height: 520px;
  border: none;
  display: block;
}

/* Rutenett for radiogalleri (brukes på radios.html) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.gallery-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #e2e8f0;
}

.gallery-card-body {
  padding: 16px;
  flex-grow: 1;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px 0 10px 0;
  font-size: 13px;
  color: var(--text-muted);
}

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

/* Responsive regler for nettbrett og mobil */
@media (max-width: 860px) {
  .page-container {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
    top: 0;
  }
  
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-menu li a {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .content-grid-shack {
    grid-template-columns: 1fr;
  }
  
  .rig-column {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .site-title {
    font-size: 32px;
  }
}

/* ==========================================================================
   Bilde-modal (Lightbox)
   ========================================================================== */

/* Zoom-peker på forstørrbare bilder og bildelenker */
a.lightbox-trigger,
.hero-card a,
.gallery-card a,
.rig-item a {
  cursor: zoom-in;
  display: block;
}

/* Modal-bakgrunn / overlay */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease-in-out;
  padding: 20px;
}

.image-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Modal-innhold */
.image-modal-content {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92);
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.image-modal.is-active .image-modal-content {
  transform: scale(1);
}

.image-modal-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  background: #111827;
}

/* Bildetekst under bildet i modalen */
.image-modal-caption {
  margin-top: 12px;
  color: #f8fafc;
  font-size: 14.5px;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  max-width: 800px;
  line-height: 1.4;
}

/* Lukkeknapp (X) */
.image-modal-close {
  position: absolute;
  top: -42px;
  right: 0;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

@media (max-width: 600px) {
  .image-modal-close {
    top: -38px;
    right: 0;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .image-modal-img {
    max-height: 72vh;
  }
}
