/* ==========================================================================
   /tools/ — client-side SEO tools UI
   Reuses the global palette / fonts from style.css (:root variables).
   ========================================================================== */

.tools-hero.section { padding-top: 3rem; }

/* Showcase grid ----------------------------------------------------------- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
    margin-top: 2.5rem;
}
.tool-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
}
.tool-card-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.15rem;
}
.tool-card-icon svg { width: 26px; height: 26px; stroke: var(--white); fill: none; stroke-width: 2; }
.tool-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--black);
    margin: 0 0 .5rem;
}
.tool-card p { color: var(--gray-600); font-size: .95rem; line-height: 1.55; margin: 0 0 1rem; flex: 1; }
.tool-card .tool-card-link {
    font-weight: 600; color: var(--primary); font-size: .95rem;
    display: inline-flex; align-items: center; gap: .35rem;
}

/* Tool workspace ---------------------------------------------------------- */
.tool-app {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-top: 1rem;
}
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-field { margin-bottom: 1.15rem; }
.tool-field label {
    display: block; font-weight: 600; color: var(--gray-800);
    font-size: .9rem; margin-bottom: .4rem;
}
.tool-field .hint { font-weight: 400; color: var(--gray-500); font-size: .8rem; }

.tool-input, .tool-textarea, .tool-select {
    width: 100%;
    font-family: var(--font-primary);
    font-size: .95rem;
    color: var(--black);
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: .7rem .85rem;
    transition: var(--transition);
}
.tool-input:focus, .tool-textarea:focus, .tool-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(0,70,255,0.12);
}
.tool-textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
textarea.tool-output { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; min-height: 220px; }

.tool-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.tool-row .tool-field { flex: 1; min-width: 160px; }

.tool-counter { font-size: .8rem; color: var(--gray-500); margin-top: .3rem; }
.tool-counter.warn { color: var(--accent-dark); font-weight: 600; }
.tool-counter.bad  { color: #d33; font-weight: 600; }

.tool-check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--gray-700); margin-bottom: .4rem; }
.tool-check input { width: auto; }

.tool-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

.copy-btn { position: relative; }
.copy-btn.copied::after {
    content: "Copiado!";
    position: absolute; left: 50%; top: -2.1rem; transform: translateX(-50%);
    background: var(--black); color: var(--white); font-size: .75rem;
    padding: .25rem .5rem; border-radius: var(--radius-sm); white-space: nowrap;
}

/* SERP preview ------------------------------------------------------------ */
.serp-toggle { display: inline-flex; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1rem; }
.serp-toggle button {
    border: none; background: var(--white); color: var(--gray-600);
    padding: .5rem 1rem; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.serp-toggle button.active { background: var(--primary); color: var(--white); }

.serp-preview {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-md); padding: 1.25rem; max-width: 600px;
}
.serp-preview.mobile { max-width: 360px; }
.serp-url { color: #202124; font-size: .82rem; line-height: 1.3; }
.serp-url .path { color: #5f6368; }
.serp-title { color: #1a0dab; font-family: arial, sans-serif; font-size: 1.25rem; line-height: 1.3; margin: .15rem 0 .2rem; }
.serp-preview.mobile .serp-title { font-size: 1.05rem; }
.serp-desc { color: #4d5156; font-family: arial, sans-serif; font-size: .875rem; line-height: 1.45; }
.serp-truncated { color: #70757a; }

/* Result / info blocks ---------------------------------------------------- */
.tool-note {
    background: var(--gray-50);
    border-left: 3px solid var(--secondary);
    border-radius: var(--radius-sm);
    padding: 1rem 1.15rem;
    font-size: .9rem; color: var(--gray-700); line-height: 1.6;
    margin: 1rem 0;
}
.tool-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.tool-tag {
    background: var(--gray-100); border: 1px solid var(--gray-300);
    border-radius: 100px; padding: .2rem .7rem; font-size: .8rem; color: var(--gray-700);
}

/* "How to use" + interlinking --------------------------------------------- */
.tool-explain { margin-top: 3rem; }
.tool-explain h2 { font-family: var(--font-heading); color: var(--black); font-size: 1.5rem; margin-bottom: .75rem; }
.tool-explain p  { color: var(--gray-700); line-height: 1.7; margin-bottom: 1rem; }
.tool-explain ol, .tool-explain ul { color: var(--gray-700); line-height: 1.8; padding-left: 1.25rem; margin-bottom: 1rem; }

.tool-cross {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
    gap: 1rem; margin-top: 1.5rem;
}
.tool-cross a {
    display: block; background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-md); padding: 1rem 1.15rem; text-decoration: none;
    color: var(--black); font-weight: 600; font-size: .95rem; transition: var(--transition);
}
.tool-cross a:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); color: var(--primary); }
.tool-cross a span { display: block; font-weight: 400; color: var(--gray-500); font-size: .82rem; margin-top: .2rem; }

/* Hreflang generator — stacked row (URL on top, selects below) */
.hl-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    padding: .85rem;
    margin-bottom: .75rem;
}

/* Keyword density checker — stats + results table */
.tool-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.tool-stats .tool-tag { background: var(--gray-100); border: 1px solid var(--gray-300); border-radius: 100px; padding: .3rem .8rem; font-size: .82rem; color: var(--gray-700); }
.kd-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kd-table { width: 100%; min-width: 300px; border-collapse: collapse; font-size: .9rem; }
.kd-density .kd-num { flex: 0 0 auto; }
.kd-table th, .kd-table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--gray-200); }
.kd-table th { color: var(--gray-500); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.kd-table td:first-child, .kd-table th:first-child { color: var(--gray-400); width: 2.5rem; }
.kd-table tbody tr:hover { background: var(--gray-50); }
.kd-density { display: flex; align-items: center; gap: .5rem; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--gray-700); }
.kd-density.warn { color: var(--accent-dark); font-weight: 600; }
.kd-density.bad  { color: #d33; font-weight: 700; }
.kd-track { flex: 1 1 50px; max-width: 110px; min-width: 36px; height: 6px; border-radius: 3px; background: var(--gray-100); overflow: hidden; }
.kd-bar { display: block; height: 100%; border-radius: 3px; background: var(--secondary); min-width: 2px; }
.kd-density.warn .kd-bar { background: var(--accent); }
.kd-density.bad  .kd-bar { background: #d33; }

/* Keyword density — compact columns on small screens so all 4 fit */
@media (max-width: 520px) {
    .kd-table { font-size: .82rem; }
    .kd-table th, .kd-table td { padding: .5rem .35rem; }
    .kd-table td:first-child, .kd-table th:first-child { width: 1.6rem; }
    .kd-track { max-width: 56px; min-width: 28px; }
    .kd-density { gap: .35rem; }
}

/* robots.txt generator — user-agent groups */
.rb-group {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    padding: .85rem;
    margin-bottom: .85rem;
}
.rb-group .rb-rules { margin-top: .35rem; }

/* Open Graph preview card (Facebook / LinkedIn style) */
.og-card { border: 1px solid var(--gray-300); border-radius: var(--radius-md); overflow: hidden; background: var(--white); max-width: 520px; box-shadow: var(--shadow-sm); }
.og-card-img { width: 100%; aspect-ratio: 1200 / 630; background-size: cover; background-position: center; background-color: var(--gray-100); }
.og-card-img.empty { display: flex; align-items: center; justify-content: center; color: var(--gray-500); font-size: .85rem; }
.og-card-body { padding: .7rem .9rem; border-top: 1px solid var(--gray-200); }
.og-card-domain { color: var(--gray-500); font-size: .72rem; text-transform: uppercase; letter-spacing: .02em; }
.og-card-title { color: var(--black); font-weight: 600; font-size: 1rem; line-height: 1.3; margin: .2rem 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.og-card-desc { color: var(--gray-600); font-size: .85rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Industries index — category sections */
.ind-cat { margin-top: 2.5rem; }
.ind-cat:first-of-type { margin-top: 1.5rem; }
.ind-cat-title {
    display: flex; align-items: center; gap: .6rem;
    font-family: var(--font-heading); font-size: 1.3rem; color: var(--black);
    padding-bottom: .6rem; margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--gray-200);
}
.ind-cat-icon {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: inline-flex; align-items: center; justify-content: center;
}
.ind-cat-icon svg { width: 19px; height: 19px; stroke: var(--white); }

/* Industry landing page — section helpers reuse .tool-explain / .tool-note / .tool-cross */
.ind-hero .section-subtitle { margin-left: 0; }
.ind-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin: 1.25rem 0; }
.ind-box {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-md); padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm);
}
.ind-box h3 { font-family: var(--font-heading); font-size: 1.08rem; color: var(--black); margin: 0 0 .5rem; }
.ind-box p, .ind-box li { color: var(--gray-700); font-size: .93rem; line-height: 1.6; }
.ind-steps { counter-reset: step; list-style: none; padding: 0; margin: 1.25rem 0; }
.ind-steps li { position: relative; padding: 0 0 1.1rem 3rem; color: var(--gray-700); line-height: 1.65; }
.ind-steps li::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 2rem; height: 2rem; border-radius: 50%;
    background: var(--primary); color: var(--white); font-weight: 700; font-size: .9rem;
    display: flex; align-items: center; justify-content: center;
}
.ind-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1rem; margin: 1.25rem 0; }
.ind-metric { text-align: center; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.25rem 1rem; }
.ind-metric strong { display: block; font-family: var(--font-heading); font-size: 1.8rem; color: var(--primary); line-height: 1; }
.ind-metric span { display: block; margin-top: .4rem; color: var(--gray-600); font-size: .85rem; }
.ind-faq { margin: 1.25rem 0; }
.ind-faq details { border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: .5rem 1.1rem; margin-bottom: .7rem; background: var(--white); }
.ind-faq summary { cursor: pointer; font-weight: 600; color: var(--black); padding: .6rem 0; list-style: none; }
.ind-faq summary::-webkit-details-marker { display: none; }
.ind-faq summary::before { content: '+'; color: var(--primary); font-weight: 700; margin-right: .6rem; }
.ind-faq details[open] summary::before { content: '−'; }
.ind-faq details p { color: var(--gray-700); line-height: 1.65; padding: 0 0 .8rem; margin: 0; }


/* Industry pages — thematic Pexels images */
.ind-figure { margin: 1.9rem 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--gray-200); background: var(--gray-100); }
.ind-figure img { display: block; width: 100%; height: auto; }
.ind-figure.ind-figure-hero img { aspect-ratio: 16 / 7; object-fit: cover; }
.ind-figure figcaption { font-size: .78rem; color: var(--gray-500); padding: .5rem .9rem; background: var(--gray-50); }
