body {
    color: var(--text-color);
}

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

a:hover,
a:focus {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Meny */
.navbar a,
.navbar-brand {
    color: var(--link-color);
    font-weight: bold;
    font-size: 14pt;
}

.navbar a:hover,
.navbar a:focus {
    color: var(--link-hover-color);
}
.navbar-nav .current-menu-item > a,
.navbar-nav .current_page_item > a {
    color: var(--active-link-color);
    font-weight: bold;
}

.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-video,
.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: -2;
}



.hero-section + * {
    margin-top: 0;
}

.hero-img.fallback {
    background-color: #222;
    width: 100%;
    height: 100%;
}

.hero-video-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    object-fit: cover;
}

#hero-rotator {
    position: relative;
    width: 100%;
    height: 100%;
}

#hero-rotator .rotator-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
    width: 100%;
    text-align: center;
}

#hero-rotator .rotator-item.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}



.hero-section .rotator-item h1,
.hero-section .rotator-item p {
    margin: 0;
    padding: 0;
    transition: all 0.5s ease;
}



.hero-text-wrapper {
    padding-bottom: 60px; /* så knappen inte ligger precis vid kanten */
}
.hero-button-custom {
    margin-top: auto;
}

#mainNavbar {
    padding-top: 2rem;
    padding-bottom: 1rem;
}

#mainNavbar .custom-logo {
    max-height: 40px; /* justera efter behov */
    height: auto;
    width: auto;
}

.navbar-nav {
  padding-right: 2rem;
}

#mainNavbar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.bg-almost-black {
  background-color: #0d0d0d !important; /* Nära kolsvart */
}

.page-featured-image {
    width: 100%;
    max-height: 500px; /* Valfritt maxhöjd */
    overflow: hidden;
}

.page-featured-image img {
    object-fit: cover;
    width: 100%;
    height: clamp(220px, 45vh, 540px);
    display: block;
}


[data-aos] {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    
}
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

.video-column {
    max-height: 200px;
    margin: 0 auto;
}

/* Allow space for fixed navbar when jumping to anchor */
.wp-block-heading,
.wp-block-group[id],
[id] {
  scroll-margin-top: calc(var(--navbar-height, 80px) + 16px);
}

.wp-block-group {
    margin-top: 75px;
}

.blog-list {
  display: grid;
  gap: 1.25rem;
}

/* Blog card base styles */
.bl-item {
  display: grid;
  grid-template-columns: 35% 65%;
  gap: 1rem;
  text-decoration: none;
  color: var(--ph-card-text, var(--text-color)); 
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  overflow: hidden;
  background: var(--ph-card-bg, var(--bs-body-bg, #fff)); 
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

/* Ensure text inside the card inherits the card color */
.bl-title,
.bl-excerpt,
.bl-cats,
.bl-cat {
  color: inherit;
}


/* Image column */
.bl-media {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;            
  overflow: hidden;
}

.bl-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bl-thumb--placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1c2a38, #92bde9);
}

/* Text column */
.bl-body {
  padding: 1rem 1rem 1rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bl-title {
  margin: 0 0 .35rem 0;
  line-height: 1.2;
  font-weight: 700;
  font-size: clamp(1.05rem, 1vw + .85rem, 1.35rem);
}

.bl-cats {
  margin-bottom: .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
}

.bl-cat {
  background: rgba(13,110,253,.18); 
  color: inherit;                    
}

.bl-excerpt {
  opacity: .85;
}

/* Keep the whole card clickable without changing text color on hover */
.bl-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.12);
}

/* Pagination */
.pagination ul {
  display: flex;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}
.pagination a,
.pagination span {
  display: inline-block;
  padding: .5rem .75rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
}
.pagination .current {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

/* ===== Blog list meta (home.php) ===== */
.bl-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  margin-bottom: .4rem;
  opacity: .9;
}

.bl-author a {
  color: inherit;
  text-decoration: none;
}
.bl-author a:hover { text-decoration: underline; }

.bl-date {
  color: inherit;
  opacity: .85;
}

.bl-meta-sep { opacity: .5; }

/* Tags inside cards: smaller text */
.bl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  margin-bottom: .5rem;
}

.bl-tag {
  font-size: .78rem;                 /* smaller size as requested */
  line-height: 1;
  padding: .28rem .5rem;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;                     /* follow card text color */
  background: rgba(0,0,0,.08);        /* light pill */
  border: 1px solid rgba(0,0,0,.08);
}

.bl-tag:hover {
  text-decoration: underline;
}

/* ===== Single post meta (under hero) ===== */
.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: clamp(12px, 2vw, 18px) 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.post-meta__left {
  display: grid;
  gap: .35rem;
}

.post-meta__row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.post-meta__author a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.post-meta__author a:hover { text-decoration: underline; }

.post-meta__cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .65rem;
}

.post-meta__cat {
  font-size: .9rem;
  line-height: 1;
  padding: .35rem .6rem;
  background: rgba(13,110,253,.08);
  color: #0d6efd;
  border-radius: 999px;
  text-decoration: none;
}
.post-meta__cat:hover { text-decoration: underline; }

.post-meta__sep { opacity: .4; }

.post-meta__date {
  color: #6c757d;
  font-size: .95rem;
}

/* Tags on single: small and subtle */
.post-meta__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  align-items: center;
}

.post-meta__tag {
  font-size: .8rem;
  line-height: 1;
  padding: .3rem .55rem;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.09);
}
.post-meta__tag:hover { text-decoration: underline; }

/* Mobile tweaks */
@media (max-width: 768px) {
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* --- Fix: förhindra "extra boxar" inne i bl-item --- */

/* Se till att kortet själv har bakgrund/radie/overflow */
.bl-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

/* Make sure the card itself has background/radius/overflow */
.bl-item .bl-body,
.bl-item .bl-title,
.bl-item .bl-cats,
.bl-item .bl-meta,
.bl-item .bl-tags,
.bl-item .bl-excerpt,
.bl-item .bl-media,
.bl-item h1, .bl-item h2, .bl-item h3,
.bl-item p,
.bl-item .wp-block-group,
.bl-item .wp-block-group__inner-container {
  background: transparent !important; 
  box-shadow: none;
  border: 0;
}

/* Ensure that the header does not generate a full-width row/bar */
.bl-title {
  display: block;
  margin: 0 0 .35rem 0;
  line-height: 1.2;
}

/* Fine-tune the layout so the right column doesn't look "empty" in 16:9 mode */
.bl-body {
  padding: 1rem 1rem 1rem 0;
  display: grid;
  align-content: center;    
  gap: .35rem;
}

.bl-title a,
.bl-media-link {
  color: inherit;
  text-decoration: none;
}

.bl-title a:hover { text-decoration: underline; }

/* If something globally forces background on links in the card */
.bl-item a { background: transparent !important; }

.bl-item {
  display: grid;
  grid-template-columns: 35% 65%;
  align-items: stretch;          
  box-sizing: border-box;
}


.bl-media {
  align-self: stretch;          
  height: auto;                  
  min-height: 220px;             
  aspect-ratio: auto;            
  overflow: hidden;
}
.bl-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;             
  display: block;
}


.bl-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;   
  gap: .5rem;
  padding: 1rem 1rem 1rem 0;
}


.bl-body > *:first-child { margin-top: 0; }


@media (max-width: 768px) {
  .bl-item { grid-template-columns: 1fr; }
  .bl-media {
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 9;        
  }
  .bl-body {
    padding: .75rem .9rem 1rem .9rem;
  }
}


@media (max-width: 768px) {
  .bl-item { grid-template-columns: 1fr; }
  .bl-media {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9; 
  }
  .bl-body {
    padding: .75rem .9rem 1rem .9rem;
  }
}


/* Mobil: stacka */
@media (max-width: 768px) {
  .bl-item {
    grid-template-columns: 1fr;
  }
  .bl-body {
    padding: .75rem .9rem 1rem .9rem;
  }
}
/* Blog list top spacing so first card doesn't stick to the top */
.blog-list-wrap {
  /* Use clamp to scale between mobile and desktop */
  padding-top: clamp(24px, 4vw, 72px);
  padding-bottom: clamp(32px, 5vw, 96px);
}

/* If a hero sits above, make sure next block can still have spacing if needed */
.hero-section + .blog-list-wrap {
  margin-top: 0; /* already padded inside */
}

@media (max-width: 768px) {
  .bl-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;       
  }
  .bl-media { aspect-ratio: 16/9; }
  .bl-body  { padding: .75rem .9rem 1rem .9rem; }
}

/* ===== Meta row under hero ===== */
.post-meta {
  display: flex;
  align-items: center;
  gap: .75rem 1.25rem;
  flex-wrap: wrap;
  padding: clamp(12px, 2vw, 18px) 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.post-meta__cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .65rem;
}

.post-meta__cat {
  font-size: .9rem;
  line-height: 1;
  padding: .35rem .6rem;
  background: rgba(13,110,253,.08);
  color: #0d6efd;
  border-radius: 999px;
  text-decoration: none;
}

.post-meta__cat:hover {
  text-decoration: underline;
}

.post-meta__sep {
  opacity: .4;
  margin: 0 .25rem;
}

.post-meta__date {
  color: #6c757d;
  font-size: .95rem;
}

/* Content spacing */
.single-post .single-content > *:first-child {
  margin-top: 0;
}

/* Archive header (optional) */
.archive-header {
  padding-bottom: .5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08); /* justera för ljust tema */
}
.archive-title {
  margin: 0 0 .25rem 0;
  font-size: clamp(1.25rem, 1.2vw + 1rem, 1.75rem);
  font-weight: 800;
}
.archive-description { opacity: .85; }
/* ====== Comment Form Styling ====== */
.comment-respond {
  margin-top: 2.5rem;
}

.comment-respond h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.comment-form {
  display: grid;
  gap: 1rem;
}

/* ===== Comment form: theme-aware (ph-dark / ph-light) ===== */
.comment-respond { margin-top: 2.5rem; }
.comment-respond h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; }
.comment-form { display: grid; gap: 1rem; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  resize: vertical;
  box-sizing: border-box;
}

/* LIGHT background */
.ph-light .comment-form input[type="text"],
.ph-light .comment-form input[type="email"],
.ph-light .comment-form input[type="url"],
.ph-light .comment-form textarea {
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(0,0,0,.18);
}
.ph-light .comment-form input::placeholder,
.ph-light .comment-form textarea::placeholder { color: rgba(0,0,0,.5); }
.ph-light .comment-form input:focus,
.ph-light .comment-form textarea:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.28);
  background: #ffffff; /* stays white on focus */
}

/* DARK background */
.ph-dark .comment-form input[type="text"],
.ph-dark .comment-form input[type="email"],
.ph-dark .comment-form input[type="url"],
.ph-dark .comment-form textarea {
  background: rgba(255,255,255,.06);
  color: #f5f5f5;
  border: 1px solid rgba(255,255,255,.18);
}
.ph-dark .comment-form input::placeholder,
.ph-dark .comment-form textarea::placeholder { color: rgba(255,255,255,.55); }
.ph-dark .comment-form input:hover,
.ph-dark .comment-form textarea:hover { border-color: rgba(255,255,255,.28); }
.ph-dark .comment-form input:focus,
.ph-dark .comment-form textarea:focus {
  outline: none;
  border-color: #6aa8ff;
  box-shadow: 0 0 0 3px rgba(106,168,255,.25);
  background: rgba(255,255,255,.09); /* stays dark on focus */
}

/* Labels & submit */
.comment-form label { display:block; font-size:.9rem; font-weight:600; margin-bottom:.35rem; opacity:.9; }
.comment-form .required { color:#dc3545; }

.comment-form input[type="submit"] {
  padding: .75rem 1.5rem;
  border-radius: 10px;
  background: #0d6efd;
  color: #fff;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}
.comment-form input[type="submit"]:hover { background:#0b5ed7; transform: translateY(-1px); }
.comment-form input[type="submit"]:active { transform: translateY(0); }


/* Error/required fields */
.comment-form .required {
  color: #dc3545; /* röd stjärna */
}

/* Minhöjd och ord-brytning för textarea */
.comment-form textarea {
  min-height: 180px;
  word-break: break-word;
}

/* Fältfel (om tema/plugins lägger .error) */
.comment-form .error input,
.comment-form .error textarea {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220,53,69,.18) !important;
}

/* Cookies-consent (WP standard) */
.comment-form-cookies-consent {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  opacity: .9;
}
.comment-form-cookies-consent input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #0d6efd;
}

/* "Logged in as", "Notes" och allowed tags */
.comment-notes,
.logged-in-as {
  font-size: .9rem;
  opacity: .85;
}
.form-allowed-tags {             /* brukar vara onödigt långt */
  font-size: .85rem;
  opacity: .75;
  max-height: 0;                 /* dölj om du vill */
  overflow: hidden;
}

/* Skicka-knappen placering */
.form-submit { margin-top: .25rem; }

/* Två kolumner för namn/e-post/URL på desktop */
@media (min-width: 640px) {
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    display: grid;
  }
  .comment-form {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: row;
  }
  .comment-form-author { grid-column: 1; }
  .comment-form-email  { grid-column: 2; }
  .comment-form-url    { grid-column: 1 / span 2; }
  .comment-form-comment{ grid-column: 1 / span 2; }
  .comment-form-cookies-consent,
  .form-submit         { grid-column: 1 / span 2; }
}

/* Disabled state (om captcha/async etc) */
.comment-form input[disabled],
.comment-form textarea[disabled] {
  opacity: .6;
  cursor: not-allowed;
}


.single-hero {
  position: relative;
  width: 100%;          
  margin: 0;
  left: auto;
  right: auto;
  overflow: hidden;     
}

.single-hero__img {
  display: block;
  width: 100%;
  height: clamp(220px, 45vh, 540px);
  object-fit: cover;
}

/* Overlay för titel */

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}



/* === PH COMMENTS: control width, colors and overflow (mobile & desktop) === */
.ph-comments-wrap { 
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

#ph-commentform,
#ph-commentform > * {
  min-width: 0;
  max-width: 100%;
}

#ph-commentform input[type="text"],
#ph-commentform input[type="email"],
#ph-commentform input[type="url"],
#ph-commentform textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #111;         
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px;
  padding: .75rem 1rem;
}

#ph-commentform .required {
  color: #dc3545;
}

#ph-commentform .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  flex-wrap: wrap;
  white-space: normal;
}

#ph-commentform .comment-form-cookies-consent label {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}

/* Button must not break the width */
#ph-commentform .form-submit { max-width:100%; }
#ph-submit { max-width:100%; }

/* Safety net: everything in the comment block is broken and clipped within the viewport */
.ph-comments-wrap * {
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width:768px){
  /* Turn off box-shadow which can create 1–2px spill and replace with outline */
  #ph-commentform input:focus,
  #ph-commentform textarea:focus {
    box-shadow: none;
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
  }
}
