/**
 * Custom Styles - NORTH Platform
 * 
 * Additional styles beyond theme.json
 */

/* Mobile-first utilities */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 1rem;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* Section spacing */
.section {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  .section {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}

/* Card component base */
.card {
  background: var(--wp--preset--color--base);
  border-radius: var(--wp--custom--spacing--radius--lg);
  box-shadow: var(--wp--custom--shadow--md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--wp--custom--shadow--lg);
}

.card-content {
  padding: 1.5rem;
}

/* Button variants */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 2px solid var(--wp--preset--color--primary);
  color: var(--wp--preset--color--primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
}

/* Grid utilities */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

@media (min-width: 768px) {
  .grid-cols-md-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-cols-lg-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: 1rem;
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-balance {
  text-wrap: balance;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Loading state */
.is-loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

/* Print styles */
@media print {
  .no-print,
  header nav,
  footer {
    display: none !important;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :focus-visible {
    outline-width: 3px;
  }
  
  .card {
    border: 2px solid currentColor;
  }
}

/* Ensure sufficient color contrast on links */
a:not([class]) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ===================================================================
   HEADER & NAVIGATION
   =================================================================== */

/* Site Header Base */
.site-header {
  /* No background set here—child themes control via --brand-primary */
  border-bottom: 1px solid var(--wp--preset--color--grey-100);
  position: sticky;
  top: var(--switcher-offset, 0); /* Push header below company switcher to avoid logo cropping */
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: top 0.2s ease;
}

/* Standard Header Layout */
.header-standard .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.75rem 0;
}

@media (max-width: 1023.98px) {
  .header-standard .header-inner {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
  }
  .header-standard .site-branding {
    flex: 0 0 auto;
  }
  .header-standard .main-navigation {
    flex: 1 1 auto;
  }
  .header-standard .primary-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-standard .primary-menu > li {
    flex: 0 0 auto;
  }
  .header-standard .primary-menu > li > a {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Industri Header Layout */
.header-industri {
  /* Multi-row layout handled by child containers */
}

/* Company Switcher label cleanup (remove white border/pill) */
.company-switcher-label,
.header-top .company-switcher .label,
.header-top .company-switcher-label {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

/* Company Switcher bar (frontend) – align gradient with WP Admin toolbar */
.north-company-switcher {
  background: linear-gradient(
    90deg,
    #B97E36 0%,   /* gruppen */
    #0B83C5 20%,  /* industri */
    #2963AF 40%,  /* eiendom */
    #BE5E32 60%,  /* enter */
    #C05BA3 80%,  /* henrys */
    #7E3393 100%  /* marketing */
  );
  color: #FFFFFF;
}

.header-top {
  border-bottom: 1px solid var(--wp--preset--color--grey-100);
}

.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.header-nav {
  background: var(--wp--preset--color--grey-50);
  position: sticky;
  top: 0;
  z-index: 910;
}

.header-nav .container {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.header-search {
  background: var(--wp--preset--color--base);
  border-bottom: 1px solid var(--wp--preset--color--grey-100);
  padding: 1rem 0;
}

/* Logo / Site Branding */
.site-branding {
  flex-shrink: 0;
}

.site-branding img,
.site-branding .custom-logo {
  display: block;
  height: auto;
  width: auto;
  max-height: 60px; /* Mobile */
  object-fit: contain;
}

@media (min-width: 768px) {
  .site-branding img,
  .site-branding .custom-logo {
    max-height: 80px; /* Tablet */
  }
}

@media (min-width: 1024px) {
  .site-branding img,
  .site-branding .custom-logo {
    max-height: 100px; /* Desktop */
  }
}

.site-logo-link {
  display: block;
  text-decoration: none;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wp--preset--color--contrast);
}

/* Primary Navigation */
.main-navigation {
  display: block; /* Visible on mobile since overlay removed */
}

@media (min-width: 1024px) {
  .main-navigation {
    display: block;
    flex: 1;
  }
  .header-standard .main-navigation {
    margin-left: auto;
    margin-right: 1rem;
  }
}

/* Mobile stacked navigation */
@media (max-width: 1023.98px) {
  .primary-menu > li > a {
    padding: 0.5rem 0.6rem; /* Kompakt padding for mobil horisontal */
    font-size: 0.875rem;
  }
  .primary-menu > li > a:hover,
  .primary-menu > li > a:focus-visible {
    background: var(--wp--preset--color--grey-100);
    border-radius: 0.4rem;
  }
  .primary-menu .sub-menu {
    position: absolute; /* Beholder dropdown oppførsel */
  }
}

.primary-menu {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.primary-menu > li {
  position: relative;
}

.primary-menu > li > a {
  display: block;
  color: var(--wp--preset--color--contrast);
  text-decoration: none;
  padding: 0.75rem 1rem;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s ease;
  position: relative;
}

.primary-menu > li > a::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.5rem;
  height: 2px;
  width: 0;
  background: var(--wp--preset--color--primary);
  transition: width 0.3s ease;
}

.primary-menu > li > a:hover,
.primary-menu > li > a:focus-visible {
  /* Default hover: keep contrast; specific brand overrides below */
  color: #FFFFFF;
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}

.primary-menu > li > a:hover::after,
.primary-menu > li > a:focus-visible::after,
.primary-menu > li.current-menu-item > a::after {
  width: calc(100% - 2rem);
}

/* Brand-specific darker hover backgrounds for better contrast */
body.child-north-gruppen .primary-menu > li > a:hover,
body.child-north-gruppen .primary-menu > li > a:focus-visible {
  background-color: #8A5C22; /* Darker orange */
  color: #FFFFFF;
}

body.child-north-industri .primary-menu > li > a:hover,
body.child-north-industri .primary-menu > li > a:focus-visible {
  background-color: #075C89; /* Darker blue */
  color: #FFFFFF;
}

body.child-north-eiendom .primary-menu > li > a:hover,
body.child-north-eiendom .primary-menu > li > a:focus-visible {
  background-color: #1E4E87; /* Darker deep blue */
  color: #FFFFFF;
}

body.child-north-enter .primary-menu > li > a:hover,
body.child-north-enter .primary-menu > li > a:focus-visible {
  background-color: #8F4621; /* Darker enter orange */
  color: #FFFFFF;
}

body.child-henrys .primary-menu > li > a:hover,
body.child-henrys .primary-menu > li > a:focus-visible {
  background-color: #8F4479; /* Darker pink */
  color: #FFFFFF;
}

body.child-north-marketing .primary-menu > li > a:hover,
body.child-north-marketing .primary-menu > li > a:focus-visible {
  background-color: #5A246B; /* Darker purple */
  color: #FFFFFF;
}

/* Header Actions (Account, Cart, CTA) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.account-link,
.cart-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--wp--preset--color--contrast);
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: background 0.2s ease;
  font-size: 0.875rem;
}

.account-link:hover,
.account-link:focus-visible,
.cart-link:hover,
.cart-link:focus-visible {
  background: var(--wp--preset--color--grey-100);
}

.cart-link {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Header CTA Button */
.header-cta {
  display: none;
}

@media (min-width: 1024px) {
  .header-cta {
    display: block;
  }
}

.header-cta .btn {
  white-space: nowrap;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
}

/* Search Form */
.header-search .search-form {
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--wp--preset--color--grey-50);
  border: 1px solid var(--wp--preset--color--grey-200);
  border-radius: 0.5rem;
  padding: 0 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--wp--preset--color--primary);
  box-shadow: 0 0 0 3px rgba(11, 131, 197, 0.1);
}

.search-icon {
  flex-shrink: 0;
  color: var(--wp--preset--color--grey-500);
}

.search-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.875rem 0;
  font-size: 1rem;
  outline: none;
}

.search-field::placeholder {
  color: var(--wp--preset--color--grey-400);
}

.search-submit {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.search-submit:hover,
.search-submit:focus-visible {
  background: var(--wp--preset--color--primary-dark);
}


.mobile-menu-cta {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--wp--preset--color--grey-100);
}

.mobile-search {
  margin-bottom: 2rem;
}

.mobile-search .search-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--wp--preset--color--grey-200);
  border-radius: 0.5rem;
  font-size: 1rem;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  text-align: center;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.5;
}

.btn-primary {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--wp--preset--color--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 131, 197, 0.3);
}

.btn-block {
  display: block;
  width: 100%;
}

/* Footer Structure */
.site-footer {
  background: var(--wp--preset--color--grey-900);
  color: #FFFFFF;
}

/* Footer Local Pride Section (removed) */

/* Footer Logo Gallery */
.footer-logos {
  /* Match exact gradient used by the WP Admin toolbar */
  background: linear-gradient(
    90deg,
    #B97E36 0%,   /* gruppen */
    #0B83C5 20%,  /* industri */
    #2963AF 40%,  /* eiendom */
    #BE5E32 60%,  /* enter */
    #C05BA3 80%,  /* henrys */
    #7E3393 100%  /* marketing */
  );
  padding: 2rem 0;
  border-bottom: 0; /* cleaner transition into main footer */
}

.footer-logos-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logos-label {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #FFFFFF; /* White label */
  margin: 0 0 1.25rem 0;
  text-align: left;
}

/* Mobile: Horizontal scroll */
.logos-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #D0D0D0 transparent;
}

.logos-scroll::-webkit-scrollbar {
  height: 6px;
}

.logos-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.logos-scroll::-webkit-scrollbar-thumb {
  background: #5A5A5A;
  border-radius: 3px;
}

.logos-scroll::-webkit-scrollbar-thumb:hover {
  background: #707070;
}

/* Desktop: Full width flex layout - all logos on one line */
@media (min-width: 1024px) {
  .logos-scroll {
    justify-content: space-between;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

.company-logo {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  gap: 0; /* remove gap since no text under logos */
  transition: transform 0.2s ease;
  text-decoration: none;
}

.company-logo img {
  height: 40px;
  width: auto;
  max-width: 120px;
  filter: none; /* Use logos in their original colors */
  opacity: 1;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

@media (min-width: 768px) {
  .company-logo img {
    height: 48px;
    max-width: 140px;
  }
}

/* Remove text labels under logos */

.company-logo:hover img,
.company-logo:focus img {
  filter: none;
  opacity: 1;
  transform: scale(1.05);
}

.company-logo:hover .company-name,
.company-logo:focus .company-name {
  color: #BEBEBE;
}

/* Color variants on hover */
.company-logo[data-company="gruppen"]:hover img {
  filter: none;
}

.company-logo[data-company="industri"]:hover img {
  filter: none;
}

.company-logo[data-company="workwear"]:hover img {
  filter: none;
}

.company-logo[data-company="eiendom"]:hover img {
  filter: none;
}

.company-logo[data-company="henrys"]:hover img {
  filter: none;
}

.company-logo[data-company="marketing"]:hover img {
  filter: none;
}

.company-logo[data-company="enter"]:hover img {
  filter: none;
}

/* Footer Main Content */
.footer-main {
  background: var(--wp--preset--color--grey-900);
  color: #FFFFFF;
  padding: 3rem 0;
}

.footer-main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .footer-main-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}

@media (min-width: 1024px) {
  .footer-main-container {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 4rem;
  }
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Footer Identity Column */
.footer-identity .footer-logo img {
  max-height: 60px;
  width: auto;
}

.footer-tagline {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Footer Navigation Column */
.footer-column-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem 0;
  color: #FFFFFF;
}

.footer-menu {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-menu a:hover,
.footer-menu a:focus {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal a:hover,
.footer-legal a:focus {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-legal .separator {
  color: rgba(255, 255, 255, 0.4);
}

/* Footer Contact Column */
.footer-address {
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

.footer-address p {
  margin: 0 0 1rem 0;
}

.footer-address strong {
  color: #FFFFFF;
  font-weight: 600;
}

.footer-address a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-address a:hover,
.footer-address a:focus {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Footer Bottom */
.footer-bottom {
  background: var(--wp--preset--color--grey-950);
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 768px) {
  .footer-bottom-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}

.footer-copyright,
.footer-credit {
  margin: 0;
}

.footer-credit a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-credit a:hover,
.footer-credit a:focus {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Improve button accessibility */
button:disabled,
.wp-block-button__link:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Form accessibility improvements */
input:invalid,
textarea:invalid,
select:invalid {
  border-color: var(--wp--preset--color--error);
}

input:valid,
textarea:valid,
select:valid {
  border-color: var(--wp--preset--color--success);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Required field indicator */
.required::after {
  content: " *";
  color: var(--wp--preset--color--error);
}

/* Error messages */
.error-message {
  color: var(--wp--preset--color--error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Success messages */
.success-message {
  color: var(--wp--preset--color--success);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ===================================================================
   Sticky Footer Layout
   =================================================================== */
html, body {
  min-height: 100%;
  overflow-x: hidden; /* Hindrer horisontal scroll / hvit stripe på mobil */
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Common WP main container selectors */
.site-main,
main#primary,
main.site-main,
.wp-site-blocks {
  flex: 1 0 auto;
}

.site-footer {
  margin-top: auto;
}

/* ========================================
   NEWSPAPER/MAGAZINE LAYOUT
   ======================================== */

/* Archive header - more editorial */
.archive-header {
  max-width: 1440px;
  margin: 0 auto 3rem;
  padding: 3rem 1.5rem 2rem;
  text-align: left;
  border-bottom: 3px solid var(--wp--preset--color--contrast);
  position: relative;
}

.archive-header::after {
  display: none;
}

.archive-title {
  font-size: 3rem;
  font-weight: 900;
  margin: 0 0 0.5rem 0;
  color: var(--wp--preset--color--contrast);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  /* font-family: serif; */
}

@media (min-width: 768px) {
  .archive-title {
    font-size: 4rem;
  }
}

.archive-description {
  font-size: 1.125rem;
  color: var(--wp--preset--color--grey-700);
  max-width: 600px;
  margin: 0;
  line-height: 1.6;
  font-style: italic;
}

/* Magazine-style grid */
.posts-grid {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

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

/* Featured post - takes full width */
.post-card.featured-post {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: #FFFFFF;
  border: none;
  border-bottom: 2px solid var(--wp--preset--color--grey-200);
  border-radius: 0;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  box-shadow: none;
}

@media (min-width: 768px) {
  .post-card.featured-post {
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: start;
  }
}

.post-card.featured-post .post-card-image {
  aspect-ratio: 16 / 9;
  border-radius: 0;
  order: 1;
  overflow: hidden;
}

@media (min-width: 768px) {
  .post-card.featured-post .post-card-image {
    aspect-ratio: 4 / 3;
  }
}

.post-card.featured-post .post-card-content {
  padding: 2rem 0;
  order: 2;
}

@media (min-width: 768px) {
  .post-card.featured-post .post-card-content {
    padding: 0;
  }
}

.post-card.featured-post .post-card-title {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  /* font-family: serif; */
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .post-card.featured-post .post-card-title {
    font-size: 2.5rem;
  }
}

.post-card.featured-post .post-card-excerpt {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--wp--preset--color--grey-800);
  margin-bottom: 2rem;
}

.post-card.featured-post .post-card-meta {
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--wp--preset--color--grey-200);
}

.post-card.featured-post:hover {
  transform: none;
  box-shadow: none;
}

/* Regular posts - newspaper columns */
.post-card:not(.featured-post) {
  /* Default to full row on mobile to avoid implicit column overflow */
  grid-column: 1 / -1;
  background: #FFFFFF;
  border: none;
  border-bottom: 1px solid var(--wp--preset--color--grey-200);
  border-radius: 0;
  box-shadow: none;
  padding-bottom: 1.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .post-card:not(.featured-post) {
    grid-column: span 6;
  }
}

@media (min-width: 1024px) {
  .post-card:not(.featured-post) {
    grid-column: span 4;
  }
}

.post-card:not(.featured-post):hover {
  transform: none;
  border-bottom-color: var(--wp--preset--color--primary);
  box-shadow: none;
}

.post-card:not(.featured-post) .post-card-image {
  aspect-ratio: 4 / 3;
  border-radius: 0;
  background: var(--wp--preset--color--grey-100);
}

.post-card:not(.featured-post) .post-card-content {
  padding: 1.5rem 0;
}

.post-card:not(.featured-post) .post-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  /* font-family: serif; */
}

.post-card:not(.featured-post) .post-card-excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--wp--preset--color--grey-700);
}

/* Prevent grid item overflow and ensure images fit containers */
.post-card {
  min-width: 0; /* allow grid items to shrink instead of overflowing */
}

.post-card-content {
  min-width: 0;
}

.post-card .post-card-image,
.post-card .post-card-image a,
.post-card .post-card-image img {
  display: block;
  width: 100%;
}

.post-card .post-card-image img {
  height: 100%;
  object-fit: cover;
}

/* Wrap long words/URLs in titles to avoid bleed */
.post-card-title,
.post-card-title a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Category badges - newspaper style */
.post-category {
  padding: 0.25rem 0.75rem;
  background: var(--wp--preset--color--contrast);
  color: #FFFFFF;
  border-radius: 0;
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: none;
}

/* Date styling */
.post-date {
  color: var(--wp--preset--color--grey-600);
  font-weight: 400;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   SINGLE POST - ARTICLE LAYOUT
   ======================================== */

/* Article header */
.post-hero {
  padding: 3rem 0 2rem;
  background: #FFFFFF;
  border-bottom: 3px solid var(--wp--preset--color--contrast);
  position: relative;
}

.post-hero::after {
  display: none;
}

.post-hero .container {
  max-width: 900px;
}

.post-hero .post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--wp--preset--color--grey-200);
}

.post-hero .post-category {
  background: var(--wp--preset--color--contrast);
  padding: 0.375rem 0.875rem;
  border-radius: 0;
}

.post-hero .post-date {
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 1.5rem 0;
  color: var(--wp--preset--color--contrast);
  letter-spacing: -0.03em;
  /* font-family: serif; */
}

@media (min-width: 768px) {
  .post-title {
    font-size: 3.5rem;
  }
}

.post-excerpt {
  font-size: 1.375rem;
  line-height: 1.6;
  color: var(--wp--preset--color--grey-800);
  margin-bottom: 1.5rem;
  font-weight: 400;
  font-style: italic;
  border-left: 3px solid var(--wp--preset--color--primary);
  padding-left: 1.5rem;
}

.post-author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--wp--preset--color--grey-700);
  font-size: 0.9375rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-author span {
  font-style: normal;
  font-weight: 700;
}

/* Featured image - newspaper style */
.post-featured-image {
  margin-bottom: 3rem;
  background: var(--wp--preset--color--grey-100);
}

.post-featured-image .container {
  max-width: 1200px;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}

/* Article content - newspaper typography */
.post-content-wrapper {
  padding: 0 0 3rem;
}

.post-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--wp--preset--color--grey-900);
  /* font-family: serif; */
}

.post-content p {
  margin: 0 0 1.5rem 0;
  text-align: justify;
}

.post-content p:first-of-type::first-letter {
  font-size: 3.5rem;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin: 0.1rem 0.75rem 0 0;
  color: var(--wp--preset--color--primary);
  /* font-family: serif; */
}

.post-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--wp--preset--color--contrast);
  /* font-family: serif; */
  border-bottom: 2px solid var(--wp--preset--color--contrast);
  padding-bottom: 0.5rem;
}

.post-content h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  /* font-family: serif; */
}

.post-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--wp--preset--color--contrast);
  background: var(--wp--preset--color--grey-50);
  font-style: italic;
  font-size: 1.25rem;
  /* font-family: serif; */
}

/* Pull quote style */
.post-content blockquote::before {
  content: '"';
  font-size: 4rem;
  line-height: 1;
  color: var(--wp--preset--color--primary);
  /* font-family: serif; */
  float: left;
  margin-right: 0.5rem;
}

@media (max-width: 767px) {
  .archive-header {
    padding: 2rem 1.25rem 1.5rem;
  }
  
  .archive-title {
    font-size: 2rem;
  }
  
  .post-card.featured-post .post-card-title {
    font-size: 1.5rem;
  }
  
  .post-content p:first-of-type::first-letter {
    font-size: 2.5rem;
  }

  /* Widen news archive layout slightly on mobile */
  .archive-header,
  .posts-grid {
    max-width: 95vw;
  }

  /* Compress vertical rhythm for archive on mobile */
  .archive-header {
    margin-bottom: 2rem;
    padding-top: 1.75rem;
    padding-bottom: 1.25rem;
  }
  .posts-grid {
    gap: 1.5rem;
    padding-bottom: 3rem;
  }
  .post-card.featured-post {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .post-card.featured-post .post-card-content {
    padding: 1.5rem 0 0;
  }
  .post-card:not(.featured-post) .post-card-content {
    padding: 1.25rem 0;
  }
  .post-card:not(.featured-post) .post-card-title {
    font-size: 1.125rem;
  }
  /* Post hero spacing tighten */
  .post-hero {
    padding: 2.25rem 0 1.5rem;
  }
}


/* Button styling for 'Les mer' - must come after other post-card styles */
.post-card-link {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem !important;
  background: var(--wp--preset--color--primary) !important;
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none !important;
  border-radius: 8px !important;
  transition: all 0.3s ease;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: none !important;
}

.post-card-link:hover {
  background: color-mix(in srgb, var(--wp--preset--color--primary) 85%, black) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  gap: 0.75rem;
}

.post-card-link svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.post-card-link:hover svg {
  transform: translateX(4px);
}

/* Back button spacing under single post content */
.post-back-wrapper {
  margin-top: 2rem;
}
.post-back-button {
  /* inherits .post-card-link styles */
  display: inline-flex;
}

/* --------------------------------------------------
 * Mobile horizontal padding / breathing space
 * Adds adaptive side padding for main content areas
 * without affecting full-width hero blocks or media.
 * -------------------------------------------------- */
@media (max-width: 767px) {
  .site-main,
  .entry-content,
  .site-header .container,
  .site-footer .container {
    /* Slightly wider content: reduce side padding */
    padding-left: clamp(10px, 3.5vw, 18px);
    padding-right: clamp(10px, 3.5vw, 18px);
  }

  /* Pages (static content) get up to 95% viewport width */
  .page .site-main .container,
  .page .entry-content {
    max-width: 95vw;
  }

  /* Shift page content slightly left: asymmetric padding */
  .page .site-main {
    padding-left: clamp(6px, 2vw, 12px);
    padding-right: clamp(16px, 5.5vw, 28px);
  }
  .page .entry-content {
    padding-left: clamp(6px, 2vw, 12px);
    padding-right: clamp(16px, 5.5vw, 28px);
  }

  /* Ensure Gutenberg full-width groups still span edge if explicitly wide */
  .entry-content .wp-block-group.alignfull,
  .entry-content .wp-block-cover.alignfull {
    padding-left: 0;
    padding-right: 0;
  }

  /* Optional: prevent text blocks touching edge inside wide groups */
  .entry-content .wp-block-group.alignwide > *:not(.wp-block-cover),
  .entry-content .wp-block-group.alignfull > *:not(.wp-block-cover) {
    padding-left: 0;
    padding-right: 0;
  }

  /* News / card grids: add internal gap side breathing */
  .post-grid,
  .archive-posts,
  .post-card-grid {
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* Page title sizing (generic pages) */
.page-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

@media (max-width: 480px) {
  .page-title {
    font-size: clamp(1.55rem, 6vw, 2.2rem);
    letter-spacing: -0.25px;
  }
}

/* --------------------------------------------------
 * NORTH Contact Form (Shortcode: [north_contact])
 * -------------------------------------------------- */
.north-contact-form {
  display: grid;
  gap: 1.25rem;
  max-width: 560px;
  margin: 2rem 0;
}

.north-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.north-field label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--wp--preset--color--contrast);
}

.north-field .required {
  color: #d15b52;
  font-weight: 700;
}

.north-field input,
.north-field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.north-field input:focus,
.north-field textarea:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 15%, transparent);
}

.north-field textarea {
  resize: vertical;
  min-height: 120px;
}

.north-contact-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: var(--wp--preset--color--primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.9375rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  justify-self: start;
}

.north-contact-submit:hover {
  background: color-mix(in srgb, var(--wp--preset--color--primary) 85%, black);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  gap: 0.75rem;
}

.north-contact-submit:active {
  transform: translateY(0);
}

.north-contact-submit svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.north-contact-submit:hover svg {
  transform: translateX(4px);
}

/* Success / error messages */
.north-contact-success,
.north-contact-error {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  margin: 1.5rem 0;
  animation: fadeIn 0.4s ease;
}

.north-contact-success {
  background: #e6f7ee;
  border: 1px solid #58b073;
  color: #1e6b3a;
}

.north-contact-error {
  background: #fde8e6;
  border: 1px solid #d15b52;
  color: #8c2f28;
}

@media (max-width: 767px) {
  .north-contact-form {
    max-width: 100%;
  }
  
  .north-field input,
  .north-field textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}
