/*
 * Sensorium Main Stylesheet
 *
 * Design System imports
 * These provide CSS custom properties (variables) and reusable components
 */

/* Core - Design tokens and reset */
@import url('core/_variables.css');
@import url('core/_reset.css');
@import url('core/_utilities.css');

/* Layouts */
@import url('layouts/_grid.css');

/* Components */
@import url('components/_buttons.css');
@import url('components/_cards.css');
@import url('components/_forms.css');
@import url('components/_badges.css');
@import url('components/_modal.css');
@import url('components/_navbar.css');
@import url('components/_pagination.css');
@import url('components/_alerts.css');
@import url('components/_breadcrumb.css');
@import url('components/_icons.css');
@import url('components/_pages.css');

/*
 * Legacy styles below - will be gradually migrated to component files
 * See docs/CSS_CONSOLIDATION_PLAN.md for migration roadmap
 */

/* Note: Basic reset is now in core/_reset.css but keeping overrides for backwards compatibility */
* {
    box-sizing: border-box;
}

strong {
    color: var(--color-primary, #E56200);
}

body {
    background-color: var(--color-bg, #F5F1EA);
}

/* Navbar styles migrated to components/_navbar.css */

h1, h2, h3, h4 {
    font-weight: var(--font-weight-bold);
}

h1 {
    font-size: var(--font-size-2xl);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

h2 {
    font-size: var(--font-size-xl);
    color: var(--color-primary);
    margin-bottom: var(--space-3);
}

h3 {
    font-size: var(--font-size-lg);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

h4 {
    font-size: var(--font-size-base);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
    margin-top: 0;
    margin-bottom: var(--space-4);
}

p {
    font-size: var(--font-size-base, 1em);
    margin-bottom: var(--space-4, 1em);
}

a {
    color: var(--color-primary, #E56200);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.main-container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-5, 20px);
    padding-top: var(--navbar-height, 70px); /* Account for fixed navbar height */
}

.container {
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 0;
}

@media (max-width: 720px) {
    .main-container {
        padding-left: 0;
        padding-right: 0;
    }

    .container {
        padding: 0 2px;
    }
}

@media (max-width: 520px) {
    .main-container {
        padding-left: 0;
        padding-right: 0;
    }

    .container {
        padding: 0 2px;
    }
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5, 20px);
    margin-bottom: var(--space-12, 60px);
}

.dashboard-card {
    background-color: var(--color-bg-card, white);
    border-radius: var(--radius-md, 8px);
    padding: var(--space-5, 20px);
    min-height: 350px;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.05));
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: var(--space-3, 10px);
    font-size: var(--font-size-xl, 22px);
    color: var(--color-text);
    margin-bottom: var(--space-5, 20px);
}

.placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
    background-color: var(--color-bg, #F5F1EA);
    border-radius: var(--radius-md, 6px);
    color: var(--color-text-light, #777);
}

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

.card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1, 0.25rem);
    width: 100%;
    margin: 0 auto;
}

.collation-card {
    background: var(--color-bg-card, white);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-md, 0 2px 4px rgba(0,0,0,0.1));
    margin-bottom: var(--space-2, 0.5rem);
    padding: var(--space-2, 0.5rem);
    transition: transform var(--transition-base, 0.2s ease), box-shadow var(--transition-base, 0.2s ease);
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: var(--space-2, 0.5rem);
    contain: layout style paint;
}

.collation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 4px 8px rgba(0,0,0,0.15));
}

.collation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-1, 0.2rem);
    grid-column: 2;
}

.collation-card-body {
    color: var(--color-text, #444);
    font-size: var(--font-size-base, 1rem);
    line-height: var(--line-height-normal, 1.5);
    margin-bottom: 0;
    overflow: hidden;
    grid-column: 2;
}

.collation-card-footer {
    display: flex;
    gap: 0.2rem;
    border-top: 1px solid var(--color-border-light);
    padding-top: 0.5rem;
    margin-top: auto;  /* Push to bottom */
    grid-column: 2 / -1;
    justify-content: flex-end;  /* Align content to right */
    align-self: end;  /* Align to bottom */
}

.collation-card-image {
    grid-column: 1;
    grid-row: 1 / -1;  /* Span from first to last row */
    overflow: hidden;
    border-radius: 4px;
}

.collation-card-image img {
    width: 100%;
}

.collation-card-image a,
.collation-dashboard-card-image a,
.link-dashboard-card-image a,
.story-card-image a,
.feed-image a {
    display: block;
    height: 100%;
}

@media (max-width: 768px) {
    .collation-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }

    .collation-card-image {
        grid-column: 1;
        grid-row: 1;
    }

    .collation-card-header {
        grid-column: 1;
        grid-row: 2;
    }

    .collation-card-body {
        grid-column: 1;
        grid-row: 3;
    }

    .collation-card-footer {
        grid-column: 1;
        grid-row: 4;
    }
}

.collation-dashboard-card {
    background: var(--color-bg-card, white);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-md, 0 2px 4px rgba(0,0,0,0.1));
    margin-bottom: var(--space-2, 0.5rem);
    padding: var(--space-2, 0.5rem);
    transition: transform var(--transition-base, 0.2s ease), box-shadow var(--transition-base, 0.2s ease);
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
}

.collation-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 4px 8px rgba(0,0,0,0.15));
}

.collation-dashboard-card-image {
    overflow: hidden;
    border-radius: 4px;
}

.collation-dashboard-card-image img {
    width: 100%;
}

.collation-dashboard-card-body {
    color: var(--color-text, #444);
    font-size: var(--font-size-base, 1rem);
    line-height: var(--line-height-normal, 1.5);
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    max-width: 100%;  /* Ensure it doesn't overflow container */
}

.section-header h1 {
    margin: 0;
    flex-shrink: 0;
}

.section-header__actions {
    display: flex;
    gap: 10px;
}

.section-title {
    font-size: 28px;
    color: var(--color-text);
    font-weight: bold;
    margin: 0;
}

.more-link {
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-left: auto;
    white-space: nowrap;
}

.collation-title {
    font-size: 22px;
    color: var(--color-primary);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collation-title h2 {
    margin: 0;
}

.collation-desc {
    color: var(--color-text-muted);
    margin-bottom: 15px;
    line-height: 1.5;
}

/* .collation-meta — defined once below near collation-header */

.update-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.publish-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.published {
    background-color: var(--color-success-light);
    color: var(--color-success);
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.published-date {
    color: var(--color-text-muted);
}

.icon {
    display: inline-block;
}

.collations-container {
    margin-bottom: 0px;
}

.header-top {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.logo-container {
    display: flex;
    align-items: center; /* This ensures vertical alignment */
}

.logo {
    height: 35px;
    width: auto;
    margin-right: 2px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-title {
    font-size: 1.2em;
    color: #fff;
    font-weight: bold;
    flex-shrink: 0;
}

.sections-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 10px 0;
    /* Stay pinned below the fixed navbar while the page scrolls */
    position: sticky;
    top: var(--navbar-height, 70px);
    z-index: var(--z-sticky, 500);
    background-color: var(--color-bg);
}

.section-tab {
    padding: 8px 16px;
    background-color: var(--color-bg-hover);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.section-tab:hover {
    background-color: var(--color-bg-active);
}

.section-tab.active {
    background-color: var(--color-primary);
    color: white;
}

.search-and-collate-container {
    margin-bottom: 20px;
    width: 200px;
    flex-shrink: 0; /* Prevent container from shrinking */
    position: sticky;
    top: 70px; /* Account for navbar height */
    z-index: 999;
    background-color: var(--color-bg);
    height: fit-content; /* Ensure container fits its content */
}

.links-container {
    margin-top: 0px;
    overflow-y: auto;
    padding: 0px;
    flex: 1; /* Allow container to take remaining space */
}

/* Loading/empty-state/error-message styles migrated to components/_alerts.css */

.grid-container {
    display: grid;
    /*grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));*/
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-list-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.grid-item {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    border-radius: 2px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 10px;  /* Reduced vertical gap to 5px, horizontal to 10px */
    align-items: start;
    align-content: start;  /* This squeezes content to the top */

}

.label {
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.label span {
    flex: 0 1 auto;
}

.label .button-container {
    margin-left: 0;
    flex: 0 0 auto;
}


.value {
    word-break: break-word;
    grid-column: 2;
}

.value input[type="text"],
.value input[type="url"],
.value input[type="date"],
.value textarea {
    width: 100%;
}

.value textarea {
    height: 6em;  /* This is approximately 4 lines of text */
    min-height: 6em;  /* Ensures the textarea doesn't shrink smaller than 4 lines */
    resize: vertical;  /* Allows vertical resizing if needed */
}

.analysis-hover {
    background-color: rgba(229, 98, 0, 0.05);
    position: relative;
}

.analysis-hover:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px;
    background-color: rgba(229, 98, 0, 0.9);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 2000;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

/* New style for the title row to display elements inline */
.title-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .title-row-inline h4 {
    margin: 0;
    display: inline;
    padding-right: 5px;
  }

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

th, td {
    border: 1px solid var(--color-border);
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}

th {
    background-color: var(--color-bg-hover);
    font-weight: bold;
    color: var(--color-text);
}

tr:nth-child(even) {
    background-color: var(--color-bg);
}

input[type="text"], input[type="date"] {
    width: 100%;
    padding: 5px;
    margin-bottom: 5px;
}

button[type="submit"]:not(.btn) {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
}

button[type="submit"]:not(.btn):hover {
    background-color: var(--color-primary-hover);
}

.search-container {
    background: var(--color-bg-card);
    padding: .2 rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

.panel-toggle {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.panel-toggle button:not(.btn) {
    background-color: var(--color-primary);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.panel-toggle button:not(.btn):hover {
    background-color: var(--color-primary-hover);
}

.panel-toggle h2 {
    margin: 0;
    font-size: 0.8 em;
}

#searchToggleIcon {
    font-size: 12px;
    line-height: 1;
}

.search-inputs-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    align-items: flex-end;
}

.search-input {
    display: flex;
    flex-direction: column;
}

.search-input input[type="checkbox"] {
    margin-left: 0;
    margin-top: 0.5rem;
    align-self: flex-start;
}

.search-input label {
    margin-bottom: 0.5rem;
}

.search-input button:not(.btn) {
    height: 2rem;
    align-self: flex-end;
}

.hidden {
    display: none;
}

.id-button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.id-button-container span {
    font-weight: bold;
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
    align-items: center;
}

.edit-button, .delete-button, .update-button, .add-button {
    padding: var(--space-1, 4px) var(--space-3, 12px);
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm, 4px);
    font-size: var(--font-size-xs, 0.75rem);
    line-height: 1.25;
}

.edit-button {
    background-color: var(--color-primary);
    color: white;
}

.delete-button {
    background-color: var(--color-danger);
    color: white;
}

.update-button, .add-button {
    background-color: var(--color-primary);
    color: white;
}

.edit-button:hover {
    background-color: var(--color-primary-hover);
}

.delete-button:hover {
    background-color: var(--color-danger-hover);
}

.update-button:hover {
    background-color: var(--color-primary-hover);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.value.title {
    font-weight: bold;
    font-size: 1.2em;
}

/* Add these rules to handle images in feed entry descriptions */
.feed-description img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.feed-description figure {
    margin: 0;
    max-width: 100%;
}

.feed-description figcaption {
    font-size: 0.9em;
    color: #666;
}

/* Commentary styles */
.commentary-container {
    margin: 8px 0;
    padding: 10px;
    background-color: var(--color-bg-hover);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 4px 4px 0;
    grid-column: 2;
}

.commentary-label {
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 5px;
    font-size: 0.9em;
}

.commentary-text {
    font-style: italic;
    color: var(--color-text-muted);
    margin-bottom: 5px;
}

.edit-commentary-btn {
    padding: 2px 8px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.edit-commentary-btn:hover {
    background-color: var(--color-primary-hover);
}

/* Active view in collation header */
.active-view {
    font-weight: bold;
    color: var(--color-primary);
}

/* Admin badge — deprecated; use nav-link--icon with SVG gear instead */
.admin-badge {
    display: none;
}

/* Deprecated: Write permission badge - kept for backwards compatibility */
.write-permission-badge {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    margin-left: 8px;
    font-size: 14px;
    cursor: default;
}


.feed-container {
    flex: 1; /* Allow feed container to take remaining space */
    margin-left: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.feed-grid {
    display: grid;
    grid-template-columns: 1fr;  /* Changed from previous value to ensure single column */
    gap: 0.25rem;
    width: 100%;  /* Changed from max-width: 800px to 100% */
    margin: 0 auto;
}

.feed-card {
    background: var(--color-bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.1rem;
    padding: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
    contain: layout style paint;
}

@media (min-width: 769px) {
    .feed-card {
        grid-template-columns: 200px minmax(0, 1fr);
        grid-template-rows: auto auto auto auto;
    }
}

.feed-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@keyframes loading {
    0% { background-position: -200px 0 }
    100% { background-position: 200px 0 }
}

.feed-card.loading {
    background: linear-gradient(90deg, var(--color-bg-hover) 25%, var(--color-bg-active) 50%, var(--color-bg-hover) 75%);
    background-size: 200px 100%;
    animation: loading 1.5s infinite linear;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

@media (min-width: 769px) {
    .feed-header { grid-column: 2; }
}

.feed-date {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.feed-image {
    margin: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: var(--color-bg-hover);
    position: relative;
    max-width: 200px;
    max-height: 200px;
}

@media (min-width: 769px) {
    .feed-image {
        grid-column: 1;
        grid-row: 1 / span 7;
        max-height: none;
    }
}

/* Specific styles for feed-image within title-row */
.title-row .feed-image {
    flex-shrink: 0;
    width: 200px;
    grid-column: unset;
    grid-row: unset;
}

.story-card {
    background: var(--color-bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.story-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.link-dashboard-card {
    background: var(--color-bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.link-dashboard-card-image {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: var(--color-bg-hover);
    border-radius: 4px;
}

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

.link-dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Override grid layout for view_link page feed-card */
.feed-card .title-row {
    /* This selector ensures the parent feed-card is styled correctly */
}

.feed-card .title-row ~ * {
    /* Reset grid positioning for siblings after title-row */
    grid-column: unset;
    grid-row: unset;
}

/* Alternative: Create a specific override for the view_link page */
.view-link-page .feed-card {
    display: block;
    grid-template-columns: unset;
    grid-template-rows: unset;
}

.feed-image img {
    width: 100%;
    height: 100%;  /* Changed from auto */
    object-fit: cover;
    position: absolute;  /* Position within the container */
    top: 0;
    left: 0;
    transition: opacity 0.3s ease-in;
}

.feed-image img.loaded {
    opacity: 1;
}

.feed-source strong {
    color: var(--color-memia-ink);
}

.feed-title {
    margin: 0 0 0.5rem 0;
}

.feed-title a {
    color: var(--color-text);
    text-decoration: none;
}

.feed-title a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.feed-description {
    color: var(--color-text-muted);
    font-size: var(--font-size-base);
    line-height: 1.5;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 769px) {
    .feed-description { grid-column: 2; }
}

.feed-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--color-border-light);
    padding-top: 0.5rem;
    margin-top: 0.4rem;
}

@media (min-width: 769px) {
    .feed-actions { grid-column: 2 / -1; }
}

.import-btn:not(.btn), .delete-btn:not(.btn), .view-link:not(.btn), .mark-read-btn:not(.btn) {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.import-btn:not(.btn), .mark-read-btn:not(.btn) {
    background: var(--color-primary);
    color: white;
}

.import-btn.imported:not(.btn) {
    background: var(--color-primary-hover);
}

.view-link:not(.btn) {
    background: var(--color-text-muted);
    color: white;
    text-decoration: none;
}

.delete-btn:not(.btn) {
    background: var(--color-danger);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .feed-container {
        padding: 0.5rem;
    }

    .feed-card {
        margin-bottom: 1rem;
    }

    .feed-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header {
        flex-wrap: wrap;
    }

    .section-header__actions {
        flex-wrap: wrap;
    }

    .search-container {
        padding: 0.5rem;
    }

    .search-input {
        flex: 1 1 100%;
    }
}

/* Floating action button */
.floating-action {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.summarize-btn {
    background: var(--color-primary);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.summarize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

/* Card improvements */
.card-title {
    margin-bottom: 1rem;
    color: var(--color-text);
}

.card-title a {
    color: var(--color-text);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.card-title.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.collation-card h2 a {
    color: var(--color-text);
    text-decoration: none;
}

.collation-card h2 a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.card-summary {
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
    line-height: 1.5;
}


.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

@media (min-width: 769px) {
    .card-summary {
        grid-column: 2;  /* Ensure it spans the content column */
        grid-row: 2;
    }

    .tag-group {
        grid-column: 2;
        grid-row: 3;
    }
}

.tag-label {
    font-weight: inherit;
    color: inherit;
    font-size: inherit;
}

.tag-group a {
    background: var(--color-bg-hover);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.tag-group a:hover {
    background: var(--color-bg-active);
    text-decoration: none;
}

.card-footer {
    border-top: 1px solid var(--color-border-light);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.card-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Add styles for view controls */
.view-controls {
    margin-bottom: 1rem;
    text-align: right;
}

.toggle-btn {
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

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


.link-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.title-group {
    flex: 1;
}

.action-link {
    display: flex;
    gap: 0 rem;
    /*margin-left: auto;*/
    flex-shrink: 0;
    max-width: 100%;  /* Ensure buttons don't overflow */
}

.inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

/* Only override non-btn button styles in inline-form */
.inline-form button:not(.btn) {
    margin: 0;
    padding: var(--space-1, 4px) var(--space-3, 12px);
    vertical-align: middle;
    line-height: 1.25;
    height: auto;
    min-height: 0;
    border: none;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 500;
}

.content-section {
    background: var(--color-bg-card);
    border-radius: 2px;
    padding: 0.2rem;
    margin-bottom: 0.2rem;
    box-shadow: var(--shadow-md);
}

.info-grid, .analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.2rem;
}

.info-item, .analysis-item {
    margin-bottom: 0.2rem;
}

.link-url {
    word-break: break-all;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;  /* Reduced gap between button and heading */
    margin: 1px;
    margin-bottom: 4px;
}

.advanced-toggle h2 {
    margin: 0;  /* Remove default margins from heading */
}


.advanced-content {
    margin-top: 1rem;
}

.advanced-content textarea {
    width: 100%;
    min-height: 200px;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .link-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-grid, .analysis-grid {
        grid-template-columns: 1fr;
    }

    .view-link-page .title-row {
        flex-direction: column;
        align-items: stretch;
    }

    .view-link-page .title-header {
        flex-direction: column;
        align-items: stretch;
    }

    .view-link-page .title-header .card-actions {
        justify-content: flex-start;
    }
}

/* Add this new style for the search toggle button */
#toggle-search:not(.btn) {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    height: 40px;
    line-height: 20px;
}

#toggle-search:not(.btn):hover {
    background-color: var(--color-primary-hover);
}

.import-url-btn:not(.btn) {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    height: 20px;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
}

.import-url-btn:not(.btn):hover {
    background-color: var(--color-primary-hover);
    text-decoration: none;
}

/* .empty-state migrated to components/_alerts.css */

/* Pagination styles migrated to components/_pagination.css */

.formatted-list ol {
    padding-left: 20px;
    margin: 4;
    margin-top: 0;  /* Add small top margin */
    list-style-position: outside;
}

.formatted-list li {
    margin-bottom: 0.2em;
    list-style: circle;
}

.newsletter-item .formatted-list ul {
    list-style: disc;
    list-style-position: outside;
    padding-left: 20px;
    margin: 0;
}

.newsletter-item .formatted-list ul > li {
    list-style: disc;
}

.title-group .description {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1em;
}

.cached-content__status {
    margin: 0 0 8px;
    color: var(--color-text-muted);
}

.cached-content__versions {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    max-height: 14em;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.cached-content__versions li + li {
    border-top: 1px solid var(--color-border-light);
}

.cached-content__version {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    background: none;
    color: var(--color-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.cached-content__version:hover {
    background-color: var(--color-bg-hover);
}

.cached-content__version.is-selected {
    background-color: var(--color-bg-active);
    font-weight: 600;
}

.cached-content__viewer-title {
    margin-bottom: 4px;
    font-weight: 600;
}

.cached-content__viewer textarea {
    width: 100%;
    resize: vertical;
}

.raw-html-process textarea {
    width: 100%;
    height: 6em;  /* Match the height of other textareas */
    min-height: 6em;
    resize: vertical;
}

.left-column-panel {
    width: 100%;
    background-color: var(--color-bg-card);
    padding: 4px;
}

.collate-panel {
    flex: 0 0 250px;
    height: fit-content;
    margin-top: 0;
    position: sticky;
    top: 140px;
}

.collation-select {
    width: 100%;
    padding: 2px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background-color: var(--color-bg-card);
    color: var(--color-text);
}

.action-button:not(.btn) {
    background-color: var(--color-primary);
    color: white;
    padding: var(--space-1, 4px) var(--space-3, 12px);
    border: none;
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-xs, 0.75rem);
    display: inline-flex;
    align-items: center;
    line-height: 1.25;
}

.action-button:not(.btn):hover {
    background-color: var(--color-primary-hover);
    text-decoration: none;
}

.collation-button:hover {
    background-color: var(--color-primary-hover);
}

.collation-button:disabled {
    background-color: var(--color-primary-hover);
    cursor: not-allowed;
}

.collation-selection {
    /*margin-top: 1rem;*/
    padding: 0.5rem;
    background-color: var(--color-bg-hover);
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.selection-container {
    display: flex;
    gap: 1rem;
    margin-top: 0rem;
}

.collation-tag {
    background-color: var(--color-bg-hover);
    color: var(--color-text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Horizontal search bar for Imported Links and Review Feeds pages */
.links-search-bar {
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    margin-bottom: 16px;
    position: sticky;
    top: var(--navbar-height, 70px);
    z-index: var(--z-sticky, 500);
    background-color: var(--color-bg);
}

/* Settings pages: search bar scrolls with the content instead of sticking under the navbar */
.links-search-bar--static {
    position: static;
}

.links-search-bar .search-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.search-bar-main {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-bar-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: var(--color-bg-card);
    color: var(--color-text);
}

.search-bar-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(229, 98, 0, 0.1);
}

.search-advanced {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border, #e0e0e0);
}

/* Single-line summary of the active filter, shared by Review Feeds and Imported Links */
.filter-summary {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--color-text-muted, #6b7280);
    min-width: 0;
}

.filter-summary__label {
    font-weight: 600;
    flex-shrink: 0;
}

.filter-summary__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.filter-summary__edit {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--color-primary, #e56200);
    cursor: pointer;
}

.filter-summary__edit:hover {
    text-decoration: underline;
}

.search-advanced__actions {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.links-search-bar .search-inputs-wrapper {
    gap: 1rem;
    align-items: flex-start;
}

.links-search-bar .search-input input[type="text"],
.links-search-bar .search-input input[type="date"],
.links-search-bar .search-input select {
    width: 140px;
}

.links-search-bar .search-input--api {
    align-self: flex-end;
}

.links-search-bar .search-inputs-wrapper + .search-inputs-wrapper {
    margin-top: 1rem;
}

.api-params-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
}

.api-params-code {
    flex: 1;
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg-subtle, #f5f5f5);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--color-text, #222);
}

/* Section picker */
.section-picker-btn--active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.section-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-backdrop);
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.section-picker-popup {
    background: var(--color-bg-card, #fff);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 360px;
    max-width: 95vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    z-index: var(--z-modal);
}

.section-picker-popup__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
}

.section-picker-popup__close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0 var(--space-1);
}
.section-picker-popup__close:hover { color: var(--color-text); }

.section-picker-popup__body {
    padding: var(--space-3) var(--space-4);
    overflow-y: auto;
    flex: 1;
}

.section-picker-popup__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-border);
}

.section-picker-empty {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    padding: var(--space-4) 0;
}

/* Tree rows */
.sp-section { margin-bottom: var(--space-2); }

.sp-section__row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
}
.sp-section__row:hover { background: var(--color-bg-hover); }

.sp-section__arrow {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    width: 12px;
    text-align: center;
    user-select: none;
}

.sp-section__name { flex: 1; }

.sp-subsections {
    padding-left: var(--space-6);
    margin-top: var(--space-1);
}

.sp-subsection__row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.sp-subsection__row:hover { background: var(--color-bg-hover); color: var(--color-text); }

/* Feed picker (Review Feeds) - extends the section picker popup */
#feedPickerBtn {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-picker-popup {
    width: 440px;
    height: 70vh;
}

.feed-picker-tools {
    padding: var(--space-3) var(--space-4) var(--space-2);
    border-bottom: 1px solid var(--color-border);
}

.feed-picker-search {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}
.feed-picker-search:focus {
    outline: none;
    border-color: var(--color-primary);
}

.feed-picker-tools__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.feed-picker-count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.feed-picker-tools__actions {
    display: flex;
    gap: var(--space-3);
}

.feed-picker-tools__actions button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-primary);
}
.feed-picker-tools__actions button:hover { text-decoration: underline; }

.feed-picker-row { font-weight: normal; }

.feed-picker-tag {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0 var(--space-1);
}

/* Add new styles for the container layout */
.links-layout {
    display: flex;
    gap: 20px;
    max-width: none; /* Remove max-width constraint */
    margin: 0; /* Remove auto margins */
    padding: 0 20px; /* Add some padding on the sides */
}

/* Responsive layout for mobile */
@media (max-width: 768px) {
    .content-layout {
        flex-direction: column;
    }

    .links-layout {
        flex-direction: column;
        padding: 0 10px; /* Reduce padding on mobile */
    }

    .collation-panel {
        flex: none;
        width: 100%;
    }

    .search-and-collate-container {
        width: 100%;
        position: relative;
        top: 0;
    }

    .links-container {
        margin-left: 0;
        width: 100%; /* Ensure full width on mobile */
    }
}

.scroll-spacer {
    /* Gives the last feed cards room to scroll past the top of the viewport,
       so they get marked as read the same way every other card does. */
    height: calc(100vh + 50px);
}

.entries-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-bg-card);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
    z-index: var(--z-sticky);
    font-size: var(--font-size-sm);
}

.section-container {
    margin-bottom: 2rem;
}

.section-heading {
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.link-item {
    background: var(--color-bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 0.5rem;
    contain: layout style paint;
}

/* Add this for the element in the first column */
.link-item > *:first-child {
    grid-row: 1 / -1;  /* This makes it span from row 1 to the last row */
}

.link-image {
    width: 200px;
}

.content-section .toggle-icon {
    font-size: 12px;
    line-height: 1;
}

.publisher-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    flex-shrink: 0;
}

.title-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 0.5rem;
}

@media (min-width: 769px) {
    .title-row {
        grid-column: 2;
        grid-row: 1;
    }
}

.title-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.title-header {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    justify-content: space-between;
}

.title-row .card-title {
    margin: 0;
    line-height: 1.2;
    flex: 1;  /* Added to allow title to take remaining space */
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.card-actions-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.card-actions-btns {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.newsletter-button {
    padding: 8px 16px;
    margin-right: 16px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.newsletter-button:hover {
    background-color: var(--color-primary-hover);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 500;
}

.status-badge.draft {
    background-color: var(--color-warning-light);
    color: var(--color-warning-text);
}

.status-badge.published {
    background-color: var(--color-success-light);
    color: var(--color-success-text);
}

.status-badge.stale {
    background-color: var(--color-warning-light);
    color: var(--color-warning-text);
}

.stale-stories-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 12px;
    border-radius: 4px;
    background-color: var(--color-warning-light);
    color: var(--color-warning-text);
}

.published-date {
    color: var(--color-text-muted);
    font-size: 0.7em;
}

.button {
    padding: var(--space-1, 4px) var(--space-3, 12px);
    border-radius: var(--radius-sm, 4px);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin: 2px;
    text-align: center;
    min-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    vertical-align: middle;
    line-height: 1.25;
    box-sizing: border-box;
}

.button.view {
    background-color: var(--color-primary);
}

.button.add-new {
    background-color: var(--color-primary);
}

.button.add {
    background-color: var(--color-primary);
}

.button.edit {
    background-color: var(--color-primary);
}

.button.delete {
    background-color: var(--color-danger);
}

.button:hover {
    opacity: 0.9;
    text-decoration: none;
    color: white;
}

/* Ensure submit buttons have consistent height with anchor buttons */
button.button[type="submit"] {
    height: auto;
    min-height: 0;
    padding: var(--space-1, 4px) var(--space-3, 12px);
    line-height: 1.25;
    vertical-align: middle;
    border: none;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 500;
    box-sizing: border-box;
}

.button-group {
    gap: 8px;
    /*height: 36px;*/
    padding: 4px 8px;
    display: inline-flex; /*flex*/
    align-items: center;
    justify-content: center;
    box-sizing: border-box;  /* Add this to include padding in height calculation */
    margin: 0;  /* Add this to remove any default margins */
    font: inherit;  /* Add this to ensure consistent font sizing */
}

.preview-links-list {
    padding-left: 1.5em;
    margin: 0;
    list-style: disc;
}

.preview-links-list li {
    list-style: disc;
    margin-bottom: 0.1em;
}

/* Add these new styles for expand/collapse functionality */
.toggle-links {
    color: var(--color-primary);
    cursor: pointer;
    display: inline-block;
    margin-top: 5px;
    font-size: 0.9em;
}

.toggle-links:hover {
    text-decoration: underline;
}

.hidden-links {
    display: none;
}

.collation-item-type {
    font-size: 0.7em;
    font-weight: 500;
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle;
    opacity: 0.6;
}

.collation-item-type--story {
    background-color: var(--color-primary-light, #e8f0fe);
    color: var(--color-primary, #4a6fa5);
}

.collation-item-type--link {
    background-color: var(--color-bg, #f5f5f5);
    color: var(--color-text-muted, #888);
}

.link-thumbnail {
    width: 200px;
}

/* Responsive layout for mobile */
@media (max-width: 768px) {
    .search-and-collate-container {
        float: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .feed-container {
        margin-left: 0; /* Reset margin on mobile */
    }
}

/* Breadcrumb styles migrated to components/_breadcrumb.css */

/* Collation masthead: mirrors the Substack post header (kicker, title, subtitle, byline) */
.collation-view-switch {
    margin: 0 0 16px;
}

.collation-masthead {
    --masthead-font: 'SF Pro Display', -apple-system, system-ui, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    max-width: 760px;
    margin: 0 auto 24px;
    padding: 0 16px;
    font-family: var(--masthead-font);
    text-align: left;
}

.collation-masthead__kicker {
    font-size: 14px;
    line-height: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b6b6b;
    margin-bottom: 8px;
}

.collation-masthead__title {
    margin: 0 0 12px;
    font-size: 40px;
    line-height: 1.15;
    font-weight: 700;
    color: #363737;
}

.collation-masthead__title a {
    color: inherit;
    text-decoration: none;
}

.collation-masthead__subtitle {
    font-size: 20px;
    line-height: 1.4;
    color: #6b6b6b;
    margin-bottom: 20px;
}

.collation-masthead__byline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.collation-masthead__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.collation-masthead__byline-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.collation-masthead__author {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #363737;
}

.collation-masthead__date {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b6b6b;
}

.collation-masthead .collation-card-footer {
    margin-top: 16px;
}

@media (max-width: 720px) {
    .collation-masthead__title {
        font-size: 30px;
    }

    .collation-masthead__subtitle {
        font-size: 18px;
    }
}

.display-export-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

/* Collation assignment edit button */
.assignment-edit-btn {
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

.assignment-edit-btn:hover {
    background-color: var(--color-primary) !important;
    color: white !important;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.feed-image img {
    cursor: pointer;
    transition: 0.3s;
}

.feed-image img:hover {
    opacity: 0.7;
}

/* Flash/alert styles migrated to components/_alerts.css */

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

.admin-grid-item {
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.admin-grid-item:hover {
    transform: translateY(-2px);
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    height: 56px; /* Increased to accommodate larger logo */
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.google-login-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.google-login-btn:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.google-login-btn img {
    width: 40px;
    height: 40px;
    border: none;
}

.newsletter-item {
    display: flex;
    flex-direction: column;
    text-align: left;
    background: var(--color-bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.newsletter-item > * {
    width: 100%;
}

/* Create a new style for feed images to be inline */
.inline-feed-image {
    margin: 1rem 0;
    overflow: hidden;
    width: 400px;
    display: block;
    background-color: var(--color-bg-hover);
}

.inline-feed-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease-in;
}

/* Hide the original feed-image class in link-item */
.link-item .feed-image {
    display: none;
}

.newsletter-item .value {
    margin-bottom: 10px;
}

.newsletter-item .value:last-of-type {
    margin-bottom: 0;
}

/* Feed list styles */
.refresh-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button.full-width {
    max-width: none;
    width: auto;
}

/* Mobile hamburger menu styles migrated to components/_navbar.css */

.uncertainty-tag-inline {
    display: inline-block;
    background-color: var(--color-info-light);
    border: 1px solid var(--color-info);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    line-height: normal;
    vertical-align: baseline;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.uncertainty-tag-inline a {
    color: var(--color-info);
    text-decoration: none;
    font-weight: 500;
}

.uncertainty-tag-inline:hover {
    background-color: var(--color-bg-active);
}

.uncertainty-tag-inline:hover a {
    text-decoration: underline;
}
