/* ===================================================
   Nellca Homepage — front-page.css
   Kompatibel med Shoptimizer-temat.

   Färger och knappar ärver från temat som standard.
   Använd --nhp-override-* variablerna för att skriva
   över temats val om de inte passar här.
   =================================================== */

:root {
  /* ---- Layout ---- */
  --nhp-max-width:   1170px;        /* matchar Shoptimizers .col-full */
  --nhp-section-py:  72px;
  --nhp-gap:         24px;
  --nhp-radius:      8px;
  --nhp-radius-lg:   12px;

  /* ---- Nellca-specifika färger (används bara där temat inte räcker) ---- */
  --nhp-hero-bg:        #1a1a1a;
  --nhp-cta-bg:         #1a1a1a;
  --nhp-b2b-bg:         #f5f4f0;
  --nhp-b2b-text:       #1a1a1a;
  --nhp-b2b-btn-bg:     #1a1a1a;
  --nhp-usp-bg:         #f5f4f0;
  --nhp-knowledge-bg:   #f5f4f0;
  --nhp-border:         rgba(0, 0, 0, 0.12);

  /* ---- Override-variabler — sätt dessa för att skriva över temat ---- */
  --nhp-override-btn-primary-bg:    initial;
  --nhp-override-btn-primary-color: initial;
  --nhp-override-heading-color:     initial;
  --nhp-override-link-color:        initial;
}

/* ===== STRUKTUR =====
   Sektionerna injiceras via shoptimizer_before_content-hooken
   och renderas utanför #content, naturligt full-bredd.
   När shortcode används injiceras .nhp-shortcode-wrapper inuti
   .col-full — CSS-utbrytning hanteras där nedan.
   ===================================================== */

/* Dölj den tomma #content-wrappern när vår template är aktiv */
.nhp-page-active #content.site-content {
    display: none !important;
}

/* ===== SHORTCODE FULL-BLEED =====
   Bryt ut sektionerna ur .col-full när shortcode används.
   Varje .nhp-section och .nhp-hero etc. får full viewportbredd. */
.nhp-shortcode-wrapper {
    width: 100%;
    overflow-x: hidden;
}

.nhp-shortcode-wrapper .nhp-hero,
.nhp-shortcode-wrapper .nhp-b2b,
.nhp-shortcode-wrapper .nhp-section {
    width:        100vw;
    position:     relative;
    left:         50%;
    margin-left:  -50vw;
    right:        50%;
    margin-right: -50vw;
}

/* ===== CONTAINER ===== */
.nhp-container {
    max-width:   var(--nhp-max-width);
    margin:      0 auto;
    /* Matchar Shoptimizers .col-full padding */
    padding-left:  2.617924em;
    padding-right: 2.617924em;
}

@media (max-width: 992px) {
    .nhp-container {
        padding-left:  1em;
        padding-right: 1em;
    }
}

/* ===== KNAPPAR =====
   Basklassen .button hanteras av Shoptimizer/WooCommerce.
   Vi lägger bara på det som är specifikt för startsidan. */

/* Primärknapp i hero — vit på mörk bakgrund */
.nhp-hero .button.nhp-btn-primary {
    background:   #fff;
    color:        #1a1a1a;
    border-color: #fff;
}
.nhp-hero .button.nhp-btn-primary:hover {
    background:   rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.88);
    color:        #1a1a1a;
}

/* Sekundärknapp i hero — outline på mörk bakgrund */
.nhp-hero .button.nhp-btn-outline {
    background:   transparent;
    color:        #fff;
    border:       2px solid rgba(255, 255, 255, 0.6);
}
.nhp-hero .button.nhp-btn-outline:hover {
    background:   rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color:        #fff;
}

/* Grön B2B-knapp */
.nhp-b2b .button.nhp-btn-green {
    background:   var(--nhp-b2b-btn-bg);
    color:        #fff;
    border-color: var(--nhp-b2b-btn-bg);
    white-space:  nowrap;
}
.nhp-b2b .button.nhp-btn-green:hover {
    opacity: 0.88;
    color:   #fff;
}

/* Vit knapp i kontakt-CTA på mörk bakgrund */
.nhp-cta .button.nhp-btn-white {
    background:   #fff;
    color:        #1a1a1a;
    border-color: #fff;
}
.nhp-cta .button.nhp-btn-white:hover {
    opacity: 0.9;
    color:   #1a1a1a;
}

/* Se till att .button-stilar inte bryts inuti sektionerna */
.nhp-homepage .button {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    text-decoration: none;
    cursor:          pointer;
    transition:      background 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s;
}

/* ===== DELADE SEKTIONSSTILAR ===== */
.nhp-section {
    padding: var(--nhp-section-py) 0;
}

.nhp-section__title {
    font-size:     clamp(22px, 3vw, 30px);
    font-weight:   700;
    margin-bottom: 40px;
    color:         var(--nhp-override-heading-color, inherit);
}

.nhp-link-arrow {
    font-weight:     600;
    color:           var(--nhp-override-link-color, #185FA5);
    font-size:       14px;
    text-decoration: none;
}
.nhp-link-arrow:hover { text-decoration: underline; }

.nhp-pill {
    display:       inline-block;
    padding:       4px 12px;
    background:    #E6F1FB;
    color:         #185FA5;
    border-radius: 100px;
    font-size:     12px;
    font-weight:   600;
    margin-bottom: 10px;
}

/* ===== GRID ===== */
.nhp-grid {
    display: grid;
    gap:     var(--nhp-gap);
}

.nhp-grid--3 { grid-template-columns: repeat(3, 1fr); }
.nhp-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .nhp-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .nhp-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nhp-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .nhp-grid--4 { grid-template-columns: 1fr; }
}

/* ===== HERO ===== */
.nhp-hero {
    background:      var(--nhp-hero-bg);
    color:           #fff;
    padding:         96px 0 88px;
    background-size: cover;
    background-position: center;
    position:        relative;
}

.nhp-hero--has-bg::before {
    content:    '';
    position:   absolute;
    inset:      0;
    background: rgba(0, 0, 0, 0.55);
}

.nhp-hero__inner {
    position:   relative;
    z-index:    1;
    max-width:  720px;
}

.nhp-hero__headline {
    font-size:     clamp(28px, 5vw, 52px);
    font-weight:   800;
    line-height:   1.15;
    letter-spacing: -1px;
    margin-bottom: 20px;
    color:         #fff;
}

.nhp-hero__subtext {
    font-size:     clamp(16px, 2vw, 19px);
    line-height:   1.6;
    color:         rgba(255, 255, 255, 0.85);
    margin-bottom: 36px;
    max-width:     600px;
}

.nhp-hero__ctas {
    display:       flex;
    gap:           16px;
    flex-wrap:     wrap;
    margin-bottom: 24px;
}

.nhp-hero__tagline {
    font-size:  14px;
    color:      rgba(255, 255, 255, 0.55);
    font-style: italic;
}

/* ===== B2B-BAND ===== */
.nhp-b2b {
    background:    var(--nhp-b2b-bg);
    padding:       20px 0;
    border-top:    1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nhp-b2b__inner {
    display:     flex;
    align-items: center;
    gap:         32px;
    flex-wrap:   wrap;
}

.nhp-b2b__content {
    flex:           1;
    min-width:      260px;
    display:        flex;
    flex-direction: column;
    gap:            4px;
}

.nhp-b2b__headline {
    font-size:   15px;
    font-weight: 700;
    color:       var(--nhp-b2b-text);
    margin:      0;
}

.nhp-b2b__text {
    font-size: 14px;
    color:     var(--nhp-b2b-text);
    margin:    0;
}

/* ===== PRODUKTKATEGORIER ===== */
.nhp-cat-card {
    display:         flex;
    flex-direction:  column;
    border:          1px solid var(--nhp-border);
    border-radius:   3px;
    overflow:        hidden;
    transition:      box-shadow 0.18s, transform 0.18s;
    text-decoration: none;
    color:           inherit;
}

.nhp-cat-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform:  translateY(-2px);
    color:      inherit;
}

.nhp-cat-card__image {
    aspect-ratio: 1/1;
    overflow:     hidden;
    background:   #f5f4f0;
}

.nhp-cat-card__image img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    transition: transform 0.3s;
    display:    block;
}

.nhp-cat-card:hover .nhp-cat-card__image img { transform: scale(1.04); }

.nhp-cat-card__image-placeholder {
    width:      100%;
    height:     100%;
    background: #f5f4f0;
}

.nhp-cat-card__body {
    padding: 16px;
    flex:    1;
}

.nhp-cat-card__name {
    font-size:     16px;
    font-weight:   600;
    margin-bottom: 4px;
}

.nhp-cat-card__count {
    font-size: 13px;
    color:     rgba(0, 0, 0, 0.5);
}

/* ===== USP ===== */
.nhp-usp {
    background: var(--nhp-usp-bg);
}

.nhp-usp-card {
    background:    #fff;
    border-radius: var(--nhp-radius-lg);
    padding:       28px;
    border:        1px solid var(--nhp-border);
}

.nhp-usp-card__icon {
    font-size:     22px;
    margin-bottom: 14px;
    color:         #185FA5;
}

.nhp-usp-card__title {
    font-size:     16px;
    font-weight:   700;
    margin-bottom: 8px;
}

.nhp-usp-card__body {
    font-size:   14px;
    color:       rgba(0, 0, 0, 0.65);
    line-height: 1.65;
}

/* ===== REFERENSPROJEKT ===== */
.nhp-references__list {
    display:        flex;
    flex-direction: column;
    gap:            32px;
}

.nhp-ref-card {
    display:               grid;
    grid-template-columns: 360px 1fr;
    border-radius:         var(--nhp-radius-lg);
    overflow:              hidden;
    border:                1px solid var(--nhp-border);
}

.nhp-ref-card__image {
    aspect-ratio: 4/3;
    overflow:     hidden;
    background:   #f5f4f0;
}

.nhp-ref-card__image img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
}

.nhp-ref-card__image-placeholder {
    width:      100%;
    height:     100%;
    background: #f5f4f0;
}

.nhp-ref-card__body {
    padding:        32px;
    display:        flex;
    flex-direction: column;
    justify-content: center;
    gap:            12px;
}

.nhp-ref-card__title {
    font-size:   20px;
    font-weight: 700;
}

.nhp-ref-card__excerpt {
    font-size:   15px;
    color:       rgba(0, 0, 0, 0.65);
    line-height: 1.65;
}

@media (max-width: 768px) {
    .nhp-ref-card { grid-template-columns: 1fr; }
    .nhp-ref-card__image { aspect-ratio: 16/9; }
}

/* ===== KUNSKAP & VERKTYG ===== */
.nhp-knowledge {
    background: var(--nhp-knowledge-bg);
}

.nhp-knowledge-card {
    background:      #fff;
    border-radius:   var(--nhp-radius-lg);
    border:          1px solid var(--nhp-border);
    display:         flex;
    flex-direction:  column;
    overflow:        hidden;
    transition:      box-shadow 0.18s;
    text-decoration: none;
    color:           inherit;
}

.nhp-knowledge-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    color:      inherit;
}

.nhp-knowledge-card__image {
    aspect-ratio: 16/9;
    overflow:     hidden;
    background:   #f5f4f0;
}

.nhp-knowledge-card__image img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: transform 0.3s;
}

.nhp-knowledge-card:hover .nhp-knowledge-card__image img {
    transform: scale(1.04);
}

.nhp-knowledge-card__body {
    padding:        20px;
    display:        flex;
    flex-direction: column;
    gap:            8px;
    flex:           1;
}

.nhp-knowledge-card__title {
    font-size:   15px;
    font-weight: 700;
    line-height: 1.4;
}

.nhp-knowledge-card__excerpt {
    font-size: 14px;
    color:     rgba(0, 0, 0, 0.6);
    flex:      1;
}

/* ===== OM OSS ===== */
.nhp-about__inner {
    display:     grid;
    grid-template-columns: 1fr 1fr;
    gap:         64px;
    align-items: center;
}

.nhp-about__inner--no-image {
    grid-template-columns: 1fr;
    max-width:             680px;
}

.nhp-about__image img {
    border-radius: var(--nhp-radius-lg);
    width:         100%;
    aspect-ratio:  4/3;
    object-fit:    cover;
    display:       block;
}

.nhp-about__content {
    display:        flex;
    flex-direction: column;
    gap:            20px;
}

.nhp-about__quote {
    font-size:   clamp(20px, 3vw, 28px);
    font-weight: 700;
    font-style:  normal;
    line-height: 1.3;
    margin:      0;
}

.nhp-about__body {
    font-size:   16px;
    color:       rgba(0, 0, 0, 0.7);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .nhp-about__inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ===== KONTAKT-CTA ===== */
.nhp-cta {
    background: var(--nhp-cta-bg);
    color:      #fff;
}

.nhp-cta__inner {
    display:     flex;
    align-items: center;
    gap:         48px;
    flex-wrap:   wrap;
}

.nhp-cta__text {
    flex:      1;
    min-width: 280px;
}

.nhp-cta__headline {
    font-size:     clamp(22px, 3vw, 32px);
    font-weight:   700;
    margin-bottom: 12px;
    color:         #fff;
}

.nhp-cta__subtext {
    font-size:   16px;
    color:       rgba(255, 255, 255, 0.75);
    line-height: 1.65;
}

.nhp-cta__contacts {
    display:        flex;
    flex-direction: column;
    gap:            12px;
    align-items:    flex-start;
}

.nhp-cta__contact-link {
    font-size:       18px;
    font-weight:     600;
    color:           #fff;
    opacity:         0.9;
    transition:      opacity 0.15s;
    text-decoration: none;
}

.nhp-cta__contact-link:hover { opacity: 1; text-decoration: underline; color: #fff; }

/* ===== RESPONSIVITET ===== */
@media (max-width: 768px) {
    :root { --nhp-section-py: 48px; }
    .nhp-hero { padding: 64px 0 56px; }
    .nhp-cta__inner { flex-direction: column; align-items: flex-start; gap: 24px; }
    .nhp-b2b__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 1024px) {
    :root { --nhp-section-py: 56px; }
    .nhp-cta__inner { flex-wrap: wrap; }
}
