/* ==========================================================================
   1. DESIGN TOKENS & SYSTEM VARIABLES
   ========================================================================== */
:root {
  --bg: #0a0e17; --panel: #101626; --panel-2: #0d1220; --text: #f5f7fb;
  --muted: #a8b1c3; --line: rgba(255, 255, 255, .08); --accent: #8fa0b5;
  --shadow: 0 18px 60px rgba(0, 0, 0, .45); --radius: 24px; --max: 1280px;
}

/* ==========================================================================
   2. GLOBAL RESET & BASE
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, Segoe UI, sans-serif; color: var(--text); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.container { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }

/* ==========================================================================
   3. NAVIGATION HEADER
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 1000; backdrop-filter: blur(12px); background: rgba(10, 14, 23, .75); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 96px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .4px; white-space: nowrap; }
.brand-badge { width: 50px; height: 50px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, rgba(143, 160, 181, .01), rgba(143, 160, 181, .06)); color: var(--accent); border: 1px solid rgba(143, 160, 181, .25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); }
.brand-logo { width: 100%; height: 100%; transform: scale(1.5); object-fit: contain; display: block; padding: 2px; }
.brand small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-item { position: relative; }
.nav-link, .nav-button { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; color: #e8edf7; font-weight: 600; font-size: 14px; }
.nav-link:hover, .nav-button:hover, .nav-link.active, .nav-button.active { background: rgba(143, 160, 181, .12); color: #fff; }
.caret { font-size: 12px; color: var(--muted); }
.dropdown { position: absolute; left: 0; top: 100%; min-width: 220px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: rgba(16, 22, 38, .98); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .2s ease; display: grid; gap: 6px; }
.dropdown a { padding: 10px 12px; border-radius: 12px; color: #e9eef8; font-weight: 600; font-size: 14px; }
.dropdown a:hover, .dropdown a.active { background: rgba(255, 255, 255, .06); }
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(8px); }
.nav-toggle { display: none; }
.hamburger { display: none; cursor: pointer; width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); align-items: center; justify-content: center; }
.hamburger span, .hamburger span:before, .hamburger span:after { display: block; width: 20px; height: 2px; background: #fff; position: relative; border-radius: 2px; content: ""; }
.hamburger span:before { position: absolute; top: -6px; left: 0; }
.hamburger span:after { position: absolute; top: 6px; left: 0; }

/* ==========================================================================
   4. HERO SECTION
   ========================================================================== */
.hero { padding: 54px 0 28px; }
.hero-card { display: grid; grid-template-columns: 1.4fr 0.6fr; align-items: stretch; border: 1px solid var(--line); border-radius: 32px; overflow: hidden; background: linear-gradient(135deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .005)); box-shadow: var(--shadow); min-height: 480px; }
.hero-copy { padding: 48px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .26em; font-size: 12px; font-weight: 800; }
.hero h1, .page-hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 800; line-height: 1.1; margin: 4px 0 8px; letter-spacing: -.035em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); }
.hero .name-accent, .page-hero .name-accent { color: var(--accent); font-weight: 400; opacity: 0.95; }
.hero p.lead, .page-hero p.lead { max-width: 100%; color: #cbd5e1; font-size: 1.05rem; line-height: 1.65; margin: 20px 0 0; letter-spacing: 0.15px; text-align: justify; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; color: #d7e4f4; font-weight: 600; }
.meta-pill { border: 1px solid rgba(143, 160, 181, .15); color: #d0def0; background: rgba(255, 255, 255, 0.01); padding: 7px 12px; border-radius: 999px; font-size: .88rem; letter-spacing: 0.2px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.portrait-wrap { height: 100%; width: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; background: radial-gradient(400px 400px at 50% 50%, rgba(143, 160, 181, 0.12), rgba(10, 14, 23, 0.75) 85%), linear-gradient(180deg, rgba(16, 22, 38, 0.4), rgba(10, 14, 23, 0.9)); border-left: 1px solid var(--line); overflow: hidden; }
.portrait-img { width: 95%; height: 95%; object-fit: contain; object-position: center top; display: block; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s ease; }
.hero-card:hover .portrait-img { transform: scale(1.03); filter: brightness(1.05); }

/* ==========================================================================
   5. BUTTONS & INTERACTION COMPONENTS
   ========================================================================== */
.btn { padding: 13px 20px; border-radius: 16px; border: 1px solid var(--line); font-weight: 700; display: inline-flex; align-items: center; gap: 10px; transition: .2s ease; letter-spacing: 0.3px; cursor: pointer; }
.btn-primary { background: linear-gradient(145deg, rgba(143, 160, 181, .2), rgba(143, 160, 181, .08)); border-color: rgba(143, 160, 181, .3); color: #fff; }
.btn-secondary { background: rgba(255, 255, 255, .03); border-color: var(--line); color: var(--text); }
.btn:hover, .quicklinks a:hover, .contact-links a:hover { transform: translateY(-2px); box-shadow: 0 0 12px rgba(143, 160, 181, 0.25); }

/* ==========================================================================
   6. GRID SECTIONS & CARDS
   ========================================================================== */
section { padding: 22px 0 38px; }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; margin: 0; letter-spacing: -.025em; }
.section-head p { margin: 5px 0 0; color: var(--muted); line-height: 1.6; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { padding: 24px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255, 255, 255, .015), rgba(255, 255, 255, .005)); box-shadow: var(--shadow); display: flex; flex-direction: column; height: 100%; transition: 0.25s ease; cursor: pointer; }
.card:hover { transform: translateY(-6px); background: rgba(255, 255, 255, 0.02); border-color: rgba(143, 160, 181, 0.35); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(143, 160, 181, 0.05); }
.card h3 { margin: 10px 0 8px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.card p { margin: 0; color: #cbd5e1; font-size: 0.98rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.card .tag { display: inline-block; font-size: .75rem; color: var(--accent); text-transform: uppercase; letter-spacing: .2em; font-weight: 800; }
.card .btn { margin-top: 12px; align-self: flex-start; }

/* ==========================================================================
   7. PUBLICATIONS INNER SECTION
   ========================================================================== */
.publication-card { cursor: pointer; }
.abstract-title { font-weight: 1000; letter-spacing: .07em; font-size: 14px; margin-bottom: 10px; }
.pub-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.pub-icons { display: flex; gap: 10px; }
.pub-icons a { width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 12px; font-weight: 700; border: 1px solid rgba(143, 160, 181, .25); background: rgba(143, 160, 181, .08); transition: .2s; }
.pub-icons a:hover { background: rgba(143, 160, 181, .18); transform: translateY(-2px); }
.pub-abstract { max-height: 0; overflow: hidden; transition: max-height 0.1s ease; border-top: 2px solid var(--line); margin-top: 12px; padding-top: 14px; }
.pub-abstract p { margin: 12px 0 0; color: var(--muted); }
.publication-card.active .pub-abstract { max-height: 300px; }

/* ==========================================================================
   8. FOOTER & SOCIAL ICONS
   ========================================================================== */
.footer { padding: 20px 0 54px; color: var(--muted); }
.footer-card { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; border: 1px solid var(--line); border-radius: 24px; padding: 18px 20px; background: rgba(255, 255, 255, .01); }
.social-footer { display: flex; justify-content: center; gap: 20px; }
.social-footer img { width: 28px; height: 28px; object-fit: contain; filter: brightness(0) invert(1); transition: 0.2s; }
.social-footer img[alt="ResearchGate"] { filter: none; }
.social-footer img:hover { transform: scale(1.2); opacity: 0.8; }
/* ==========================================================================
   9. SUB-PAGES & INFRASTRUCTURE
   ========================================================================== */

/* --- 9.1 Layout Containers --- */
.sub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.about-story { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; align-items: start; }

/* --- 9.2 About Component --- */
.about-photo { border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: linear-gradient(145deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01)); box-shadow: var(--shadow); padding: 20px; }
.about-photo img { width: 100%; height: auto; object-fit: contain; border-radius: 18px; }
.about-photo p { margin: 16px 0 0; padding: 0; text-align: center; color: var(--muted); font-style: italic; font-weight: 600; background: none; border: none; }
.about-copy { padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01)); box-shadow: var(--shadow); max-width: 800px; margin: 0 auto; }
.about-copy h3 { margin: 10px 0 18px; font-size: 1.6rem; color: #fff; }
.about-copy p { color: #cbd5e1; margin: 0 0 20px; font-size: 1.05rem; line-height: 1.75; text-align: left; }
.about-copy > p:first-of-type::first-letter { font-size: 2.8rem; font-weight: 800; float: left; line-height: 1; margin-right: 10px; color: #fff; }

/* --- 9.3 Problem-Solving & Method System --- */
.method-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel-2); margin: 28px 0; }
.method-card h4 { margin: 0 0 16px; font-size: 1.1rem; color: #fff; }
.method-card p { margin: 16px 0 0; color: var(--muted); }
.method-list { display: flex; flex-wrap: wrap; gap: 10px; }
.method-list span { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(143, 160, 181, .25); background: rgba(143, 160, 181, .08); color: var(--text); font-weight: 600; font-size: 0.9rem; transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); }
.method-list span:hover { background: rgba(143, 160, 181, 0.2); border-color: rgba(143, 160, 181, 0.5); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(143, 160, 181, 0.15); }

/* --- 9.4 Contact Page Systems --- */
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.contact-card { min-height: 340px; display: flex; flex-direction: column; justify-content: space-between; padding: 32px; }
.card-body { display: flex; flex-direction: column; gap: 12px; }
.contact-title { margin: 4px 0 0 0 !important; font-size: 1.35rem; line-height: 1.3; color: #fff; word-break: break-all; }
.contact-paragraph { margin: 4px 0 0 0 !important; font-size: 0.94rem; line-height: 1.6; color: var(--muted); display: block !important; -webkit-line-clamp: none !important; overflow: visible !important; }
.contact-links { margin-top: 28px; display: flex; flex-direction: column; }
.contact-links .btn { width: 100%; justify-content: center; padding: 12px 16px; font-size: 14px; }
.profile-buttons-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.profile-buttons-grid .btn { padding: 10px 8px; font-size: 13px; }

/* --- 9.5 Journal Engine & Sidebar --- */
.stats-ribbon-section { padding: 0 0 20px 0; }
.stats-ribbon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel-2); padding: 24px; text-align: center; }
.stat-ribbon-item { display: flex; flex-direction: column; gap: 4px; }
.stat-ribbon-item:not(:last-child) { border-right: 1px solid var(--line); }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.journal-feed-section { padding: 20px 0 60px 0; }
.journal-layout-grid { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 32px; align-items: start; }
.feed-section-title { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.15em; color: var(--muted); margin: 0 0 20px 0; text-transform: uppercase; }
.journal-feed-left { display: flex; flex-direction: column; gap: 20px; }
.journal-post-card { padding: 32px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255, 255, 255, .015), rgba(255, 255, 255, .005)); box-shadow: var(--shadow); transition: opacity 0.3s ease, transform 0.3s ease;}
.post-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.post-tag-pill { font-size: 0.75rem; font-weight: 800; color: #fff; background: rgba(143, 160, 181, 0.15); border: 1px solid rgba(143, 160, 181, 0.25); padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.post-date { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.post-title { margin: 0 0 12px 0; font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: #fff; }
.post-text { margin: 0 !important; color: #cbd5e1 !important; font-size: 1.02rem !important; line-height: 1.65 !important; display: block !important; -webkit-line-clamp: none !important; overflow: visible !important; }
.feed-footer-note { text-align: center; padding: 24px; border: 1px dashed var(--line); border-radius: 16px; }
.feed-footer-note p { margin: 0; font-size: 0.92rem; color: var(--muted); font-style: italic; }
.sidebar-sticky-wrapper { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 20px; }
.hobby-sidebar-card { padding: 24px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel-2); }
.hobby-sidebar-card .tag { font-size: 0.72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 8px; }
.hobby-sidebar-card h3 { margin: 0 0 10px 0; font-size: 1.15rem; font-weight: 700; color: #fff; }
.hobby-sidebar-card p { margin: 0; font-size: 0.94rem; line-height: 1.55; color: #cbd5e1; }

/* --- 9.6 Sub-Portal & Utility Components --- */
.timeline { display: grid; gap: 16px; }
.timeline-item { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .015); }
.timeline-item strong { font-size: 1.05rem; }
.timeline-item span { display: block; color: var(--muted); font-size: .96rem; margin-bottom: 8px; }
.skills { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(143, 160, 181, .18); color: #dffeff; font-weight: 700; }
.list { display: grid; gap: 12px; padding-left: 18px; }
.list li { color: #d7e0ee; }
.tiny { font-size: .9rem; }
.kicker-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.kicker { padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); color: #d7e4f4; font-weight: 600; font-size: .92rem; }
.quicklinks { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.quicklinks a { padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(143, 160, 181, .35); background: linear-gradient(145deg, rgba(143, 160, 181, .22), rgba(143, 160, 181, .12)); color: #fff; font-weight: 700; transition: .2s ease; }
.image-caption { text-align: center; font-weight: 700; letter-spacing: .08em; padding: 18px; border: 1px solid rgba(143, 160, 181, .18); border-radius: 18px; background: rgba(143, 160, 181, .06); margin-top: 18px; margin-bottom: 0px; }
.page-hero { padding: 54px 0 24px; }
.page-hero-card { padding: 38px 36px; border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(135deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01)); box-shadow: var(--shadow); }

/* ==========================================================================
   10. MATRIX DASHBOARD & METADATA SPREAD
   ========================================================================== */
.matrix-filter-dashboard { background: var(--panel-2); border: 1px solid var(--line); padding: 18px 24px; border-radius: 20px; margin-bottom: 40px; display: flex; flex-direction: column; gap: 16px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; }
.filter-row.row-combined { border-bottom: 1px solid rgba(255, 255, 255, .04); padding-bottom: 14px; }
.filter-divider { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.matrix-btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

.matrix-btn { background: rgba(255, 255, 255, .01); border: 1px solid var(--line); color: #cbd5e1; padding: 6px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600; cursor: pointer; transition: .2s; white-space: nowrap; }
.matrix-btn:hover { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .15); color: #fff; }
.matrix-btn.active { background: #fff; border-color: #fff; color: #0a0e17; font-weight: 700; }

.matrix-btn.master-reset { border-radius: 10px; background: rgba(143, 160, 181, .04); border-color: rgba(143, 160, 181, .15); }
.matrix-btn.master-reset.active { background: #fff; border-color: #fff; color: #0a0e17; }

/* Post Metadata Dual Alignment */
.post-meta { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 12px; margin-bottom: 14px; }
.meta-left, .meta-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.post-tag-pill.focus-tag { font-size: .75rem; font-weight: 600; color: var(--muted); border: 1px dashed var(--line); padding: 4px 10px; border-radius: 999px; }

/* Responsive Scaling */
@media (max-width: 991px) {
  .filter-divider { display: none; }
  .matrix-btn-group, .filter-row { width: 100%; }
  .matrix-btn, .matrix-btn.master-reset { flex-grow: 1; text-align: center; }
  
  .post-meta { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
  .meta-left, .meta-right { width: 100%; justify-content: flex-start; }
  .meta-right { border-bottom: 1px solid rgba(255,255,255,.03); padding-bottom: 6px; }
}

/* ==========================================================================
   11. MEDIA QUERIES (RESPONSIVE VIEWPORTS)
   ========================================================================== */
@media (max-width: 980px) {
  .hero-card { grid-template-columns: 1fr; } 
  .hero-copy { padding: 40px 32px; }
  .portrait-wrap { border-left: none; border-top: 1px solid var(--line); min-height: 440px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills, .about-story { grid-template-columns: 1fr; }
  .about-photo { position: static; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-layout-grid { grid-template-columns: 1fr; gap: 40px; }
  .sidebar-sticky-wrapper { position: static; }
}

@media (max-width: 820px) {
  .hamburger { display: flex; }
  .nav { display: none; position: absolute; left: 16px; right: 16px; top: 96px; padding: 12px; border-radius: 22px; background: rgba(10, 14, 23, .98); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav-toggle:checked ~ .nav { display: grid; }
  .nav-item { width: 100%; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; background: transparent; padding: 4px 0 0 18px; min-width: 0; }
  .nav-item:hover .dropdown { transform: none; }
  .nav-link, .nav-button { justify-content: space-between; width: 100%; }
  .header-inner { position: relative; }
}

@media (max-width: 640px) {
  .brand-badge { width: 58px; height: 58px; }
  .header-inner { min-height: 90px; }
  .nav { top: 90px; }
  .hero-copy { padding: 32px 20px; }
  .hero p.lead { font-size: 0.98rem; line-height: 1.6; text-align: left; }
  .cards, .sub-grid, .contact-grid { grid-template-columns: 1fr; }
  .contact-card { min-height: auto; }
  .about-copy { padding: 22px; }
  .about-photo img { aspect-ratio: 4 / 4.6; }
  .quicklinks a { width: 100%; justify-content: center; }
  .hero h1, .page-hero h1 { font-size: 2.4rem; } 
  .page-hero-card { padding: 28px 22px; }
  .stats-ribbon-grid { grid-template-columns: 1fr; gap: 20px; }
  .stat-ribbon-item:not(:last-child) { border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .journal-post-card { padding: 24px; }
  .filter-dashboard-wrapper { flex-direction: column; align-items: start; gap: 12px; padding: 16px; }
  .filter-buttons-group { width: 100%; }
  .filter-btn { width: 100%; text-align: center; }
}

@media (max-width: 640px) {
  .post-photo-grid.layout-triple,
  .post-photo-grid.layout-multi,
  .post-photo-grid.layout-dual {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }
  .post-photo-grid .grid-photo-item {
    grid-row: auto !important;
    aspect-ratio: 16 / 10 !important;
  }
}
/* ==========================================================================
   12. AUTOMATED PHOTO GRID MATRIX & LIGHTBOX ENGINE
   ========================================================================== */

/* --- 12.1 Grid Base & Layout Variations --- */
.post-photo-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-template-rows: repeat(auto-fill, minmax(140px, 1fr));
  max-height: 320px;
  grid-auto-rows: 150px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-photo-grid.expanded { max-height: none; }

.grid-photo-item {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.grid-photo-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.grid-photo-item:hover img { transform: scale(1.05); }

/* --- 12.2 Specific Layout Logic --- */
.post-photo-grid.layout-single { grid-template-columns: 1fr; }
.post-photo-grid.layout-single .grid-photo-item { aspect-ratio: 16 / 9; }

.post-photo-grid.layout-dual { grid-template-columns: 1fr 1fr; }
.post-photo-grid.layout-dual .grid-photo-item { aspect-ratio: 4 / 3; }

.post-photo-grid.layout-triple { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-photo-grid.layout-triple .grid-photo-item:nth-child(1) { grid-row: span 2; aspect-ratio: 4 / 3; }
.post-photo-grid.layout-triple .grid-photo-item:not(:nth-child(1)) { aspect-ratio: 3 / 2; }

.post-photo-grid.layout-multi { grid-template-columns: repeat(2, 1fr); }
.post-photo-grid.layout-multi .grid-photo-item { aspect-ratio: 3 / 2; }

/* --- 12.3 Lightbox Engine --- */
.lightbox {
  position: fixed;
  z-index: 99999;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 80vh; cursor: zoom-out; }

.lb-prev, .lb-next, .lb-close { position: absolute; color: transparent; font-size: 2rem; cursor: pointer; padding: 20px; z-index: 10; }
.lb-prev, .lb-next { top: 0; height: 100%; width: 15%; display: flex; align-items: center; }
.lb-prev { left: 0; justify-content: flex-start; }
.lb-next { right: 0; justify-content: flex-end; }
.lb-close { top: 20px; right: 20px; }
.lb-prev:hover, .lb-next:hover { color: white; background: rgba(255, 255, 255, 0.05); }

/* --- 12.4 Controls --- */
.view-all-wrapper { display: flex; justify-content: flex-end; margin-top: 8px; }
.view-all-btn {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: 0.1s;
}

/* ==========================================================================
   13. Education
   ========================================================================== */


.education-split { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 48px; 
  padding-bottom: 60px;
}

.section-title { font-size: 1.5rem; margin-bottom: 24px; color: var(--accent); }

.edu-timeline { 
  display: flex; flex-direction: column; gap: 24px; 
  border-left: 2px solid var(--line); padding-left: 24px;
}

.edu-card { position: relative; }
.edu-card::before { 
  content: ""; position: absolute; left: -31px; top: 0; 
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
}

.edu-date { font-size: 0.8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.edu-card h3 { margin: 4px 0; font-size: 1.2rem; }
.edu-institution { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.edu-detail { font-size: 0.95rem; color: var(--muted); }

.cert-link { font-size: 0.85rem; color: var(--accent); font-weight: 700; }

@media (max-width: 820px) {
  .education-split { grid-template-columns: 1fr; }
}

.edu-full-section { padding: 40px 0 80px; }
.edu-timeline-full { border-left: 2px solid var(--line); padding-left: 32px; display: flex; flex-direction: column; gap: 48px; }

.edu-card-full { position: relative; }
.edu-card-full::before { 
  content: ""; position: absolute; left: -39px; top: 0; 
  width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg); background: var(--accent);
}
/* Reduce the gap between Program Name and Institution */
.edu-card-full h3 {
  margin-bottom: 5px !important; /* Tightens space below the title */
  line-height: 1.2;
}

.edu-institution {
  margin-top: 0 !important;      /* Removes extra space above institution */
  margin-bottom: -10px !important; /* Keeps a small gap before the grades */
  font-size: 1rem;
}
.edu-date { font-size: 0.75rem; font-weight: 800; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; }
.edu-card-full h3 { margin: 6px 0; font-size: 1.4rem; }
.edu-institution { color: var(--text); font-weight: 600; margin-bottom: 8px; font-size: 1.05rem; }
/* Ensure the department line has proper spacing */
.edu-card-full .edu-detail {
  margin-top: 15px !important; 
}
.course-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.course-pill { 
  padding: 5px 12px; background: rgba(255, 255, 255, 0.03); 
  border: 1px solid var(--line); border-radius: 6px; 
  font-size: 0.8rem; color: var(--muted);
}
.course-toggle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.course-toggle:hover { background: rgba(255, 255, 255, 0.06); }
.course-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 10px; }
/* Fix spacing inside collapsible details */
details summary { margin-bottom: 10px; }
details h4 { 
  margin: 24px 0 10px 0 !important; /* Added space above each subsection */
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
details h4:first-of-type { margin-top: 10px !important; }


/* Styling for the course list container */
.course-grid { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-top: -10px; 
  padding-bottom: 24px; 
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Separator line */
  margin-bottom: 8px;
}

/* REMOVED: .course-grid:last-of-type { border-bottom: none; } */

/* Clean H4 headings */
details h4 { 
  margin: 20px 0 5px 0 !important; 
  font-size: 0.85rem; 
  color: var(--accent);
  border-bottom: none !important;
}