/* Catálogo Premios Manuel Lourenzo 2026 - FETEAGAL */
:root {
    --c-dark: #1A1A2E;
    --c-accent: #E94560;
    --c-gold: #C8963E;
    --c-light: #F5F5F5;
    --c-mid: #DEDEDE;
    --c-text: #2C2C2C;
    --c-subtext: #666666;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--c-text);
    background: #fafafa;
    line-height: 1.7;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--c-accent);
    color: white;
    padding: 8px;
    z-index: 100;
    text-decoration: none;
}
.skip-link:focus {
    top: 0;
}

/* Header */
.header {
    background: var(--c-dark);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: var(--c-accent);
}
.header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.header p { color: var(--c-gold); font-size: 1.1rem; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: hidden;
}

/* Filters */
.filters {
    background: white;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}
.filters input, .filters select {
    padding: 0.5rem;
    border: 1px solid var(--c-mid);
    border-radius: 4px;
    font-size: 0.9rem;
}
.filters input { flex: 1; min-width: 200px; }

/* Show grid - new for candidaturas */
.show-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
    overflow-x: hidden;
}
.show-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #eee;
}
.show-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.show-card-link:hover .show-card {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}
.show-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}
.show-card-poster {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--c-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.show-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.show-card-poster .no-poster {
    color: var(--c-subtext);
    font-size: 0.9rem;
}
.show-card-body {
    padding: 1rem;
    /* Fix long text issues */
    overflow-wrap: break-word;
}

.show-card-body h3 {
    margin-bottom: 0.3rem;
    /* Allow title wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.company-name {
    color: var(--c-subtext);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    /* Handle long company names */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix photo-item for long filenames */
.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    text-align: center;
    background: #f5f5f5;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.photo-item img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.photo-item .label {
    font-size: 0.85rem;
    color: var(--c-subtext);
    margin-top: 0.25rem;
}

.photo-item .filename {
    font-size: 0.75rem;
    color: var(--c-subtext);
    margin-top: 0.25rem;
    /* Critical: handle long filenames */
    word-break: break-all;
    font-family: monospace;
    max-height: 2.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.show-card-body h3 {
    margin-bottom: 0.3rem;
}
.show-card-body h3 a {
    color: var(--c-dark);
    text-decoration: none;
}
.show-card-body h3 a:hover {
    color: var(--c-accent);
}
.show-card-body .company-name {
    color: var(--c-subtext);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Company card (old, kept for reference) */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}
.company-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #eee;
}
.company-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}
.company-card-header {
    background: var(--c-dark);
    color: white;
    padding: 1rem;
    position: relative;
}
.company-card-header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--c-accent);
}
.fed-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    white-space: nowrap;
    float: none;
}
.fed-Feteagal { background: #1A5276; }
.fed-Fegatea { background: #1E8449; }
.fed-Independente { background: #7D6608; }
.company-card-body { padding: 1rem; }
.company-card-body h3 { margin-bottom: 0.5rem; }
.company-card-body h3 a { color: var(--c-dark); text-decoration: none; }
.company-card-body h3 a:hover { color: var(--c-accent); }
.company-card-body .location {
    color: var(--c-subtext);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.show-count { color: var(--c-subtext); font-size: 0.85rem; }
.show-list { 
    list-style: none; 
    padding-left: 0; 
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.show-list li { 
    padding: 0.2rem 0; 
    color: var(--c-text);
}
.show-list a { 
    color: #1155CC; 
    text-decoration: none;
}
.show-list a:hover { text-decoration: underline; }

/* Company page */
.company-header {
    background: var(--c-dark);
    color: white;
    padding: 2rem 1rem;
    position: relative;
}
.company-header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background: var(--c-accent);
}
.company-meta {
    color: var(--c-mid);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.meta-separator {
    color: var(--c-subtext);
}

/* Show TOC */
.show-toc {
    position: sticky;
    top: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}
.show-toc h3 { margin-bottom: 0.5rem; color: var(--c-dark); }
.show-toc ul { list-style: none; padding-left: 0; }
.show-toc li { padding: 0.3rem 0; }
.show-toc a {
    color: var(--c-text);
    text-decoration: none;
    transition: color 0.2s;
}
.show-toc a:hover { color: var(--c-accent); }

/* Show section */
.show-section {
    background: white;
    padding: 2rem;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 6px solid var(--c-accent);
}
.show-section:nth-child(even) { background: #fafafa; }
.show-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}
.show-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.show-title-section {
    flex:1;
}
.show-title-section h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.show-number {
    background: var(--c-accent);
    color: white;
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}
.show-title {
    color: var(--c-dark);
    font-size: 1.3rem;
    font-weight: 600;
}
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}
.category-tag {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.category-tag-more {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    background: var(--c-mid);
    color: var(--c-text);
    font-size: 0.8rem;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s;
}
.category-tag-more:hover {
    background: var(--c-subtext);
    color: white;
}

/* Photo gallery */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
    overflow-x: hidden;
}
.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    text-align: center;
    background: #f5f5f5;
    padding: 0.5rem;
}
.photo-item:hover { transform: scale(1.05); }
.photo-item img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    border-radius: 4px;
}
.photo-item .label {
    font-size: 0.85rem;
    color: var(--c-subtext);
    margin-top: 0.5rem;
}
.photo-item .filename {
    font-size: 0.75rem;
    color: var(--c-subtext);
    margin-top: 0.25rem;
    word-break: break-all;
    font-family: monospace;
}

/* PDF poster placeholder */
.pdf-poster .pdf-placeholder {
    width: 100%;
    height: 200px;
    background: var(--c-light);
    border: 2px dashed var(--c-mid);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--c-subtext);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    gap: 0.5rem;
}
.pdf-poster .pdf-placeholder:hover {
    background: var(--c-mid);
    color: var(--c-text);
    border-color: var(--c-text);
}
.pdf-poster .pdf-icon {
    font-size: 2rem;
}
.photo-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 8px;
}
.photo-item:hover .photo-overlay {
    opacity: 1;
}
.photo-overlay button {
    background: white;
    color: var(--c-dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Document table */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.doc-table th, .doc-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.doc-table th {
    background: var(--c-dark);
    color: white;
    font-weight: bold;
}
.doc-table tr:hover {
    background: var(--c-light);
}
.doc-table button {
    background: var(--c-accent);
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}
.doc-table button:hover {
    opacity: 0.9;
}

/* Video */
.video-link {
    display: inline-block;
    margin: 0.5rem 0;
    color: #1155CC;
    text-decoration: none;
}
.video-link:hover { text-decoration: underline; }

/* Back link */
.back-link {
    display: inline-block;
    margin: 1rem 0;
    color: var(--c-accent);
    text-decoration: none;
    font-weight: bold;
}
.back-link:hover { text-decoration: underline; }

/* Footer */
.footer {
    background: var(--c-dark);
    color: var(--c-mid);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
}

/* Lightbox */
.lightbox-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}
.lightbox-label {
    color: white;
    text-align: center;
    margin-top: 1rem;
}
.lightbox-close {
    position: absolute;
    top: -2rem;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}
.lightbox-download {
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--c-dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
}

/* Focus styles for accessibility */
a:focus, button:focus {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* Representative info */
.rep-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--c-mid);
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.rep-info a {
    color: var(--c-gold);
    text-decoration: none;
}
.rep-info a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 { font-size: 1.5rem; }
    .show-grid { grid-template-columns: 1fr; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .show-header-top {
        flex-direction: column-reverse;
        align-items: flex-start;
    }
    .show-title-section h1 {
        font-size: 1.3rem;
    }
    .fed-badge {
        align-self: flex-start;
    }
    .company-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .meta-separator {
        display: none;
    }
    .rep-info {
        font-size: 0.85rem;
    }
    .filters { flex-direction: column; }
    .filters input { min-width: 100%; }
}
