/* =========================================================
   DEWICK & ASSOCIATES – Our Journey  (Elementor widgets)
   Base layout. Colours/typography are overridable from the
   Elementor "Style" tab via {{WRAPPER}} selectors.
   All classes are namespaced with .djn- to avoid theme clashes.
   ========================================================= */

/* ---- shared tokens (defaults match the original design) ---- */
.djn-header,
.djn-item,
.djn-footer {
  --djn-green: #4caf50;
  --djn-green-light: #e8f0e9;
  --djn-navy: #2e2b6e;
  --djn-charcoal: #333333;
  --djn-charcoal-dark: #3c3f41;
  --djn-grey-text: #555555;
  --djn-grey-light: #999999;
  --djn-yellow: #f5d020;
  --djn-red: #d32f2f;
  --djn-line: #b5b5b5;
  --djn-dot: #888888;
  --djn-white: #ffffff;

  --djn-date-width: 200px;
  --djn-marker-width: 80px;
  --djn-col-gap: 8px;
  --djn-rail-length: 22px;
  --djn-item-gap: 52px;

  font-family: 'Be Vietnam Pro', 'Open Sans', Arial, Helvetica, sans-serif;
  color: var(--djn-charcoal);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

.djn-header *,
.djn-item *,
.djn-footer * {
  box-sizing: border-box;
}

/* =========================================================
   PAGE WRAPPER
   Add the CSS class  djn-page  to the Section, Column or
   Container that holds these widgets to reproduce the
   original fluid 92%-of-viewport, centered layout (instead
   of a fixed boxed width). Pair it with the Section set to
   Content Width = Full Width.
   ========================================================= */
.elementor-element.djn-page {
  max-width: 92% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* =========================================================
   HEADER WIDGET
   ========================================================= */
.djn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.djn-header-left {
  flex-shrink: 0;
}

.djn-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.djn-logo-circle {
  width: 42px;
  height: 42px;
  background: var(--djn-charcoal-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.djn-logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* when the logo is an uploaded image, show it as-is (no dark circle / crop) */
.djn-logo-circle.has-image {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  width: auto !important;
}

.djn-logo-circle.has-image img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

.djn-logo-circle .djn-logo-text {
  color: var(--djn-white);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-transform: lowercase;
  font-style: italic;
}

.djn-logo-circle i,
.djn-logo-circle svg {
  color: var(--djn-white);
  fill: var(--djn-white);
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.djn-company-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--djn-charcoal);
  text-transform: uppercase;
}

.djn-header-right {
  text-align: left;
  max-width: 60%;
}

.djn-main-title {
  font-size: 46px;
  font-weight: 700;
  color: var(--djn-navy);
  line-height: 1.1;
  margin: 0 0 8px;
}

.djn-subtitle {
  font-size: 16px;
  color: var(--djn-grey-text);
  line-height: 1.5;
  font-weight: 400;
  margin: 0;
}

/* =========================================================
   TIMELINE ITEM WIDGET
   ========================================================= */
.djn-item {
  display: grid;
  grid-template-columns: var(--djn-date-width) var(--djn-marker-width) 1fr;
  gap: 0 var(--djn-col-gap);
  position: relative;
  align-items: start;
  padding-bottom: var(--djn-item-gap);
}

/* continuous dashed vertical spine (drawn per item, stacks seamlessly).
   Sits on the marker centre: date column + the grid gap before the marker
   column + half the marker column. margin-left:-1px centres the 2px line
   (translateX(-50%) does nothing on a 0-width element). */
.djn-spine {
  content: '';
  position: absolute;
  left: calc(var(--djn-date-width) + var(--djn-col-gap) + (var(--djn-marker-width) / 2));
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed var(--djn-line);
  margin-left: -1px;
  z-index: 0;
  pointer-events: none;
}

/* last item: spine stops at the node so the line ends cleanly */
.djn-item--last .djn-spine {
  bottom: auto;
  height: 30px;
}

/* keep the vertical line continuous when items are stacked as separate
   Elementor widgets in one column (removes the default widget gap;
   spacing comes from each item's own "Spacing Below" padding instead) */
.elementor-widget-djn_timeline_item:not(:last-child) {
  margin-bottom: 0 !important;
}

/* ---- date column ---- */
.djn-date {
  text-align: right;
  padding-right: 24px;
  padding-top: 10px;
  position: relative;
  z-index: 2;
}

.djn-year {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--djn-navy);
  margin-bottom: 6px;
  line-height: 1.2;
}

.djn-milestone {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--djn-grey-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.4;
}

/* ---- marker column + crosshair rails ---- */
.djn-marker {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
  min-height: 58px;
  padding-top: 4px;
}

.djn-rail {
  position: absolute;
  top: 50%;
  width: var(--djn-rail-length);
  height: 0;
  border-top: 2px dashed var(--djn-line);
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}

.djn-rail--left {
  right: calc(50% + 24px);
}

.djn-rail--left::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -4px;
  width: 8px;
  height: 8px;
  background: var(--djn-dot);
  border-radius: 50%;
}

.djn-rail--right {
  left: calc(50% + 24px);
}

.djn-rail--right::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  width: 8px;
  height: 8px;
  background: var(--djn-dot);
  border-radius: 50%;
}

.djn-marker-icon {
  width: 58px;
  height: 58px;
  background: var(--djn-charcoal-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  overflow: hidden;
}

.djn-marker-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.djn-marker-icon i,
.djn-marker-icon svg {
  color: var(--djn-white);
  fill: var(--djn-white);
  stroke: var(--djn-white);
  font-size: 28px;
  width: 28px;
  height: 28px;
}

.djn-marker-text {
  color: var(--djn-white);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

/* ---- content column (green left border) ---- */
.djn-content {
  padding-left: 24px;
  padding-top: 4px;
  position: relative;
  z-index: 2;
  border-left: 5px solid var(--djn-green);
  margin-left: 4px;
}

.djn-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--djn-green);
  margin: 0 0 10px;
  line-height: 1.4;
}

.djn-body {
  color: var(--djn-grey-text);
  font-size: 17px;
  line-height: 1.7;
}

.djn-body p {
  margin: 0 0 10px;
}

.djn-body p:last-child {
  margin-bottom: 0;
}

.djn-list {
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
}

.djn-list li {
  margin-bottom: 8px;
  color: var(--djn-grey-text);
  font-size: 17px;
  line-height: 1.7;
}

/* radio-style bullets */
.djn-list--radio li {
  position: relative;
  padding-left: 28px;
}

.djn-list--radio li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--djn-grey-text);
  border-radius: 50%;
  background: var(--djn-white);
}

.djn-list--radio li::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 12px;
  width: 5px;
  height: 5px;
  background: var(--djn-grey-text);
  border-radius: 50%;
}

/* nucleus / inline highlight */
.djn-highlight {
  background: var(--djn-yellow);
  padding: 1px 4px;
  font-weight: 600;
  color: var(--djn-charcoal);
}

.djn-cat {
  color: var(--djn-green);
  font-weight: 700;
}

/* placeholder note */
.djn-note {
  color: var(--djn-red);
  font-size: 11px;
  font-weight: 600;
  margin-top: 10px;
  font-style: normal;
}

/* ---- project gallery block ---- */
.djn-gallery {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.djn-card {
  flex: 0 0 auto;
  width: 170px;
  text-align: center;
}

/* linked cards (Custom Post Type loop) */
a.djn-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease;
}

a.djn-card:hover {
  transform: translateY(-2px);
}

.djn-card-img {
  width: 170px;
  height: 115px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: #ddd;
  margin-bottom: 8px;
}

.djn-card span {
  font-size: 12px;
  color: var(--djn-grey-text);
  line-height: 1.3;
  display: block;
}

/* ---- project slider (carousel with dots) ---- */
.djn-slider {
  position: relative;
  width: 100%;
}

.djn-slider-viewport {
  overflow: hidden;
  width: 100%;
}

.djn-slider-track {
  display: flex;
  gap: 14px;
  transition: transform 0.35s ease;
  will-change: transform;
  touch-action: pan-y;
}

.djn-slider-track .djn-card {
  flex: 0 0 auto;
}

.djn-slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.djn-slider-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #cfd3d6;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.djn-slider-dot:hover {
  background: #aeb4b8;
}

.djn-slider-dot.is-active {
  background: var(--djn-green);
  transform: scale(1.3);
}

/* ---- service icons row ---- */
.djn-services {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.djn-service {
  text-align: center;
  width: 84px;
}

.djn-service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  margin-bottom: 6px;
}

.djn-service-icon i,
.djn-service-icon svg {
  color: #2980b9;
  fill: none;
  stroke: #2980b9;
  font-size: 42px;
  width: 42px;
  height: 42px;
}

.djn-service-icon img {
  max-height: 46px;
  max-width: 100%;
  width: auto;
}

.djn-service span {
  font-size: 12px;
  color: var(--djn-grey-text);
  line-height: 1.3;
  display: block;
}

/* ---- "today" cards grid ---- */
.djn-today {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  max-width: 420px;
}

.djn-today-card {
  background: var(--djn-green-light);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.djn-today-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.djn-today-icon i,
.djn-today-icon svg {
  color: #487a4c;
  fill: #487a4c;
  font-size: 34px;
  width: 34px;
  height: 34px;
}

.djn-today-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.djn-today-card span {
  font-size: 15px;
  font-weight: 600;
  color: var(--djn-green);
}

/* =========================================================
   FOOTER WIDGET
   ========================================================= */
.djn-footer {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.djn-footer .djn-logo-circle {
  width: 38px;
  height: 38px;
}

.djn-footer p {
  font-size: 14px;
  color: var(--djn-grey-text);
  line-height: 1.6;
  padding-top: 4px;
  margin: 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  .djn-item {
    grid-template-columns: 44px 1fr;
    gap: 0 16px;
  }

  .djn-spine {
    left: 22px;
    margin-left: -1px;
  }

  .djn-date {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    padding-right: 0;
    padding-top: 0;
    margin-bottom: 4px;
  }

  .djn-marker {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
    min-height: auto;
    padding-top: 0;
  }

  .djn-rail {
    display: none;
  }

  .djn-marker-icon {
    width: 40px;
    height: 40px;
  }

  .djn-content {
    grid-column: 2;
    grid-row: 2;
    padding-left: 16px;
    padding-top: 0;
    margin-left: 0;
    border-left-width: 3px;
  }

  .djn-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .djn-header-right {
    text-align: left;
    max-width: 100%;
  }

  .djn-main-title {
    font-size: 34px;
  }

  .djn-year {
    font-size: 20px;
  }

  .djn-heading {
    font-size: 18px;
  }

  .djn-body,
  .djn-list li {
    font-size: 16px;
  }

  .djn-gallery {
    flex-wrap: wrap;
  }

  .djn-gallery .djn-card,
  .djn-gallery .djn-card-img {
    width: calc(50% - 5px);
    max-width: 170px;
  }

  .djn-gallery .djn-card-img {
    height: 95px;
    width: 100%;
  }

  .djn-slider-track .djn-card,
  .djn-slider-track .djn-card-img {
    width: 150px;
  }

  .djn-slider-track .djn-card-img {
    height: 100px;
  }

  .djn-service {
    width: calc(33.333% - 8px);
    min-width: 72px;
  }

  .djn-today {
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .djn-footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .djn-main-title {
    font-size: 30px;
  }

  .djn-gallery .djn-card {
    width: calc(50% - 5px);
  }

  .djn-service {
    width: calc(50% - 6px);
  }
}
