/* Excel single + archive sayfa tasarımı (excel-form.css ek) */

/* ---- Common ---- */
.excel-single, .excel-archive {
  padding: 1.5rem 0 3rem;
  background: linear-gradient(180deg, var(--secondary) 0%, var(--background) 200px);
}
.excel-single > .container,
.excel-archive > .container {
  display: flex; flex-direction: column; gap: 1rem;
}

/* ---- Hero ---- */
.excel-single__hero, .excel-archive__header {
  position: relative;
  background: linear-gradient(135deg, var(--card) 0%, var(--secondary) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.excel-single__hero::before, .excel-archive__header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
}
.excel-single__hero h1, .excel-archive__header h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 0.5rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.excel-single__tagline, .excel-archive__header > p {
  font-size: 1.05rem;
  color: var(--foreground);
  line-height: 1.7;
  margin: 0;
}
.excel-archive__header strong { color: var(--accent); }

/* Badges */
.excel-single__badges {
  list-style: none; padding: 0; margin: 1rem 0 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.excel-single__badges li {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
}

/* ---- Section cards ---- */
.excel-single section, .excel-archive section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
}
.excel-single h2, .excel-archive h2 {
  font-size: 1.375rem; font-weight: 700;
  color: var(--primary);
  margin: 0 0 1rem;
  line-height: 1.25;
}
.excel-single__rich, .excel-archive ol, .excel-archive ul {
  line-height: 1.75; color: var(--foreground);
}
.excel-single__rich p, .excel-archive ol li, .excel-archive ul li { margin: 0 0 0.625rem; }
.excel-single__rich ul, .excel-single__rich ol { padding-left: 1.5rem; }

/* ---- Code / pre / formula blocks (overflow-safe) ---- */
.excel-archive pre,
.excel-single pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.875rem 2.75rem 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid #1e293b;
  margin: 0.625rem 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono, 'Space Grotesk', 'Consolas', monospace);
  font-size: 0.85rem;
  line-height: 1.55;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre;
  tab-size: 2;
  box-shadow: var(--shadow-sm);
}

/* ---- Formül kopyala butonu (hub) ---- */
.fp-formula-wrap {
  position: relative;
  margin: 0.625rem 0 1rem;
}
.fp-formula-wrap pre {
  margin: 0;
}
.fp-formula-copy {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 28px;
  height: 28px;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  z-index: 2;
}
.fp-formula-copy svg { display: block; }
.fp-formula-copy:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}
.fp-formula-copy:active { transform: translateY(1px); }
.fp-formula-copy.is-copied {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.excel-archive pre code,
.excel-single pre code {
  display: block;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}
.excel-archive code,
.excel-single code {
  background: var(--secondary);
  color: var(--primary);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: var(--font-mono, 'Space Grotesk', 'Consolas', monospace);
  font-size: 0.875em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ensure all section content doesn't overflow */
.excel-single section,
.excel-archive section { overflow-wrap: anywhere; min-width: 0; }
.excel-single section *,
.excel-archive section * { max-width: 100%; }

/* ---- Yasal ---- */
.excel-single__yasal p {
  background: linear-gradient(135deg, var(--secondary), var(--card));
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-sm);
  margin: 0;
  font-family: var(--font-mono, 'Space Grotesk', monospace);
  font-size: 0.9rem;
}

/* ---- FAQ ---- */
.excel-faq-list { display: grid; gap: 0.5rem; }
.excel-faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.excel-faq-item[open] { border-color: var(--accent); box-shadow: var(--shadow); }
.excel-faq-item summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.875rem 1.125rem;
  cursor: pointer; list-style: none;
  font-weight: 600; color: var(--foreground); font-size: 0.95rem;
  transition: background 0.15s; gap: 1rem;
}
.excel-faq-item summary::-webkit-details-marker { display: none; }
.excel-faq-item summary::after {
  content: '+'; font-size: 1.5rem; color: var(--accent);
  transition: transform 0.2s; font-weight: 300; line-height: 1; flex-shrink: 0;
}
.excel-faq-item[open] summary::after { transform: rotate(45deg); }
.excel-faq-item summary:hover { background: var(--secondary); }
.excel-faq-item > div {
  padding: 0 1.125rem 1rem;
  color: var(--foreground); line-height: 1.7; font-size: 0.92rem;
}

/* ---- Related cards (single) ---- */
.excel-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.excel-related-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.125rem 1.25rem;
  transition: all 0.2s; display: flex; flex-direction: column;
  justify-content: space-between; gap: 0.5rem; text-decoration: none;
  color: inherit; min-height: 90px;
}
.excel-related-card:hover {
  border-color: var(--accent); box-shadow: var(--shadow);
  transform: translateX(2px);
}
.excel-related-card h3 {
  font-size: 0.95rem; font-weight: 600;
  color: var(--foreground); line-height: 1.35;
}
.excel-related-card__cta {
  font-size: 0.8rem; color: var(--accent); font-weight: 700;
}

/* ---- Meta footer ---- */
.excel-single__meta {
  background: var(--secondary) !important; border: 1px solid var(--border);
  padding: 1rem 1.5rem !important; border-radius: var(--radius-md);
  box-shadow: none !important;
}
.excel-single__review { font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 0.375rem; }
.excel-single__review strong { color: var(--primary); }
.excel-single__disclaimer {
  font-size: 0.8rem; color: var(--muted-foreground);
  line-height: 1.6; margin: 0;
}

/* ---- Archive: benefits list ---- */
.excel-benefits-list {
  list-style: none !important; padding: 0 !important;
  display: grid; gap: 0.625rem; margin: 0.75rem 0 0 !important;
}
.excel-benefits-list li {
  background: linear-gradient(135deg, var(--secondary), var(--card));
  padding: 0.875rem 1.125rem; border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.9rem; line-height: 1.5;
}
.excel-benefits-list li strong { color: var(--primary); }

/* ---- Archive: filter ---- */
.excel-archive__filter {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
}
.excel-archive__filter input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--background);
  font-size: 0.95rem; font-family: inherit;
}
.excel-archive__filter input:focus {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(74,111,165,0.12);
}

/* ---- Archive: category block + grid ---- */
.excel-cat-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem 1.75rem; box-shadow: var(--shadow-sm); }
.excel-cat-block h2 {
  font-size: 1.25rem;
}

.excel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.875rem;
}
.excel-card {
  background: linear-gradient(135deg, var(--secondary), var(--card));
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.25rem; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: all 0.2s; min-height: 130px;
}
.excel-card:hover {
  background: var(--card); border-color: var(--accent);
  box-shadow: var(--shadow); transform: translateY(-2px);
}
.excel-card__icon { font-size: 1.75rem; line-height: 1; }
.excel-card h3 {
  font-size: 1rem; font-weight: 700;
  color: var(--primary); margin: 0; line-height: 1.3;
}
.excel-card__tagline {
  font-size: 0.825rem; color: var(--muted-foreground);
  line-height: 1.4; flex-grow: 1; margin: 0;
}
.excel-card__cta {
  font-size: 0.825rem; color: var(--accent);
  font-weight: 700; align-self: flex-start;
}

/* ---- Archive: guide ol ---- */
.excel-archive__guide ol { padding-left: 1.5rem; counter-reset: step; list-style: none; }
.excel-archive__guide ol li {
  counter-increment: step;
  position: relative;
  padding: 0.5rem 0 0.5rem 2rem;
  border-left: 2px solid var(--secondary);
  margin-left: 0.25rem;
}
.excel-archive__guide ol li::before {
  content: counter(step);
  position: absolute;
  left: -0.85rem; top: 0.4rem;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.excel-archive__guide ol li strong { color: var(--primary); }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .excel-single, .excel-archive { padding: 1rem 0 2rem; }
  .excel-single__hero, .excel-archive__header { padding: 1.25rem 1.25rem; }
  .excel-single section, .excel-archive section { padding: 1.25rem 1.125rem; }
  .excel-single h2, .excel-archive h2 { font-size: 1.1rem; }
  .excel-single h3, .excel-archive h3 { font-size: 0.95rem; }
  .excel-archive pre, .excel-single pre { font-size: 0.78rem; padding: 0.625rem 0.75rem; }
  .excel-archive code, .excel-single code { font-size: 0.82em; }
  .excel-archive ul li, .excel-archive ol li { word-break: break-word; }
  /* hero kırpılma engelle */
  .excel-single__hero h1, .excel-archive__header h1 { word-break: break-word; overflow-wrap: anywhere; }
}
