/**
 * e-brei.net - Stili di Stampa
 * Foglio di stile dedicato alla stampa
 */

/* ==========================================================================
   1. IMPOSTAZIONI PAGINA
   ========================================================================== */

@page {
    margin: 20mm 15mm 25mm 15mm;
    
    @bottom-center {
        content: "Pagina tratta da e-brei.net";
        font-family: 'Open Sans', sans-serif;
        font-size: 9pt;
        color: #666;
    }
    
    @bottom-right {
        content: counter(page);
        font-family: 'Open Sans', sans-serif;
        font-size: 9pt;
        color: #666;
    }
}

/* ==========================================================================
   2. RESET E IMPOSTAZIONI BASE
   ========================================================================== */

* {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: white !important;
}

/* ==========================================================================
   3. HEADER - Logo a sinistra, Titolo centrato
   ========================================================================== */

header#mainHeader {
    display: block !important;
    position: relative !important;
    box-shadow: none !important;
    border-bottom: 2px solid #1e3a5f;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.header-top {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    position: relative;
    padding: 0 !important;
    max-width: 100% !important;
}

.header-brand-wrap {
    width: 100%;
    padding: 0 !important;
}

.header-brand {
    display: flex !important;
    align-items: center !important;
    width: 100%;
    gap: 0 !important;
}

/* Logo a sinistra */
.logo-link {
    display: flex !important;
    opacity: 1 !important;
    width: auto !important;
    flex-shrink: 0;
}

.logo {
    height: 50px !important;
    width: auto !important;
}

/* Titolo centrato */
.header-brand > a:not(.logo-link) {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.titolo {
    height: 50px !important;
    width: auto !important;
}

/* Nascondere elementi non necessari nell'header */
.menu-toggle,
.header-actions,
.search-wrapper,
.search-toggle,
.search-box,
.support-btn {
    display: none !important;
}

/* Nascondere completamente la navbar */
nav#mainNav,
nav {
    display: none !important;
}

/* ==========================================================================
   4. PAGE HERO - Mostra titolo pagina
   ========================================================================== */

.page-hero {
    background: none !important;
    padding: 10px 0 20px 0 !important;
    text-align: left !important;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.page-hero::before {
    display: none !important;
}

.page-hero-content {
    max-width: 100% !important;
}

.page-hero h1 {
    color: #1e3a5f !important;
    font-size: 24pt !important;
    margin-bottom: 5px !important;
}

.page-hero p {
    color: #666 !important;
    font-size: 11pt !important;
}

/* ==========================================================================
   5. CONTENUTO PRINCIPALE
   ========================================================================== */

main,
.container,
.content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #1e3a5f;
    page-break-after: avoid;
}

h1 { font-size: 20pt; }
h2 { font-size: 16pt; }
h3 { font-size: 14pt; }
h4 { font-size: 12pt; }

p, li, td, th {
    orphans: 3;
    widows: 3;
}

/* Link - senza URL in stampa */
a {
    color: #1e3a5f !important;
    text-decoration: underline;
}

a:after {
    content: "" !important;
}

/* Immagini */
img {
    max-width: 100% !important;
    page-break-inside: avoid;
}

/* Tabelle */
table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background: #f5f5f5 !important;
}

/* ==========================================================================
   6. FOOTER - Solo dedica e copyright
   ========================================================================== */

footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 2px solid #1e3a5f;
    background: white !important;
}

.footer-content {
    display: block !important;
}

/* Nascondere tutte le sezioni tranne la dedica */
.footer-section {
    display: none !important;
}

/* Mostrare solo la dedica (prima sezione) */
.footer-section:first-child {
    display: block !important;
    margin-bottom: 15px;
}

.footer-section:first-child h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 11pt;
    color: #000;
    font-style: italic;
    font-weight: normal;
    text-align: left;
    margin: 0;
}

/* Footer Bottom - copyright e licenza */
.footer-bottom {
    text-align: center;
    font-size: 9pt;
    color: #444;
    padding-top: 10px;
}

.footer-bottom p {
    margin: 0;
    color: #444;
}

.footer-bottom img {
    display: none !important;
}

.footer-bottom a {
    color: #444 !important;
}

.footer-bottom a:after {
    content: "" !important;
}

/* ==========================================================================
   7. ELEMENTI DA NASCONDERE
   ========================================================================== */

.back-to-top,
.breadcrumb,
.carousel-btn,
.carousel-dots,
.carousel-btn-left,
.carousel-btn-right,
.btn,
.btn-primary,
.btn-secondary,
.btn-gold,
button:not(.print-btn),
.dropdown-toggle,
.dropdown-menu,
.calendario-nav,
.calendario-print-btn,
.calendario-today-btn,
.share-buttons,
.social-links,
.cookie-banner,
.popup,
.modal {
    display: none !important;
}

/* ==========================================================================
   8. HOMEPAGE - Layout stampa specifico
   ========================================================================== */

/* Carousel: mostra come griglia statica 2x2 */
.carousel-container {
    display: block !important;
}

.carousel-viewport {
    overflow: visible !important;
}

.carousel-track {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    transform: none !important;
    width: 100% !important;
}

/* Card nel carousel */
.carousel-track .card {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    page-break-inside: avoid;
    display: block !important;
}

/* Mostra solo le prime 4 card */
.carousel-track .card:nth-child(1),
.carousel-track .card:nth-child(2),
.carousel-track .card:nth-child(3),
.carousel-track .card:nth-child(4),
.carousel-track .card:nth-child(5) {
    display: block !important;
}

.carousel-track .card:nth-child(n+6) {
    display: none !important;
}

/* Card styling per stampa */
.card {
    box-shadow: none !important;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.card:hover {
    transform: none !important;
    box-shadow: none !important;
}

.card-image {
    height: 100px !important;
}

.card-content {
    padding: 15px !important;
}

.card-title {
    font-size: 14pt !important;
}

.card-text {
    font-size: 10pt !important;
    min-height: auto !important;
}

.card-link {
    display: none !important;
}

/* Interruzione pagina dopo il carousel */
.carousel-dots {
    display: block !important;
    visibility: hidden;
    height: 0;
    page-break-after: always;
}

/* Categorie: griglia 3 colonne */
.sidebar-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 30px;
}

.category-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
    width: 100% !important;
}

.category-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    page-break-inside: avoid;
}

.category-icon {
    width: 40px !important;
    height: 40px !important;
}

.category-name {
    font-size: 10pt;
    color: #1e3a5f;
}

/* Sidebar (ultimi documenti) sotto le categorie */
.sidebar {
    width: 100% !important;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.sidebar h3 {
    font-size: 14pt;
    color: #1e3a5f;
    margin-bottom: 15px;
}

.sidebar-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.sidebar-item h4 {
    font-size: 11pt;
    margin-bottom: 5px;
}

.sidebar-item p {
    font-size: 9pt;
    color: #666;
}

/* ==========================================================================
   10. PAGINE DEFAULT - Layout stampa
   ========================================================================== */

.section-page {
    padding: 0 !important;
}

.section-container {
    max-width: 100% !important;
    padding: 0 !important;
}

.section-layout {
    display: block !important;
    grid-template-columns: none !important;
}

.section-main {
    width: 100% !important;
    max-width: 100% !important;
}

/* Sidebar nelle pagine default */
.section-layout .sidebar,
.sidebar-desktop {
    display: none !important;
}

/* Contenuto HTML */
.html-content,
.page-content {
    font-size: 11pt;
    line-height: 1.6;
}

.html-content h2 {
    font-size: 16pt;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.html-content h3 {
    font-size: 13pt;
    margin-top: 15px;
    margin-bottom: 8px;
}

.html-content p {
    margin-bottom: 10px;
    text-align: justify;
}

.html-content ul,
.html-content ol {
    margin-bottom: 10px;
    padding-left: 20px;
}

.html-content li {
    margin-bottom: 5px;
}

.html-content blockquote {
    border-left: 3px solid #1e3a5f;
    padding-left: 15px;
    margin: 15px 0;
    font-style: italic;
    color: #555;
}

.html-content img {
    max-width: 15% !important;
    height: auto !important;
}

.html-content pre,
.html-content code {
    font-size: 9pt;
    background: #f5f5f5 !important;
    padding: 2px 5px;
    border-radius: 3px;
}

.html-content pre {
    padding: 10px;
    overflow-x: auto;
    page-break-inside: avoid;
}

/* ==========================================================================
   11. PAGINA ORARI SHABBAT
   ========================================================================== */

.calculator-section {
    display: block !important;
}

/* Nascondere selettore località e bottoni in stampa */
.location-selector {
    display: none !important;
}

/* Results section */
.results-section {
    display: block !important;
}

/* Shabbat Card */
.shabbat-card {
    border: 2px solid #1e3a5f !important;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: white !important;
    page-break-inside: avoid;
    color: #000;
}

.shabbat-card-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

/* Zmanim Cards */
.zmanim-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: white !important;
    page-break-inside: avoid;
}

.zmanim-card-title {
    font-size: 14pt !important;
    color: #1e3a5f;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.zmanim-date {
    font-size: 10pt;
    color: #666;
    margin-bottom: 10px;
}

/* Righe orari */
.zman-row {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.zman-row:last-child {
    border-bottom: none;
}

.zman-name {
    font-size: 10pt;
    color: #333;
    font-weight: 500;
}

.zman-name-hebrew {
    font-size: 9pt;
    color: #666;
}

.zman-time {
    font-size: 12pt;
    font-weight: 600;
    color: #1e3a5f;
}

/* Info section */
.info-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.info-title {
    font-size: 14pt !important;
    margin-bottom: 15px;
}

.minhag-note {
    background: #f9f9f9 !important;
    padding: 10px 15px;
    border-left: 3px solid #1e3a5f;
    margin-bottom: 15px;
    font-size: 10pt;
    color: #000;
}

.info-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
}

.info-item {
    padding: 10px;
    background: #f9f9f9 !important;
    border-radius: 6px;
    page-break-inside: avoid;
}

.info-item h4 {
    font-size: 11pt;
    margin-bottom: 5px;
    color: #1e3a5f;
}

.info-item p {
    font-size: 9pt;
    color: #555;
    margin: 0;
}

/* ==========================================================================
   12. PAGINE CATEGORIA BLOG
   ========================================================================== */

.blog-container {
    padding: 0 !important;
}

/* Info box introduttivo */
.info-box {
    background: #f9f9f9 !important;
    border-left: 3px solid #1e3a5f;
    padding: 15px;
    margin-bottom: 20px;
    page-break-inside: avoid;
}

.info-box-content {
    font-size: 10pt;
    color: #000;
}

/* Conteggio articoli */
.category-count {
    font-size: 10pt;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

/* Griglia articoli */
.articles-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 15px !important;
}

.article-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: white !important;
    page-break-inside: avoid;
}

.article-card-content {
    page-break-inside: avoid;
}

.article-card-title {
    font-size: 12pt !important;
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-card-title a {
    color: #1e3a5f !important;
    text-decoration: none !important;
}

.article-card-meta {
    font-size: 9pt;
    color: #666;
    margin-bottom: 8px;
}

.article-card-meta span::before {
    color: #999;
}

.article-card-summary {
    font-size: 9pt;
    color: #444;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Nascondere link "Leggi l'articolo" in stampa */
.article-card-link {
    display: none !important;
}

/* Nascondere paginazione in stampa */
.pagination {
    display: none !important;
}

/* ==========================================================================
   13. PAGINE TURISMO (Kosher in Italy, Comunità, ecc.)
   ========================================================================== */

.turismo-page {
    padding: 0 !important;
}

/* Nascondere filtro di ricerca */
.live-filter,
.filter-status,
.items-section-header .live-filter-input,
.live-filter-icon,
.live-filter-clear {
    display: none !important;
}

/* Griglia comunità: 1 colonna */
.communities-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 15px !important;
}

/* Community Card */
.community-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: white !important;
    page-break-inside: avoid;
    break-inside: avoid;
}

.community-card.featured {
    border-color: #1e3a5f;
    border-width: 2px;
}

.community-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9 !important;
    padding: 10px;
    border-radius: 4px;
    color: #1e3a5f;
}

.community-header-text {
    flex: 1;
}

.community-name {
    font-size: 12pt !important;
    color: #1e3a5f;
    margin: 0 0 5px 0;
}

.community-meta {
    font-size: 9pt;
    color: #666;
}

.community-region {
    color: #666;
}

.featured-badge {
    display: inline-block;
    background: #1e3a5f !important;
    color: white !important;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 8pt;
    margin-left: 8px;
}

.community-icon {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0;
}

.community-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Community Body */
.community-body {
    font-size: 10pt;
}

.community-info .info-item {
    margin-bottom: 5px;
    color: #333;
}

.community-info .info-icon {
    margin-right: 5px;
}

.community-info a {
    color: #1e3a5f !important;
    text-decoration: none !important;
}

/* Nascondere bottoni azione */
.community-actions {
    display: none !important;
}

/* Info Cards */
.turismo-info-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
    margin-top: 20px;
}

.turismo-info-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: white !important;
    page-break-inside: avoid;
    text-decoration: none !important;
}

.turismo-info-card-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
}

.turismo-info-card-title {
    font-size: 11pt !important;
    color: #1e3a5f;
    margin-bottom: 5px;
}

.turismo-info-card-text {
    font-size: 9pt;
    color: #444;
    margin: 0;
}

/* Sezione Ambasciate */
.embassies-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #1e3a5f;
}

.embassies-header {
    display: flex !important;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.embassies-icon {
    font-size: 24pt;
}

.embassies-title {
    font-size: 14pt !important;
    margin: 0 0 5px 0;
}

.embassies-subtitle {
    font-size: 10pt;
    color: #666;
    margin: 0;
}

.embassies-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
}

.embassy-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: white !important;
    page-break-inside: avoid;
}

.embassy-name {
    font-size: 11pt !important;
    color: #1e3a5f;
    margin: 0 0 10px 0;
}

.embassy-info {
    font-size: 9pt;
    color: #333;
}

.embassy-info p {
    margin: 5px 0;
}

.embassy-info a {
    color: #1e3a5f !important;
    text-decoration: none !important;
}

/* Nascondere CTA section */
.cta-section {
    display: none !important;
}

/* ==========================================================================
   14. UTILITÀ STAMPA
   ========================================================================== */

.print-only {
    display: block !important;
}

.no-print,
.screen-only {
    display: none !important;
}

/* Page breaks */
.page-break-before {
    page-break-before: always;
}

.page-break-after {
    page-break-after: always;
}

.avoid-break {
    page-break-inside: avoid;
}

/* ==========================================================================
   15. STAMPA CALENDARIO SETTIMANALE (funzionalità specifica)
   ========================================================================== */

#printTemplate {
    display: block !important;
}

/* Quando si stampa il calendario, nascondi tutto il resto */
body:has(#printTemplate) > *:not(#printTemplate) {
    display: none !important;
}

.print-header {
    text-align: center;
    border-bottom: 2px solid #1e3a5f;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.print-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    color: #1e3a5f;
    margin: 0 0 5px 0;
}

.print-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.print-week-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.print-day {
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 15px;
    min-height: 100px;
    page-break-inside: avoid;
}

.print-day:last-child {
    border-bottom: 1px solid #ddd;
}

.print-day.shabbat {
    background: #f5f5f5 !important;
}

.print-day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.print-day-name {
    font-weight: 700;
    font-size: 16px;
    color: #1e3a5f;
}

.print-day-date {
    font-size: 14px;
    color: #666;
}

.print-day-hebrew {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

.print-day-events {
    margin-bottom: 10px;
}

.print-event {
    display: inline-block;
    background: #f0f0f0 !important;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.print-day-notes {
    font-size: 12px;
    color: #aaa;
    margin-top: auto;
}

.print-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-size: 11px;
    color: #888;
}
