/* === FILE: assets/style.css === */

/* EduNews - Stili generali */
:root {
  --edunews-primary: #0073aa;
  --edunews-primary-dark: #005177;
  --edunews-text: #333333;
  --edunews-text-light: #666666;
  --edunews-bg: #ffffff;
  --edunews-border: #e0e0e0;
  --edunews-shadow: 0 2px 10px rgba(0,0,0,0.08);
  --edunews-radius: 10px;
  --edunews-transition: all 0.3s ease;
}

/* Titolo generale */
.edunews-title {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 30px;
  color: var(--edunews-text);
  position: relative;
  padding-bottom: 12px;
}

.edunews-title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--edunews-primary);
  border-radius: 3px;
}

/* Stili comuni per gli articoli */
.edunews-article {
  background: var(--edunews-bg);
  border-radius: var(--edunews-radius);
  box-shadow: var(--edunews-shadow);
  overflow: visible;
  transition: var(--edunews-transition);
  width: 340px;
  min-height: 380px;
  height: auto;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  border: 1px solid var(--edunews-border);
  max-width: 260px;
}

.edunews-article:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  transform: translateY(-3px);
}

.edunews-article img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-top-left-radius: var(--edunews-radius);
  border-top-right-radius: var(--edunews-radius);
  background: #f0f0f0;
}

.edunews-article-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.edunews-article h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 48px;
  max-height: 48px;
}

.edunews-article h3 a {
  color: var(--edunews-text);
  text-decoration: none;
  transition: var(--edunews-transition);
}

.edunews-article h3 a:hover {
  color: var(--edunews-primary);
}

.edunews-article-meta {
  font-size: 15px;
  color: var(--edunews-text-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edunews-article-meta .edunews-date {
  margin-right: 8px;
}

.edunews-article-meta .edunews-category {
  background: var(--edunews-primary);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  text-align: center;
  max-width: 100%;
}

.edunews-article p {
  margin: 0 0 15px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--edunews-text-light);
  flex-grow: 1;
}

.edunews-article-footer {
  margin-top: auto;
  display: flex;
  justify-content: center;
}

.edunews-read-more {
  display: inline-block;
  padding: 8px 16px;
  background: var(--edunews-primary);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  transition: var(--edunews-transition);
  margin-top: 10px;
}

.edunews-read-more:hover {
  background: var(--edunews-primary-dark);
}

/* Stili per il layout Grid */
.edunews-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3.5rem;
  margin: 0 auto 60px auto;
  max-width: 1100px;
  justify-content: center;
}

.edunews-grid-item {
  margin: 0;
  display: flex;
  justify-content: center;
}

/* Stili per il layout List */
.edunews-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 0 auto 30px auto;
  max-width: 1100px;
}

.edunews-list-item {
  width: 100%;
  background: var(--edunews-bg);
  border-radius: var(--edunews-radius);
  box-shadow: var(--edunews-shadow);
  border: 1px solid var(--edunews-border);
  padding: 1.5rem;
  overflow: hidden;
}

.edunews-list-item:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  transform: translateY(-3px);
}

.edunews-list-image {
  flex: 0 0 200px;
  background: #f0f0f0;
}

.edunews-list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edunews-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.edunews-list-content h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.4;
}

.edunews-list-content p {
  margin: 0 0 10px;
  flex-grow: 1;
  font-size: 14px;
  line-height: 1.6;
}

.edunews-date-top {
  margin-bottom: 10px;
  display: block;
}

/* Stili per il layout Slide */
.edunews-splide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 0;
  overflow: visible;
}

.splide__slide {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.splide__pagination {
  padding: 1em 0;
  position: relative;
  bottom: -15px;
}

.splide__arrow {
  display: none !important;
}

.splide__arrow svg {
  fill: #000;
  width: 1em;
  height: 1em;
}

.splide__arrow--prev {
  left: -60px;
}
.splide__arrow--next {
  right: -60px;
}

.splide__pagination__page {
  background: black;
  width: 8px;
  height: 8px;
  opacity: 1;
  border: none;
  border-radius: 50%;
  margin: 0 4px;
  transform: scale(1);
  transition: background 0.3s, border 0.3s;
}
.splide__pagination__page.is-active {
  background: white;
  border: 1px solid black;
}

/* Responsive */
@media (max-width: 1200px) {
  .edunews-wrapper { max-width: 1000px; }
}
@media (max-width: 1250px) {
  .edunews-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
}
@media (max-width: 1024px) {
  .edunews-splide { max-width: 800px; }
  .edunews-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}
@media (max-width: 768px) {
  .edunews-splide { max-width: 98vw; }
  .splide__arrow--prev {
    left: -30px;
  }
  .splide__arrow--next {
    right: -30px;
  }
  .edunews-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

.edunews-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* Splide Styles */
.edunews-splide {
  padding: 0 0;
}

.splide__track {
  overflow-x: hidden !important;
  padding-top: 4px;
  padding-bottom: 50px;
}

.splide__list {
  display: flex;
  align-items: stretch;
}

.edunews-article {
  width: 260px;
  max-width: 100%;
  min-width: 0;
}

.edunews-article:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  transform: translateY(-3px);
}

.edunews-article img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background: #f0f0f0;
}

.edunews-article-content {
  padding: 18px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.edunews-article h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
}

.edunews-article h3 a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

.edunews-article h3 a:hover {
  color: #0073aa;
}

.edunews-article-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edunews-article-meta .edunews-date {
  margin-right: 8px;
}

.edunews-article-meta .edunews-category {
  background: #0073aa;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.edunews-article p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  flex-grow: 1;
}

.edunews-article-footer {
  margin-top: auto;
}

.edunews-read-more {
  display: inline-block;
  padding: 7px 14px;
  background: #0073aa;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s;
  margin-top: 8px;
}

.edunews-read-more:hover {
  background: #005177;
}

/* Splide arrows and pagination */
.splide__arrow {
  background: #fff;
  opacity: 1;
  width: 40px;
  height: 40px;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

.splide__arrow svg {
  fill: #000;
  width: 1em;
  height: 1em;
}

.splide__arrow--prev { left: -60px; }
.splide__arrow--next { right: -60px; }

.splide__pagination__page {
  background: black;
  width: 8px;
  height: 8px;
  opacity: 1;
  border: none;
  border-radius: 50%;
  margin: 0 4px;
  transition: background 0.3s, border 0.3s;
}
.splide__pagination__page.is-active {
  background: white;
  border: 1px solid black;
}

/* Grid Layout Styles */
.edunews-grid-item {
  width: 100%;
  padding: 0.5rem;
}

.edunews-grid .edunews-article {
  width: 100%;
  height: 100%;
  margin: 0;
}

/* List Layout Styles */
.edunews-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 30px;
}

.edunews-list-item:last-child {
}

.edunews-article-list {
  display: flex;
  gap: 1.5rem;
}

.edunews-list-image {
  flex: 0 0 180px;
}

.edunews-list-image img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.edunews-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.edunews-list-content h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.edunews-list-content p {
  margin: 0 0 10px;
  flex-grow: 1;
}

/* Responsive Styles for Grid and List */
@media (max-width: 1024px) {
  .edunews-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .edunews-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
  
  .edunews-article-list {
    flex-direction: column;
  }
  
  .edunews-list-image {
    flex: 0 0 auto;
    margin-bottom: 1rem;
  }
  
  .edunews-list-image img {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 640px) {
  .edunews-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* === Stili aggiunti da templates/single.php === */

.edunews-single-article {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.edunews-single-article .edunews-article-content {
    /* Aggiunta specificità per evitare conflitti con .edunews-article-content dello shortcode */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 40px;
}

.edunews-single-article .edunews-article-header {
    margin-bottom: 30px;
}

.edunews-single-article .edunews-article-image {
    margin: -40px -40px 30px -40px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    max-height: 400px;
}

.edunews-single-article .edunews-article-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.edunews-single-article .edunews-article-title {
    font-size: 2.5em;
    margin: 0 0 20px;
    color: #333;
    line-height: 1.2;
}

.edunews-single-article .edunews-article-meta {
    color: #666;
    font-size: 0.9em;
    display: flex;
    gap: 20px;
    align-items: center;
}

.edunews-single-article .edunews-article-category a {
    color: #0073aa;
    text-decoration: none;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
}

.edunews-single-article .edunews-article-category a:hover {
    background: #e0e0e0;
}

.edunews-single-article .edunews-article-body {
    font-size: 1em;
    line-height: 1.8;
    color: #444;
}

.edunews-single-article .edunews-article-body p {
    margin-bottom: 1.5em;
}

.edunews-single-article .edunews-article-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.edunews-single-article .edunews-article-links {
    text-align: center;
}

.edunews-single-article .edunews-read-original {
    display: inline-block;
    padding: 12px 24px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.edunews-single-article .edunews-read-original:hover {
    background: #005177;
    color: #fff;
}

/* Media query specifica per single */
@media (max-width: 768px) {
    .edunews-single-article {
        margin: 20px auto;
    }

    .edunews-single-article .edunews-article-content {
        padding: 20px;
    }

    .edunews-single-article .edunews-article-image {
        margin: -20px -20px 20px -20px;
        max-height: 300px;
    }

    .edunews-single-article .edunews-article-title {
        font-size: 2em;
  }
}
  
/* Stili per contenuto markdown */
.edunews-content h1,
.edunews-content h2,
.edunews-content h3 {
    color: #333;
    margin: 15px 0 10px 0;
    line-height: 1.2;
}

.edunews-content h1 {
    font-size: 1.3em;
    font-weight: bold;
}

.edunews-content h2 {
    font-size: 1.2em;
    font-weight: bold;
}

.edunews-content h3 {
    font-size: 1.1em;
    font-weight: bold;
    color: #2271b1;
}

.edunews-content p {
    margin: 10px 0;
    line-height: 1.5;
}

.edunews-content strong {
    font-weight: bold;
}

.edunews-content em {
    font-style: italic;
}

.edunews-content a {
    color: #2271b1;
    text-decoration: underline;
}

.edunews-content a:hover {
    color: #135e96;
}

/* Responsive adjustments per markdown */
@media (max-width: 768px) {
    .edunews-content h1,
    .edunews-content h2,
    .edunews-content h3 {
        margin: 10px 0 8px 0;
    }
    
    .edunews-content h1 {
        font-size: 1.2em;
    }
    
    .edunews-content h2 {
        font-size: 1.1em;
    }
    
    .edunews-content h3 {
        font-size: 1.05em;
    }
}
  