/*
 * ESE Home Theme – styles/index.css
 * Università del Salento · OJS 3.3
 *
 * Variabili colore iniettate dinamicamente dal plugin PHP.
 * Fallback verde se non iniettate.
 */

/* ── RESET & VARIABILI ───────────────────────────────────────────────────── */
:root {
  --ese-home-primary:       oklch(0.22 0.08 155);
  --ese-home-primary-mid:   oklch(0.28 0.09 155);
  --ese-home-primary-light: oklch(0.40 0.10 155);
  --ese-home-gold:          oklch(0.72 0.12 82);
  --ese-home-cream:         oklch(0.975 0.008 145);
  --ese-home-cream-dark:    oklch(0.94 0.012 145);
  --ese-home-text:          oklch(0.18 0.02 155);
  --ese-home-text-mid:      oklch(0.45 0.02 155);
  --ese-home-text-light:    oklch(0.60 0.015 155);
  --ese-home-border:        oklch(0.88 0.012 145);
  --ese-home-font-display:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --ese-home-font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --ese-home-radius:        10px;
}

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

body {
  font-family: var(--ese-home-font-body);
  background: var(--ese-home-cream);
  color: var(--ese-home-text);
  margin: 0;
  line-height: 1.5;
}

/* ── HEADER SITO ─────────────────────────────────────────────────────────── */
.ese-home-header {
  background: var(--ese-home-primary);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid oklch(1 0 0 / 0.07);
}

.ese-home-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.ese-home-header__logo-box {
  width: 40px;
  height: 40px;
  background: var(--ese-home-gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}

.ese-home-header__logo-letter {
  font-family: var(--ese-home-font-display);
  font-weight: 700;
  color: var(--ese-home-primary);
  font-size: 20px;
  line-height: 1;
}

.ese-home-header__brand {
  flex-shrink: 0;
}

.ese-home-header__name {
  font-family: var(--ese-home-font-display);
  font-size: 17px;
  font-weight: 600;
  color: white;
  letter-spacing: -0.01em;
  line-height: 1;
}

.ese-home-header__sub {
  font-size: 10px;
  color: oklch(1 0 0 / 0.48);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

.ese-home-header__divider {
  width: 1px;
  height: 28px;
  background: oklch(1 0 0 / 0.14);
  flex-shrink: 0;
}

.ese-home-header__ojs-label {
  font-size: 11px;
  color: oklch(1 0 0 / 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
}

.ese-home-header__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ese-home-header__nav a {
  color: oklch(1 0 0 / 0.72);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
}

.ese-home-header__nav a:hover {
  color: white;
}

.ese-home-header__lang {
  display: flex;
  gap: 4px;
}

.ese-home-header__lang a,
.ese-home-header__lang span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid oklch(1 0 0 / 0.2);
  color: oklch(1 0 0 / 0.6);
  text-decoration: none;
  transition: all 0.15s;
}

.ese-home-header__lang a.active,
.ese-home-header__lang span.active {
  background: var(--ese-home-gold);
  color: var(--ese-home-primary);
  border-color: var(--ese-home-gold);
}

.ese-home-header__login {
  background: var(--ese-home-gold);
  color: var(--ese-home-primary) !important;
  border: none;
  border-radius: 7px;
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--ese-home-font-body);
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.ese-home-header__login:hover {
  opacity: 0.87;
  color: var(--ese-home-primary) !important;
}

/* ── HERO / SEARCH STRIP ─────────────────────────────────────────────────── */
.ese-home-hero {
  background: var(--ese-home-primary-mid);
  padding: 32px 40px 26px;
  border-bottom: 1px solid oklch(0 0 0 / 0.06);
}

.ese-home-hero__inner {
  max-width: 1280px;
  margin: 0 auto;
}

.ese-home-hero__title {
  font-family: var(--ese-home-font-display);
  font-size: 28px;
  font-weight: 600;
  color: white;
  letter-spacing: -0.02em;
  margin: 0 0 5px;
}

.ese-home-hero__count {
  font-size: 13px;
  color: oklch(1 0 0 / 0.5);
  margin: 0 0 20px;
}

.ese-home-hero__search-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ese-home-hero__search-wrap {
  position: relative;
  flex: 1 1 300px;
  max-width: 480px;
}

.ese-home-hero__search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
}

.ese-home-hero__search {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: oklch(1 0 0 / 0.1);
  border: 1px solid oklch(1 0 0 / 0.18);
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-family: var(--ese-home-font-body);
  outline: none;
  transition: border-color 0.15s;
}

.ese-home-hero__search::placeholder { color: oklch(1 0 0 / 0.4); }
.ese-home-hero__search:focus { border-color: oklch(1 0 0 / 0.4); }

/* ── JOURNAL GRID ────────────────────────────────────────────────────────── */
.ese-home-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 40px 64px;
}

.ese-home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1100px) { .ese-home-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px)  { .ese-home-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .ese-home-grid { grid-template-columns: 1fr; } }

/* ── JOURNAL CARD ────────────────────────────────────────────────────────── */
.ese-home-card {
  background: white;
  border: 1px solid var(--ese-home-border);
  border-radius: var(--ese-home-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.ese-home-card:hover {
  border-color: var(--ese-home-primary-light);
  box-shadow: 0 8px 28px oklch(0.22 0.08 155 / 0.14);
  transform: translateY(-3px);
}

/* Copertina */
.ese-home-card__cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--ese-home-cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ese-home-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder cover (quando non c'è immagine) */
.ese-home-card__cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ese-home-primary);
  color: white;
  font-family: var(--ese-home-font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -2px;
  opacity: 0.92;
}

/* Body */
.ese-home-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.ese-home-card__title {
  font-family: var(--ese-home-font-display);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.38;
  color: var(--ese-home-text);
  margin: 0;
  flex: 1;
}

.ese-home-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── BOTTONI ─────────────────────────────────────────────────────────────── */
.ese-home-btn {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--ese-home-font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.01em;
  border: none;
  line-height: 1.4;
}

.ese-home-btn--primary {
  background: var(--ese-home-primary);
  color: white;
}

.ese-home-btn--primary:hover {
  background: var(--ese-home-primary-light);
  color: white;
}

.ese-home-btn--outline {
  background: transparent;
  color: var(--ese-home-primary);
  border: 1px solid var(--ese-home-primary-light);
}

.ese-home-btn--outline:hover {
  background: var(--ese-home-primary);
  color: white;
}

/* ── SEARCH JS filter: nasconde card non corrispondenti ──────────────────── */
.ese-home-card[data-hidden="true"] { display: none; }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.ese-home-footer {
  background: var(--ese-home-primary);
  padding: 22px 40px;
  color: oklch(1 0 0 / 0.4);
  font-size: 12px;
}

.ese-home-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ese-home-footer a {
  color: oklch(1 0 0 / 0.4);
  text-decoration: none;
  margin-left: 16px;
  transition: color 0.15s;
}

.ese-home-footer a:hover { color: white; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ese-home-header__inner { padding: 12px 20px; gap: 12px; }
  .ese-home-hero { padding: 22px 20px 18px; }
  .ese-home-main { padding: 20px 20px 48px; }
  .ese-home-header__ojs-label { display: none; }
}
