/* MAINTAINER NOTE
   File: static/css/custom.css
   Purpose: Global custom styles and overrides for the STUPA MAKERS website.
   Contains breadcrumb utilities, card styles, and component-specific designs.
*/

/* ---- Layout utilities used by breadcrumbs ---- */
.items-center {
    align-items: center;
}

:root {
    --color-accent: #f18700;
}

.card-pad {
    padding: 1.5rem;
}


a.btn-primary-sm {
    color: white !important;
}

a.btn-sm.btn-primary {
    color: white !important;
}


/* Buttons */
.ical-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    background-color: transparent;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}
.ical-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background-color: color-mix(in srgb, var(--color-accent) 8%, transparent);
    transform: translateY(-1px);
}

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

.ical-btn-primary:hover {
    opacity: 0.9;
    color: white;
}

.md-heading-anchor::before {
    display: none;
}

html[data-theme="dark"] {
    a.btn-primary-sm {
        color: black !important;
    }

    a.btn-sm.btn-primary {
        color: black !important;
    }

    .text-muted\/60 {
        color: rgba(249, 250, 251, 0.7);
    }


    .ical-btn-primary {
        color: black !important;
    }

    .ical-btn-primary:hover {
        color: var(--color-accent) !important;
    }
}

/* Spacing utilities (used in markup) */
.mb-4 {
    margin-bottom: 1rem;
} /* margin-bottom:16px */
.mr-1.5 {
    margin-right: 0.375rem;
} /* 6px */
.ml-1 {
    margin-left: 0.25rem;
} /* 4px */
.mx-2 {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
} /* 8px */

/* Typography helpers */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}
.font-medium {
    font-weight: 500;
}
.tracking-tight {
    letter-spacing: -0.02em;
}

/* Color utilities */
.text-muted {
    color: var(--color-text-muted);
}
/* Utility class with opacity suffix used in templates: `text-muted/60` */
.text-muted\/60 {
    color: rgba(107, 114, 128, 0.6);
}

/* Accent color and hover variant used in links */
.text-accent {
    color: var(--color-accent);
}
.hover\:text-accent:hover {
    color: var(--color-accent);
}

/* Transition helper (color-only) */
.transition-colors {
    transition: color 0.18s ease-in-out;
}

/* Small opacity helper used for chevron icon */
.opacity-70 {
    opacity: 0.7;
}

/* Space-between siblings helpers (mimic Tailwind space-x utilities) */
.space-x-1 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0.25rem;
} /* 4px */
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0.5rem;
} /* 8px */

/* Responsive variant: md:space-x-2 (min-width: 768px) */
@media (min-width: 768px) {
    .md\:space-x-2 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0.5rem;
    }
}

/* Inline helper to handle repeated combined classes */

/* ---- Icon sizing & targeted rules for breadcrumbs ----
   Instead of relying on generated bracket utilities (like text-[0.65rem]),
   target the Font Awesome icon classes used in the breadcrumbs for exact sizing.
*/
nav[aria-label="Breadcrumb"] i.fa-house,
nav[aria-label="Breadcrumb"] i.fa-solid.fa-house {
    font-size: 0.65rem; /* matches text-[0.65rem] */
    margin-right: 0.375rem; /* matches mr-1.5 */
    line-height: 1;
    vertical-align: middle;
}

nav[aria-label="Breadcrumb"] i.fa-chevron-right,
nav[aria-label="Breadcrumb"] i.fa-solid.fa-chevron-right {
    margin: 0 0.5rem; /* mx-2 */
    font-size: 0.55rem; /* matches text-[0.55rem] */
    opacity: 0.7; /* matches opacity-40 */
    line-height: 1;
    vertical-align: middle;
}

/* Ensure the current page token in breadcrumb uses muted color */
nav[aria-label="Breadcrumb"] [aria-current="page"] .text-muted,
nav[aria-label="Breadcrumb"] [aria-current="page"] span {
    color: var(--color-text-muted);
}

/* Anchor link defaults inside breadcrumbs */
nav[aria-label="Breadcrumb"] a {
    color: var(--color-text);
    text-decoration: none;
}
nav[aria-label="Breadcrumb"] a:hover,
nav[aria-label="Breadcrumb"] a.hover\:text-accent:hover {
    color: var(--color-accent);
}

/* Make sure breadcrumb container uses the expected small sizing */
nav[aria-label="Breadcrumb"] {
    font-size: 0.75rem; /* text-xs */
    font-weight: 500; /* font-medium */
    letter-spacing: -0.02em;
}

/* Small accessibility nicety: keep icons and text aligned on narrow lines */
nav[aria-label="Breadcrumb"] ol,
nav[aria-label="Breadcrumb"] li {
    display: inline-flex;
    align-items: center;
}

/* Card Styles for Home and Lists */
.card-home--project {
    position: relative;
    overflow: hidden;
    transition:
        transform 0.18s ease-out,
        box-shadow 0.18s ease-out,
        border-color 0.18s ease-out,
        background-color 0.18s ease-out;
}

.card-home--project::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(
        circle at 120% 50%,
        color-mix(in srgb, var(--color-accent) 70%, transparent),
        transparent 60%
    );
    opacity: 0;
    transform: translateX(-8px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.card-home--project:hover {
    transform: translateY(-4px) translateX(3px);
    border-color: color-mix(
        in srgb,
        var(--color-accent) 40%,
        var(--color-border)
    );
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.5);
}

.card-home--project:hover::after {
    opacity: 0.22;
    transform: translateX(0);
}

.card-tag-pill {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
    background-color: color-mix(in srgb, var(--color-bg) 92%, transparent);
    font-size: 0.65rem;
    color: var(--color-text-muted);
}

/* Featured Badge */
.card-badge--featured {
    background-color: color-mix(in srgb, #f59e0b 22%, transparent) !important;
    color: #f59e0b !important;
    border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent) !important;
    box-shadow: 0 0 10px -2px color-mix(in srgb, #f59e0b 25%, transparent) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Card Header/Body Layout */
.card-home-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.card-home-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--color-surface) 40%, transparent);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.card-home-body {
    display: block;
    text-decoration: none;
}

/* Card Footer and Buttons */
.card-home-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid color-mix(in srgb, var(--color-border) 40%, transparent);
}

.card-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
    border: 1px solid var(--color-border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.card-cta-btn:hover {
    background-color: color-mix(in srgb, var(--color-accent) 10%, transparent);
    border-color: color-mix(in srgb, var(--color-accent) 30%, transparent);
    color: var(--color-accent);
}

/* Protocol Specific Styles */
.protocol-meta {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 12px;
    background-color: color-mix(in srgb, var(--color-surface) 60%, transparent);
    border: 1px solid var(--color-border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.protocol-timestamp {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: color-mix(in srgb, var(--color-accent) 10%, transparent);
    color: var(--color-accent);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--color-accent) 20%, transparent);
}

.protocol-timestamp--start {
    background: color-mix(in srgb, #22c55e 10%, transparent);
    color: #22c55e;
    border-color: color-mix(in srgb, #22c55e 20%, transparent);
}

.protocol-timestamp--end {
    background: color-mix(in srgb, #ef4444 10%, transparent);
    color: #ef4444;
    border-color: color-mix(in srgb, #ef4444 20%, transparent);
}

.vote-box {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border-radius: 10px;
    border-left: 4px solid var(--color-accent);
    background-color: color-mix(in srgb, var(--color-surface) 40%, transparent);
}

.vote-title {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vote-results {
    display: flex;
    gap: 1.5rem;
    font-weight: 700;
}

.vote-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vote-yes { color: #22c55e; }
.vote-no { color: #ef4444; }
.vote-abs { color: var(--color-text-muted); }

/* About Page Styles */
.about-hero {
    padding: 5rem 2rem;
    background: radial-gradient(circle at top right, color-mix(in srgb, var(--color-accent) 15%, transparent), transparent 50%),
                radial-gradient(circle at bottom left, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 50%),
                var(--color-surface);
    border-radius: 32px;
    margin-bottom: 5rem;
    text-align: center;
    border: 1px solid color-mix(in srgb, var(--color-border) 40%, transparent);
    position: relative;
    overflow: hidden;
}



.about-hero h1 {
    margin-top: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.about-hero p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--color-text);
    opacity: 0.9;
}

.about-section {
    margin: 4rem 0;
}

/* Style Markdown Headers on About Page */
.about-hero + h2,
.about-section + h2,
section + h2 {
    text-align: center;
    margin-top: 6rem;
    margin-bottom: 3rem;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    border-bottom: none !important;
}

.about-hero + h2::after,
.about-section + h2::after,
section + h2::after,
.about-hero + h2::before,
.about-section + h2::before,
section + h2::before {
    display: none !important;
    content: none !important;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.about-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 2.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.about-card:hover {
    border-color: color-mix(in srgb, var(--color-accent) 60%, var(--color-border));
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    background-color: color-mix(in srgb, var(--color-surface) 90%, white);
}

html[data-theme="dark"] .about-card:hover {
    background-color: color-mix(in srgb, var(--color-surface) 95%, black);
}

.about-icon-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    background-color: color-mix(in srgb, var(--color-accent) 15%, transparent);
    color: var(--color-accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.about-card:hover .about-icon-wrapper {
    transform: scale(1.15) rotate(8deg);
    background-color: color-mix(in srgb, var(--color-accent) 25%, transparent);
}

.about-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.about-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.contact-section {
    background-color: color-mix(in srgb, var(--color-surface) 40%, transparent);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 3rem;
    margin: 4rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem;
    margin-top: 2.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-top: 0.25rem;
}

.contact-item strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .about-hero {
        padding: 3.5rem 1.25rem;
        margin-bottom: 3rem;
        border-radius: 24px;
    }

    .about-hero h1 {
        font-size: 2rem;
    }

    .about-hero p {
        font-size: 1rem;
    }

    .about-hero + h2,
    .about-section + h2,
    section + h2 {
        margin-top: 4rem;
        margin-bottom: 2rem;
        font-size: 1.75rem;
    }

    .about-section {
        margin: 2.5rem 0;
    }

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

    .about-card {
        padding: 1.5rem;
    }

    .contact-section {
        padding: 2rem 1.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .about-cta {
        padding: 3rem 1.5rem;
        margin: 4rem 0;
    }

    .about-cta h2 {
        font-size: 1.75rem;
    }
}

/* End of custom.css */
