/* Academia Homepage - Frontend */

:root {
    --ach-rojo: #DC143C;
    --ach-rojo-hover: #EF1D3E;
    --ach-rojo-bright: #FF1744;
    --ach-negro: #1a1a1a;
    --ach-blanco: #ffffff;
    --ach-gris-bg: #f5f5f5;
    --ach-gris-text: #555;
    --ach-gris-dim: #888;
    --ach-gris-light: #eee;
    --ach-borde: #e0e0e0;
}

/* Hero */
.ach-hero {
    background: #111;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    min-height: 240px;
    border: 1px solid #222;
    margin-bottom: 12px;
}
.ach-hero-content {
    flex: 1;
    padding: 32px 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ach-hero-content h1 {
    font-size: 1.85em;
    line-height: 1.12;
    margin-bottom: 10px;
    font-weight: 800;
    color: #fff;
}
.ach-hero-content h1 span { color: var(--ach-rojo); }
.ach-hero-content p {
    color: #aaa;
    font-size: 0.92em;
    margin-bottom: 16px;
    line-height: 1.45;
}
.ach-hero-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ach-btn-register {
    background: var(--ach-rojo);
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95em;
    transition: background 0.2s;
    display: inline-block;
}
.ach-btn-register:hover { background: var(--ach-rojo-hover); color: #fff !important; }
.ach-free-tag { color: #aaa; font-size: 0.82em; }
.ach-free-tag strong { color: #4caf50; font-weight: 700; }
.ach-hero-image {
    width: 420px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.ach-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.ach-hero-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 80px;
    background: linear-gradient(to right, #111, transparent);
}

/* Stats */
.ach-stats {
    display: flex;
    background: var(--ach-blanco);
    border: 1px solid var(--ach-borde);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ach-stat {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-right: 1px solid var(--ach-borde);
}
.ach-stat:last-child { border-right: none; }
.ach-stat-num { font-size: 1.25em; font-weight: 800; color: var(--ach-rojo); }
.ach-stat-label { font-size: 0.62em; color: var(--ach-gris-dim); text-transform: uppercase; letter-spacing: 0.8px; }

/* Search */
.ach-search {
    background: var(--ach-blanco);
    border: 1px solid var(--ach-borde);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ach-search-title {
    background: var(--ach-negro);
    color: #fff;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.88em;
    letter-spacing: 0.3px;
}
.ach-search-title span { color: var(--ach-rojo-bright); font-weight: 800; }
.ach-search-body { padding: 14px 18px; }
.ach-search-form { display: flex; gap: 8px; }
.ach-search-form input[type="text"] {
    flex: 3;
    min-width: 0;
    padding: 11px 14px;
    border: 2px solid var(--ach-borde);
    border-radius: 6px;
    font-size: 0.9em;
    background: var(--ach-gris-bg);
    color: var(--ach-negro);
}
.ach-search-form input[type="text"]::placeholder { color: #999; }
.ach-search-form input[type="text"]:focus { border-color: var(--ach-rojo); outline: none; }
.ach-search-form select {
    flex: 0 0 auto;
    width: 160px;
    padding: 11px 10px;
    border: 2px solid var(--ach-borde);
    border-radius: 6px;
    font-size: 0.82em;
    background: var(--ach-gris-bg);
    color: var(--ach-negro);
}
.ach-search-btn {
    padding: 11px 24px;
    background: var(--ach-rojo);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9em;
}
.ach-search-btn:hover { background: var(--ach-rojo-hover); }

/* Inline search results */
.ach-inline-results {
    margin-top: 14px;
    border-top: 2px solid var(--ach-rojo);
    padding-top: 12px;
}
.ach-inline-header {
    font-size: 0.82em;
    color: var(--ach-gris-text);
    margin-bottom: 10px;
    font-weight: 600;
}
.ach-inline-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--ach-gris-bg);
    border-radius: 8px;
    padding: 4px;
}
.ach-inline-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.15s;
    border-radius: 6px;
    background: var(--ach-blanco);
}
.ach-inline-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(220,20,60,0.12);
    transform: translateX(3px);
}
.ach-inline-icon {
    font-size: 1.3em;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ach-gris-bg);
    border-radius: 6px;
    flex-shrink: 0;
}
.ach-inline-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ach-inline-name {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--ach-negro);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ach-inline-item:hover .ach-inline-name { color: var(--ach-rojo); }
.ach-inline-cat {
    font-size: 0.7em;
    color: var(--ach-gris-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ach-inline-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}
.ach-inline-type {
    background: var(--ach-negro);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.65em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.ach-inline-size {
    font-size: 0.7em;
    color: var(--ach-gris-dim);
    white-space: nowrap;
}
.ach-inline-viewall {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--ach-rojo), #b71c1c);
    color: #fff !important;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.25s;
    box-shadow: 0 3px 12px rgba(220,20,60,0.3);
    letter-spacing: 0.3px;
}
.ach-inline-viewall:hover {
    background: linear-gradient(135deg, #b71c1c, #880e0e);
    box-shadow: 0 5px 20px rgba(220,20,60,0.4);
    transform: translateY(-1px);
}
.ach-inline-arrow {
    margin-left: 6px;
    font-size: 1.2em;
    transition: transform 0.2s;
}
.ach-inline-viewall:hover .ach-inline-arrow { transform: translateX(4px); }

/* Grid */
.ach-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 320px;
    gap: 12px;
    margin-bottom: 14px;
}

/* Cards */
.ach-card {
    background: var(--ach-blanco);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ach-borde);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ach-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.ach-card-img { height: 110px; overflow: hidden; position: relative; }
.ach-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ach-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 6px 10px;
}
.ach-card-badge {
    background: var(--ach-rojo);
    color: #fff;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.65em;
    font-weight: 700;
}
.ach-card-body { padding: 10px 12px; flex: 1; }
.ach-card h3 { font-size: 0.88em; margin-bottom: 3px; color: var(--ach-negro); }
.ach-card p { font-size: 0.73em; color: var(--ach-gris-text); line-height: 1.35; }

/* Featured card */
.ach-card-featured {
    border: 2px solid var(--ach-rojo);
    position: relative;
    box-shadow: 0 2px 12px rgba(220,20,60,0.15);
}
.ach-card-featured:hover {
    box-shadow: 0 6px 24px rgba(220,20,60,0.2);
}
.ach-featured-badge {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 2;
    background: var(--ach-rojo);
    color: #fff;
    font-size: 0.58em;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* News panel */
.ach-news {
    background: var(--ach-blanco);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--ach-borde);
    grid-row: 1 / span 3;
    grid-column: 4;
    overflow-y: auto;
    max-height: 700px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ach-news h3 {
    font-size: 0.82em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ach-rojo);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ach-negro);
}
.ach-news h3 span { font-size: 0.7em; color: var(--ach-gris-dim); font-weight: normal; }
.ach-news-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--ach-gris-light);
    text-decoration: none !important;
    color: inherit;
}
.ach-news-item:last-child { border-bottom: none; }
.ach-news-item:hover .ach-news-title { color: var(--ach-rojo); }
.ach-news-thumb {
    width: 52px; height: 52px;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--ach-gris-light);
}
.ach-news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ach-news-title {
    font-size: 0.76em;
    line-height: 1.3;
    margin-bottom: 2px;
    font-weight: 500;
    color: #333;
    transition: color 0.2s;
}
.ach-news-meta { font-size: 0.62em; color: var(--ach-gris-dim); }
.ach-news-source { color: var(--ach-rojo); font-weight: 700; }

/* SEO chips */
.ach-seo-strip {
    background: var(--ach-blanco);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--ach-borde);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ach-seo-strip h3 { font-size: 0.8em; margin-bottom: 8px; color: var(--ach-gris-dim); }
.ach-chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.ach-chip-row::-webkit-scrollbar { height: 3px; }
.ach-chip-row::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.ach-chip {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.73em;
    text-decoration: none !important;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--ach-borde);
    background: transparent;
    color: #555;
    transition: all 0.2s;
}
.ach-chip:hover { border-color: var(--ach-rojo); color: var(--ach-rojo); }
.ach-chip small { font-size: 0.75em; color: var(--ach-gris-dim); font-weight: normal; display: block; }
.ach-chip-transistor small { color: #2196F3; }
.ach-chip-diagrama small { color: #4CAF50; }
.ach-chip-bios small { color: #FF9800; }
.ach-chip-boardview small { color: #9C27B0; }

/* Responsive */
@media (max-width: 1100px) {
    .ach-grid { grid-template-columns: 1fr 1fr; }
    .ach-news { grid-column: span 2; grid-row: auto; max-height: 260px; }
}
@media (max-width: 700px) {
    .ach-grid { grid-template-columns: 1fr; }
    .ach-news { grid-column: 1; }
    .ach-hero { flex-direction: column; }
    .ach-hero-image { width: 100%; height: 160px; }
    .ach-hero-image::after { display: none; }
    .ach-hero-content { padding: 20px; }
    .ach-hero-content h1 { font-size: 1.4em; }
    .ach-search-form { flex-direction: column; }
    .ach-stats { flex-wrap: wrap; }
    .ach-stat { min-width: 33.3%; }
}
