/* Main Styles - Everything Cloud */

/* Theme Colors */
:root {
  --color-primary-teal: #1a7b8e;
  --color-white: #ffffff;
  --color-text-fade: rgba(255, 255, 255, 0.5);
}

/* Global Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  background-color: var(--color-primary-teal);
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--viewport-margin);
}

/* Header & Navigation */
header {
  padding: 0 0 40px 0;
  flex-shrink: 0;
}

/* Top Global Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: nowrap;
  margin-bottom: 60px;
}

.top-nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
  order: 0;
}

.logo {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  order: 1;
}

.logo img {
  display: block;
  height: auto;
  max-height: 50px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

/* If logo needs to be inverted to white (for dark logos) */
.logo img.invert-to-white {
  filter: brightness(0) invert(1);
}

/* If logo is already white/light, no filter needed */
.logo img.logo-light {
  /* No filter - logo is already light colored */
}

/* Hide burger menu on desktop */
.burger-menu {
  display: none;
}

/* Active State Indicator - Asymmetrical half-circle */
.top-nav a.active {
  position: relative;
}

.top-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 8px;
  border-bottom: 8px solid var(--color-white);
  border-radius: 0 0 0px 8px;
}

/* Services Navigation Wrapper */
.services-nav-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 80px;
  margin-left: auto;
  margin-right: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: var(--max-width);
  width: 100%;
}

.services-nav-wrapper::-webkit-scrollbar {
  display: none;
}

/* Services Navigation */
.services-nav {
  display: inline-flex;
  gap: 60px;
  align-items: center;
  position: relative;
}

/* Prevent flex items from shrinking */
.services-nav h1,
.services-nav a,
.services-nav .scroll-arrow {
  flex-shrink: 0;
}

/* Dynamic fade based on scroll position */
.services-nav.has-overflow.scrolled-start {
  mask-image: linear-gradient(to right, black 0%, black calc(100% - 120px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 0%, black calc(100% - 120px), transparent 100%);
}

.services-nav.has-overflow.scrolled-middle {
  mask-image: linear-gradient(to right, transparent 0%, black 80px, black calc(100% - 80px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 80px, black calc(100% - 80px), transparent 100%);
}

.services-nav.has-overflow.scrolled-end {
  mask-image: linear-gradient(to right, transparent 0%, black 120px, black 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 120px, black 100%);
}

.services-nav a {
  white-space: nowrap;
  position: relative;
  line-height: 72px;
  font-size: 32px;
}

/* Active State for Services - Asymmetrical rectangle */
/* .services-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 0;
  width: 100%;
  height: 12px;
  background-color: transparent;
  border: 3px solid var(--color-white);
  border-radius: 12px 0 0 8px;
  border-top: none;
  border-right: none;
} */

.services-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 0;
  width: 100%;
  height: 16px;
  border-bottom: 17px solid var(--color-white);
  border-radius: 0 0 0px 16px;
}

.services-nav .scroll-arrow {
  font-size: 40px;
  cursor: pointer;
  position: sticky;
  z-index: 10;
  display: none;
}

.services-nav .scroll-arrow-left {
  left: 0;
  background: linear-gradient(to left, transparent 0%, var(--color-primary-teal) 30%, var(--color-primary-teal) 100%);
  padding-right: 40px;
  margin-right: -40px;
}

.services-nav .scroll-arrow-right {
  right: 0;
  background: linear-gradient(to right, transparent 0%, var(--color-primary-teal) 30%, var(--color-primary-teal) 100%);
  padding-left: 40px;
  margin-left: -40px;
}

/* Main Content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-width: 0;
}

/* Three-Column Content Layout (Homepage) */
.three-column-content {
  column-count: 3;
  column-gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.three-column-content p {
  margin-bottom: 1.5em;
  break-inside: avoid-column;
}

/* Text Fade Effect */
.text-fade {
  position: relative;
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

/* Footer Navigation */
footer {
  padding: 40px 0 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  margin-top: auto;
}

.footer-nav {
  display: flex;
  gap: 40px;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.footer-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 8px;
  border-bottom: 8px solid var(--color-white);
  border-radius: 0 0 0px 8px;
}

/* Articles Page Specific */

/* Hero Section */
.hero {
  margin-bottom: 60px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.hero h1 {
  margin-bottom: 30px;
}

.hero-text {
  position: relative;
  max-height: 200px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

/* Article Catalogue Grid */
.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: calc((var(--column-width) * 8) + (var(--gutter-width) * 7));
  margin: 0 auto;
  width: 100%;
}

.catalogue-section h2 {
  font-size: 40px;
  line-height: 48px;
  font-weight: 700;
  margin-bottom: 20px;
}

.catalogue-section ul {
  list-style: none;
  padding: 0;
}

.catalogue-section li {
  margin-bottom: 10px;
}

.catalogue-section a {
  color: white;
  text-decoration: none;
}

.catalogue-section a:hover {
  text-decoration: underline;
}

.see-more {
  font-weight: 700;
  margin-top: 10px;
}

/* Article Detail Page Specific */

.article-layout {
  display: grid;
  grid-template-columns: repeat(12, var(--column-width));
  gap: var(--gutter-width);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.article-number-col {
  grid-column: 1 / 2;
}

.article-content-col {
  grid-column: 3 / 10;
}

.article-content {
  position: relative;
}

.article-content h1 {
  margin-bottom: 30px;
}

.article-content .section-label {
  display: block;
  margin-bottom: 20px;
}

.article-body {
  position: relative;
  max-height: 60vh;
  overflow-y: auto;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  padding-bottom: 100px;
}

/* Article Graphics Placeholder */
.article-graphics {
  display: flex;
  gap: 40px;
  align-items: center;
  margin: 40px 0;
}

.graphic-item {
  width: 100px;
  height: 100px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

/* Responsive Styles */

@media screen and (max-width: 1024px) {
  .three-column-content {
    column-count: 2;
  }
  
  .catalogue-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .article-number-col {
    grid-column: 1;
  }
  
  .article-content-col {
    grid-column: 2 / 9;
  }
  
  .logo img {
    max-height: 45px;
    max-width: 180px;
  }
  
  .services-nav {
    gap: 40px;
  }
  
  .services-nav h1 {
    font-size: 35px;
    line-height: 42px;
  }
}

@media screen and (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
  }
  
  .top-nav-links {
    gap: 30px;
  }
  
  .logo img {
    max-height: 40px;
    max-width: 150px;
  }
  
  .services-nav {
    gap: 30px;
  }
  
  .services-nav h1 {
    font-size: 30px;
    line-height: 36px;
  }
  
  .services-nav .scroll-arrow {
    font-size: 32px;
  }
  
  .services-nav .scroll-arrow-left {
    padding-right: 30px;
    margin-right: -30px;
  }
  
  .services-nav .scroll-arrow-right {
    padding-left: 30px;
    margin-left: -30px;
  }
  
  .three-column-content {
    column-count: 1;
  }
  
  .catalogue-grid {
    grid-template-columns: 1fr;
  }
  
  .article-layout {
    grid-template-columns: 1fr;
  }
  
  .article-number-col,
  .article-content-col {
    grid-column: 1;
  }
}

@media screen and (max-width: 480px) {
  .top-nav-links {
    gap: 20px;
    font-size: 20px;
    line-height: 24px;
  }
  
  .services-nav {
    gap: 24px;
  }
  
  .services-nav h1 {
    font-size: 24px;
    line-height: 28px;
  }
  
  .services-nav .scroll-arrow {
    font-size: 28px;
  }
  
  .services-nav .scroll-arrow-left {
    padding-right: 20px;
    margin-right: -20px;
  }
  
  .services-nav .scroll-arrow-right {
    padding-left: 20px;
    margin-left: -20px;
  }
  
  .services-nav-wrapper {
    margin-bottom: 60px;
  }
  
  /* Active state adjustments for mobile */
  .services-nav a.active::after {
    bottom: -12px;
    height: 10px;
    border-width: 2px;
  }
}
