/* Copyright (C) Rein Ytterberg */

/* ============================================================================
   EDI & EDIFACT INTEGRATION PAGE
   ============================================================================
   Styles specific to the EDI/EDIFACT integration page (edi.html).

   Shared pattern classes (used here):
   - .tab-button: Tab/button styling for exchange-tabs, exception-tabs
   - .section-gutter-sm: Padding for edi-exceptions, edi-foundation
   - .footer-link: Footer link styling

   See style.css for the shared pattern definitions.
   ============================================================================ */

/* EDI Page Opening Section */
.edi-opening {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 65px;
  align-items: end;
  padding-top: 38px;
  padding-bottom: 28px;
}

.edi-opening h1 {
  font-size: clamp(3rem, 5vw, 5rem);
}

.edi-opening em {
  color: var(--blue);
}

.edi-opening p {
  font-size: 1.05rem;
}

.edi-opening p + p {
  margin-top: 15px;
}

.edi-opening strong {
  font-weight: 400;
  color: var(--blue);
}

/* EDI Hero Image */
.edi-hero {
  max-width: 1320px;
  margin: auto;
  position: relative;
}

.edi-hero img {
  width: 100%;
  height: auto;
  max-height: 570px;
  object-fit: contain;
}

.edi-hero figcaption {
  position: absolute;
  left: 25px;
  bottom: 12px;
  background: #ffffffe8;
  padding: 4px 8px;
  font-size: 0.8125rem;
}

/* Exchange Section (EDI Message Workflow) */
.exchange-section {
  background: #eaf0ff;
  padding: 45px 0 32px;
}

.exchange-intro,
.exception-heading,
.foundation-heading {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 65px;
  align-items: end;
  margin-bottom: 28px;
}

.exchange-intro h2,
.exception-heading h2,
.automotive h2,
.foundation-heading h2,
.edi-pilot h2 {
  font-size: clamp(2.4rem, 3.8vw, 3.7rem);
}

.exchange-intro em,
.exception-heading em,
.foundation-heading em {
  color: var(--blue);
}

.exchange-intro > p,
.exception-heading > p,
.foundation-heading > p {
  font-size: 1rem;
}

/* Exchange and Exception Tabs
   Note: Button styling handled by .tab-button class in style.css
*/
.exchange-tabs,
.exception-tabs {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid #9daecc;
  flex-wrap: wrap;
}

/* Flow Panel (workflow content) */
#flow-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  padding-top: 24px;
  min-height: 310px;
}

#flow-panel h3 {
  font-size: 2.2rem;
  margin: 10px 0 15px;
}

#flow-panel p {
  font-size: 1rem;
}

#flow-panel > div > span {
  font-size: 0.875rem;
}

#flow-codes {
  color: #a13006;
  font-size: 1.125rem !important;
  font-weight: bold;
  margin-bottom: 13px;
}

.robot-link {
  margin-top: 14px;
  color: var(--blue);
}

.workflow-note {
  font-size: 0.8125rem;
  max-width: none;
  margin-top: 20px;
}

/* EDI Exceptions Section
   Note: Padding handled by .section-gutter-sm class in style.css
*/
#issue-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 65px;
  padding-top: 25px;
  min-height: 245px;
}

#issue-panel h3 {
  font-size: 2.1rem;
  margin-bottom: 15px;
}

#issue-panel > div:last-child h3 {
  font-size: 1.5rem;
  color: var(--blue);
  margin-top: 29px;
}

#issue-panel p {
  font-size: 1rem;
}

.issue-status {
  font-size: 0.875rem !important;
  color: #ac3106;
  font-weight: bold;
  margin-bottom: 12px;
}

.source-trail {
  color: var(--blue);
  margin-top: 15px;
}

/* Automotive Section */
.automotive {
  background: #ed4b0a;
  color: white;
  padding: 45px 0;
}

.automotive-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
}

.automotive em {
  color: #251c1a;
}

.automotive h3 {
  font-size: 1.8rem;
  margin-bottom: 18px;
}

.automotive p {
  font-size: 1rem;
  margin-top: 18px;
}

.standard-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 25px;
  margin-top: 20px;
}

.standard-links a {
  font-size: 0.875rem;
  text-underline-offset: 4px;
}

/* EDI Foundation Section
   Note: Padding handled by .section-gutter-sm class in style.css
*/
.edi-foundation dl {
  margin: 30px 0 0;
}

.edi-foundation dl > div {
  display: grid;
  grid-template-columns: 0.8fr 2fr;
  gap: 35px;
  border-top: 1px solid var(--rule);
  padding: 18px 0;
}

.edi-foundation dt {
  font-size: 1.25rem;
  font-weight: bold;
  letter-spacing: -0.02em;
}

.edi-foundation dd {
  font-size: 1rem;
  margin: 0;
  max-width: 760px;
}

/* Message Reference Details */
.message-reference {
  margin-top: 20px;
}

.message-reference summary {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 5px;
  cursor: pointer;
  font-size: 1rem;
}

.message-reference p {
  margin: 18px 0;
  font-size: 0.9375rem;
  max-width: none;
}

.message-reference table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
  margin-bottom: 20px;
}

.message-reference th,
.message-reference td {
  text-align: left;
  border-bottom: 1px solid var(--rule);
  padding: 10px 12px 10px 0;
}

.message-reference a {
  font-size: 0.875rem;
  text-underline-offset: 4px;
}

/* EDI Pilot Call-to-Action Section */
.edi-pilot {
  background: #08152e;
  color: white;
  padding: 50px 0;
}

.pilot-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: center;
}

.edi-pilot em {
  color: #9eb9ff;
}

.edi-pilot p {
  font-size: 1rem;
  margin-top: 20px;
}

.edi-pilot .cta {
  margin-top: 25px;
  font-size: 1rem;
}

.pilot-email {
  display: block;
  margin-top: 12px;
  font-size: 1rem;
}

.edi-pilot aside h3 {
  font-size: 1.8rem;
}

.edi-pilot aside a {
  display: inline-block;
  margin-top: 22px;
  color: #b7ceff;
  text-underline-offset: 5px;
  font-size: 1rem;
} /* Footer links
   Note: Link styling handled by .footer-link class in style.css
*/

/* ============================================================================
   MESSAGE STORY & TRANSLATION SECTION
   ============================================================================
   Shows the supplier opportunity and EDIFACT message example.
*/

.message-story {
  background: #08152e;
  color: white;
  padding: 45px 0;
}

.message-story-heading,
.industry-heading {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 28px;
}

.message-story h2,
.industry-section h2 {
  font-size: clamp(2.4rem, 3.8vw, 3.7rem);
}

.message-story em {
  color: #9eb9ff;
}

.message-story-heading > p,
.industry-heading > p {
  font-size: 1rem;
}

/* Message Translation Example */
.message-translation {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 60px;
  align-items: center;
}

.edifact-example {
  min-width: 0;
  border-left: 3px solid #ff8d50;
  padding-left: 22px;
}

.edifact-example figcaption {
  font-size: 0.875rem;
  color: #b7ceff;
  margin-bottom: 15px;
}

.edifact-example pre {
  font:
    14px/1.75 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  margin: 0;
  overflow-x: auto;
  padding-bottom: 10px;
  tab-size: 2;
}

.edifact-example code > span {
  color: #b7ceff;
}

.edifact-example code > b {
  color: #ffb17e;
  font-weight: 600;
}

.edifact-example > p {
  font-size: 0.8125rem;
  margin-top: 13px;
  max-width: 480px;
}

/* Readable Order Example */
.readable-order > span {
  font-size: 0.875rem;
  color: #b7ceff;
}

.readable-order h3 {
  font-size: 2.5rem;
  margin-top: 13px;
  margin-bottom: 20px;
}

.order-facts {
  font-size: 0.9375rem;
  margin: 0 0 15px;
}

.order-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin: 7px 0;
}

.order-facts dd {
  margin: 0;
}

.readable-order table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  margin: 15px 0 20px;
}

.readable-order th,
.readable-order td {
  padding: 10px 0;
  border-bottom: 1px solid #536384;
  text-align: left;
}

.readable-order th {
  font-size: 0.875rem;
  font-weight: 400;
  color: #b7ceff;
}

.readable-order th:last-child,
.readable-order td:last-child {
  text-align: right;
}

.readable-order > p {
  font-size: 1rem;
}

.readable-order > p.mapping-note {
  font-size: 0.8125rem;
  margin-top: 13px;
  color: #b7ceff;
}

/* ============================================================================
   INDUSTRY SECTION
   ============================================================================
   Shows use cases across different industries.
*/

.industry-section {
  background: #ed4b0a;
  color: white;
  padding: 45px 0;
}

.industry-heading em {
  color: #281a15;
}

.industry-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 45px;
  align-items: center;
}

.industry-layout figure {
  min-width: 0;
}

.industry-layout img {
  width: 100%;
  height: auto;
}

.industry-layout figcaption {
  font-size: 0.8125rem;
  margin-top: 10px;
}

.industry-layout dl {
  margin: 0;
}

.industry-layout dl > div + div {
  margin-top: 18px;
}

.industry-layout dt {
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1.3;
}

.industry-layout dd {
  margin: 5px 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.industry-scope {
  font-size: 0.8125rem;
  max-width: none;
  margin-top: 22px;
}

/* ============================================================================
   ILLUSTRATED EXCEPTION
   ============================================================================
   Shows the consequence of a message being valid but problematic.
*/

.illustrated-exception {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: center;
  padding-top: 23px;
}

.illustrated-exception > img {
  width: 100%;
  height: auto;
}

.illustrated-exception #issue-panel {
  display: block;
  padding-top: 0;
  min-height: 290px;
}

.illustrated-exception #issue-panel > div:last-child h3 {
  margin-top: 22px;
}

.illustrated-exception #issue-panel h3 {
  font-size: 1.9rem;
}

.illustrated-exception #issue-panel > div:last-child h3 {
  font-size: 1.4rem;
}

.automotive-note {
  max-width: none;
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */

@media (max-width: 950px) {
  .edi-opening,
  .exchange-intro,
  .exception-heading,
  .foundation-heading,
  #flow-panel,
  #issue-panel,
  .automotive-layout,
  .pilot-layout {
    gap: 30px;
  }

  .message-story-heading,
  .message-translation,
  .industry-heading,
  .industry-layout {
    gap: 30px;
  }

  .edifact-example {
    padding-left: 15px;
  }

  .edifact-example pre {
    font-size: 13px;
  }

  .readable-order h3 {
    font-size: 2.2rem;
  }

  .illustrated-exception {
    gap: 25px;
  }
}

@media (max-width: 720px) {
  .edi-opening {
    display: block;
    padding-top: 25px;
    padding-bottom: 23px;
  }

  .edi-opening h1 {
    font-size: 3rem;
  }

  .edi-opening > div {
    margin-top: 20px;
  }

  .edi-opening p {
    font-size: 1rem;
  }

  .edi-hero figcaption {
    position: static;
    background: #f1f4fa;
    padding: 7px 22px;
    font-size: 0.75rem;
  }

  .exchange-section {
    padding: 30px 0;
  }

  .exchange-intro,
  .exception-heading,
  .foundation-heading {
    display: block;
    margin-bottom: 23px;
  }

  .exchange-intro h2,
  .exception-heading h2,
  .automotive h2,
  .foundation-heading h2,
  .edi-pilot h2 {
    font-size: 2.35rem;
  }

  .exchange-intro > p,
  .exception-heading > p,
  .foundation-heading > p {
    margin-top: 20px;
  }

  .exchange-tabs,
  .exception-tabs {
    gap: 7px 19px;
  }

  #flow-panel,
  #issue-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 22px;
    min-height: 0;
  }

  #flow-panel h3,
  #issue-panel h3 {
    font-size: 1.85rem;
  }

  #flow-panel h3 br {
    display: none;
  }

  .exchange-action {
    border-top: 1px solid #aab9d3;
    padding-top: 20px;
  }

  #issue-panel > div:last-child h3 {
    margin-top: 0;
  }

  .automotive {
    padding: 35px 0;
  }

  .automotive-layout,
  .pilot-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .automotive h3 {
    font-size: 1.6rem;
  }

  .edi-foundation dl > div {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 16px 0;
  }

  .message-reference table {
    font-size: 0.875rem;
  }

  .edi-pilot {
    padding: 35px 0;
  }

  .message-story,
  .industry-section {
    padding: 33px 0;
  }

  .message-story-heading,
  .industry-heading {
    display: block;
    margin-bottom: 23px;
  }

  .message-story h2,
  .industry-section h2 {
    font-size: 2.35rem;
  }

  .message-story-heading > p,
  .industry-heading > p {
    margin-top: 18px;
  }

  .message-translation,
  .industry-layout,
  .illustrated-exception {
    grid-template-columns: 1fr;
    gap: 27px;
  }

  .edifact-example pre {
    font-size: 13px;
  }

  .readable-order h3 {
    font-size: 2.2rem;
  }

  .industry-layout dt {
    font-size: 1.15rem;
  }

  .industry-layout dd {
    font-size: 1rem;
  }

  .illustrated-exception > img {
    max-height: 265px;
    object-fit: contain;
  }

  .illustrated-exception #issue-panel {
    min-height: 0;
  }

  .illustrated-exception #issue-panel h3 {
    font-size: 1.85rem;
  }
}
