/* EDITORIAL DE LUXO v16.0 - TEMA: CORES, NOMES (1982) 
   PACOTE COMPLETO: Index, Artigos, Galeria, Sobre, Pesquisa e Modais
*/

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&family=Krona+One&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Unbounded:wght@200..900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&display=swap');

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --muted: #888888;
    --border: #eeeeee;
    --paper: #fcfaf5;
    --accent: #0055ff;
    --highlight: #ff6600;
    --transition: 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- RESET & GLOBAL --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    background-color: var(--bg); 
    color: var(--text); 
    font-family: 'Montserrat', sans-serif; 
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- CABEÇALHO (HEADER) --- */
.app-header {
    padding: 80px 5% 40px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.user-info span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--muted);
    display: block;
    margin-bottom: 15px;
}

.user-info h1 {
    font-family: "Dancing Script", cursive;
    font-size: clamp(2.2rem, 8vw, 4rem);
    font-weight: 300;
    color: var(--accent);
}

/* --- BARRA DE PESQUISA --- */
.search-container {
    margin: 40px auto 0;
    max-width: 400px;
    position: relative;
    text-align: center;
}

#searchInput {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    text-align: center;
    outline: none;
    transition: var(--transition);
}

#searchInput:focus {
    border-bottom: 1px solid var(--accent);
    letter-spacing: 4px;
}

/* --- NAVEGAÇÃO --- */
.sidebar-pc {
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.side-nav { 
    display: flex; gap: 40px; 
}

.side-nav a {
    text-decoration: none;
    color: var(--text);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: var(--transition);
}

.side-nav a.active { 
    color: var(--accent); 
    font-weight: 600; 
    border-bottom: 1px solid var(--accent); 
}

/* --- HOME HERO (INDEX.HTML) --- */
.home-hero {
    padding: 150px 10%;
    text-align: center;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-label {
    font-size: 0.6rem;
    letter-spacing: 7px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 25px;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 300;
    line-height: 1.1;
}

.hero-title span {
    font-style: italic;
    color: var(--highlight);
}

/* --- GRID SYSTEM --- */
.grid-poemas, .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
}

.card-poema, .photo-item {
    padding: 80px 10%;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: background 0.5s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card-poema:nth-child(even), .photo-item:nth-child(even) {
    border-right: none; 
}

.card-poema:hover, .photo-item:hover { 
    background: #fafafa; 
}

/* Estilo Imagens no Grid (Capas) */
.capa-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 30px;
}

.capa-container img, .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition: var(--transition);
}

.card-poema:hover img, .photo-item:hover img {
    filter: grayscale(0);
    transform: scale(1.02);
}

/* --- PÁGINA SOBRE MIM (ABOUT.HTML) --- */
.perfil-container { 
    display: flex; 
    min-height: 80vh; 
    width: 100%; }

.perfil-imagem { 
    flex: 1; 
    position: relative; 
    /* border-right: 1px solid var(--border);  */
}

.perfil-imagem img { 
    width: 95%; height: 100%; 
    object-fit: cover; 
    filter: grayscale(1); 
    margin-left: 10px; }

.legenda-foto {
    position: absolute; bottom: 0; left: 0;
    background-color: var(--accent); color: #fff;
    padding: 15px 25px; 
    font-size: 0.65rem;
    text-transform: uppercase; 
    letter-spacing: 4px; 
    font-weight: 600; 
    opacity: 0.6;
}

.perfil-texto { 
    flex: 1.2;
    padding: 80px 10%;
}

.label-categoria {
    color: var(--muted);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
}

.titulo-perfil { 
    font-family: 'Cormorant Garamond', serif; 
    font-size: clamp(2.5rem, 5vw, 4rem); 
    font-style: italic; 
    margin-bottom: 30px; 
    color: var(--highlight); 
}

.paragrafo-destaque {
    font-family: 'Cormorant Garamond', serif; 
    font-size: 1.4rem; 
    font-style: italic; 
    color: var(--text); 
    margin-bottom: 30px; 
    border-left: 2px solid var(--highlight); 
    padding-left: 20px; }

.texto-biografia { 
    font-size: 0.95rem; 
    color: #444; 
    line-height: 1.8; 
    margin-bottom: 40px; 
    max-width: 600px; 
}
.assinatura-autor { 
    font-family: "Dancing Script", cursive; 
    font-size: 1.8rem; 
    font-weight: 600; 
    color: var(--text);
 }

/* --- SISTEMA DE MODAIS --- */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: #fff;
    overflow-y: auto;
}

.modal-content {
    margin: 0 auto;
    padding: 80px 5% 60px;
    max-width: 1200px;
    text-align: center;
}

#imgFull {
    display: block;
    margin: 0 auto 40px;
    width: auto;
    max-width: 800px; /* Limite Desktop */
    max-height: 60vh;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.texto-completo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    line-height: 1.8;
    display: block;
    max-width: fit-content; /* CORREÇÃO ALINHAMENTO */
    margin: 0 auto;
    text-align: justify;
    white-space: pre-line;
    padding: 0;
}

.close-modal {
    position: fixed;
    top: 30px; right: 40px;
    font-size: 50px;
    color: var(--accent);
    cursor: pointer;
    z-index: 100000;
}

/* --- FOOTER & NEWSLETTER --- */

.footer-newsletter { 
    background: #111; 
    color: #fff; 
    padding: 60px 10% 0; 
    text-align: center; }

.newsletter-form input { 
    background: transparent; 
    border: none; 
    border-bottom: 1px solid #333; 
    color: #fff; 
    padding: 15px; 
    width: 100%; 
    max-width: 400px; 
    text-align: center; 
    outline: none; 
    margin-bottom: 25px; 
}

.newsletter-form button { 
    background: transparent; 
    color: var(--highlight); 
    border: 1px solid var(--highlight); 
    padding: 12px 30px; 
    cursor: pointer; 
    text-transform: uppercase; 
    letter-spacing: 2px; }

.copyright { 
    margin-top: 60px; 
    padding-bottom: 10px; 
    width: 100%; 
    display: block; 
    font-size: 0.6rem; 
    opacity: 0.5; }

/* --- TOAST (POP-UP) --- */
#mensagem-sucesso {
    display: none; 
    position: fixed; 
    bottom: 30px; 
    right: 30px;
    background-color: var(--highlight); 
    color: #fff; 
    padding: 15px 30px;
    border-left: 5px solid var(--accent); 
    z-index: 100000;
    text-transform: uppercase; 
    font-size: 0.75rem; 
    letter-spacing: 2px;
}
.toast-in { 
    animation: slideIn 0.5s forwards;
}

@keyframes slideIn { 
    from { 
        transform: translateX(100%); 
        opacity: 0; } 
    to { 
        transform: translateX(0); 
        opacity: 1;
    } 
}

/* --- LOGIN --- */

.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    text-align: center;
    max-width: 320px;
    width: 100%;
}

.login-label {
    font-size: 0.6rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 20px;
}

.login-title {
    font-family: "Dancing Script", cursive;
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 30px;
}

.login-box input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 5px;
    margin-bottom: 20px;
    text-align: center;
    outline: none;
    transition: var(--transition);
}

.login-box input:focus {
    border-bottom: 1px solid var(--accent);
}

.login-box button {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 10px 25px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
}

.login-box button:hover {
    background: var(--accent);
    color: #fff;
}

.login-error {
    color: red;
    display: none;
    margin-top: 15px;
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.login-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 9999;
}


/* --- EDITOR --- */

.editor-container {
    display: flex;
    justify-content: center;
    padding: 80px 5%;
}

.editor-box {
    width: 100%;
    max-width: 700px;
}

.editor-title {
    width: 100%;
    border: none;
    outline: none;
    font-size: 2rem;
    font-family: 'Cormorant Garamond', serif;
    margin: 20px 0;
}

.editor-text {
    width: 100%;
    border: none;
    outline: none;
    min-height: 250px;
    font-size: 1.1rem;
    line-height: 1.8;
    font-family: 'Cormorant Garamond', serif;
    resize: none;
}

.editor-button {
    margin-top: 30px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    padding: 10px 25px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.editor-button:hover {
    background: var(--accent);
    color: #fff;
}

.metadados {
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.5;
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.preview-text {
    white-space: pre-line;
    line-height: 1.8;
    margin-top: 20px;
    font-family: 'Cormorant Garamond', serif;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.editor-toolbar button {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.editor-toolbar button {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-toolbar button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.editor-toolbar svg {
    width: 16px;
    height: 16px;
}

.editor-toolbar button.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0,0,0,0.03);
}

.editor-text {
    min-height: 250px;
    outline: none;
    line-height: 1.8;
    font-family: 'Cormorant Garamond', serif;
    border: 1.5px solid var(--muted);
}

.editor-text:empty:before {
    content: "Escreva...";
    opacity: 0.5;
}

.preview-text p,
.preview-text div {
    margin: 0;
}

.preview-text {
    line-height: 1.8;
}

.preview-text br {
    display: block;
    margin-bottom: 8px;
}

.preview-text p + p {
    margin-top: 12px;
}

.conteudo-texto {
    line-height: 1.8;
    font-family: 'Cormorant Garamond', serif;
}

.conteudo-texto p {
    margin-bottom: 12px;
    font-size: 1.25rem;
}

.toolbar button {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toolbar button:hover {
    background: #f2f2f2;
}

/* apenas botões de formatação */
.toolbar button.format.active {
    background: #111;
}

.toolbar button.format.active svg {
    stroke: #fff;
}

/* ===============================
EDITORIAL DE LUXO v16.3 (SAFE FIX)
=============================== */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400..700&family=Krona+One&family=Montserrat:ital,wght@0,100..900&family=Poppins&family=Unbounded&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&display=swap');

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --muted: #888888;
    --border: #eeeeee;
    --paper: #fcfaf5;
    --accent: #0055ff;
    --highlight: #ff6600;
    --transition: 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    background-color: var(--bg); 
    color: var(--text); 
    font-family: 'Montserrat', sans-serif; 
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ================= HEADER ================= */

.app-header {
    padding: 80px 5% 40px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.user-info span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--muted);
    display: block;
    margin-bottom: 15px;
}

.user-info h1 {
    font-family: "Dancing Script", cursive;
    font-size: clamp(2.2rem, 8vw, 4rem);
    font-weight: 300;
    color: var(--accent);
}

/* ================= SEARCH ================= */

.search-container {
    margin: 40px auto 0;
    max-width: 400px;
    text-align: center;
}

#searchInput {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 5px;
    text-align: center;
    outline: none;
}

/* ================= NAV ================= */

.sidebar-pc {
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.side-nav { display: flex; gap: 40px; }

.side-nav a {
    text-decoration: none;
    color: var(--text);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.side-nav a.active { 
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
}

/* ================= GRID ================= */

.grid-poemas, .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.card-poema, .photo-item {
    padding: 80px 10%;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.card-poema:nth-child(even),
.photo-item:nth-child(even) {
    border-right: none;
}

.autor-rodape {
  margin-top: 60px;
  text-align: right;
  font-style: italic;
  opacity: 0.7;
  letter-spacing: 1px;
}

.foto-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.foto-topo {
  text-align: center;
  margin-bottom: 20px;
}


.foto-rodape {
  margin-top: auto; /* 🔥 ISSO EMPURRA PRA BAIXO */
  text-align: right;
  font-style: italic;
  opacity: 0.7;
  padding-top: 40px;
}

#ordenarSelect {
  border: none;
  background: none;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  outline: none;
}

#dataPublicacao {
  /* margin-top: 15px; */
  border: none;
  border-bottom: 1px solid #111;
  background: transparent;
  padding: 6px;
  font-size: 13px;
  font-style: italic;
  color: #333;
  outline: none;
}

#dataPublicacao:focus {
  border-bottom: 1px solid #000;
}

/* 🔥 remove o “quadrado preto” */
#ordenarSelect:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
}

/* opcional - leve feedback */
#ordenarSelect:hover {
  opacity: 0.7;
}


/* ================= CAPA ================= */

.capa-container {
    aspect-ratio: 16/9;
    overflow: hidden;
    margin-bottom: 30px;
}

.capa-container img,
.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ================= LOGIN ================= */

.login-container {
    position: fixed;
    inset: 0;
    display:flex;
    align-items:center;
    justify-content:center;
    background: var(--bg);
    z-index: 9999;
}

.login-box input {
    width:100%;
    border:none;
    border-bottom:1px solid var(--border);
    padding:12px;
    margin-bottom:20px;
    text-align:center;
}

.login-error { display:none; color:red; }

/* ================= EDITOR ================= */

/* 🔥 UNIFICADO */
.editor-text {
    min-height: 250px;
    outline: none;
    line-height: 1.8;
    font-family: 'Cormorant Garamond', serif;
    border: 1.5px solid var(--muted);
    padding: 20px;
    border-radius: 6px;
    transition: 0.3s;
}

.editor-text:focus {
    border-color: var(--accent);
    background: #fff;
}

.editor-text:empty:before {
    content: "Escreva...";
    opacity: 0.5;
}

/* 🔥 TOOLBAR CORRIGIDA */
.editor-toolbar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.editor-toolbar button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
}

.editor-toolbar button:hover {
    border-color: var(--accent);
}

.editor-toolbar button.active {
    background: rgba(0,0,0,0.05);
    border-color: var(--accent);
}

.editor-toolbar svg {
    width: 16px;
    height: 16px;
}

/* ================= PREVIEW ================= */

.preview-text {
    white-space: pre-line;
    line-height: 1.8;
    font-family: 'Cormorant Garamond', serif;
}

.preview-text p,
.preview-text div { margin: 0; }

.preview-text p + p { margin-top: 12px; }

/* ================= BOTÕES ================= */

#salvar-texto,
#salvar-foto {
    border: 1px solid var(--accent);
    background: transparent;
    padding: 10px 20px;
    cursor: pointer;
}

#salvar-texto:hover,
#salvar-foto:hover {
    background: var(--accent);
    color: #fff;
}

/* ================= NEWSLETTER ================= */

.footer-newsletter { 
    background: #111; 
    color: #fff; 
    padding: 60px 10% 0; 
    text-align: center; 
}

/* ================= MODAL ================= */

.modal {
    display:none;
    position:fixed;
    inset:0;
    background:#fff;
    z-index:99999;
}

#mensagem-sucesso {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#mensagem-sucesso.show {
  opacity: 1;
  pointer-events: auto;
}

/* ================= ANIMAÇÃO ================= */

.fade-in {
    animation: fade 0.4s ease;
}

@keyframes fade {
    from { opacity:0; transform: translateY(10px); }
    to { opacity:1; transform: translateY(0); }
}







/* --- RESPONSIVIDADE (MOBILE) --- */
@media (max-width: 850px) {
   
    #lista-poemas, .grid-poemas, .gallery-grid, .perfil-container { 
        display: flex !important; 
        flex-direction: column !important; 
    }
    .card-poema, .photo-item, .perfil-texto { 
        padding: 40px 8% !important; 
        border-right: none !important; 
    }

    /* Imagens Article Mobile */
    .capa-container { 
        height: 250px !important; 
    }
    #imgFull { 
        max-width: 100% !important; 
        max-height: 100% !important; 
        object-fit: cover !important; }

    .texto-completo { 
        font-size: 1.1rem !important;
        max-width: 100% !important; 
    }
    
    .side-nav { 
        gap: 15px; 
        font-size: 0.6rem; 
        flex-wrap: wrap; 
        justify-content: center; 
    }

    .side-nav a {
        font-size: 0.55rem;
    }
    
    .perfil-imagem { 
        width: 100%; 
        height: 35vh; 
    }


}
