/* * {
    border: black 1px solid !important;
} */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── Prevent horizontal overflow on all screen sizes ────────────────────── */
html {
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ── CSS custom properties (colour tokens) ──────────────────────────────────── */

:root {
    --color-bg: #f4f4f4;
    --color-surface: #ffffff;
    --color-surface-alt: #f7f7f7;
    --color-header-bg: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --color-nav-bg: #333;
    --color-nav-text: #ffffff;
    --color-text: #1a1a1a;
    --color-text-secondary: #555;
    --color-text-muted: #888;
    --color-border: #e0e0e0;
    --color-border-strong: #333;
    --color-tag-bg: #f0f0f0;
    --color-tag-text: #333;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-shadow-hover: rgba(0, 0, 0, 0.14);
    --color-accent: #0ea5e9;
    --color-accent-hover: #0284c7;
    --color-footer-bg: #1a1a1a;
    --color-footer-text: #ffffff;
    --color-footer-muted: #aaa;
    --color-success: #27ae60;
    --color-error: #c0392b;
    --color-timeline-line: #ddd;
    --color-timeline-marker: #333;
    --color-timeline-marker-current: #0ea5e9;
    /* Spacing tokens */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    /* Type tokens */
    --text-sm: 0.875rem;
    --text-xs: 0.8rem;
    /* Radius tokens */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
}

[data-theme="dark"] {
    --color-bg: #0f0f0f;
    --color-surface: #1e1e1e;
    --color-surface-alt: #252525;
    --color-header-bg: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    --color-nav-bg: #1a1a1a;
    --color-nav-text: #e0e0e0;
    --color-text: #e8e8e8;
    --color-text-secondary: #b0b0b0;
    --color-text-muted: #888;
    --color-border: #333;
    --color-border-strong: #666;
    --color-tag-bg: #2a2a2a;
    --color-tag-text: #ccc;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-shadow-hover: rgba(0, 0, 0, 0.5);
    --color-accent: #38bdf8;
    --color-accent-hover: #7dd3fc;
    --color-footer-bg: #0a0a0a;
    --color-footer-text: #e0e0e0;
    --color-footer-muted: #777;
    --color-success: #2ecc71;
    --color-error: #e74c3c;
    --color-timeline-line: #333;
    --color-timeline-marker: #666;
    --color-timeline-marker-current: #38bdf8;
}

/* System preference fallback — applies dark tokens for users who have never
   toggled manually and whose OS is set to dark mode. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --color-bg: #0f0f0f;
        --color-surface: #1e1e1e;
        --color-surface-alt: #252525;
        --color-header-bg: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
        --color-nav-bg: #1a1a1a;
        --color-nav-text: #e0e0e0;
        --color-text: #e8e8e8;
        --color-text-secondary: #b0b0b0;
        --color-text-muted: #888;
        --color-border: #333;
        --color-border-strong: #666;
        --color-tag-bg: #2a2a2a;
        --color-tag-text: #ccc;
        --color-shadow: rgba(0, 0, 0, 0.3);
        --color-shadow-hover: rgba(0, 0, 0, 0.5);
        --color-accent: #38bdf8;
        --color-accent-hover: #7dd3fc;
        --color-footer-bg: #0a0a0a;
        --color-footer-text: #e0e0e0;
        --color-footer-muted: #777;
        --color-success: #2ecc71;
        --color-error: #e74c3c;
        --color-timeline-line: #333;
        --color-timeline-marker: #666;
        --color-timeline-marker-current: #38bdf8;
    }
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    /* cap side margins so mid-tablet content isn't over-indented */
    margin: 0 min(10%, 140px);
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Site-level page header only — scoped to direct child of body so the
   dark gradient does NOT bleed into .post-article-header on detail pages
   (fixes #91). Was bare `header { ... }` which matched all header elements. */
body > header {
    background: var(--color-header-bg);
    color: white;
    padding: 45px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

h1 {
    padding-bottom: 10px;
    font-weight: 700;
    font-size: 32px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    letter-spacing: 2px;
}

h2 {
    padding: 15px 0;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 500;
    font-size: 20px;
    letter-spacing: 0.3px;
}

h3 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

header h2:first-of-type {
    font-size: 18px;
    opacity: 0.9;
}

section {
    padding: 40px 20px;
    margin-top: 0;
    background-color: transparent;
}

section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-text);
    font-size: 28px;
    position: relative;
    padding-bottom: 15px;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-border-strong), var(--color-text-muted), var(--color-border-strong));
    border-radius: 2px;
}

p {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 400;
    font-size: 14px;
}

.hidden {
    display: none;
}

strong {
    font-weight: bolder;
    font-size: large;
}


/* Nav box — exclude admin-subnav so its flex-direction:row is not overridden */

nav:not(.admin-subnav) {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 99;
    background-color: var(--color-nav-bg);
}

/* Hamburger toggle — hidden on desktop, visible on mobile */
.nav-toggle {
    display: none;
    width: 100%;
    background: var(--color-nav-bg);
    color: var(--color-nav-text);
    border: none;
    border-radius: 0;
    padding: 14px 1.25rem;
    font-size: 0.95rem;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 500;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    height: auto;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-toggle-icon {
    font-size: 1.25rem;
    line-height: 1;
}

ul.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    background-color: var(--color-nav-bg);
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

.nav li {
    display: inline-flex;
    width: auto;
    margin: 0;
    padding: 0;
}

.nav a {
    text-align: center;
    padding: 14px 1.25rem;
    margin: 0;
    color: var(--color-nav-text);
    display: block;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.nav a:hover,
.nav li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sec-cont {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cont {
    grid-template-columns: 3fr;
}


/* services and portfolio boxes */

.box {
    height: auto;
    width: 29%;
    margin: 10px;
    padding: 10px;
    display: inline-block;
    line-height: 1.5em;
}

/* ── Admin sub-navigation (#378) ────────────────────────────────────────── */

.admin-subnav {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 0 1.25rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.admin-subnav::-webkit-scrollbar { display: none; }

.admin-subnav-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.9rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.admin-subnav-item:hover {
    color: var(--color-text);
}

.admin-subnav-item.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}

@media (max-width: 600px) {
    .admin-subnav { padding: 0 0.75rem; justify-content: flex-start; }
    .admin-subnav-item { padding: 0.65rem 0.65rem; font-size: 0.8rem; }
}

/* ── Admin dashboard (#378) ─────────────────────────────────────────────── */

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
    padding: 1.5rem 0 0.5rem;
    max-width: 720px;
    margin: 0 auto;
}

.admin-dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.25rem 1.25rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    box-shadow: 0 1px 4px var(--color-shadow);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}

.admin-dashboard-card:hover {
    box-shadow: 0 3px 12px var(--color-shadow-hover);
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

.admin-dashboard-card-icon { font-size: 1.4rem; line-height: 1; margin-bottom: 0.15rem; }
.admin-dashboard-card-title { font-weight: 600; font-size: 0.95rem; }
.admin-dashboard-card-desc { font-size: 0.8rem; color: var(--color-text-secondary); line-height: 1.4; }

@media (max-width: 480px) {
    .admin-dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

.admin-page {
    padding: 20px 0;
}

.admin-card {
    width: 100%;
    max-width: 720px;
    margin: 0 auto 1.5rem;
    padding: 1.5rem 1.75rem;
    background: var(--color-surface);
    box-shadow: 0 2px 14px var(--color-shadow);
    border-radius: 12px;
    text-align: left;
}

.admin-card-title {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.2rem;
}

.admin-card-title::after { display: none; }

.saved-list-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 1.5rem 0 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.admin-message {
    min-height: 1.25em;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.login-section .admin-card {
    max-width: 420px;
}

.login-message {
    color: var(--color-error);
    margin-top: 0.75rem;
}

.login-section input[type="password"] {
    width: 100%;
}

.private-card textarea,
.admin-card input[type="text"],
.admin-card textarea,
.admin-card input[type="file"] {
    width: 100%;
}

.private-card .hint {
    margin-top: 1rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

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

.hs-wrap {
    position: relative;
    overflow-x: hidden;
    overflow-y: hidden;
}

.hs {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.port-cont {
    display: inline-block;
    padding: 1em;
    box-sizing: border-box;
}

.cont-item {
    height: auto;
    width: auto;
    white-space: normal;
}


/* paddle buttons */

.paddle {
    position: absolute;
    top: 50%;
    bottom: 0;
    width: 3em;
}

.left-paddle {
    left: 0;
}

.right-paddle {
    right: 0;
}

button {
    align-self: center;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    height: 40px;
    cursor: pointer;
    font-family: inherit;
    border-radius: 6px;
    transition: background 0.2s ease;
}

button:hover {
    background: var(--color-border);
}


/* testimonials */

blockquote {
    font-weight: normal;
    font-style: italic;
}


/* footer elements */

#contact {
    display: inline-flex;
    background-color: #333;
}

.contact-cont,
.legal-cont {
    background-color: #333;
    color: white;
    width: 50%;
    padding: 10px;
}

.contact-cont {
    text-align: left;
}

.legal-cont {
    text-align: right;
}

footer p {
    font-size: 12px;
}

footer a {
    color: white;
}

footer a:hover {
    text-decoration: underline;
}

.travel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    justify-items: center;
    padding: 0;
}

.travel-grid .box,
.travel-uploader.box {
    width: 100%;
    display: block;
}

.travel-card {
    width: 100%;
    padding: 1rem;
    text-align: left;
    background: var(--color-surface);
    box-shadow: 0 2px 12px var(--color-shadow);
    border-radius: 10px;
}

.travel-card .media {
    width: 100%;
    min-height: 180px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background: #eaeaea;
}

.travel-card .media img,
.travel-card .media video {
    width: 100%;
    height: auto;
    display: block;
}

.media-thumb-wrap {
    position: relative;
    display: block;
}

.media-extra-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    pointer-events: none;
}

.media-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.media-list-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.media-list-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-secondary);
}

.media-remove-btn {
    flex-shrink: 0;
    height: 28px;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    color: var(--color-error);
    border-color: var(--color-error);
}

.travel-content h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1.1rem;
    color: var(--color-text);
}

/* Meta block: location on first line, date on second */
.travel-content .meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
}

.travel-content .meta .travel-location {
    color: var(--color-text-secondary);
}

.travel-content .meta .travel-date {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.travel-uploader {
    width: 100%;
    text-align: left;
    background: var(--color-surface);
    box-shadow: 0 2px 12px var(--color-shadow);
    border-radius: 10px;
    padding: 1rem;
}

.travel-uploader h3 {
    margin-top: 0;
}

.travel-uploader form {
    display: grid;
    gap: 0.75rem;
}

/* Removed: .travel-uploader label — travel form now uses .admin-card label styles */

.travel-uploader input[type="text"],
.travel-uploader textarea,
.travel-uploader input[type="file"] {
    width: 100%;
    padding: 0.65rem;
    margin-top: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    background: var(--color-bg);
    color: var(--color-text);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.travel-uploader button {
    cursor: pointer;
    min-width: 120px;
    padding: 0.75rem 1rem;
    height: auto;
}

.travel-preview {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed #999;
    border-radius: 8px;
    background: var(--color-surface-alt);
}

.travel-preview.hidden {
    display: none;
}

.preview-media {
    margin-bottom: 0.75rem;
}

.preview-media img,
.preview-media video {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.preview-text p {
    margin: 0.2rem 0;
}

/* About section */
.about-cont {
    max-width: 900px;
    margin: 0 auto;
    background: var(--color-surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--color-shadow);
}

.about-inner {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    align-items: center;
}

.profile-figure {
    margin: 0;
    text-align: center;
}

.profile-figure img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.about-text {
    text-align: left;
}

.about-text p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--color-text);
}

.about-actions {
    margin-top: 1.5rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: 8px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-download:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-download::before {
    content: '↓';
    font-size: 1.1em;
    line-height: 1;
}

/* Projects Grid */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.project-card {
    flex: 1 1 300px;
    max-width: 420px;
    text-align: left;
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.75rem;
    box-shadow: 0 2px 12px var(--color-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-left: 4px solid var(--color-border-strong);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
}

.project-header {
    margin-bottom: 1rem;
}

.project-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    color: var(--color-text);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    background: var(--color-tag-bg);
    color: var(--color-tag-text);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.project-card p {
    margin: 0.75rem 0;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.project-meta {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Skills section */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.skill-category {
    flex: 1 1 280px;
    max-width: 480px;
    background: var(--color-surface);
    padding: 1.75rem;
    border-radius: 10px;
    box-shadow: 0 2px 12px var(--color-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.skill-category:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
}

.skill-category h3 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: var(--color-text);
    font-size: 1.15rem;
    border-bottom: 2px solid var(--color-border-strong);
    padding-bottom: 0.75rem;
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-list li {
    padding: 0.5rem 0;
    color: var(--color-text-secondary);
    line-height: 1.6;
    border-bottom: 1px solid var(--color-border);
}

.skill-list li:last-child {
    border-bottom: none;
}

/* Contact & Footer */
footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 0;
}

#contact {
    background: var(--color-footer-bg);
    padding: 2rem 20px;
}

.contact-wrapper {
    max-width: 1000px;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    text-align: left;
}

.contact-info,
.footer-links {
    padding: 1rem 0;
}

.contact-info h3,
.footer-links h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-info p,
.footer-links p {
    margin: 1rem 0;
    font-size: 1.05rem;
    line-height: 1.8;
}

.contact-info a,
.footer-links a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover,
.footer-links a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--color-footer-muted);
    font-size: 0.9rem;
}

.footer-visits {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-page {
    flex: 1;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--color-text);
}

.stat-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-accent);
    min-width: 3rem;
    text-align: right;
}

.stat-last {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    min-width: 8rem;
    text-align: right;
}

/* ── Deployment panel (#98 / #117) ─────────────────────────────────────────── */

.deploy-status-row {
    padding: 0.6rem 0.75rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
}

.deploy-output {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #0d1117;
    color: #e6edf3;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    border-radius: var(--radius-md);
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

[data-theme="dark"] .deploy-output {
    background: #010409;
    color: #c9d1d9;
}

/* Travel empty state */
.travel-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ── Travel gallery lightbox (#30) ─────────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox.hidden {
    display: none;
}

.lightbox-media {
    max-width: min(90vw, 900px);
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 6px;
}

.lightbox-caption {
    margin-top: 0.75rem;
    color: #ddd;
    font-size: 0.9rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lightbox-counter {
    color: #aaa;
    font-size: 0.82rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.28);
}

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

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

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

.lightbox-prev.hidden,
.lightbox-next.hidden {
    display: none;
}

/* Make cards with multiple media look clickable */
.travel-card.has-gallery {
    cursor: pointer;
}

.travel-card.has-gallery .media-thumb-wrap::after {
    content: 'View gallery';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    border-radius: 10px 10px 0 0;
}

.travel-card.has-gallery:hover .media-thumb-wrap::after {
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
}

/* AI Dev section */
.ai-dev-inner {
    text-align: left;
}

.ai-dev-inner > p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--color-text);
}

.ai-dev-points {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.ai-point {
    flex: 1 1 220px;
    max-width: 300px;
    background: var(--color-surface-alt);
    border-radius: 8px;
    padding: 1.25rem;
    border-left: 3px solid var(--color-border-strong);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ai-point:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
}

.ai-point h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--color-text);
}

.ai-point p {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Certifications */
.cert-row {
    margin-top: 2rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.cert-row h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border-strong);
    padding-bottom: 0.5rem;
}

.cert-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 12px var(--color-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cert-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
}

.cert-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cert-title {
    font-weight: 600;
    color: var(--color-text);
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

.cert-meta {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.cert-link {
    white-space: nowrap;
    background: var(--color-text);
    color: var(--color-bg);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.cert-link:hover {
    background: var(--color-text-secondary);
    color: var(--color-bg);
}

@media screen and (max-width: 768px) {
    /* ── Hamburger nav ───────────────────────────────────────────────────── */
    .nav-toggle {
        display: flex;
    }

    ul.nav {
        display: none;
        flex-direction: column;
        flex-wrap: nowrap;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .nav li {
        width: 100%;
        display: flex;
    }

    .nav a {
        text-align: left;
        padding: 13px 1.5rem;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    /* dark mode toggle in collapsed nav */
    .nav li #dark-mode-toggle {
        width: 100%;
        text-align: left;
        border-radius: 0;
        padding: 13px 1.5rem;
        height: auto;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        font-size: 0.95rem;
        background: transparent;
        border-top: none;
        border-left: none;
        border-right: none;
    }

    /* ── General mobile layout ──────────────────────────────────────────── */
    .cert-card {
        flex-direction: column;
        align-items: flex-start;
    }

    body {
        margin: 0;
    }

    /* Scoped to match the tightened desktop rule — body > header only */
    body > header {
        padding: 30px 15px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 18px;
    }

    section {
        padding: 30px 15px;
    }

    section h2 {
        font-size: 22px;
    }

    .about-inner {
        grid-template-columns: 1fr;
    }

    .about-text {
        text-align: center;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .box {
        width: auto;
        margin: auto;
    }

    .hs,
    .hs-wrap {
        height: 600px;
    }

    .paddle {
        top: auto;
        width: 10px;
        height: 100%;
        align-self: auto;
        z-index: 1;
        background-color: #f7f7f780;
    }

    .paddle p {
        display: none;
    }

    .travel-uploader {
        display: none;
    }
}

/* ── Dark mode toggle button ──────────────────────────────────────────────── */

#dark-mode-toggle {
    background: transparent;
    border: none;
    color: var(--color-nav-text);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 14px 1rem;
    height: auto;
    width: auto;
    line-height: 1;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
}

#dark-mode-toggle:hover {
    opacity: 0.75;
    background: transparent;
}

/* ── Career Timeline (Issue #9) ─────────────────────────────────────────── */

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    text-align: left;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-timeline-line);
}

.timeline-item {
    position: relative;
    padding: 0 0 2.5rem 3.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 12px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-timeline-marker);
    border: 3px solid var(--color-bg);
    box-shadow: 0 0 0 2px var(--color-timeline-marker);
    z-index: 1;
}

.timeline-marker--current {
    background: var(--color-timeline-marker-current);
    box-shadow: 0 0 0 2px var(--color-timeline-marker-current);
}

.timeline-content {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 12px var(--color-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
}

.timeline-date {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    font-family: 'Space Grotesk', system-ui, sans-serif;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.timeline-content h3 {
    margin: 0.25rem 0 0.75rem;
    font-size: 1.15rem;
    color: var(--color-text);
}

.timeline-content p {
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-bottom: 0.75rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.timeline-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.timeline-link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Timeline location pin — uses project tokens instead of raw values */
.timeline-location {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

/* Timeline thumbnail — max-height is a content constraint, radius/spacing use tokens */
.timeline-thumb {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
}

/* Travel timeline container */
#travel-timeline {
    width: 100%;
    padding-top: var(--space-4);
}

@media (max-width: 768px) {
    .timeline::before {
        left: 14px;
    }
    .timeline-item {
        padding-left: 2.75rem;
    }
    .timeline-marker {
        left: 6px;
        width: 16px;
        height: 16px;
    }
}

/* ── GitHub activity widget (Issue #5) ─────────────────────────────────────── */

.github-repos-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto 1.5rem;
    text-align: left;
}

.github-repo-card {
    flex: 1 1 260px;
    max-width: 380px;
    display: block;
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px var(--color-shadow);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-left: 3px solid var(--color-border-strong);
}

.github-repo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
}

.github-repo-name {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}

.github-repo-desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.github-repo-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.github-repo-lang {
    font-weight: 600;
    color: var(--color-text-secondary);
}

.github-fallback {
    color: var(--color-text-secondary);
    text-align: center;
    width: 100%;
}

.github-fallback a {
    color: var(--color-accent);
}

.github-profile-link {
    text-align: center;
    margin-top: 0.5rem;
}

.github-profile-link a {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.github-profile-link a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* ── Contact form (Issue #3) ────────────────────────────────────────────────── */

.contact-form-wrap {
    max-width: 640px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px var(--color-shadow);
    text-align: left;
}

#contact-form label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--color-bg);
    color: var(--color-text);
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

#contact-form input[type="text"]:focus,
#contact-form input[type="email"]:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--color-border-strong);
}

#contact-form button[type="submit"] {
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    height: auto;
    transition: background 0.2s ease;
    margin-top: 0.5rem;
}

#contact-form button[type="submit"]:hover {
    background: var(--color-text-secondary);
}

#contact-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.contact-form-message {
    margin-top: 1rem;
    font-size: 0.95rem;
    min-height: 1.4rem;
}

.contact-form-message.success {
    color: var(--color-success);
}

.contact-form-message.error {
    color: var(--color-error);
}

/* ── Admin saved memories list ────────────────────────────────────────────── */

.saved-memories {
    margin-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.saved-memories h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.saved-memory-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.saved-memory-row:last-child {
    border-bottom: none;
}

.saved-memory-info {
    font-size: 0.9rem;
    color: var(--color-text);
}

.saved-memory-location {
    color: var(--color-text-secondary);
}

.saved-memory-date {
    color: var(--color-text-muted);
}

/* ── Blog (Issue #7) ──────────────────────────────────────────────────────── */

.posts-list {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
    text-align: left;
}

/* Specificity fix: .posts-list { display: grid } beats .hidden { display: none }
   because it appears later in the file. Double-class selector restores correct behaviour. */
.posts-list.hidden {
    display: none;
}

.post-card {
    display: block;
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 2px 12px var(--color-shadow);
    text-decoration: none;
    /* Explicit colour token prevents UA :visited purple overriding in light mode (fixes #87) */
    color: var(--color-text);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-left: 3px solid var(--color-border-strong);
}

/* Prevent browser :visited colour bleeding onto card title text */
.post-card:visited {
    color: var(--color-text);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
}

.post-card-title {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 600;
    color: var(--color-text);
    font-size: 1.25rem;
    margin: 0 0 0.4rem;
}

.post-card-date {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

.post-card-excerpt {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.posts-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.post-back-bar {
    max-width: 720px;
    margin: 0 auto 0.75rem;
    padding: 0 0.25rem;
}

.post-back-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.post-back-link:hover {
    text-decoration: underline;
}

.post-article {
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
    background: var(--color-surface);
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--color-shadow);
}

.post-article-header {
    margin-bottom: 0.25rem;
}

/* Scoped to the reader page only — must NOT bleed onto the admin #post-title input */
.post-article #post-title {
    text-align: left;
    font-size: 2rem;
    margin: 0 0 0.5rem;
    color: var(--color-text);
}

.post-article #post-title::after { display: none; }

.post-date {
    color: var(--color-text-muted);
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
}

.post-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

/* Legacy — keep in case of cached pages */
.post-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.post-markdown {
    color: var(--color-text);
    line-height: 1.75;
    font-size: 1rem;
}

.post-markdown h1,
.post-markdown h2,
.post-markdown h3 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    color: var(--color-text);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    text-align: left;
    padding-bottom: 0;
}

.post-markdown h1::after,
.post-markdown h2::after,
.post-markdown h3::after { display: none; }

.post-markdown h1 { font-size: 1.6rem; }
.post-markdown h2 { font-size: 1.35rem; }
.post-markdown h3 { font-size: 1.15rem; }

.post-markdown p { margin: 0.85rem 0; }

.post-markdown a {
    color: var(--color-accent);
    text-decoration: underline;
}

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

.post-markdown code {
    background: var(--color-tag-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.92em;
    font-family: 'Courier New', monospace;
}

.post-markdown pre {
    background: var(--color-surface-alt);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    margin: 1rem 0;
}

.post-markdown pre code {
    background: transparent;
    padding: 0;
}

.post-markdown blockquote {
    border-left: 3px solid var(--color-border-strong);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--color-text-secondary);
    font-style: italic;
}

.post-markdown ul,
.post-markdown ol {
    margin: 0.85rem 0;
    padding-left: 1.5rem;
}

.post-markdown li { margin: 0.35rem 0; }

.post-markdown img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}

.post-status {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-status.published {
    background: var(--color-success);
    color: white;
}

.post-status.draft {
    background: var(--color-tag-bg);
    color: var(--color-text-secondary);
}

.post-admin-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.btn-small {
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    height: auto;
    width: auto;
}

.btn-small:hover { opacity: 0.85; }

.btn-danger {
    background: var(--color-error);
    color: #fff;
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    height: auto;
    width: auto;
}

.btn-danger:hover { opacity: 0.85; }

/* ── Travel map (Issue #8) ───────────────────────────────────────────────────── */

.travel-view-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.view-toggle-btn {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1.1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    height: auto;
    width: auto;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

.view-toggle-btn:hover {
    background: var(--color-tag-bg);
}

.view-toggle-btn.active {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

.travel-map {
    height: 400px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 12px var(--color-shadow);
    z-index: 1;
}

.travel-map.hidden,
.travel-grid.hidden {
    display: none;
}

.popup-content {
    max-width: 200px;
    text-align: left;
}

.popup-thumb {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: block;
}

.popup-location {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Override Leaflet popup defaults to match site theme */
.leaflet-popup-content-wrapper {
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 8px;
}

.leaflet-popup-tip {
    background: var(--color-surface);
}

/* ── Admin coord row (Issue #8) ─────────────────────────────────────────────── */

.location-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.location-row input {
    flex: 1;
}

.location-row .btn-secondary {
    flex-shrink: 0;
    padding: 0 0.75rem;
    height: 38px;
    font-size: 0.85rem;
}

.coord-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .coord-row { grid-template-columns: 1fr; }
}

.hint {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ── Button variants ─────────────────────────────────────────────────────────── */

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    cursor: pointer;
    height: auto;
    width: auto;
    letter-spacing: 0.2px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-border-strong);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    cursor: pointer;
    height: auto;
    width: auto;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-text);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Full-width buttons on narrow login/setup cards */
.login-section .btn-primary,
.login-section .btn-secondary {
    width: 100%;
    text-align: center;
}

/* ── Admin card form inputs ─────────────────────────────────────────────────── */

/* Forms inside admin cards use a grid for consistent field spacing */
#travel-form,
#post-form {
    display: grid;
    gap: 0.75rem;
}

.admin-card label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    /* No margin-bottom — gap on the parent grid handles spacing */
    margin-bottom: 0;
}

.admin-card input[type="text"],
.admin-card input[type="email"],
.admin-card input[type="number"],
.admin-card input[type="date"],
.admin-card textarea,
.admin-card input[type="file"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    margin-top: 0.35rem;
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.admin-card input[type="text"]:focus,
.admin-card input[type="email"]:focus,
.admin-card input[type="number"]:focus,
.admin-card input[type="date"]:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Suppress WebKit's native calendar icon so the field looks clean */
.admin-card input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    filter: invert(var(--calendar-icon-invert, 0));
    cursor: pointer;
}

[data-theme="dark"] .admin-card input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* ── Login divider ──────────────────────────────────────────────────────────── */

.login-divider {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
    margin: 1.25rem 0;
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--color-border);
}

.login-divider span {
    padding: 0 0.75rem;
}

/* ── Mobile-first post editor (Issue #7) ─────────────────────────────────────── */

#post-form textarea#post-body {
    min-height: 240px;
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: 0.95rem;
    line-height: 1.55;
    resize: vertical;
}

@media (max-width: 768px) {
    .admin-card {
        padding: 1rem 0.85rem;
        border-radius: 8px;
    }

    /* 16px input font prevents iOS Safari from auto-zooming on focus */
    .admin-card input[type="text"],
    .admin-card input[type="email"],
    .admin-card input[type="number"],
    .admin-card input[type="date"],
    .admin-card input[type="password"],
    .admin-card textarea {
        font-size: 16px;
        padding: 0.75rem 0.85rem;
    }

    /* Generous tap targets — 44px is Apple's HIG recommendation */
    .admin-card .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-card .form-actions button,
    .admin-card .form-actions .btn-primary,
    .admin-card .form-actions .btn-secondary {
        width: 100%;
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    #post-form textarea#post-body {
        min-height: 50vh;
    }

    .saved-memory-row {
        align-items: flex-start;
    }

    .post-admin-actions {
        width: 100%;
        margin-top: 0.5rem;
    }

    .post-admin-actions .btn-small,
    .post-admin-actions .btn-danger {
        flex: 1;
        min-height: 38px;
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* ── Issue #34: Styled file input ─────────────────────────────────────────── */

.file-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-input-btn {
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    height: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.file-input-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-family: 'Inter', system-ui, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}

/* ── Issue #39: Custom coordinate stepper ─────────────────────────────────── */

/* Hide native browser up/down spinner arrows on number inputs */
.coord-stepper input[type="number"]::-webkit-outer-spin-button,
.coord-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.coord-stepper input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}

/* Wrapper: [−] [input] [+] in a single row */
.coord-stepper {
    display: flex;
    align-items: stretch;
    margin-top: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.coord-stepper:focus-within {
    border-color: var(--color-accent);
}

/* Override the generic .admin-card input styles for number inputs inside steppers */
.coord-stepper input[type="number"] {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.6rem;
    margin-top: 0;        /* cancel the label-child offset */
    border: none;         /* border is on the wrapper */
    border-radius: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    text-align: center;
    box-sizing: border-box;
}

.coord-stepper input[type="number"]:focus {
    outline: none;
    border-color: transparent; /* focus ring is on the wrapper */
}

/* Step buttons */
.coord-step-btn {
    flex-shrink: 0;
    width: 36px;
    height: auto;
    min-height: 38px;
    padding: 0;
    background: var(--color-surface-alt);
    border: none;
    border-radius: 0;
    color: var(--color-text);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

.coord-step-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.coord-step-btn:active {
    background: var(--color-border-strong);
    color: var(--color-surface);
}

/* Dividers between btn and input */
.coord-step-btn:first-child {
    border-right: 1px solid var(--color-border);
}

.coord-step-btn:last-child {
    border-left: 1px solid var(--color-border);
}

/* Mobile: taller tap targets */
@media (max-width: 768px) {
    .coord-step-btn {
        width: 44px;
        min-height: 44px;
    }

    .coord-stepper input[type="number"] {
        font-size: 16px; /* prevent iOS zoom */
        padding: 0.75rem 0.4rem;
    }
}

/* ── Issue #78: clickable cards & detail page styles ────────────────────────── */

/* Travel card now an <a> — strip default link styling, use token colour to
   prevent UA :visited purple overriding in light mode (fixes #87) */
a.travel-card {
    display: block;
    color: var(--color-text);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.travel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--color-shadow);
}

/* Prevent browser :visited colour bleeding onto card content */
a.travel-card:visited {
    color: var(--color-text);
}

/* Timeline item link wrapping <h3> (used by both blog and travel) —
   explicit token colour prevents UA :visited purple in light mode (fixes #87) */
.timeline-content a {
    color: var(--color-text);
    text-decoration: none;
}

/* Prevent browser :visited colour overriding the heading colour in light mode */
.timeline-content a:visited {
    color: var(--color-text);
}

.timeline-content a:hover h3 {
    color: var(--color-accent);
}

.timeline-item .media-thumb-wrap {
    transition: opacity 0.15s ease;
}

.timeline-item .media-thumb-wrap:hover {
    opacity: 0.85;
}

/* ── Post detail pages (blog + travel) ───────────────────────────────────────── */

.post-meta {
    color: var(--color-text-muted);
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.95rem;
    margin: 0.25rem 0 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.post-meta .travel-location::before {
    content: "📍 ";
}

.post-meta .travel-date::before,
.post-meta .blog-date::before {
    content: "📅 ";
}

.post-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.gallery-thumb {
    cursor: pointer;
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #eaeaea;
    transition: transform 0.15s ease;
}

.gallery-thumb:hover {
    transform: scale(1.02);
}

.gallery-thumb img,
.gallery-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.travel-post-map {
    border: 1px solid var(--color-border);
}
