/*
Theme Name: SMNTCS Retro Child
Theme URI:
Description: Child theme di SMNTCS Retro
Author: sigis
Author URI:
Template: smntcs-retro
Version: 1.0.1
Text Domain: smntcs-retro-child
*/

/* ===========================
   VARIABILI GLOBALI
=========================== */
:root {
  --nord0: #000000;          /* Sfondo */
  --nord4: #d8dee9;          /* Testo con link */
  --nord9: #ffffff;          /* Testo principale */
  --border-style: 1px dashed var(--nord9); /* Linea tratteggiata bianca */
  --highlight-green: #7dd87d; /* Hover link/tag */
  --highlight-yellow: #f4e06d;
  --highlight-blue: #5fb4f0;
  --highlight-purple: #c792e8;
  --z-header: 10000;
}

/* ===========================
   UTILITÀ
=========================== */
.border-default {
  border: var(--border-style);
}

.label {
  display: inline-block;
}

/* ===========================
   BASE DEL SITO
=========================== */
body {
  font-family: 'Hack', 'Courier New', Courier, monospace;
  font-size: 16px;
  line-height: 1.6;
  padding: 20px;
  max-width: 800px;
  margin: auto;
  background-color: var(--nord0);
  color: var(--nord9);
}

/* Wrapper contenuti */
.content-wrapper {
  max-width: 800px;
  margin: auto;
  padding: 20px;
}

/* ===========================
   HEADER
=========================== */
#header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  flex-wrap: nowrap;
  position: relative;
  z-index: var(--z-header);
}

#header-menu-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 1;
}

/* Menu principale */
#header-menu {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Logo */
#custom-logo img {
  max-height: 55px;
  max-width: 100%;
  display: block;
}

/* Toggle hamburger */
#menu-toggle {
  display: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--nord9);
  background-color: transparent;
  border: none;
}

/* ===========================
   RESPONSIVE MENU MOBILE
=========================== */
@media (max-width: 768px) {
  
	/* Toggle hamburger */
	#menu-toggle {
    display: block;
    font-size: 3rem;
    flex-shrink: 0;
  }

/* Wrapper del menu */
  #header-menu-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
	
  /* Menu mobile */
  #header-menu {
    display: none; /* nascosto di default */
    flex-direction: column; /* voci in verticale */
    align-items: stretch; /* voci estese in larghezza */
    white-space: normal; /* evita il taglio delle voci */
   position: fixed;
    top: 110px; /* posizione verticale del menu: da regolare */
    right: 20px; /* vicino al bordo destro dello schermo */
    left: auto;
    width: min(320px, 85vw);
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
    background-color: rgba(20, 20, 20, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: calc(var(--z-header) + 1);
    transition: all 0.3s ease-in-out;
  }

  /* Quando il menu è aperto */
  #header-menu.open {
    display: flex;
  }
	
	/* Lista generata da WordPress */
  #header-menu nav,
  #header-menu nav ul {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
  }
 
/* Voci menu mobile */
  #header-menu a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 20px;
    color: var(--nord9);
    text-decoration: none;
    border-bottom: 1px solid #333;
  }

/* Effetto hover */
  #header-menu a:hover {
    background-color: #222;
  }
}

/* Nasconde titolo/motto ma mantiene accessibilità */
#site-title h1,
#site-title h2 {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===========================
   HOMEPAGE
=========================== */

/* Crea l'effetto 'terminal typing' del testo */
.home h1.post-title {
  display: none;
}

.terminal-text {
    visibility: hidden;
}

.terminal-text.is-typing {
    visibility: visible;
}

.terminal-line {
    display: block;
}

.terminal-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    margin-left: 0.1em;
    vertical-align: -0.1em;
    border-right: 2px solid var(--highlight-green);
    animation: terminal-blink 0.8s steps(1) infinite;
}

/* I box della Home non vengono mostrati all'inizio */
.home-terminal-section {
    display: none;
}

/* Il box viene mostrato quando inizia la digitazione */
.home-terminal-section.is-active {
    display: block;
}

.home-terminal-section p:first-child {
  margin-top: 0;
}

.home-terminal-section p:last-child {
  margin-bottom: 0;
}

@keyframes terminal-blink {
    50% {
        opacity: 0;
    }
}

/* ===========================
   PAGINE
=========================== */
.page h1.post-title {
  font-size: 3rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 1.5em;
}

/* ===========================
   POST SINGOLI
=========================== */
.single-post h1 {
  font-size: 2rem;
}



/* ===========================
   TABELLE
=========================== */
table,
.responsive-table-wrapper table {
  width: 100%;
  border: var(--border-style);
  border-collapse: collapse;
  line-height: 1.4;
  box-sizing: border-box;
  background-color: #1a1a1a !important; /*sfondo grigio scuro*/
}

table td,
table th,
.responsive-table-wrapper td,
.responsive-table-wrapper th {
  padding: 12px;
  font-size: 14px; /*Dimensione fissata a 14px in modo che nella tabella sia inferiore al testo sotto */
  text-align: left;
  background-color: #1a1a1a !important; /*sfondo grigio scuro*/
}

/* Colori bordo uniformati per Projects, Activities, Publications */
.responsive-table-wrapper.projects-table,
.responsive-table-wrapper.activities-table,
.responsive-table-wrapper.publications-table,
.responsive-table-wrapper.projects-table table,
.responsive-table-wrapper.activities-table table,
.responsive-table-wrapper.publications-table table,
.responsive-table-wrapper.projects-table td,
.responsive-table-wrapper.activities-table td,
.responsive-table-wrapper.publications-table td,
.responsive-table-wrapper.projects-table th,
.responsive-table-wrapper.activities-table th,
.responsive-table-wrapper.publications-table th {
  border-color: var(--nord9);
}

/* Sezioni sotto la tabella iniziale con i metadati */
.field-section {
  margin-top: 2.5rem;
  padding: 1rem 1.5rem;
  border: var(--border-style);
  background-color: #1a1a1a !important; /*sfondo grigio scuro*/
}

/* Colori titoli delle sezioni (DESCRIPTION//, LINKS//) */
.responsive-table-wrapper.projects-table .label {
  color: var(--highlight-blue);
}

.responsive-table-wrapper.activities-table .label {
  color: var(--highlight-yellow);
}

.responsive-table-wrapper.publications-table .label {
  color: var(--highlight-purple);
}


/* ===========================
   PAGINE TAG E CATEGORIE
=========================== */

body.tag .tag-post-wrapper,
body.category .category-post-wrapper {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

/* Riquadri dei post */
body.tag .tag-post-item,
body.category .category-post-item {
  margin: 10px 0; 
  padding: 20px; 
  border: var(--border-style);
  border-radius: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  transition: box-shadow 0.2s ease-in-out;
}

/* Distanza verticale tra riquadri delle pagine Tag e Categorie */
body.tag #site-content-posts > .tag-post-item,
body.category #site-content-posts > .category-post-item {
  margin-top: 15px !important;    /* distanza sopra ogni riquadro */
  margin-bottom: 15px !important; /* distanza sotto ogni riquadro */
}

/* Forza zero margini ereditati dal tema */
body.tag .tag-post-wrapper > .tag-post-item,
body.category .category-post-wrapper > .category-post-item {
  margin-top: 6px !important;
  margin-bottom: 6px !important;
}

/* Hover */
body.tag .tag-post-item:hover,
body.category .category-post-item:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* Titolo */
body.tag .tag-post-title,
body.category .category-post-title {
  text-transform: uppercase;
  font-size: 1.2em;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 10px 0;
  transition: color 0.2s ease-in-out;
}

body.tag .tag-post-link:hover .tag-post-title,
body.category .category-post-link:hover .category-post-title {
  color:  var(--highlight-green);
}

/* Meta */
body.tag .tag-post-meta,
body.category .category-post-meta {
  width: 100%;
  font-size: 0.95em;
  margin-bottom: 10px;
  color: #7dd87d;
  line-height: 1.5;
}

/* Forza le immagini dei post a usare tutta la larghezza disponibile */
.single-post article img,
.single-post article figure img,
.single-post article .wp-block-image img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 1.5rem auto;
}

/* ===========================
   RESPONSIVE TABLE
=========================== */
.responsive-table-wrapper td {
  width: 100%;
  display: block;
  border-bottom: 1px dashed var(--highlight-yellow);
}

@media (min-width: 768px) {
  .responsive-table-wrapper table {
    display: table;
  }

  .responsive-table-wrapper tr {
    display: table-row;
  }

  .responsive-table-wrapper td {
    display: table-cell;
    width: 30%;
  }
}

/* ===========================
   VIDEO RESPONSIVE
=========================== */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: var(--nord0);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===========================
   FORM CF7
=========================== */
.wpcf7-response-output {
  border: 1px dashed var(--nord9) !important;
  padding: 15px !important;
  background-color: transparent !important;
  color: var(--nord9) !important;
}

/* ===========================
   ACCESSIBILITY
=========================== */

/* Accessibilità: focus da tastiera */
:focus-visible {
  outline: 2px solid var(--highlight-green);
  outline-offset: 3px;
}

/* Accessibilità: riduzione delle animazioni per chi lo richiede*/
@media (prefers-reduced-motion: reduce) {
  .terminal-cursor {
    animation: none;
  }
}

/* ===========================
   FOOTER
=========================== */
.footer-social-icons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}

.footer-social-icons a {
  color: var(--nord9);
  font-size: 1.5rem;
  transition: color 0.3s ease;
  text-decoration: none;
}

.footer-social-icons a:hover {
  color: #ccc;
}

.footer-privacy {
  padding: 20px;
  font-size: 1.2rem;
  text-align: center;
  color: var(--nord9);
}

.footer-privacy a {
  text-decoration: none;
  margin: 0 5px;
}

.footer-privacy a:hover {
  text-decoration: underline;
}
