/* ==========================================================================
   CORNELLÀPOLIS – TEMA CLARO PREMIUM (LINEAR / VERCEL STYLE)
   ========================================================================== */

/* ==========================
   VARIABLES
   ========================== */
:root {
  --color-primary: #016A3D;
  --color-primary-light: #7AFFB5;
  --color-text: #111827;
  --color-text-secondary: #6b7280;
  --color-bg: #f4f5f7;
  --color-white: #ffffff;
  --color-border: rgba(0,0,0,0.08);

  --radius-card: 18px;
  --radius-input: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 18px 45px rgba(15,23,42,0.18);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ==========================
   RESET GLOBAL
   ========================== */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
}

a {
  text-decoration: none !important;
  color: inherit;
}

/* ==========================
   CONTENEDOR BASE
   ========================== */
.container {
  width: 100%;
  max-width: 1250px;
  margin: auto;
  padding: 0 24px;
}

/* ==========================================================================
   NAVBAR – LINEAR STYLE
   ========================================================================== */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1250px;
  margin: auto;
  padding: 0 24px;
}
.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text);
}
.logo-accent { color: var(--color-primary); }
.main-nav { display: flex; gap: 22px; }
.main-nav a {
  color: var(--color-text-secondary);
  font-weight: 600;
}
.main-nav a:hover { color: var(--color-text); }

/* ==========================================================================
   BOTONES GLOBAL
   ========================================================================== */
.btn-primary {
  background: var(--color-primary);
  color: white !important;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(1,106,61,0.3);
  transition: 0.15s;
}
.btn-primary.small {
  padding: 10px 20px;
  font-size: 14px;
}
.btn-primary:hover {
  background: #015732;
  transform: translateY(-1px);
}

.btn-ghost {
  background: white;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.btn-delete {
  background: #ff4a4a;
  color: white !important;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  border: none;
  display: inline-block;
  transition: 0.15s;
}
.btn-delete.small {
  padding: 8px 14px;
  font-size: 13px;
}
.btn-delete:hover {
  background: #d93636;
  transform: translateY(-2px);
}

/* ==========================================================================
   INPUTS / SELECTS / TEXTAREA
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border);
  background: white;
  font-size: 15px;
  outline: none;
  transition: 0.15s;
}

textarea { min-height: 150px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(1,106,61,0.18);
}

/* ==========================================================================
   PANEL / DASHBOARD
   ========================================================================== */
.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding-top: 40px;
  max-width: 1250px;
  margin: auto;
}
@media(max-width:900px){
  .dashboard { grid-template-columns: 1fr; }
}

.dash-card {
  background: white;
  padding: 30px;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   LISTADOS
   ========================================================================== */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

/* CARD */
.post-card-list {
  background: white;
  border: 1px solid var(--color-border);
  padding: 26px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: .15s;
}
.post-card-list:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   SINGLE POST — **ESTILO FINAL PREMIUM**
   ========================================================================== */

.single-wrapper {
  max-width: 900px;
  margin: 40px auto 70px;
  padding: 0 24px;
}

.single-post-card {
  background: white;
  border-radius: 18px;
  padding: 32px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}

.single-title {
  font-size: 32px;
  margin: 10px 0 15px;
  font-weight: 800;
}

.single-meta {
  color: var(--color-text-secondary);
  font-size: 15px;
  margin-bottom: 6px;
}

.single-content {
  font-size: 18px;
  line-height: 1.65;
  margin-top: 18px;
}

/* IMAGEN DEL POST REDUCIDA Y ELEGANTE */
.single-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* PETICIÓN */
.petition-block {
  margin-top: 20px;
}

/* COMENTARIOS */
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.comment-meta {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

/* ==========================================================================
   HOME (INDEX)
   ========================================================================== */
.section-home {
  max-width: 1250px;
  margin: 40px auto;
  padding: 0 24px;
}

.home-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 18px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 26px;
}

.card-mini {
  background: white;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: .15s;
}
.card-mini:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-mini img {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 12px;
}

.card-title {
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.card-date {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.link-more {
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 18px;
  display: inline-block;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: white;
  padding: 40px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  margin-top: 50px;
}
/* ============================================================
   BOTÓN FLOTANTE + PARA CREAR PUBLICACIÓN (LISTADOS PÚBLICOS)
   ============================================================ */
.fab-add {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #016A3D, #7AFFB5);
  color: #ffffff !important;
  font-size: 34px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  cursor: pointer;
  border: none;
  text-decoration: none !important;
  z-index: 40;
}

.fab-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.22);
}
/* ============================================================
   FILE UPLOAD – SUPER PREMIUM STYLE
============================================================ */
.upload-box {
    border: 2px dashed var(--color-border);
    border-radius: 18px;
    padding: 30px;
    background: #f9fafb;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 20px;
    position: relative;
}

.upload-box:hover {
    background: #f0fdf4;
    border-color: var(--color-primary);
}

.upload-box svg {
    width: 42px;
    height: 42px;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.upload-box strong {
    color: var(--color-primary);
}

.upload-box span {
    color: var(--color-text-secondary);
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Texto del nombre del archivo */
.upload-filename {
    margin-top: 10px;
    font-size: 14px;
    color: var(--color-text-secondary);
}
/* ============================================================
   SECCIONES (EVENTOS, NOTICIAS, ETC)
============================================================ */

/* Contenedor de sección */
.section-header {
    background: white;
    padding: 40px;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

/* Grid */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 26px;
    margin-bottom: 70px;
}

/* Tarjetas */
.section-card {
    background: white;
    padding: 26px;
    border-radius: var(--radius-card);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: .15s;
    text-decoration: none;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
}

.section-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Texto */
.section-card .title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-card .excerpt {
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}

.section-card .meta {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* ======= FAB BUTTON para todas las páginas ======= */
.fab-add {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #016A3D, #7AFFB5);
    color: white !important;
    border: none;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    text-decoration: none;
}

.fab-add:hover {
    transform: scale(1.06);
}
.section-header {
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
}

.section-header p {
    color: var(--color-text-secondary);
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.section-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius-card);
    padding: 26px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: .15s;
    color: inherit;
}

.section-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.section-card .post-tag {
    background: rgba(1,106,61,0.10);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--color-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.section-card .title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-card .excerpt {
    font-size: 15px;
    color: #4b5563;
    margin-bottom: 18px;
}

.section-card .meta {
    margin-top: auto;
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.like-btn,
.firmar-btn {
    margin-top: 14px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    width: fit-content;
}

.like-btn {
    background: #fde047;
}

.firmar-btn {
    background: var(--color-primary);
    color: white;
}
/* ===== BOTÓN FLOTANTE + (FAB ADD) ===== */
.fab-add {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #016A3D, #7AFFB5);
    color: white !important;
    border: none;
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    z-index: 999;
    text-decoration: none !important;
    transition: 0.15s;
}

.fab-add:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}
.image-preview {
    margin-top: 20px;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.1);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
/* Oculta input-file nativo completamente */
.file-upload-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0 !important;
    cursor: pointer;
}

/* Caja bonita */
.file-upload-wrapper {
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 32px;
    background: #f9fafb;
    cursor: pointer;
    transition: .2s;
    text-align: center;
    display: block;
}

.file-upload-wrapper:hover {
    background: #eefcf4;
    border-color: #016A3D;
}

.upload-icon {
    color: #016A3D;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 15px;
    color: #6b7280;
}
.upload-text strong {
    color: #016A3D;
}
/* ============================================================
   RESPONSIVE GLOBAL CORNELLÀPOLIS
   Aplica a TODA la web, sin romper nada
   ============================================================ */

/* ========== MÓVIL PEQUEÑO (<480px) ========== */
@media (max-width: 480px) {

    /* Header */
    .header-inner {
        padding: 0 14px;
    }
    .main-nav { display: none; }

    /* Botón Mi Panel */
    .btn-panel {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }

    /* Hero */
    .hero {
        padding: 20px !important;
        height: auto !important;
        padding-top: 90px !important;
        padding-bottom: 40px !important;
        text-align: left !important;
        flex-direction: column !important;
    }

    .hero-content {
        flex-direction: column !important;
        gap: 30px !important;
    }

    .hero-left h1 {
        font-size: 32px !important;
        line-height: 1.2 !important;
    }
    .hero-left p {
        font-size: 15px !important;
    }
    .btn-primary { width: 100%; text-align: center; }

    .hero-right {
        width: 100% !important;
    }

    .hero-card {
        padding: 20px !important;
    }

    /* Grid listado */
    .list-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .post-card-list {
        padding: 20px !important;
    }

    /* Tarjetas Home */
    .home-grid {
        grid-template-columns: 1fr !important;
    }

    /* Página post */
    .single-post img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 12px;
    }

    /* Formulario crear */
    form .form-group {
        margin-bottom: 18px !important;
    }

    input, select, textarea {
        font-size: 16px !important; /* anti zoom iPhone */
        padding: 12px !important;
    }

    .file-upload-wrapper {
        padding: 26px !important;
    }
    .upload-text {
        font-size: 14px !important;
    }

    /* Botón FAB */
    .dash-fab {
        width: 58px !important;
        height: 58px !important;
        bottom: 18px !important;
        right: 18px !important;
        font-size: 26px !important;
    }

    /* Panel */
    .dashboard {
        grid-template-columns: 1fr !important;
        padding: 20px !important;
    }

    .dash-sidebar {
        margin-bottom: 20px;
    }

    /* Footer */
    .site-footer {
        padding: 20px !important;
        font-size: 14px !important;
    }
}

/* ============================================================
   TABLET (iPad retrato < 900px)
   ============================================================ */
@media (max-width: 900px) {

    /* Header */
    .header-inner {
        padding: 0 18px;
    }

    /* Hero */
    .hero {
        padding-left: 30px !important;
        padding-right: 30px !important;
    }
    .hero-left h1 {
        font-size: 42px !important;
    }

    /* Tarjetas */
    .home-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Panel */
    .dashboard {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

/* ============================================================
   IPAD / TABLET HORIZONTAL (900px – 1200px)
   ============================================================ */
@media (min-width: 900px) and (max-width: 1200px) {

    .hero-left h1 {
        font-size: 48px !important;
    }

    .hero-right {
        width: 100% !important;
    }

    .home-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================
   PANTALLAS GRANDES (>1500px)
   ============================================================ */
@media (min-width: 1500px) {
    .hero-content {
        max-width: 1400px !important;
    }
    .container {
        max-width: 1400px !important;
    }
}
/* --- Fix: el uploader no debe tapar nada --- */

.file-upload-wrapper {
    position: relative !important;
    z-index: 5 !important;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    opacity: 0 !important;
    cursor: pointer;
}

textarea {
    position: relative;
    z-index: 10 !important; /* SIEMPRE por encima */
    background: white;
}
.file-upload-wrapper {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 32px;
    background: #f8fafc;
    text-align: center;
    transition: .15s;
}

.file-upload-wrapper:hover {
    background: #f1f5f9;
    border-color: #016A3D;
}

.upload-content svg {
    margin-bottom: 12px;
}

.upload-text {
    font-size: 14px;
    margin: 0;
    color: #475569;
}
#removeImageBtn {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}

#removeImageBtn:hover {
    background: #fecaca;
}
.fab-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #016A3D, #7AFFB5);
    border-radius: 50%;
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    z-index: 9999;
    transition: transform .2s, box-shadow .2s;
}

.fab-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px; /* separación entre logo y texto */
    font-size: 24px;
    font-weight: 800;
}

.logo-icon {
    height: 32px;       /* tamaño perfecto */
    width: auto;
    display: block;
}
