/* DigitalEuro.com — directory site styles (light, clean B2B look) */

:root {
  --blue: #1a3a6b;
  --blue-accent: #2563eb;
  --gold: #f5b800;
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #5c667a;
  --border: #e3e8f0;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; text-decoration: none; }

/* Header */
.site-header { background: var(--blue); color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.5px; }
.logo span { color: var(--gold); }
.logo small { font-weight: 400; opacity: 0.7; font-size: 0.75em; }
.main-nav { display: flex; gap: 22px; align-items: center; }
.main-nav a { color: #dfe6f2; font-size: 0.95rem; }
.main-nav a:hover { color: #fff; }
.nav-cta {
  background: var(--gold); color: var(--blue) !important;
  padding: 8px 16px; border-radius: 6px; font-weight: 700;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, #254a86 60%, #2d5aa0 100%);
  color: #fff; text-align: center; padding: 70px 0 60px;
}
.hero h1 { font-size: 2.4rem; margin-bottom: 12px; }
.hero-sub { max-width: 640px; margin: 0 auto 30px; color: #cdd9ee; }
.search-bar { display: flex; max-width: 620px; margin: 0 auto; }
.search-bar input {
  flex: 1; padding: 14px 18px; border: none; border-radius: 8px 0 0 8px;
  font-size: 1rem; outline: none;
}
.search-bar button {
  padding: 14px 28px; border: none; border-radius: 0 8px 8px 0;
  background: var(--gold); color: var(--blue); font-weight: 700; font-size: 1rem;
  cursor: pointer;
}
.search-bar button:hover { filter: brightness(1.05); }
.hero-stats { display: flex; justify-content: center; gap: 60px; margin-top: 36px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; color: var(--gold); }
.hero-stats span { font-size: 0.85rem; color: #b9c7e0; }

/* Sections */
.section { padding: 48px 0; }
.section-alt { background: #fff; }
.section h2 { font-size: 1.5rem; margin-bottom: 24px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; transition: box-shadow .15s, transform .15s;
  display: flex; flex-direction: column;
}
.card > p { flex-grow: 1; }
.card:hover { box-shadow: 0 6px 18px rgba(26,58,107,.1); transform: translateY(-2px); }
.card .icon { font-size: 1.8rem; }
/* Favicon display: category emoji sits behind, the favicon img covers it.
   If the image fails to load it removes itself and the emoji shows. */
.card .icon.has-favicon {
  width: 44px; height: 44px; background: #eef3fb; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; position: relative; overflow: hidden;
}
.company-header .icon.has-favicon { position: relative; overflow: hidden; }
.icon .favicon {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #fff;
}
.card h3 { font-size: 1.05rem; margin: 8px 0 4px; }
.card p { font-size: 0.88rem; color: var(--muted); }
.card .tag {
  display: inline-block; font-size: 0.75rem; background: #eef3fb; color: var(--blue-accent);
  border-radius: 4px; padding: 2px 8px; margin: 6px 6px 0 0;
}
.badge-featured {
  background: var(--gold); color: var(--blue); font-size: 0.7rem; font-weight: 700;
  border-radius: 4px; padding: 2px 8px; margin-left: 8px; vertical-align: middle;
}

/* Buttons */
.btn-primary {
  display: inline-block; background: var(--gold); color: var(--blue);
  font-weight: 700; padding: 12px 28px; border-radius: 8px; margin-top: 16px;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-outline {
  display: inline-block; border: 1.5px solid var(--blue-accent); color: var(--blue-accent);
  font-weight: 600; padding: 8px 20px; border-radius: 8px; margin-top: 12px;
}

/* CTA band */
.cta-band { background: var(--blue); color: #fff; text-align: center; padding: 52px 0; }
.cta-band p { color: #cdd9ee; max-width: 520px; margin: 0 auto; }

/* Breadcrumb + filters */
.breadcrumb { font-size: 0.85rem; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a { color: var(--blue-accent); }
.page-title { padding: 10px 0 6px; font-size: 1.7rem; }
.page-sub { color: var(--muted); margin-bottom: 24px; }

/* Company detail */
.company-header { display: flex; align-items: center; gap: 18px; margin: 10px 0 6px; }
.company-header .icon {
  width: 64px; height: 64px; background: #eef3fb; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 20px; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }
.info-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.info-box h4 { margin-bottom: 10px; font-size: 0.95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.info-box a { color: var(--blue-accent); word-break: break-all; }

/* Forms */
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 640px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.95rem; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--blue-accent);
}
.form-note { font-size: 0.82rem; color: var(--muted); }
.form-alert { display: none; padding: 12px 14px; border-radius: 6px; font-size: 0.9rem; margin-bottom: 16px; }
.form-alert:not(:empty) { display: block; }
.form-alert--success { background: #e6f6ec; color: #1a7f3c; border: 1px solid #b7e4c5; }
.form-alert--error { background: #fdecec; color: #b3261e; border: 1px solid #f5c2c0; }
.form-field-error { display: block; font-size: 0.78rem; color: #b3261e; margin-top: 4px; }

/* Footer — one typographic scale shared by every page.
   The base font-size on .site-footer is the floor: any text placed in the
   footer without its own rule still matches the rest of the site. */
.site-footer {
  background: #101a2e;
  color: #93a1bd;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 44px 0 24px;
  margin-top: 0;
}
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 700px) { .footer-cols { grid-template-columns: 1fr; gap: 24px; } }
.site-footer .logo { color: #fff; }
.site-footer h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 10px;
}
/* Only the column links stack; inline links elsewhere in the footer stay
   inline so they cannot break the copyright line. */
.footer-cols a { display: block; padding: 3px 0; font-size: 0.88rem; color: #93a1bd; }
.footer-cols a:hover { color: #fff; }
.site-footer a:hover { color: #fff; }
.footer-note { font-size: 0.82rem; margin-top: 8px; }
.footer-bottom { border-top: 1px solid #22314f; margin-top: 28px; padding-top: 16px; }
.footer-bottom p { font-size: 0.8rem; line-height: 1.5; }
@media (max-width: 700px) {
  .site-footer { padding: 32px 0 20px; }
}

/* Legal pages */
.legal { max-width: 760px; }
.legal h2 { margin: 24px 0 8px; font-size: 1.15rem; }
.legal p, .legal li { color: #3a4458; font-size: 0.95rem; }
.legal ul { padding-left: 20px; margin: 8px 0; }

@media (max-width: 700px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-stats { gap: 30px; }
  .main-nav a:not(.nav-cta) { display: none; }
}

/* Tag rows: keep tags on one line */
.tag-row { display: flex; flex-wrap: nowrap; gap: 6px; overflow: hidden; margin-top: auto; padding-top: 12px; }
.tag-row .tag { margin: 0; white-space: nowrap; }

/* Rotation note shown under the page title on category/country pages */
.rotation-note {
  font-size: 13px;
  color: var(--muted, #6b7280);
  background: var(--surface-alt, #f3f4f6);
  border-left: 3px solid var(--accent, #2563eb);
  padding: 8px 14px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 24px;
}

/* Star rating: display row + interactive widget on company detail pages */
.rating-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px; margin: 18px 0;
}
.rating-stars { color: var(--gold); font-size: 1.25rem; letter-spacing: 2px; }
.rating-text { color: var(--muted); font-size: 0.92rem; }
.rating-text strong { color: var(--text); font-size: 1.05rem; }
.rate-widget { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.rate-label { font-size: 0.9rem; color: var(--muted); }
.rate-stars { display: inline-flex; gap: 2px; }
.rate-star {
  background: none; border: none; cursor: pointer; padding: 0 1px;
  font-size: 1.35rem; line-height: 1; color: #cfd6e2;
  transition: color .12s, transform .12s;
}
.rate-star:hover { color: var(--gold); transform: scale(1.15); }
.rate-star.selected { color: var(--gold); }
.rate-msg { font-size: 0.85rem; color: var(--muted); min-width: 120px; }
@media (max-width: 700px) {
  .rate-widget { margin-left: 0; flex-wrap: wrap; }
}

/* DB version badge styles are injected by app.js (assets/app.js) so the
   patch is self-contained; no stylesheet rules needed here. */

/* Listing pages: result counter above the grid + numbered pagination */
.result-meta {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: var(--muted);
}
.empty-note {
  grid-column: 1 / -1;
  color: var(--muted);
}
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 28px 0 56px;
}
.pager a,
.pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.pager a:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.pager .is-current {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 600;
}
.pager .is-gap {
  border: 0;
  background: none;
  color: var(--muted);
  min-width: 22px;
  padding: 0;
}
.pager .is-disabled {
  opacity: 0.45;
  cursor: default;
}
@media (max-width: 600px) {
  .pager a, .pager span { min-width: 34px; height: 34px; padding: 0 8px; font-size: 0.85rem; }
}
