/* Supermercato Italiano - Editorial News Theme */
:root {
  --primary: #A61C1C;
  --primary-dark: #8B1717;
  --secondary: #1E4D2B;
  --secondary-light: #2A6B3A;
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #555555;
  --border: #E5E5E5;
  --success: #1E4D2B;
  --warning: #D97706;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --font-heading: 'Lora', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-top {
  background: var(--secondary);
  color: #fff;
  font-size: 0.85rem;
  padding: 0.4rem 0;
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.header-top a {
  color: #fff;
}

.header-main {
  padding: 1rem 0;
}

.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover {
  text-decoration: none;
  color: var(--primary-dark);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-main {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  list-style: none;
}

.nav-main a {
  padding: 0.5rem 0.85rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 4px;
  text-decoration: none;
}

.nav-main a:hover,
.nav-main a.active {
  background: rgba(166, 28, 28, 0.08);
  color: var(--primary);
  text-decoration: none;
}

.search-form {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.search-form input {
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  width: 180px;
  background: transparent;
  outline: none;
}

.search-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.search-form button:hover {
  background: var(--primary-dark);
}

/* Breaking News Ticker */
.ticker {
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: ticker 35s linear infinite;
  padding-left: 100%;
}

.ticker-label {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  margin-right: 1rem;
  font-size: 0.8rem;
  display: inline-block;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Container */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Main content */
main {
  flex: 1;
  padding: 2rem 0;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, #163A20 100%);
  color: #fff;
  padding: 3rem 0;
  margin-bottom: 2.5rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.3;
  margin-bottom: 1rem;
  max-width: 800px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 640px;
  margin-bottom: 1.5rem;
}

.hero-meta {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Cards & Grid */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  height: 180px;
  object-fit: cover;
  width: 100%;
  background: #e8e8e8;
}

.card-body {
  padding: 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: var(--primary);
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 0.75rem;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Categories badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(166, 28, 28, 0.1);
  color: var(--primary);
}

.badge-green {
  background: rgba(30, 77, 43, 0.12);
  color: var(--secondary);
}

/* Poll / Quiz */
.poll-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.poll-widget h3 {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.poll-option {
  display: block;
  margin: 0.6rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.poll-option:hover {
  background: rgba(166, 28, 28, 0.05);
  border-color: var(--primary);
}

.poll-option input {
  margin-right: 0.6rem;
}

.poll-result {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 6px;
  display: none;
}

.poll-bar {
  height: 10px;
  background: #e5e5e5;
  border-radius: 5px;
  margin: 0.4rem 0 0.8rem;
  overflow: hidden;
}

.poll-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* Forms */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(166, 28, 28, 0.12);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.consent-check input {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--secondary-light);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* Newsletter */
.newsletter-box {
  background: linear-gradient(135deg, var(--secondary) 0%, #163A20 100%);
  color: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  margin: 2.5rem 0;
}

.newsletter-box h3 {
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
}

.newsletter-box p {
  opacity: 0.9;
  margin-bottom: 1.25rem;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
}

.newsletter-form .consent-check {
  width: 100%;
  color: rgba(255,255,255,0.95);
}

.newsletter-form .consent-check a {
  color: #fff;
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background: #1A1A1A;
  color: #ccc;
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h4 {
  color: #fff;
  font-family: var(--font-heading);
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 0.4rem;
}

.footer-grid a {
  color: #bbb;
}

.footer-grid a:hover {
  color: #fff;
}

.company-info {
  line-height: 1.7;
}

.company-info strong {
  color: #eee;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Legal pages */
.legal-content {
  max-width: 820px;
  margin: 0 auto;
}

.legal-content h1 {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.legal-content .last-update {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.legal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  color: var(--secondary);
}

.legal-content h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.legal-content p,
.legal-content li {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.legal-content ul,
.legal-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-info-box {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-info-box h3 {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  color: var(--secondary);
}

.contact-info-box p {
  margin-bottom: 0.6rem;
}

.map-embed {
  margin-top: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-embed iframe {
  width: 100%;
  height: 300px;
  border: 0;
}

/* About page */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.team-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
}

.team-card h4 {
  font-family: var(--font-heading);
  margin-bottom: 0.3rem;
}

.team-card .role {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1A1A1A;
  color: #eee;
  padding: 1.25rem;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  display: none;
}

.cookie-banner.visible {
  display: block;
}

.cookie-banner-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
}

.cookie-banner p {
  flex: 1;
  min-width: 260px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookie-banner a {
  color: #fff;
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.cookie-actions .btn {
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
}

.btn-accept {
  background: var(--primary);
  color: #fff;
}

.btn-reject {
  background: transparent;
  border: 1px solid #888;
  color: #eee;
}

.btn-custom {
  background: transparent;
  border: 1px solid #888;
  color: #eee;
}

/* Cookie preferences modal */
.cookie-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal.open {
  display: flex;
}

.cookie-modal-content {
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  max-height: 90vh;
  overflow-y: auto;
}

.cookie-modal-content h3 {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
}

.cookie-cat {
  margin: 1rem 0;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.cookie-cat label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.cookie-cat p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Page header for inner pages */
.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 0.4rem;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
}

/* Article list */
.article-list article {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
  .article-list article {
    grid-template-columns: 1fr;
  }
}

.article-list .thumb {
  height: 130px;
  object-fit: cover;
  border-radius: 6px;
  background: #e8e8e8;
}

.article-list h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.article-list h2 a {
  color: var(--text);
  text-decoration: none;
}

.article-list h2 a:hover {
  color: var(--primary);
}

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }
  .nav-main {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 0.5rem 0;
  }
  .nav-main.open {
    display: flex;
  }
  .header-main .container {
    flex-wrap: wrap;
  }
  .search-form {
    order: 3;
    width: 100%;
  }
  .search-form input {
    width: 100%;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
