/* ===========================
   CSS Reset & Base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===========================
   Custom Properties
   =========================== */
:root {
  --bg:          #F8F5F1;
  --surface:     #FFFFFF;
  --border:      #DDD6CE;
  --text:        #2A2218;
  --muted:       #7A6C5E;
  --accent:      #5C4F43;
  --accent-soft: #EDE6DC;
  --accent-dark: #3A2E24;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hero:  'DM Serif Display', serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --max-width: 960px;
  --nav-height: 56px;
  --radius: 8px;

  --color-code-bg:  #EDE6DC;
  --color-code-text: #2A2218;
  --theme-dot-border: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-links a,
  .footer-links a,
  .card,
  .nav-toggle span,
  .news-table tbody tr {
    transition: none;
  }

  .card:hover {
    transform: none;
    border-color: var(--border);
  }
}

/* ===========================
   Base Typography
   =========================== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 500;
  margin-top: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Always underline prose links so they're visible on low-contrast themes */
p a, li a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li { margin-bottom: 0.3rem; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  border: none;
  border-top: 0.5px solid var(--border);
  margin: 2rem 0;
}

/* Inline SVG icons (replaces Font Awesome) — sized by font-size, colored by currentColor */
svg.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}

/* ===========================
   Layout
   =========================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding: 5rem 0;
}

/* ===========================
   Navigation (al-folio tab style)
   =========================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
}

.nav-brand:hover {
  text-decoration: none;
  color: var(--accent);
  transition: color 0.2s ease;
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  height: 100%;
}

.nav-links li {
  display: flex;
  align-items: stretch;
  margin-bottom: 0;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.nav-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0.5px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: box-shadow 0.15s ease;
}

.theme-dot.active {
  box-shadow: 0 0 0 1.5px var(--accent);
}

.theme-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-dot-dark-mono {
  border: 0.5px solid var(--theme-dot-border);
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: var(--surface);
  border-top: 0.5px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.83rem;
  margin: 0;
  line-height: 1.4;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  transition: color 0.15s;
}

.footer-links-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.footer-faith-note {
  color: var(--muted);
  font-size: 0.83rem;
  text-align: center;
  flex: 1;
  margin: 0;
  line-height: 1.4;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===========================
   Editor
   =========================== */
.page-content-editor {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2.5rem;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.editor-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.editor-field-inline {
  justify-content: flex-end;
}

.editor-field label {
  font-weight: 500;
  color: var(--muted);
}

.editor-field input[type="text"],
.editor-field input[type="datetime-local"] {
  border-radius: 4px;
  border: 0.5px solid var(--border);
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.editor-body textarea {
  width: 100%;
  border-radius: 6px;
  border: 0.5px solid var(--border);
  padding: 0.6rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
}

.toastui-editor-defaultUI {
  border-radius: 6px;
  border: 0.5px solid var(--border);
}

.toastui-editor-defaultUI .toastui-editor-toolbar {
  border-bottom: 0.5px solid var(--border);
}

/* WYSIWYG pane: always light background, force dark text so dark themes
   don't bleed light-on-white inherited colors */
.toastui-editor-contents {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #222222;
  background: #FFFFFF;
}

/* Markdown pane: force readable colors so dark themes don't cause
   light-on-white or dark-on-dark text */
.toastui-editor-md-container {
  background: var(--surface);
}
.toastui-editor-md-container .toastui-editor-md-splitter {
  background-color: var(--border);
}
.toastui-editor-defaultUI .ProseMirror {
  color: #222222;
}
.toastui-editor-md-container .CodeMirror {
  background: var(--surface);
  color: var(--text);
}
.toastui-editor-md-container .CodeMirror .cm-header {
  color: var(--text);
}
.toastui-editor-md-container .CodeMirror .cm-string,
.toastui-editor-md-container .CodeMirror .cm-link {
  color: var(--accent);
}

.editor-images {
  border-radius: 6px;
  border: 0.5px solid var(--border);
  padding: 0.75rem 0.9rem;
}

.editor-image-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.editor-image-row input[type="file"] {
  font-size: 0.8rem;
}

.editor-image-row input[type="text"] {
  flex: 1;
  min-width: 120px;
  border-radius: 4px;
  border: 0.5px solid var(--border);
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.editor-actions {
  display: flex;
  gap: 0.75rem;
}

.editor-actions button,
.editor-image-row button {
  border-radius: 4px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.editor-actions button#save-post {
  border-color: var(--accent);
}

.editor-post-list {
  font-size: 0.85rem;
}

.editor-posts {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0 0;
  border-radius: 6px;
  border: 0.5px solid var(--border);
}

.editor-post-item {
  padding: 0.45rem 0.7rem;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
}

.editor-post-item:last-child {
  border-bottom: none;
}

.editor-post-item:hover {
  background: var(--surface);
}

.editor-post-item.editor-post-error {
  color: var(--muted);
  font-size: 0.8rem;
  cursor: default;
}
.editor-post-item.editor-post-error:hover {
  background: transparent;
}
.editor-post-item.editor-post-error code {
  font-size: 0.75rem;
  word-break: break-all;
}

.editor-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .page-content-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===========================
   Profile Section (al-folio style)
   =========================== */
.profile-section {
  display: flex;
  gap: 3rem;
  align-items: center;
  padding: 3rem 0 2.5rem;
}

.profile-left {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* CSS avatar (initials) — shown when no profile photo */
.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 3rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 0.5px solid var(--border);
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-name {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  font-weight: 400;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.profile-position {
  font-size: 0.875rem;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  margin: 0 0 1.1rem;
  line-height: 1.5;
}

.profile-social {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.profile-social a {
  color: var(--muted);
  font-size: 1.3rem;
  transition: color 0.15s;
  text-decoration: none;
}

.profile-social a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.profile-social a:hover {
  color: var(--accent);
}

.profile-faith-note {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-right {
  flex: 1;
  min-width: 0;
}

.profile-right p {
  font-size: 1rem;
  line-height: 1.65;
}

.profile-edu-line {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.profile-skills {
  margin: 1rem 0 0;
}

.profile-skills-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.25rem;
  margin-top: 0.5rem;
}

.profile-skills-label:first-child {
  margin-top: 0;
}

.profile-skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.profile-skills-row:last-child {
  margin-bottom: 0;
}

.profile-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.profile-contact-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.profile-contact-row a {
  color: var(--muted);
}

.profile-contact-row a:hover {
  color: var(--accent);
}

/* ===========================
   Content / Page Sections
   =========================== */
.content-section {
  margin-top: 2.75rem;
  padding-top: 2.25rem;
  border-top: 0.5px solid var(--border);
}

.content-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 0.5px solid var(--border);
  font-family: 'Inter', sans-serif;
}

/* ===========================
   Section Headers (blog/page headings)
   =========================== */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  margin: 0;
}

.section-header a {
  font-size: 0.875rem;
  color: var(--muted);
}

.section-header a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===========================
   Page Header (inner pages)
   =========================== */
.page-header {
  padding: 2.5rem 0 2rem;
  margin-bottom: 0;
}

.page-header h1 {
  margin: 0 0 0.3rem;
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  font-weight: 400;
}

.page-header .subtitle {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  margin: 0;
}

/* ===========================
   Cards (Projects)
   =========================== */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-soft);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 16px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
  font-family: 'Inter', sans-serif;
}

.card-date {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }

.card-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.card-description {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.card-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.card-links a {
  font-size: 0.85rem;
  color: var(--accent);
}

/* ===========================
   Tags
   =========================== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.tag,
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  font-family: 'Inter', sans-serif;
}

/* ===========================
   Blog / Post List
   =========================== */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  padding: 1.25rem 0;
  border-bottom: 0.5px solid var(--border);
}

.post-item:first-child { padding-top: 0; }
.post-item:last-child { border-bottom: none; }

.post-item-title {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 0.3rem;
  font-family: 'Inter', sans-serif;
}

.post-item-title a { color: var(--text); }
.post-item-title a:hover { color: var(--accent); text-decoration: none; }

.post-item-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.post-item-excerpt {
  font-size: 0.92rem;
  color: var(--muted);
}

/* ===========================
   Blog Post Page
   =========================== */
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 0.5px solid var(--border);
}

.post-header h1 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 2rem;
  font-family: 'Inter', sans-serif;
}

.post-date {
  font-size: 0.875rem;
  color: var(--muted);
}

.post-content {
  --text-width: 65ch;
  font-size: 1.02rem;
  font-family: 'Inter', sans-serif;
  max-width: min(var(--text-width), 100%);
  margin-left: auto;
  margin-right: auto;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: 'Inter', sans-serif;
}

.post-content h2,
.post-content h3 {
  margin-top: 2rem;
}

.post-content pre {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin: 1.25rem 0;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  color: var(--muted);
  font-style: italic;
}

.post-content img {
  display: block;
  margin: 1.25rem auto;
  border-radius: 6px;
  max-width: 70%;
  height: auto;
}

/* Images inserted by the editor: <figure class="post-image"> ... */
.post-content figure.post-image {
  max-width: min(calc(var(--text-width) * 0.75), 100%);
  margin: 1.25rem auto;
}
.post-content figure.post-image img {
  width: 100%;
  display: block;
  border-radius: 6px;
  margin-left: auto;
  margin-right: auto;
}
.post-content figure.post-image figcaption {
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
@media (max-width: 768px) {
  .post-content figure.post-image {
    max-width: 100%;
  }
}

/* Caption convention used by the editor:
   ![Caption](url)
   _Caption_
*/
.post-content p:has(> img) + p > em:only-child {
  display: block;
  text-align: center;
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 0.5px solid var(--border);
}

.post-nav a {
  font-size: 0.9rem;
  color: var(--muted);
}

.post-nav a:hover { color: var(--accent); }

/* ===========================
   Gallery Page
   =========================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.gallery-album-card {
  display: block;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-album-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  text-decoration: none;
}

.gallery-album-cover img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.gallery-album-info {
  padding: 0.75rem 1rem;
}

.gallery-album-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
  font-family: 'Inter', sans-serif;
}

.gallery-album-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

/* ===========================
   Album Detail Page
   =========================== */
.album-detail {
  max-width: 900px;
  margin: 0 auto;
}

.album-description {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 600px;
}

.album-grid {
  columns: 280px;
  column-gap: 1.2rem;
  margin-top: 1.5rem;
}

.album-photo {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.6rem 0.75rem;
  margin: 0 0 1.2rem 0;
  break-inside: avoid;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.album-photo:hover,
.album-photo:focus-within {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.album-photo-trigger {
  all: unset;
  display: block;
  width: 100%;
  cursor: zoom-in;
  border-radius: 4px;
}

.album-photo-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.album-photo img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.album-photo figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.55rem;
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .album-photo {
    transition: none;
  }
  .album-photo:hover,
  .album-photo:focus-within {
    transform: none;
  }
}

/* ===========================
   Album Lightbox
   =========================== */
.album-lightbox[hidden] {
  display: none;
}

.album-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  padding: 2rem 3.5rem;
  box-sizing: border-box;
}

.album-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  background: #000;
  display: block;
}

.album-lightbox-caption {
  color: #f0f0f0;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
  max-width: 80vw;
  margin: 1rem auto 0;
  min-height: 1.2em;
}

.album-lightbox-counter {
  color: rgba(240, 240, 240, 0.7);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  letter-spacing: 0.03em;
}

.album-lightbox-close,
.album-lightbox-prev,
.album-lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  color: #f0f0f0;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: 'Inter', sans-serif;
}

.album-lightbox-close:hover,
.album-lightbox-prev:hover,
.album-lightbox-next:hover,
.album-lightbox-close:focus-visible,
.album-lightbox-prev:focus-visible,
.album-lightbox-next:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}

.album-lightbox-close {
  top: 1rem;
  right: 1rem;
  font-size: 1.75rem;
}

.album-lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.album-lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.album-lightbox[data-single="true"] .album-lightbox-prev,
.album-lightbox[data-single="true"] .album-lightbox-next,
.album-lightbox[data-single="true"] .album-lightbox-counter {
  display: none;
}

@media (max-width: 600px) {
  .album-lightbox {
    padding: 1rem;
  }
  .album-lightbox-prev {
    left: 0.5rem;
  }
  .album-lightbox-next {
    right: 0.5rem;
  }
  .album-lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
  }
  .album-lightbox-img {
    max-width: 94vw;
    max-height: 72vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .album-lightbox-close,
  .album-lightbox-prev,
  .album-lightbox-next {
    transition: none;
  }
}

.album-nav {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.album-nav a {
  color: var(--accent);
  text-decoration: none;
}

.album-nav a:hover {
  text-decoration: underline;
}

/* Post page album section */
.post-album {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-album h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

/* ===========================
   Editor Album Section
   =========================== */
.editor-album {
  border-radius: 6px;
  border: 0.5px solid var(--border);
  padding: 0.75rem 0.9rem;
}

.editor-album-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.editor-album-upload-row input[type="file"] {
  font-size: 0.8rem;
}

.editor-album-upload-row button {
  border-radius: 4px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.editor-album-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.editor-album-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
  border: 0.5px solid var(--border);
  border-radius: 4px;
}

.editor-album-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.editor-album-item input[type="text"] {
  flex: 1;
  min-width: 120px;
  border-radius: 4px;
  border: 0.5px solid var(--border);
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.editor-album-item button {
  border-radius: 4px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--muted);
}

.editor-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.editor-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--muted);
}

.editor-tab.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ===========================
   Research / Publications
   =========================== */
.research-entry {
  padding: 1.5rem 0;
  border-bottom: 0.5px solid var(--border);
}

.research-entry:last-child { border-bottom: none; }

.research-entry h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  font-family: 'Inter', sans-serif;
}

.research-entry .research-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.research-entry .research-role {
  font-weight: 500;
  font-style: italic;
}

.publication {
  padding: 1.25rem 0;
  border-bottom: 0.5px solid var(--border);
}

.publication:last-child { border-bottom: none; }

.publication-title {
  font-weight: 500;
  margin-bottom: 0.3rem;
  font-family: 'Inter', sans-serif;
}

.publication-authors {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.publication-venue {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
}

/* ===========================
   Publication Tiles
   =========================== */
.pub-tile {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 0.5px solid var(--border);
}

.pub-tile:last-child { border-bottom: none; }

.pub-tile-image {
  width: 150px;
  min-height: 110px;
  flex-shrink: 0;
  align-self: flex-start;
  border-radius: 8px;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-tile-image .pub-tile-icon {
  font-size: 2.25rem;
  color: var(--accent);
  opacity: 0.6;
}

.pub-tile-body {
  flex: 1;
  min-width: 0;
}

.pub-tile-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 0.3rem;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
}

.pub-tile-title a { color: var(--text); }
.pub-tile-title a:hover { color: var(--accent); text-decoration: none; }

.pub-tile-authors {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.pub-tile-venue {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.5rem;
}

.pub-tile-description {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

/* ===========================
   CV / Resume Page
   =========================== */
.page-header-resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header-resume .resume-download {
  margin: 0;
}

.resume-download {
  margin: 0.75rem 0 0;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 0.5px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: var(--surface);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-download:hover {
  background: var(--accent-dark);
}

.resume-section {
  margin-bottom: 2.25rem;
}

.resume-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  margin-top: 0;
  font-family: 'Inter', sans-serif;
}

.resume-item {
  margin-bottom: 1.25rem;
}

.resume-item-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.resume-item-title {
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.resume-item-date {
  font-size: 0.875rem;
  color: var(--muted);
}

.resume-item-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* ===========================
   Skills list (inline tags)
   =========================== */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.skills-list li {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.65rem;
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 680px) {
  h1 { font-size: 1.5rem; }

  .profile-section {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0 1.5rem;
  }

  .profile-left {
    flex: none;
    width: 100%;
  }

  .profile-avatar {
    width: 130px;
    height: 130px;
    font-size: 2.5rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 0.5px solid var(--border);
    padding: 0.75rem 1.5rem;
    gap: 0;
    z-index: 90;
  }

  .nav-links li {
    align-items: center;
    background: var(--surface);
    width: 100%;
  }

  .nav-links a {
    padding: 0.6rem 0;
    width: 100%;
    border-bottom: 0.5px solid var(--border);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a.active {
    border-bottom-color: var(--border);
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: flex; }

  .footer-inner { flex-direction: column; text-align: center; }

  .card-grid { grid-template-columns: 1fr; }

  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-photos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .album-grid { columns: 1; }

  .post-nav { flex-direction: column; }

  .resume-item-header { flex-direction: column; }

  .profile-contact-row { flex-direction: column; gap: 0.5rem; }
}

/* ===========================
   Spotify Widget
   =========================== */
.spotify-widget {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.spotify-widget .spotify-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--accent);
}

.spotify-widget a {
  color: var(--muted);
}

.spotify-widget a:hover {
  color: var(--accent);
}

.spotify-time {
  color: var(--muted);
}

/* ===========================
   Announcements / News Table (al-folio style)
   =========================== */
.news-table {
  width: 100%;
  border-collapse: collapse;
}

.news-table thead th {
  width: 9rem;
  padding: 0.5rem 1.25rem 0.5rem 0;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: left;
  border-bottom: 0.5px solid var(--border);
}

.news-table thead th:last-child {
  width: auto;
}

.news-table tbody tr {
  border-bottom: 0.5px solid var(--border);
  transition: background-color 0.15s ease;
}

.news-table tbody tr:last-child {
  border-bottom: none;
}

.post-preview-table tbody tr:hover {
  background-color: var(--surface);
}

.news-date {
  width: 9rem;
  padding: 0.75rem 1.25rem 0.75rem 0;
  vertical-align: top;
  font-size: 0.825rem;
  color: var(--muted);
  white-space: nowrap;
}

.news-content {
  padding: 0.75rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
  vertical-align: top;
}

.news-content strong {
  font-weight: 500;
}

.post-preview-table .news-content a {
  font-weight: 500;
}

.post-preview-text {
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 680px) {
  .news-table thead {
    display: none;
  }

  .news-table,
  .news-table tbody,
  .news-table tr,
  .news-date,
  .news-content {
    display: block;
  }

  .news-date {
    padding: 0.75rem 0 0.15rem;
    width: auto;
  }

  .news-content {
    padding: 0 0 0.75rem;
  }

  .pub-tile {
    flex-direction: column;
  }

  .pub-tile-image {
    width: 100%;
    min-height: 140px;
    align-self: auto;
  }
}

/* ── announcement visibility ── */
.news-row-old {
  display: none;
}

.news-empty {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  padding: 0.25rem 0;
  margin: 0;
}

.news-more-btn {
  margin-top: 0.6rem;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 0;
  align-items: center;
  gap: 0.35rem;
}

.news-more-btn:hover {
  text-decoration: underline;
}
