@import url("header.css");
@import url("main.css");
@import url("footer.css");

/* Skip link */
.skip-link {
    position: absolute;
    top: -60px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 700;
    border-radius: 0 0 6px 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.85rem;
    color: #666;
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus {
    text-decoration: underline;
}

section {
    width: 90%;
    max-width: 1100px;
    margin: 24px auto;
}

.contenedor {
    margin-bottom: 32px;
}

.titol-principal {
    font-size: clamp(2rem, 2.8vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 10px;
}

.contenedor p {
    max-width: 70ch;
    line-height: 1.6;
    color: #555;
}

/* Contenedor */
.contenido {
    width: 100%;
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 20px;
}

/* Grid de tarjetas */
.contenido > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.contenido.hero {
    margin: 32px auto;
    padding: 48px 20px;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.contenido.hero .titol-principal {
    margin-top: 0;
}

.contenido.hero p {
    margin: 12px auto 0;
    max-width: 70ch;
}

.contenido:not(.hero) {
    background: #fff;
    padding: 32px 24px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.contenido .titol {
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

.contenido > div > div {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contenido > div > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.contenido h3 {
    margin: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #222;
    line-height: 1.3;
}

.contenido p {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: left;
    flex-grow: 1;
}

.contenido a {
    align-self: flex-start;
    margin-top: auto;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--accent);
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.contenido a:hover {
    background: var(--accent);
    color: #fff;
}

.imagen-container {
    width: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: opacity 0.2s ease;
}

.imagen-container:hover {
    opacity: 0.85;
}

.imagen-container::after {
    content: '🔍';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.imagen-container:hover::after {
    opacity: 1;
}

/* Imagen */
.contenido img {
    max-width: 100%;
    max-height: 150px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #fff;
    padding: 0;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90vh;
    width: 700px;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #000;
    background-color: #f0f0f0;
}

.modal-body {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    max-height: calc(90vh - 180px);
}

.modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
}

.modal-btn {
    background: var(--accent);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.modal-btn:hover {
    background-color: #c4380e;
}

/* Responsive */
@media (max-width: 768px) {
    .contenido {
        margin: 24px auto;
        padding: 0 16px;
    }

    .contenido:not(.hero) {
        padding: 24px 16px;
    }

    .contenido .titol {
        font-size: 1.1rem;
    }

    .contenido p {
        font-size: 0.85rem;
    }

    .modal-content {
        max-width: 95%;
        width: auto;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 16px;
    }
}