/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    text-decoration: none;
    color: inherit;
    box-shadow: 6px 6px 0 var(--text-muted);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.card.fit-content {
    height: fit-content;
}

.card.shadow-hover:hover {
    transform: translateY(-4px);
    box-shadow: 6px 10px 0 var(--accent);
    z-index: 10;
}

.card.sidebar {
    height: fit-content;
}

.card.sidebar, .card.accent-shadow {
    box-shadow: 6px 6px 0 var(--accent);
}

.card.sidebar.padded {
    padding: 30px;
}

.card.sidebar.center {
    align-items: center;
    text-align: center;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: #fff;
    min-width: 0;
}

.card-title {
    font-family: var(--font-head);
    font-weight: bold;
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    min-width: 0;
}

.card-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-square {
    width: 10px;
    height: 10px;
    background-color: var(--accent);
    display: inline-block;
    flex-shrink: 0;
}

.card-header-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.card-header-meta-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
}

.card-header-meta-icon {
    font-size: 1.1em;
}

.card-header-meta-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-light);
}

.card > img:not(.no-card-image), .card > video:not(.no-card-image) {
    border-bottom: 1px solid var(--border-color);
}

.card > iframe {
    border-bottom: 1px solid var(--border-color);
}

.card > a {
    border-bottom: 1px solid var(--border-color);
}

.card-image {
    width: 100%;
    display: block;
}

.card-image.cover-h-200 {
    height: 200px;
    object-fit: cover;
}

.card-image.cover-ar-169 {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-image.scale-down-h-200 {
    height: 200px;
    object-fit: scale-down;
}

.card-image-cover.small {
    height: 180px;
}

.card-content {
    padding: 15px;
}

.card-content.flex {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.stretched-link {
    border: none !important;
}

.stretched-link::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1;
}

.card-links-bar {
    display: flex;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    position: relative;
    z-index: 2;
}

.card-link-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-main);
    text-decoration: none;
    min-width: 0;
    transition: color 0.2s, background 0.2s;
}

.card-link-btn:hover {
    color: var(--accent);
    background: var(--bg-light);
}

.card-link-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.card-link-btn .link-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Section Anchors --- */
.section-anchor {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin: 0 0 30px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    text-decoration: none;
    color: inherit;
}

.section-anchor .num {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent);
}

.section-anchor .label {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
}

/* Arrow transitions */
.section-anchor .arrow {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-left: auto;
    font-family: var(--font-mono);
    font-weight: bold;
    transition: color 0.2s;
    font-size: 0.9rem;
    color: var(--text-light);
}

.section-anchor .arrow svg {
    transition: transform 0.2s;
    width: 15px;
}

.section-anchor:hover .arrow svg {
    transform: translateX(5px);
}

.section-anchor:hover .arrow {
    color: var(--accent);
}

/* --- Tags --- */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list.inline {
    display: inline-flex;
    margin-left: 10px;
}

.tag {
    background: #eee;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    border-radius: 4px;
    color: var(--text-light);
}

.tag.pill {
    background: #f0f0f0;
    border: 1px solid #ddd;
    text-decoration: none;
    transition: all 0.2s;
}

.tag.pill:hover, .tag.pill.active {
    border-color: var(--accent);
    color: var(--accent);
}

.tag.pill.active {
    background: var(--accent);
    color: #fff;
}

.text-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}

.text-tag:not(:last-child)::after {
    content: '•';
    margin: 0 0 0 8px;
    color: #ccc;
}

.text-tag:not(:first-child) {
    opacity: 0.9;
}

/* --- Buttons --- */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
    font-weight: bold;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border: 2px solid var(--text-main);
    transition: all 0.2s;
    cursor: pointer;
}

.btn.primary {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

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

.btn.secondary {
    background: #fff;
    color: var(--text-main);
}

.btn.secondary:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.reset-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
}

.reset-link:hover {
    text-decoration: underline;
}

/* --- Misc --- */
.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    object-fit: cover;
    margin-bottom: 25px;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: auto;
}

.socials a {
    font-size: 1.5rem;
    color: #333;
    transition: color 0.2s;
}

.socials svg {
    font-size: 1.3em;
}

.socials .icon-linkedin {
    font-size: 1.1em;
}

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

/* --- Blog Row --- */

.blog-row {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 20px;
    max-width: 900px;
}

.blog-row .card {
    display: flex;
    flex-direction: row;
    min-height: 120px;
}

.blog-row-img-col {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    position: relative;
    background-color: #eee;
    overflow: hidden;
}

.blog-row-img-col img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-row-icon-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f8f8f8;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.blog-row-icon-placeholder svg {
    font-size: 40px;
}

.blog-row-content-col {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.blog-row-header {
    padding: 10px 15px;
    flex-shrink: 0;
}

.blog-row-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 10px;
}

.blog-row-body {
    padding: 10px 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: start;
}

.blog-row-desc {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-row-tags {
    margin-top: 8px;
}

/* --- Global Image Caption --- */
.global-img-caption {
    position: absolute;
    margin-top: 12px;
    background: rgba(47, 47, 47, 0.85);
    backdrop-filter: blur(2px);
    color: #f8f9fa;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    text-align: center;
    border-radius: 6px;
    pointer-events: none;
    z-index: 10000;
    box-sizing: border-box;

    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.2s, transform 0.2s ease-out;
}

.global-img-caption.visible {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 650px) {
    .blog-row .card {
        flex-direction: column;
    }

    .blog-row-img-col {
        width: 100%;
        height: 160px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .blog-row-img-col img {
        position: relative;
    }
}

/* --- Global Image Lightbox --- */
#global-img-lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    background: rgba(0, 0, 0, 0.7);
}

#global-img-lightbox.visible {
    opacity: 1;
    pointer-events: auto;
}

#global-img-lightbox .lightbox-card {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    cursor: default;
}

#global-img-lightbox .lightbox-img-wrapper {
    flex-grow: 1;
    flex-shrink: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 15px;
}

#global-img-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

#global-img-lightbox .lightbox-caption {
    font-size: 0.95rem;
    color: var(--text-main);
    text-align: center;
    margin: 0;
}

.lightbox-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close-btn:hover {
    color: var(--accent);
}

@media (max-width: 650px) {
    #global-img-lightbox {
        padding: 15px;
    }
}
