/* ===================================================================
   Refactored Stylesheet
   ===================================================================
   - Organized by H. Peter Hong, HTML CSS Builder
   -
   - This stylesheet has been restructured for improved readability,
   - maintainability, and scalability.
   -
   - Table of Contents:
   - 1. Global & Body Styles
   - 2. Navigation & Links
   - 3. Main Layout & Content Containers
   - 4. Typography & Basic Elements
   - 5. Component: Video & Notes
   - 6. Component: Image Gallery & Lightbox
   - 7. Component: LinkedIn & Article Styles
   - 8. Utility Classes
   - 9. Consolidated Media Queries
   =================================================================== */

/* =================================
   1. Global & Body Styles
   ================================= */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f0faf9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.lightbox-active-scroll-lock {
    overflow: hidden;
}

body.standalone-article {
	background: #e9f5f3;
	font-family: system-ui, sans-serif;
}

body.standalone-article .main-content {
  align-items: stretch; 
  justify-content: flex-start;
}

body.standalone-article .post-article {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
	padding: 1.5rem 2rem;
	margin: 2.5rem auto;
	max-width: 800px;
	color: #222;
}

body.standalone-article .linkedin-card,
body.standalone-article .video-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

body.standalone-article .linkedin-card .video-container {
  margin-left:-2rem;
  margin-right:-2rem;
  width:calc(100% + 4rem);
}

body.standalone-article #000 .linkedin-content {
  padding-left: 0;
  padding-right: 0;
}

/* =================================
   2. Navigation & Links
   ================================= */
nav {
    background-color: #2C8B80;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 1;
}

.back-link {
    display: inline-block;
    margin: 0;
    font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: white;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.back-link:hover,
.back-link:focus {
    color: #4ED2B1;
    text-decoration: underline;
}

.back-link::before {
    content: "⇐ ";
    font-weight: 900;
}

.footer-section {
	margin: 0;
    text-align: center;
}

.footer-back-link {
    display: inline-block;
    margin: 0;
    font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2C8B80;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s, color 0.2s;
}

.footer-back-link:hover,
.footer-back-link:focus {
    opacity: 1;
    color: #247166; 
    text-decoration: underline;
}

.footer-back-link::before {
    content: "⇐ ";
    font-weight: 900;
}

/* =================================
   3. Main Layout & Content Containers
   ================================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: left;
    max-width: 900px; /* Note: This overrides a previous max-width of 600px */
    width: 90%;
    margin: 0 auto; 
}

.content-section {
	background-color: #fff;
	border-radius: 10px;
	border: 1px solid #eee;
	padding: 25px 35px;
	margin: 30px auto;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	max-width: 900px;
	box-sizing: border-box;
	transition: box-shadow 0.3s ease;
}

.content-section:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =================================
   4. Typography & Basic Elements
   ================================= */
h1, h2, h3 {
    color: #2C8B80;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
}

p {
    color: #4b5563;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

hr {
	margin: 1rem auto;
	width: 50%; 
}

.underlined {
	border-bottom: 2px solid #1a4157;
    margin-bottom: 1.5rem; 
}

.h-sub { 
    font-style: italic;
    font-weight: 400;
    font-size: 0.8em;
    color: #1e8e7a;
    margin-left: 0.4ch;
}

/* =================================
   5. Component: Video & Notes
   ================================= */
.video-container {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* 16:9 aspect ratio */
	height: 0;
	overflow: hidden;
	border-radius: 8px; 
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.video-notes {
	background-color: #fff;
	border: 1px solid #e0eeeb;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	padding: 1rem 2rem 0 2rem;
	margin: 1rem auto 0 auto;
	max-width: 800px;
	color: #374151;
	font-size: 0.97rem;
	line-height: 1.6;
}

.video-notes h3 {
	color: #2C8B80;
	margin-top: 0;
	margin-bottom: 1rem;
	font-size: 1.2rem;
	font-weight: 600;
	border-bottom: 2px solid #1e8e7a;
	display: inline-block;
	padding-bottom: 0.2rem;
}

.video-notes p {
	margin-bottom: 1rem;
}

.video-notes a {
	color: #0073b1; 
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px dashed rgba(0, 115, 177, 0.4);
	transition: color 0.2s, border-color 0.2s;
}

.video-notes a:hover,
.video-notes a:focus {
	color: #005582;
	border-color: #005582;
	text-decoration: underline;
}

.video-timeline {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
}

.video-timeline li {
	margin-bottom: 0.3rem;
	line-height: 1.4;
}

.video-timeline a {
	color: #0073b1;
	text-decoration: none;
	border-bottom: 1px dotted rgba(0,115,177,0.4);
	font-weight: 500;
	transition: color 0.2s, border-color 0.2s;
}

.video-timeline a:hover,
.video-timeline a:focus {
	color: #116466;
	border-color: #116466;
	text-decoration: underline;
}

.credit-note {
	font-size: 0.85rem;
	color: #555;
	margin-top: 0.8rem;
	text-align: center;
}

/* =================================
   6. Component: Image Gallery & Lightbox
   ================================= */
.image-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1rem;
	max-width: 1200px;
	margin: 2rem auto;
}

.image-gallery figure {
	margin: 0;
	text-align: center;
	overflow: hidden;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-gallery img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.3s ease;
}

.image-gallery img:hover {
	transform: scale(1.05); 
}

.image-gallery figcaption {
	font-size: 0.9rem;
	color: #555;
	margin-top: 0.75rem;
	padding: 0 0.5rem;
}

.image-gallery .gallery-item {
	width: 100%;
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.image-gallery .gallery-item:hover {
	transform: scale(1.03);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* --- Lightbox --- */
:root {
  --lightbox-bg: rgba(0, 0, 0, 0.85);
  --lightbox-btn-bg: rgba(0, 0, 0, 0.3);
  --lightbox-btn-hover-bg: rgba(0, 0, 0, 0.5);
  --lightbox-btn-color: white;
  --lightbox-transition-speed: 0.2s;
  --lightbox-z-index-overlay: 1000;
  --lightbox-z-index-buttons: 1001;
}

#lightbox-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--lightbox-bg);
	z-index: var(--lightbox-z-index-overlay);
	display: none;
    padding: 0;
    box-sizing: border-box;
}

#lightbox-overlay.active {
	display: block;
}

.lightbox-content {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

#lightbox-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	border-radius: 4px;
	box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.lightbox-btn {
	color: var(--lightbox-btn-color);
	cursor: pointer;
	z-index: var(--lightbox-z-index-buttons);
	background-color: var(--lightbox-btn-bg);
	border: none;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color var(--lightbox-transition-speed);
	font-size: 2.5rem;
    font-family: sans-serif;
	line-height: 1;
	user-select: none;
    flex-shrink: 0;
}

.lightbox-btn:hover {
	background-color: var(--lightbox-btn-hover-bg);
}

#prev-btn {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
}

#next-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
}
			
#lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
    padding-bottom: 4px;
}

/* =================================
   7. Component: LinkedIn & Article Styles
   ================================= */
article {
	background-color: #fdfdfd;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

article h2 {
	display: inline-block;
	margin: 0;
	font-size: 1.4rem;
	font-weight: 700;
	color: #005b5b;
	white-space: nowrap;
}

article h4 {
	color: #1e8e7a;
	margin: 0 0 1rem;
	font-size: 1.05rem;
}

article h5 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
}

article p {
	margin: 0 0 0.6rem;
	line-height: 1.45;
	font-size: 0.95rem;
}

.linkedin-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 0.9em;
    margin-top: 1em;
}

body.standalone-article .linkedin-footer {
	border-top: 1px solid #eee;
	padding-top: 1rem;
	margin-top: 1.5rem;
	font-size: 0.9rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

body.standalone-article .linkedin-footer a {
	color: #0073b1;
	text-decoration: none;
}

body.standalone-article .linkedin-footer .copy-btn {
	background: #eef7f6;
	border: 1px solid #aad4cf;
	border-radius: 4px;
	padding: 0.4rem 0.8rem;
	cursor: pointer;
}

/* =================================
   8. Utility Classes
   ================================= */
.visually-hidden {
	position:absolute;
	left:-9999px;
	width:1px;
	height:1px;
	overflow:hidden;
}

/* ===============================================================
   9. Consolidated Media Queries
   =============================================================== */

/* Medium devices (tablets, etc. up to 768px) */
@media (max-width: 768px) {
	#prev-btn {
        left: 0.5rem;
    }

    #next-btn {
        right: 0.5rem;
    }

	#lightbox-close {
		top: 10px;
		right: 10px;
        background-color: var(--lightbox-btn-hover-bg);
	}
}

/* Standard mobile phones (up to 600px) */
@media (max-width: 600px) {
    .back-link {
        display: block;
        font-size: 0.9rem;
    }

	.video-notes {
		margin-top: 0.8rem;
		padding: 0.8rem 1rem 1.2rem;
	}
	
	.video-notes h3 {
		font-size: 1.05rem;
	}
	
	.video-timeline li {
		margin-bottom: 0.25rem;
		font-size: 0.95rem;
	}
	
	.credit-note {
		font-size: 0.8rem;
	}

	.image-gallery {
		gap: 1rem;
	}

	.image-gallery figcaption {
		font-size: 0.85rem;
	}
	
	.lightbox-btn {
		width: 40px;
		height: 40px;
		font-size: 2rem;
	}
}