/**
 * Argentum Stories - Master Stylesheet
 * Minimalist, professional, responsive design
 */

/* ============================================
   Reset & Base Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */

.header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 50px;
    width: auto;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #612B3D;
    border: 1px solid #612B3D;
    border-radius: 3px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #612B3D;
    color: #fff;
}

.nav-link.logout {
    border-color: #999;
    color: #999;
}

.nav-link.logout:hover {
    background: #999;
    color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   Main Content & Container
   ============================================ */

.main {
    flex: 1;
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.no-projects {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

/* ============================================
   Group Layout
   ============================================ */

.group {
    margin-bottom: 3rem;
}

.group:first-child {
    margin-top: 0;
}

/* ============================================
   Card Grid
   ============================================ */

.group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .group {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 640px) {
    .group {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Card Base Styling
   ============================================ */

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    position: relative;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #612B3D;
}

.card-image {
    width: 100%;
    height: 160px;
    background: #f5f5f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image-placeholder {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    color: #999;
}

.placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #000;
    line-height: 1.3;
}

.card-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    flex-grow: 1;
    line-height: 1.5;
}

/* ============================================
   First Card in Group: Special Styling
   ============================================ */

.card-first-in-group {
    --group-color: #612B3D;
    --group-name: "Group";
    
    /* Thick borders on top and left */
    border-top: 5px solid var(--group-color);
    border-left: 5px solid var(--group-color);
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    
    margin-top: 2.5rem;
}

/* Display group name above the card */
.card-first-in-group::before {
    content: var(--group-name);
    position: absolute;
    top: -2rem;
    left: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--group-color);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Adjust spacing for first card group label */
.group .card-first-in-group {
    margin-top: 2.5rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
    padding: 1.5rem;
    background: #f9f9f9;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header-left {
        width: 100%;
        justify-content: center;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .main {
        padding: 1rem;
    }

    .header-title {
        font-size: 1.2rem;
    }

    .header-logo {
        height: 40px;
    }

    .card-first-in-group::before {
        top: -1.5rem;
        font-size: 0.8rem;
    }

    .card-first-in-group {
        margin-top: 2rem;
    }
}

/* ============================================
   Accessibility & Focus States
   ============================================ */

.card:focus-visible {
    outline: 2px solid #612B3D;
    outline-offset: -2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #612B3D;
    outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .header,
    .footer {
        display: none;
    }

    .main {
        padding: 0;
    }
}
