/* assets/css/custom.css */

/* --- Profile Section Styling --- */

.home-profile {
    display: flex;           /* Arrange items in a row */
    align-items: center;     /* Vertically center the items */
    justify-content: flex-start; /* Horizontally center the whole group */
    gap: 1.5rem;             /* Add space between image and text */
    margin-bottom: 3rem;
}

.profile-text {
    text-align: left; /* Left-align the text block */
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-title {
    margin-bottom: 0.5rem;
}

.profile-subtitle {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--secondary);
}


/* --- NEW: Profile Header Styling --- */

.profile-header {
    display: flex;
    align-items: center;
    /* No need for justify-content as the parent is already handling centering */
}

.profile-header .social-icons {
    margin-left: 1rem; /* Adds some space between the name and the icon */
    font-size: 1.5rem; /* Makes the icon a bit larger */
}


/* --- NEW: Value Chain Layout Styling --- */
.value-chain {
    display: flex; /* Arrange children in a row */
    justify-content: center; /* Center the items horizontally */
    flex-wrap: wrap; /* Allow items to stack on smaller screens */
    gap: 1rem; /* Add space between the columns */
    margin-top: 2rem;
}

.value-chain .node {
    flex: 1; /* Allow nodes to grow and shrink equally */
    min-width: 220px; /* Set a minimum width before stacking */
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
}

.value-chain .node h2, .value-chain .node h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* --- Card (Sub-Node) Styling --- */
.value-chain .sub-nodes {
    display: grid;
    gap: 1rem;
    text-align: left;
}

.value-chain .card {
    display: block;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease-in-out;
    background-color: var(--card-background-color);
}

.value-chain .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.value-chain .card h4 {
    margin-top: 0;
    color: var(--primary-color);
}

.value-chain .card.disabled {
    background-color: #f7dddd;
    color: #f6b3b3;
    pointer-events: none;
}

.value-chain .card.disabled h4 {
    color: #aaa;
}

/* --- NEW: Font Size Adjustments --- */

/* Reduce the size of the main domain titles (e.g., "Supply Chain") */
.value-chain .node h2, .value-chain .node h3 {
    font-size: 1.4rem; 
}

/* Reduce the size of the capability titles in each card (e.g., "Demand Forecasting") */
.value-chain .card h4 {
    font-size: 1rem;
    margin-bottom: 0; /* Add this to tighten up the spacing in the card */
}

/* --- NEW: Description Text Styling --- */

/* Control the font size of the description text in each card */
.value-chain .card p {
    font-size: 0.7rem; /* Slightly smaller than default text */
    margin-bottom: 0;
    color: var(--secondary); /* Uses the theme's secondary text color for a subtle look */
}


.profile-wrapper-about .home-profile {
    display: flex;
    justify-content: flex-start !important;
}


/* --- NEW: Styling for Image at End of Value Chain --- */
.value-chain-end-image-container {
    text-align: center; /* Center the image horizontally */
    margin-top: 4rem; /* Space above the image */
    margin-bottom: 2rem; /* Space below the image */
    padding: 0 1rem; /* Add some padding on smaller screens */
}

.value-chain-end-image {
    max-width: 800px; /* Limit max width for large screens */
    width: 100%; /* Make it responsive */
    height: auto; /* Maintain aspect ratio */
    border-radius: 8px; /* Soften edges */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Subtle shadow for depth */
    opacity: 0.9; /* Slightly reduce opacity to blend with dark theme */
}

/* Optional: Add a media query for even smaller screens if needed */
@media (max-width: 768px) {
    .value-chain-end-image {
        max-width: 100%;
    }
}

/* --- Rebuild (2026-11): home sections, links, diagrams, About --- */
.profile-links { margin-top: 0.4rem; font-size: 0.95rem; }
.profile-links a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.home-section { margin: 2.5rem 0 1rem; font-size: 1.35rem; }
.home-intro { color: var(--secondary); margin-bottom: 1rem; }
.home-more { margin-top: 0.5rem; }
.card.disabled { cursor: default; opacity: 0.6; }
pre.mermaid { background: transparent; border: 0; text-align: center; padding: 1rem 0; overflow-x: auto; }
pre.mermaid svg { max-width: 100%; height: auto; }
.about-photo { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; float: right; margin: 0 0 1rem 1.5rem; }
@media (max-width: 600px) {
  .home-profile { flex-direction: column; align-items: flex-start; }
  .about-photo { float: none; display: block; margin: 0 0 1rem; }
}

/* --- Diagrams and article graphics (2026-11): the editorial palette the graphics use --- */
figure.diagram { margin: 2rem 0; padding: 1.25rem 0.75rem; background: #F7F5F0; border: 1px solid #E2DCCE; border-left: 4px solid #B4441F; border-radius: 8px; }
.dark figure.diagram { background: #1F2633; border-color: #2A2F3A; border-left-color: #B4441F; }
figure.diagram pre.mermaid { margin: 0; padding: 0; }
.post-single .entry-cover img { border-radius: 8px; border: 1px solid #E2DCCE; }

/* --- Diagrams as plain containers (2026-12-01): no longer inside <pre>, labels as SVG text --- */
figure.diagram .mermaid { text-align: center; line-height: 1.5; }
figure.diagram .mermaid svg { height: auto; max-width: 100%; }
.diagram-enlarge { display: block; margin: 0.75rem auto 0; padding: 0.45rem 1rem; font-size: 0.85rem; border-radius: 999px;
  border: 1px solid #B4441F; color: #B4441F; background: transparent; cursor: pointer; }
.dark .diagram-enlarge { color: #F2A65A; border-color: #F2A65A; }
.diagram-viewer { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(20, 33, 61, 0.92); }
.diagram-viewer.open { display: block; }
.diagram-viewer-body { position: absolute; inset: 3.25rem 0 0 0; overflow: auto; -webkit-overflow-scrolling: touch;
  background: #F7F5F0; padding: 1rem; touch-action: pan-x pan-y pinch-zoom; }
.dark .diagram-viewer-body { background: #1F2633; }
.diagram-viewer-body svg { max-width: none !important; height: auto; display: block; margin: 0 auto; }
.diagram-viewer-close { position: absolute; top: 0.5rem; right: 0.75rem; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 0; font-size: 1.75rem; line-height: 1; color: #14213D; background: #F7F5F0; cursor: pointer; }
html.diagram-open, html.diagram-open body { overflow: hidden; }

/* --- Phones (2026-12-01): headings sized for a small screen, comfortable reading, nothing wider than the screen --- */
@media (max-width: 600px) {
  .post-header .post-title, .post-title { font-size: 1.75rem; line-height: 1.25; }
  .post-description { font-size: 1.05rem; }
  .post-content h1 { font-size: 1.6rem; }
  .post-content h2 { font-size: 1.4rem; line-height: 1.3; margin-top: 2rem; }
  .post-content h3 { font-size: 1.2rem; line-height: 1.35; }
  .post-content h4 { font-size: 1.05rem; }
  .post-content { font-size: 1.05rem; line-height: 1.7; overflow-wrap: break-word; }
  .post-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: normal; }
  .post-content img, .post-content video, .post-content iframe { max-width: 100%; height: auto; }
  .post-content iframe[src*="youtube"] { aspect-ratio: 16 / 9; width: 100%; height: auto; }
  .post-content pre { overflow-x: auto; }
  figure.diagram { padding: 1rem 0.5rem; margin: 1.5rem -0.25rem; }
  .entry-cover { margin-left: 0; margin-right: 0; }
  .home-section { font-size: 1.2rem; }
  .post-entry .entry-header h2 { font-size: 1.25rem; line-height: 1.3; }
}

/* --- Home page article list with pictures (2026-12-02): the article's illustration beside its title and summary --- */
.post-entry.has-thumb { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; align-items: start; }
.post-entry .entry-thumb { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; border: 1px solid #E2DCCE; margin: 0; }
.dark .post-entry .entry-thumb { border-color: #2A2F3A; }
.post-entry .entry-body { min-width: 0; }
@media (max-width: 600px) {
  .post-entry.has-thumb { grid-template-columns: 1fr; gap: 0.75rem; }
  .post-entry .entry-thumb { aspect-ratio: 16 / 9; }
}

/* --- Accelerator pages: link to the working tool in the playground (2026-12-02) --- */
.try-tool { margin: 1rem 0 1.5rem; padding: 0.9rem 1.1rem; border: 1px solid #E2DCCE; border-left: 4px solid #B4441F; border-radius: 8px; background: #F7F5F0; }
.dark .try-tool { background: #1F2633; border-color: #2A2F3A; border-left-color: #B4441F; }
.try-tool a { font-weight: 600; color: #B4441F; text-decoration: none; }
.dark .try-tool a { color: #F2A65A; }
.try-tool span { font-size: 0.92rem; color: var(--secondary); }

/* --- Readers: like, share, subscribe and comments (2026-12-02; layouts/partials/engage.html) --- */
.engage { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #E2DCCE; }
.dark .engage { border-top-color: #2A2F3A; }
.engage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.like-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.9rem; border: 1px solid #E2DCCE; border-radius: 999px; background: transparent; color: var(--primary); font-size: 0.95rem; cursor: pointer; }
.like-btn[hidden] { display: none; }
.like-btn svg { fill: none; stroke: #B4441F; stroke-width: 2; }
.like-btn.liked svg { fill: #B4441F; }
.like-btn.liked { cursor: default; border-color: #B4441F; }
.dark .like-btn { border-color: #2A2F3A; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; font-size: 0.92rem; }
.share-label { color: var(--secondary); }
.share a, .share button { color: #B4441F; font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; font-size: inherit; cursor: pointer; box-shadow: none; }
.share button[hidden] { display: none; }
.dark .share a, .dark .share button { color: #F2A65A; }
.engage-title { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
.subscribe { margin-top: 1.75rem; padding: 1rem 1.2rem 0.6rem; border: 1px solid #E2DCCE; border-left: 4px solid #B4441F; border-radius: 8px; background: #F7F5F0; }
.dark .subscribe { background: #1F2633; border-color: #2A2F3A; border-left-color: #B4441F; }
.subscribe .engage-title { margin-top: 0; }
.subscribe-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.engage-form input, .engage-form textarea { width: 100%; padding: 0.55rem 0.7rem; border: 1px solid #D6CFBF; border-radius: 6px; background: var(--theme); color: var(--primary); font: inherit; }
.dark .engage-form input, .dark .engage-form textarea { border-color: #2A2F3A; }
.subscribe-form input[type=email] { flex: 1 1 220px; width: auto; }
.engage-form button { padding: 0.55rem 1.1rem; border: 0; border-radius: 6px; background: #B4441F; color: #fff; font-weight: 600; cursor: pointer; }
.engage-form button:disabled { opacity: 0.6; cursor: default; }
.comment-form { display: grid; gap: 0.35rem; margin-top: 1rem; }
.comment-form label { font-size: 0.9rem; color: var(--secondary); margin-top: 0.35rem; }
.comment-form button { justify-self: start; margin-top: 0.5rem; }
.engage-small { font-size: 0.85rem; color: var(--secondary); margin: 0.5rem 0 0; }
.engage-status { font-size: 0.92rem; font-weight: 600; margin: 0.4rem 0 0; min-height: 1.2em; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { padding: 0.8rem 0; border-bottom: 1px solid #E2DCCE; }
.dark .comment-list li { border-bottom-color: #2A2F3A; }
.comment-who { font-size: 0.9rem; color: var(--secondary); }
.comment-who strong { color: var(--primary); }
.comment-list p { margin: 0.35rem 0 0; white-space: pre-wrap; }
.comment-empty, .linkedin-discuss { color: var(--secondary); font-size: 0.95rem; }
.comment-empty[hidden], .linkedin-discuss[hidden] { display: none; }
.linkedin-discuss a { color: #B4441F; font-weight: 600; }
.home-subscribe { margin: 2rem 0; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* --- The article's LinkedIn post, embedded on request (2026-12-02) --- */
.linkedin-show { margin: 0.25rem 0 0.75rem; padding: 0.4rem 0.9rem; border: 1px solid var(--border); border-radius: 6px; background: var(--entry); color: var(--primary); cursor: pointer; font-size: 0.9rem; }
.linkedin-show[hidden] { display: none; }
.linkedin-embed iframe { width: 100%; max-width: 560px; height: 640px; border: 0; border-radius: 8px; background: var(--entry); }
.linkedin-more[hidden] { display: none; }
.linkedin-more ul { margin: 0.25rem 0 0.5rem 1.1rem; }

/* --- The header lines up with the article column: logo over its left edge, menu ending at its right (2026-12-02) --- */
.nav { max-width: calc(var(--main-width) + var(--gap) * 2); }

/* --- An article's series: the parts at the top, the next and previous at the bottom (2026-12-02) --- */
.series-box { margin: 0 0 1.25rem; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--entry); font-size: 0.95rem; }
.series-box summary { cursor: pointer; color: var(--secondary); }
.series-box summary strong { color: var(--primary); }
.series-box ol { margin: 0.6rem 0 0.4rem 1.2rem; }
.series-box li { margin: 0.2rem 0; }
.series-box a, .series-all a { color: #B4441F; }
.series-all { margin: 0; font-size: 0.9rem; }
.series-nav { display: flex; gap: 0.75rem; margin: 1.5rem 0 0.5rem; }
.series-nav a { flex: 1; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 8px; color: var(--primary); text-decoration: none; }
.series-nav a span { display: block; font-size: 0.8rem; color: var(--secondary); }
.series-nav .series-next { text-align: right; }
@media (max-width: 600px) { .series-nav { flex-direction: column; } .series-nav .series-next { text-align: left; } }
