/**
 * Site: Tutte le Pubblicazioni di Dario de Judicibus
 * Purpose: Main stylesheet, i.e. layout, CSS variables, Bootstrap overrides and custom components.
 *
 * Author: Dario de Judicibus
 * Email: dejudicibus@gmail.com
 *
 * Copyright:
 * Creative Commons Attribution-NonCommercial-NoDerivatives
 * International License (CC BY-NC-ND), latest version.
 *
 * Version: 2.00
 */

/* ==========================================================================
  1. CSS VARIABLES (Design tokens)
  ========================================================================== */
:root{
  --page-max-width: 1200px;

  /* Base */
  --color-bg: #ffffff;
  --color-text: #1f2933;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-shadow: rgba(0,0,0,.12);

  /* Brand – Blue */
  --color-primary: #4f93c2;
  --color-primary-soft: #e6f0f7;
  --color-primary-dark: #2f6f9e;

  /* Brand – Green */
  --color-secondary: #4f9d8b;
  --color-secondary-soft: #e8f3ef;
  --color-secondary-dark: #2f6f63;

  --radius: 12px;
  --border: 1px solid rgba(0,0,0,.08);

  /* Action ribbon colors */
  --ribbon-buy: var(--color-secondary-dark);
  --ribbon-read: var(--color-primary);
  --ribbon-card: #d79a4a; /* soft orange (tunable) */
  --ribbon-list: #b18cfe; /* soft purple (tunable) */
  --ribbon-none: #cbd5e1; /* neutral gray */
}

/* ==========================================================================
   2. BASE / RESET
   ========================================================================== */

html, body{
  height: 100%;
}

body{
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ==========================================================================
   3. LAYOUT
   ========================================================================== */

/* Centered layout */
.page{
  display: flex;
  justify-content: center;
}

.container-main{
  width: 100%;
  max-width: var(--page-max-width);
  padding: 0 1rem;
}

/* Basic components */
.site-header{
  border-bottom: var(--border);
}

.site-footer{
  border-top: var(--border);
}

.card-publication{
  border: var(--border);
  border-radius: var(--radius);
}

.pub-cover{
  width: 72px;
}

.cover-placeholder{
  width: 72px;
  height: 96px;
  border: var(--border);
  color: var(--color-muted);
}

/* ==========================================================================
   4. TYPOGRAPHY
   ========================================================================== */

a{
  color: var(--color-text);
}

a:hover{
  color: var(--color-primary-dark);
}

.text-justify {
    text-align: justify;
    hyphens: auto;
}

.site-logo{
  height: 28px;
  width: auto;
  display: block;
}

.site-title{
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}

.site-author{
  font-size: .9rem;
  opacity: .8;
  white-space: nowrap;
}

.lead {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-muted);
}

.author {
  font-size: 1.2rem;
  font-style: normal;
  font-weight: 600;
}

/* ==========================================================================
   5. HEADER & NAVIGATION
   ========================================================================== */

.site-header{
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.site-header nav a{
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
  position: relative;
  padding-bottom: 6px;
}

.site-header nav a:hover{
  color: var(--color-text);
  text-decoration: none;
}

.site-header nav a::after{
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary); /* azzurro */
  transition: width 0.25s ease;
}

.site-header nav a:hover::after,
.site-header nav a.active::after{
  width: 100%;
}

/* ==========================================================================
   6. COMPONENTS
   ========================================================================== */

.page-title{
  font-size: 1.75rem;
  font-weight: 600;
}

.card{
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.badge{
  font-weight: 500;
  border-radius: 999px;
  padding: 0.35em 0.7em;
  font-size: 0.75rem;
}

.badge-topic{
  background-color: var(--color-secondary-soft);
  color: var(--color-secondary-dark);
}

.badge-soft-primary{
  background-color: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.badge-soft-secondary{
  background-color: var(--color-secondary-soft);
  color: var(--color-secondary-dark);
}

/* ==========================================================================
   7. CARD PUBLICATION SPECIFIC STYLES
   ========================================================================== */

/* Card ribbon (left vertical bar) */
.pub-card{
  position: relative;
  overflow: hidden; /* ensures ribbon follows rounded corners */
}

.pub-card-body{
  padding-left: 3.25rem; /* space for the ribbon */
}

.pub-ribbon{
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.pub-ribbon > span{
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.85rem;
}

.pub-ribbon--buy{ background: var(--ribbon-buy); }
.pub-ribbon--read{ background: var(--ribbon-read); }
.pub-ribbon--card{ background: var(--ribbon-card); }
.pub-ribbon--list{ background: var(--ribbon-list); }
.pub-ribbon--none{ background: var(--ribbon-none); }
.pub-ribbon--none > span{ display: none; }

/* Make it clear clickable without looking like a traditional link */
.pub-click{
  color: inherit;
}

.pub-click:hover{
  color: inherit;
  text-decoration: none;
}

/* Right column alignment + code size */
.pub-right{
  min-height: 96px; /* matches your cover placeholder height */
}

.pub-code{
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap; /* evita spezzature brutte */
  opacity: 0.85;       /* leggermente più soft */
}

/* ==========================================================================
   8. LIST PUBLICATION SPECIFIC STYLES
   ========================================================================== */
.record-row{
  position: relative;
  display:flex;
  align-items:center;
  gap:1rem;
  padding:0.32rem 1rem;
  padding-left: calc(1rem + 24px); /* room for the ribbon */
  border: var(--border);
  border-radius:18px;
  background: var(--color-bg);
  text-decoration:none;
  color: inherit;
}

.record-row::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;          /* <-- this makes it always match the full card height */
  width:24px;
  border-radius:18px 0 0 18px;
  background: var(--ribbon-none);
}

.record-row.record-ribbon--read::before{
  background: var(--ribbon-read);
}

.record-row.record-ribbon--neutral::before{
  background: var(--ribbon-none);
}

.record-ico{
  width: 40px;
  height: 40px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--color-bg);
  flex: 0 0 auto;
}

.record-ico img{
  max-width: 32px;
  max-height: 32px;
}

.record-fallback-ico{
  width: 22px;
  height: 22px;
}

.record-main{
  flex: 1 1 auto;
  min-width: 0;
}

.record-title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-right{
  display:flex;
  gap:.75rem;
  align-items:center;
}

.record-detail,
.record-date{
  font-size: 0.875rem;
  line-height: 1.2;
}

.record-date{
  white-space: nowrap;
}

/* ==========================================================================
   9. INTRO STYLES
   ========================================================================== */
/* Intro: image + text layout */
.intro-figure{
  width: min(420px, 100%);
  border-radius: 1rem;
  overflow: hidden; /* needed for crop */
  background: var(--color-bg);
}

/* Crop the top whitespace by forcing cover within a fixed height */
.intro-image{
  display: block;
  width: 100%;
  height: 420px;           /* desktop crop height */
  object-fit: cover;       /* crops the blank area */
  object-position: 50% 80%;/* pushes focus down (adjust if needed) */
}

.link-buttons{
  display: flex;
  gap: 16px;
  justify-content: center;   /* cambia in flex-start se li vuoi a sinistra */
  align-items: flex-start;
  margin-top: 14px;
}

/* Il “pulsante” è un <a> cliccabile */
.link-btn{
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;                 /* rounded square */
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.75);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.link-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
  border-color: rgba(0,0,0,.2);
}

.link-btn:active{
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.link-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(13,110,253,.25), 0 10px 26px rgba(0,0,0,.12);
}

.link-btn__label{
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  opacity: .9;
}

.link-btn__img{
  width: 64px;          /* dimensione pulsante/immagine: cambia a 56/72/80 se vuoi */
  height: 64px;
  object-fit: contain;
  border-radius: 12px;  /* arrotondo anche l’immagine */
  display: block;
}





