/* 
 * Custom Styles for Daniel Projects
 * Only includes styles not covered by Bootstrap 5
 * Theme colors are defined in theme-colors.css
 */

/* Font Families */
:root {
    --font-monse: 'Montserrat', sans-serif;
    --font-lora: 'Lora', serif;
    --font-robo: 'Roboto', sans-serif;
}

/* Font Classes */
.font-monserrat {
    font-family: var(--font-monse) !important;
    font-weight: 500 !important;
    font-style: italic !important;
}

.font-lora {
    font-family: var(--font-lora);
    font-weight: 400;
}

.font-roboto {
    font-family: var(--font-robo);
    font-weight: 300;
}

/* Base Typography */
body {
    font-family: var(--font-robo) !important;
    font-weight: 300;
    /* padding-top: 76px; Account for fixed Bootstrap navbar */
    min-height: 100vh;
}

h1 {
    font-family: var(--font-monse) !important;
    font-weight: 500;
    font-style: italic;
}

h2, h3, h4, h5, h6, a {
    font-family: var(--font-lora) !important;
    font-weight: 400;
}

/* Body padding for fixed navbar and sticky footer setup */

/* Project and Blog Card Custom Styles - Background image with color overlay */
.project-card, .blog-card {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: block;
    color: inherit;
    cursor: pointer;
    background-color: var(--theme-dark); /* Default dark background for visibility */
}

/* Blurred and darkened background image layer */
.project-card::before, .blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    filter: brightness(0.5) blur(3px);
    transform: scale(1.1); /* Scale up to prevent blur edge artifacts */
}

/* Ensure content is above the blurred background */
.project-card > *, .blog-card > * {
    position: relative;
    z-index: 1;
}

.project-card:hover, .blog-card:hover {
    color: inherit;
    text-decoration: none;
}

.project-card-content, .blog-card-content {
    position: relative;
    z-index: 2;
}

.project-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Extra small badge with lightest weight and reduced spacing */
.badge-xs {
    font-size: 0.65rem;
    font-weight: 100;
    padding: 0.15rem 0.3rem;
    margin: 0;
    line-height: 1.2;
}

/* Theme Toggle Button Styles */
.theme-icon-light,
.theme-icon-dark {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-icon-dark {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .theme-icon-light {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

/* Material Design Icons (MDI) - Ensure proper display */
.mdi {
    font-family: "Material Design Icons";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Custom project card hover effect */
.project-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Ensure navbar uses theme colors */
.navbar {
    background-color: var(--theme-navbar-bg) !important;
    box-shadow: 0 6px 12px -10px rgba(0, 0, 0, 0.2);
}

/* Rich content typography */
.template-blogpage article .rich-text,
.template-projectpage article .rich-text {
    line-height: 1.7;
    color: var(--theme-text);
}

.template-blogpage article .rich-text h2,
.template-blogpage article .rich-text h3,
.template-blogpage article .rich-text h4,
.template-blogpage article .rich-text h5,
.template-blogpage article .rich-text h6,
.template-projectpage article .rich-text h2,
.template-projectpage article .rich-text h3,
.template-projectpage article .rich-text h4,
.template-projectpage article .rich-text h5,
.template-projectpage article .rich-text h6 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--theme-text);
}

.template-blogpage article .content-heading,
.template-projectpage article .content-heading {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--theme-text);
    font-size: 1.75rem;
}

.template-blogpage article .rich-text p,
.template-projectpage article .rich-text p {
    margin-bottom: 1.1rem;
}

.template-blogpage article .rich-text a,
.template-projectpage article .rich-text a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.template-blogpage article .rich-text blockquote,
.template-projectpage article .rich-text blockquote,
.template-blogpage article .content-quote,
.template-projectpage article .content-quote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--theme-primary);
    background-color: var(--theme-border-light);
    color: var(--theme-text);
}

.template-blogpage article .content-quote p,
.template-projectpage article .content-quote p {
    margin: 0;
}

.template-blogpage article .rich-text ul,
.template-blogpage article .rich-text ol,
.template-projectpage article .rich-text ul,
.template-projectpage article .rich-text ol {
    padding-left: 1.5rem;
    margin-bottom: 1.1rem;
}

.template-blogpage article .rich-text li,
.template-projectpage article .rich-text li {
    margin-bottom: 0.4rem;
}

.template-blogpage article .rich-text hr,
.template-projectpage article .rich-text hr {
    margin: 2rem 0;
    border-color: var(--theme-border);
}

/* Ensure footer uses theme colors */
footer {
    background-color: var(--theme-footer-bg) !important;
}

/* Filter Section Styles */
.filter-section {
    margin-bottom: 2rem;
}

.filter-badge {
    transition: opacity 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.filter-badge:hover {
    opacity: 1 !important;
    transform: translateY(-1px);
}

.filter-badge.active {
    opacity: 1;
    font-weight: 500;
}

.badge-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    font-weight: 400;
}

/* Collapsible filter styles */
#filterCollapse {
    margin-top: 0.5rem;
}

#filterCollapse .badge {
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

#filterCollapse .badge:hover {
    opacity: 1 !important;
}

/* Custom Tooltip Styling */
.custom-tooltip {
    opacity: 0.5 !important;
}

.custom-tooltip .tooltip-inner {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

/* Hero Section Responsive Height */
.hero-section {
    height: calc(100vh - 76px);
}

@media (max-width: 800px) {
    .hero-section {
        height: 50vh; /* Scaled down for mobile */
        min-height: 300px;
    }
}

/* DP Isotype Animation */
.dp-isotype-anim rect {
    transform-box: fill-box;
    transform-origin: center;
    shape-rendering: geometricPrecision;
    outline: 1px solid transparent;
    backface-visibility: hidden;
}

@keyframes cycle-rect-1 {
    0%, 100% { height: 58.5; rx: 30; }
    16.6% { height: 57; rx: 21; }
    33.3% { height: 57; rx: 15; }
    50% { height: 60; rx: 9; }
    66.6% { height: 57; rx: 15; }
    83.3% { height: 57; rx: 21; }
}

@keyframes cycle-rect-2 {
    0%, 100% { height: 57; rx: 21; }
    16.6% { height: 57; rx: 15; }
    33.3% { height: 60; rx: 9; }
    50% { height: 57; rx: 15; }
    66.6% { height: 57; rx: 21; }
    83.3% { height: 58.5; rx: 30; }
}

@keyframes cycle-rect-3 {
    0%, 100% { height: 57; rx: 15; }
    16.6% { height: 60; rx: 9; }
    33.3% { height: 57; rx: 15; }
    50% { height: 57; rx: 21; }
    66.6% { height: 58.5; rx: 30; }
    83.3% { height: 57; rx: 21; }
}

@keyframes cycle-rect-4 {
    0%, 100% { height: 60; rx: 9; }
    16.6% { height: 57; rx: 15; }
    33.3% { height: 57; rx: 21; }
    50% { height: 58.5; rx: 30; }
    66.6% { height: 57; rx: 21; }
    83.3% { height: 57; rx: 15; }
}

.dp-isotype-anim .rect-1 { animation: cycle-rect-1 8s linear infinite; }
.dp-isotype-anim .rect-2 { animation: cycle-rect-2 8s linear infinite; }
.dp-isotype-anim .rect-3 { animation: cycle-rect-3 8s linear infinite; }
.dp-isotype-anim .rect-4 { animation: cycle-rect-4 8s linear infinite; }

/* Responsive Content Images */
article img, 
.rich-text img, 
.block-image img,
.content-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Carousel Customizations */
.carousel-container {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.carousel-item img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

/* 16:9 Aspect Ratio for wide screens */
@media (min-width: 992px) {
    .carousel-container {
        aspect-ratio: 16 / 9;
        max-height: 70vh; /* Prevent it from being too tall on very large monitors */
    }
    .carousel-item img {
        height: 100%; /* Fill the 16:9 container */
    }
}

@media (max-width: 768px) {
    .carousel-item img {
        height: 300px;
    }
}

/* Rounded corners for carousel images */
.carousel-rounded {
    border-radius: 0.5rem;
}

/* Carousel Indicators (Dots) */
.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: var(--theme-primary, #0d6efd);
    border: none;
    opacity: 0.5;
}

.carousel-indicators .active {
    opacity: 1;
    background-color: var(--theme-danger);
}

/* Carousel Control Icons Color */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: brightness(0) saturate(100%);
}

/* Carousel Expand Button */
.carousel-expand-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.carousel-expand-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
    color: #000;
}

.carousel-expand-btn i {
    font-size: 20px;
}
