/* CMA — Base Styles */

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8f9fa;
}

h1 { font-size: 2rem; font-weight: 600; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }

a { color: #3498db; text-decoration: none; }
a:hover { color: #2980b9; text-decoration: underline; }

/* Layout */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.lead {
    font-size: 1.15rem;
    color: #636e72;
    margin-bottom: 1.5rem;
}

/* Navigation */
.main-nav {
    background: #fff;
    border-bottom: 1px solid #e1e8ed;
    padding: 0 1.5rem;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    font-size: 0.9rem;
    color: #636e72;
}

.nav-user {
    font-size: 0.9rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.nav-user:hover {
    color: #3498db;
    text-decoration: none;
}

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* Footer */
.main-footer {
    margin-top: 3rem;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #95a5a6;
    border-top: 1px solid #e1e8ed;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: #3498db;
    color: #fff;
}
.btn-primary:hover { background: #2980b9; color: #fff; }

.btn-secondary {
    background: #e1e8ed;
    color: #2c3e50;
}
.btn-secondary:hover { background: #d5dce2; color: #2c3e50; }

.btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #dadce0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-google:hover { background: #f8f9fa; color: #333; }

.btn-full { width: 100%; text-align: center; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.3rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d5dce2;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-page {
    max-width: 640px;
}

.input-code {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    margin-bottom: 1rem;
}

.input-code:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

.alert-success {
    background: #efe;
    color: #363;
    border-left: 4px solid #363;
}

.alert-info {
    background: #eef;
    color: #336;
    border-left: 4px solid #336;
}

/* Boxes */
.welcome-box, .action-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.action-box {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #3498db;
    color: #fff;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #95a5a6;
    font-size: 0.85rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e8ed;
}

.divider span {
    padding: 0 1rem;
}

/* Access Gate */
.gate-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

.gate-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 440px;
    width: 100%;
    padding: 3rem 2.5rem;
    text-align: center;
}

.gate-container h1 {
    margin-bottom: 0.5rem;
}

.gate-subtitle {
    color: #636e72;
    margin-bottom: 1.5rem;
}

/* Auth pages */
.auth-container {
    max-width: 420px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #636e72;
}

/* Collection pages */
.collection-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.collection-description {
    color: #636e72;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.collection-meta {
    display: flex;
    gap: 2rem;
    color: #636e72;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.collection-nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.nav-card {
    display: block;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nav-card:hover {
    text-decoration: none;
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.nav-card h3 {
    margin-bottom: 0.3rem;
}

.nav-card p {
    color: #636e72;
    font-size: 0.9rem;
}

/* Badges (shared) */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-public { background: #e8f5e9; color: #2e7d32; }
.badge-private { background: #fce4ec; color: #c62828; }
.badge-unlisted { background: #fff3e0; color: #e65100; }

.nav-link.active {
    color: #2c3e50;
    font-weight: 600;
}

.nav-collection-badge {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #ffe0b2;
}

.nav-collection-badge:hover {
    background: #ffe0b2;
    color: #e65100;
    text-decoration: none;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-card {
    display: block;
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #2c3e50;
    transition: box-shadow 0.15s, transform 0.15s;
}

.gallery-card:hover {
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.gallery-card__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #f0f2f5;
    overflow: hidden;
}

.gallery-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card__no-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.8rem;
    color: #95a5a6;
    gap: 0.25rem;
}

.gallery-card__no-thumb--audio { background: #f0e6ff; color: #7c3aed; }
.gallery-card__no-thumb--video { background: #e0f2fe; color: #0369a1; }

.gallery-card__type-icon {
    font-size: 2rem;
    line-height: 1;
}

.gallery-card__type-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-card__caption {
    padding: 0.5rem 0.75rem;
}

.gallery-card__title {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Asset Detail */
.asset-detail__image {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.asset-detail__image img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    margin: 0 auto;
}

.asset-detail__file-preview {
    padding: 3rem;
    text-align: center;
    background: #f0f2f5;
    width: 100%;
}

.asset-detail__file-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Audio player */
.asset-detail__audio {
    background: #f0e6ff;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.asset-detail__audio-icon {
    font-size: 3rem;
    color: #7c3aed;
    margin-bottom: 1rem;
}

.asset-detail__audio-player {
    width: 100%;
    max-width: 500px;
}

/* PDF embed */
.asset-detail__pdf-embed {
    width: 100%;
    height: 70vh;
    border: none;
}

.asset-detail__title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.asset-detail__description {
    color: #636e72;
    margin-bottom: 1.5rem;
}

.asset-detail__meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1.5rem;
    font-size: 0.9rem;
}

.asset-detail__meta dt {
    color: #95a5a6;
    font-weight: 500;
}

.asset-detail__meta dd {
    color: #2c3e50;
}

/* Account Page */
.account-section {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.account-section h2 {
    margin-bottom: 1rem;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.account-memberships {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-membership {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3e50;
    transition: background 0.15s;
}

.account-membership:hover {
    background: #e1e8ed;
    text-decoration: none;
}

.account-membership__name {
    font-weight: 500;
}

/* Join Page */
.join-container {
    max-width: 440px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    text-align: center;
}

.join-container h1 {
    margin-bottom: 1rem;
}

.join-container .form-group {
    text-align: left;
}

/* Tag Badges */
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    line-height: 1.4;
}

.tag-badge__link {
    color: #fff;
    text-decoration: none;
}

.tag-badge__link:hover {
    color: #fff;
    text-decoration: underline;
}

.tag-badge__remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.1rem;
}

.tag-badge__remove:hover {
    color: #fff;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #d5dce2;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
}

.tag-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.asset-detail__tags {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ed;
}

/* Gallery Tag Filter */
.gallery-tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.tag-filter-chip {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border: 1px solid #d5dce2;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #636e72;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.tag-filter-chip:hover {
    background: #e1e8ed;
    text-decoration: none;
    color: #2c3e50;
}

.tag-filter-chip--active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.tag-filter-chip--active:hover {
    color: #fff;
}

/* Public Entry List */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.entry-card {
    display: block;
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.entry-card:hover {
    text-decoration: none;
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.entry-card__body {
    padding: 1.25rem 1.5rem;
}

.entry-card__title {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.entry-card__date {
    font-size: 0.85rem;
    color: #636e72;
    margin-bottom: 0.5rem;
}

.entry-card__description {
    color: #636e72;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.entry-card__meta {
    font-size: 0.8rem;
    color: #95a5a6;
}

/* Public Entry Detail */
.entry-hero {
    margin-bottom: 1.5rem;
}

.entry-hero h1 {
    margin-bottom: 0.25rem;
}

.entry-hero__date {
    font-size: 0.95rem;
    color: #636e72;
}

.entry-description {
    color: #636e72;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Public Entry Notes */
.entry-notes-public {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e8ed;
}

.entry-note-public {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.entry-note-public__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.entry-note-public__content {
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
