/*
 Theme Name:   Extendable Child
 Theme URI:    https://example.com/
 Description:  Child Theme per Extendable
 Author:       Il tuo nome
 Template:     extendable
 Version:      1.0.0
*/

/* ==========================
   Stili per form ricerca atti
   ========================== */
.atti-search-form {
  background: #f5f9fc;
  border: 1px solid #dce3eb;
  padding: 20px;
  margin: 20px 0;
  border-radius: 6px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.atti-search-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0px 25px;
  margin-bottom: 5px;
}

.atti-search-form label {
  display: block;
  font-weight: 600;
  margin: 0;
  padding: 0;
  color: #333;
  font-size: 14px;
  line-height: 1.2;
}

.atti-search-form input,
.atti-search-form select {
  width: 100%;
  padding: 4px 7px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  margin: 0;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.atti-search-form input:focus,
.atti-search-form select:focus {
  border-color: #0056a3;
  box-shadow: 0 0 3px rgba(0, 86, 163, 0.3);
  outline: none;
}

.atti-search-form button {
  background-color: #004080;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.atti-search-form button:hover {
  background-color: #0066cc;
}

/* ==========================
   Stili tabella atti (desktop)
   ========================== */
.desktop-only {
  display: table;
}

.mobile-only {
  display: none;
}

.atti-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}

.atti-table th,
.atti-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}

.atti-table th {
  background-color: #004080;
  color: #fff;
  font-weight: 600;
}

.atti-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.atti-table tr:hover {
  background-color: #eef5ff;
}

.atti-table td a {
  color: #004080;
  text-decoration: none;
  font-weight: 500;
}

.atti-table td a:hover {
  text-decoration: underline;
}

/* ==========================
   Stili card atti (mobile)
   ========================== */
.atto-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 15px;
  background: #fff;
}

.atto-card h4 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 16px;
  color: #004080;
}

.atto-card p {
  margin: 4px 0;
  font-size: 14px;
}

.atto-card a {
  color: #004080;
  text-decoration: none;
  font-weight: 500;
}

.atto-card a:hover {
  text-decoration: underline;
}

/* ==========================
   Responsive
   ========================== */
@media (max-width: 768px) {
  .atti-search-form {
    padding: 10px;
  }

  .atti-search-form .form-grid {
    gap: 0px 12px;
  }

  .atti-search-form button {
    width: 100%;
  }

  /* tabella scrollabile invece che card */
  .atti-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ddd;
  }

  .atti-table table {
    width: 100%;
    min-width: 700px; /* forza scroll se troppo stretta */
    border-collapse: collapse;
  }

  .atti-table th,
  .atti-table td {
    font-size: 13px;
    white-space: nowrap;
  }
}
/* ==========================
   Albo Pretorio: barra come le altre pagine
   ========================== */
body.post-type-archive-atti .albo-pretorio-hero {
  background: var(--wp--preset--color--tertiary, #f6f6fb);
  margin: 0 !important;
  padding-top: var(--wp--preset--spacing--30) !important;
  padding-bottom: var(--wp--preset--spacing--30) !important;
  padding-left: var(--wp--preset--spacing--30) !important;
  padding-right: var(--wp--preset--spacing--30) !important;
}

body.post-type-archive-atti .albo-pretorio-hero h1 {
  margin: 0 !important;
  line-height: 1.2;
  font-size: var(--wp--preset--font-size--large) !important;
}

body.post-type-archive-atti .albo-pretorio-hero .alignwide {
  max-width: var(--wp--style--global--wide-size, 1200px);
  margin-left: auto;
  margin-right: auto;
}

body.post-type-archive-atti .albo-pretorio-hero.has-global-padding {
  padding-top: var(--wp--preset--spacing--30) !important;
  padding-bottom: var(--wp--preset--spacing--30) !important;
}

body.post-type-archive-atti .albo-pretorio-hero.alignfull {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}
/* Barra titolo Albo Pretorio */
.albo-pretorio-hero {
  background-color: var(--wp--preset--color--tertiary, #f6f6fb);
  padding: var(--wp--preset--spacing--30, 2rem);
  margin: 0 0 2rem 0;
  text-align: center;
}

.albo-pretorio-hero h1 {
  font-size: var(--wp--preset--font-size--large, 2rem);
  margin: 0;
}
.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.alignwide {
  margin-left: auto;
  margin-right: auto;
  max-width: var(--wp--style--global--wide-size, 1200px);
}
/* Forza i blocchi "full width" a estendersi */
.wp-block-group.alignfull {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
}

/* Evita che il layout "constrained" restringa */
.wp-block-group.is-layout-constrained.alignfull {
  max-width: 100vw !important;
}
/* Rimuove il “constrained layout” e estende la barra interamente */
body.post-type-archive-atti .wp-block-group.alignfull {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
}

/* Se ci sono residui di layout constraining */
body.post-type-archive-atti .is-layout-constrained.alignfull {
  max-width: none !important;
}

/* Stile titolo come nelle altre pagine */
body.post-type-archive-atti .wp-block-group.alignfull h1 {
  margin: 0;
  font-size: var(--wp--preset--font-size--large);
  color: inherit;
}
/* Forza la barra hero di "Albo Pretorio" a occupare 100% viewport */
body.post-type-archive-atti .albo-pretorio-hero {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

/* Annulla i vincoli interni */
body.post-type-archive-atti .albo-pretorio-hero.is-layout-constrained {
  max-width: 100vw !important;
}
body.post-type-archive-atti .albo-pretorio-hero.has-global-padding {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* Rende la tabella atti più larga sui desktop */
.atti-table {
    width: 100% !important;
    max-width: 100% !important;
}

/* Permette al wrapper di espandersi */
.page .entry-content .atti-table {
    margin-left: auto;
    margin-right: auto;
}
/* Riduci il gap tra la barra grigia (Group alignfull) e il blocco Shortcode */
.wp-block-group.alignfull.has-background + .wp-block-shortcode {
  margin-top: 8px !important;  /* era ~var(--block-gap), di solito 32-40px */
}

/* Ulteriore micro-ritocco: tira su di poco il box ricerca (solo desktop) */
@media (min-width: 782px) {
  .atti-search-form {
    margin-top: -8px !important; /* opzionale: togli se non serve */
  }
}
/* Centra il bottone "Cerca" */
.atti-search-form > .btn-cerca,
.atti-search-form > button[type="submit"],
.atti-search-form > input[type="submit"] {
  display: block !important;
  margin: 12px auto 0 !important; /* auto sui lati = centrato */
  float: none !important;
}

/* (Opzionale) su desktop assicurati che NON prenda la larghezza piena */
@media (min-width: 769px) {
  .atti-search-form > .btn-cerca {
    width: auto !important;
  }
}




