/* =========================
   1. PÁGINAS INTERNAS
   ========================= */

.page-section {
    display: block;
}

.page-section > p:first-of-type {
    max-width: 75ch;
}

/* =========================
   2. HERO / INICIO
   ========================= */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: nowrap;
}

.hero-text {
    flex: 1 1 65%;
}

.hero-text h1 {
    font-size: 2.4rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--color-primary);
    display: inline-block;
    padding-bottom: 8px;
}

.hero-text p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--color-text);
    margin-bottom: 18px;
}

.hero-image {
    flex: 0 0 300px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 300px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border: 4px solid #ffffff;
}

/* =========================
   3. VISTAS PREVIAS EN HOME
   ========================= */
.preview-section {
    margin-top: 30px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.preview-card {
    background: var(--color-surface);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e8edf3;
    padding: 18px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.preview-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.preview-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
}

.preview-card h3 {
    color: #1f2d3d;
    margin-bottom: 10px;
}

.preview-card p {
    color: #444;
    line-height: 1.7;
}

.section-action {
    margin-top: 20px;
    text-align: center;
}

/* =========================
   4. CONTACTO
   ========================= */
.contact-section {
    background: #f2f2f2;
}

.contact-intro {
    font-size: 1.05rem;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
}

.contact-info h2,
.contact-info h3 {
    color: var(--color-primary);
    margin-bottom: 15px;
}

.contact-info p {
    margin-bottom: 18px;
    font-size: 1rem;
    line-height: 1.6;
}

.contact-info a {
    color: var(--color-secondary);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.contact-note {
    background: #f7f9fc;
    padding: 14px;
    border-left: 4px solid var(--color-secondary);
    border-radius: 8px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #1c1c1c;
}

.form-group input,
.form-group textarea {
    padding: 14px 16px;
    border: 1px solid #cfcfcf;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.12);
}

/* =========================
   5. PUBLICACIONES
   ========================= */
.publicaciones-section h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--color-primary);
}

.books-grid,
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 20px;
}

.book-card,
.profile-card,
.software-card {
    background: var(--color-surface);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e8edf3;
    padding: 18px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.book-card:hover,
.profile-card:hover,
.software-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.book-card img {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto 15px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.book-card h3,
.profile-card h3,
.software-card h3 {
    color: var(--color-primary);
    margin-bottom: 10px;
}

.book-card a,
.profile-card a,
.software-card a {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
    font-weight: 600;
}

.book-card a:hover,
.profile-card a:hover,
.software-card a:hover {
    text-decoration: underline;
}

.profile-card {
    text-align: center;
}

.icon {
    width: 50px;
    margin: 0 auto 10px;
}

.profile-card a {
    padding: 8px 12px;
    background: #1a73e8;
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    transition: background var(--transition);
}

.profile-card a:hover {
    text-decoration: none;
    background: #155fbe;
}

.software-card p {
    font-size: 0.95rem;
    color: var(--color-text-soft);
    margin: 6px 0;
    line-height: 1.5;
}

.software-card p strong {
    color: #111827;
}

.software-card a {
    display: inline-block;
    margin-top: 10px;
    margin-right: 8px;
    padding: 8px 14px;
    font-size: 0.9rem;
    border-radius: 6px;
    color: #ffffff;
    background: #0b8043;
    text-decoration: none;
    transition: background var(--transition);
}

.software-card a:hover {
    background: #086c36;
    text-decoration: none;
}

.icon-indecopi {
    width: 140px;
    height: auto;
    margin-top: 6px;
    vertical-align: middle;
}

/* =========================
   6. RESPONSIVE
   Ajustes para tablets y móviles
   ========================= */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 24px;
    }

    .hero-text,
    .hero-image {
        width: 100%;
        flex: 1 1 100%;
    }

    .hero-image {
        justify-content: center;
    }

    .hero-image img {
        max-width: 260px;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .book-card,
    .profile-card,
    .software-card {
        padding: 16px;
    }

    .icon-indecopi {
        width: 120px;
    }
}